feat: refactoring project
This commit is contained in:
8
node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
8
node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
@@ -12,15 +12,19 @@ const WebpackError = require("./WebpackError");
|
||||
/** @typedef {import("./DefinePlugin").CodeValue} CodeValue */
|
||||
|
||||
class EnvironmentPlugin {
|
||||
/**
|
||||
* @param {(string | string[] | Record<string, any>)[]} keys keys
|
||||
*/
|
||||
constructor(...keys) {
|
||||
if (keys.length === 1 && Array.isArray(keys[0])) {
|
||||
/** @type {string[]} */
|
||||
this.keys = keys[0];
|
||||
this.defaultValues = {};
|
||||
} else if (keys.length === 1 && keys[0] && typeof keys[0] === "object") {
|
||||
this.keys = Object.keys(keys[0]);
|
||||
this.defaultValues = keys[0];
|
||||
this.defaultValues = /** @type {Record<string, any>} */ (keys[0]);
|
||||
} else {
|
||||
this.keys = keys;
|
||||
this.keys = /** @type {string[]} */ (keys);
|
||||
this.defaultValues = {};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user