feat: refactoring project
This commit is contained in:
18
node_modules/webpack/lib/library/AssignLibraryPlugin.js
generated
vendored
18
node_modules/webpack/lib/library/AssignLibraryPlugin.js
generated
vendored
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user