feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -36,9 +36,8 @@ const IDENTIFIER_REGEX =
* @param {string} name name to be validated
* @returns {boolean} true, when valid
*/
const isNameValid = name => {
return !KEYWORD_REGEX.test(name) && IDENTIFIER_REGEX.test(name);
};
const isNameValid = name =>
!KEYWORD_REGEX.test(name) && IDENTIFIER_REGEX.test(name);
/**
* @param {string[]} accessor variable plus properties
@@ -136,15 +135,14 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
`Library name must be a string or string array. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
);
}
} else {
if (name && typeof name !== "string" && !Array.isArray(name)) {
throw new Error(
`Library name must be a string, string array or unset. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
);
}
} else if (name && typeof name !== "string" && !Array.isArray(name)) {
throw new Error(
`Library name must be a string, string array or unset. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
);
}
const _name = /** @type {string | string[]} */ (name);
return {
name: /** @type {string | string[]} */ (name),
name: _name,
export: library.export
};
}