summaryrefslogtreecommitdiff
path: root/node_modules/@babel/preset-env/lib/normalize-options.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/preset-env/lib/normalize-options.js
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/@babel/preset-env/lib/normalize-options.js')
-rw-r--r--node_modules/@babel/preset-env/lib/normalize-options.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/node_modules/@babel/preset-env/lib/normalize-options.js b/node_modules/@babel/preset-env/lib/normalize-options.js
index d22fba19..c80a3a51 100644
--- a/node_modules/@babel/preset-env/lib/normalize-options.js
+++ b/node_modules/@babel/preset-env/lib/normalize-options.js
@@ -13,7 +13,7 @@ var _moduleTransformations = require("./module-transformations.js");
var _options = require("./options.js");
var _helperValidatorOption = require("@babel/helper-validator-option");
var _babel7Plugins = require("./polyfills/babel-7-plugins.cjs");
-const corejs3Polyfills = JSON.parse(require("fs").readFileSync(require.resolve("core-js-compat/data.json")));
+const corejs3Polyfills = require("core-js-compat/data.json");
const v = new _helperValidatorOption.OptionValidator("@babel/preset-env");
const allPluginsList = Object.keys(_pluginsCompatData.plugins);
const modulePlugins = ["transform-dynamic-import", ...Object.keys(_moduleTransformations.default).map(m => _moduleTransformations.default[m])];
@@ -33,7 +33,7 @@ const getValidIncludesAndExcludes = (type, corejs) => {
function flatMap(array, fn) {
return Array.prototype.concat.apply([], array.map(fn));
}
-const normalizePluginName = plugin => plugin.replace(/^(@babel\/|babel-)(plugin-)?/, "");
+const normalizePluginName = plugin => plugin.replace(/^(?:@babel\/|babel-)(?:plugin-)?/, "");
exports.normalizePluginName = normalizePluginName;
const expandIncludesAndExcludes = (filterList = [], type, corejs) => {
if (filterList.length === 0) return [];
@@ -44,7 +44,7 @@ const expandIncludesAndExcludes = (filterList = [], type, corejs) => {
if (typeof filter === "string") {
try {
re = new RegExp(`^${normalizePluginName(filter)}$`);
- } catch (e) {
+ } catch (_) {
invalidFilters.push(filter);
return [];
}
@@ -62,7 +62,7 @@ const expandIncludesAndExcludes = (filterList = [], type, corejs) => {
return selectedPlugins;
};
const checkDuplicateIncludeExcludes = (include = [], exclude = []) => {
- const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);
+ const duplicates = include.filter(opt => exclude.includes(opt));
v.invariant(duplicates.length === 0, `The plugins/built-ins '${duplicates.join(", ")}' were found in both the "include" and
"exclude" options.`);
};