refactor: AI review

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2026-08-12 13:46:34 +08:00
parent ab3f9ff4ef
commit 7a0cba98e0
No known key found for this signature in database
GPG Key ID: 39DC4436AE3564D5

View File

@ -38,7 +38,7 @@ export const SSH_EXISTING_TYPE = {
export default {
methods: {
hasCloudConfigComment(userScript) {
if (typeof userScript === 'string' && /(^|\n)\s*#cloud-config(\s|$)/.test(userScript)) {
if (typeof userScript === 'string' && /^\s*#cloud-config(\s|$)/.test(userScript)) {
return true;
}