aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/preset-env/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/preset-env/lib')
-rw-r--r--node_modules/@babel/preset-env/lib/available-plugins.js43
-rw-r--r--node_modules/@babel/preset-env/lib/built-in-definitions.js168
-rw-r--r--node_modules/@babel/preset-env/lib/debug.js91
-rw-r--r--node_modules/@babel/preset-env/lib/default-includes.js8
-rw-r--r--node_modules/@babel/preset-env/lib/defaults.js29
-rw-r--r--node_modules/@babel/preset-env/lib/index.js253
-rw-r--r--node_modules/@babel/preset-env/lib/module-transformations.js14
-rw-r--r--node_modules/@babel/preset-env/lib/normalize-options.js152
-rw-r--r--node_modules/@babel/preset-env/lib/targets-parser.js172
-rw-r--r--node_modules/@babel/preset-env/lib/use-built-ins-entry-plugin.js79
-rw-r--r--node_modules/@babel/preset-env/lib/use-built-ins-plugin.js245
-rw-r--r--node_modules/@babel/preset-env/lib/utils.js139
12 files changed, 0 insertions, 1393 deletions
diff --git a/node_modules/@babel/preset-env/lib/available-plugins.js b/node_modules/@babel/preset-env/lib/available-plugins.js
deleted file mode 100644
index d57c0f29..00000000
--- a/node_modules/@babel/preset-env/lib/available-plugins.js
+++ /dev/null
@@ -1,43 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-var _default = {
- "syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
- "syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
- "syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
- "transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
- "proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
- "transform-arrow-functions": require("@babel/plugin-transform-arrow-functions"),
- "transform-block-scoped-functions": require("@babel/plugin-transform-block-scoped-functions"),
- "transform-block-scoping": require("@babel/plugin-transform-block-scoping"),
- "transform-classes": require("@babel/plugin-transform-classes"),
- "transform-computed-properties": require("@babel/plugin-transform-computed-properties"),
- "transform-destructuring": require("@babel/plugin-transform-destructuring"),
- "transform-dotall-regex": require("@babel/plugin-transform-dotall-regex"),
- "transform-duplicate-keys": require("@babel/plugin-transform-duplicate-keys"),
- "transform-for-of": require("@babel/plugin-transform-for-of"),
- "transform-function-name": require("@babel/plugin-transform-function-name"),
- "transform-literals": require("@babel/plugin-transform-literals"),
- "transform-modules-amd": require("@babel/plugin-transform-modules-amd"),
- "transform-modules-commonjs": require("@babel/plugin-transform-modules-commonjs"),
- "transform-modules-systemjs": require("@babel/plugin-transform-modules-systemjs"),
- "transform-modules-umd": require("@babel/plugin-transform-modules-umd"),
- "transform-object-super": require("@babel/plugin-transform-object-super"),
- "transform-parameters": require("@babel/plugin-transform-parameters"),
- "transform-shorthand-properties": require("@babel/plugin-transform-shorthand-properties"),
- "transform-spread": require("@babel/plugin-transform-spread"),
- "transform-sticky-regex": require("@babel/plugin-transform-sticky-regex"),
- "transform-template-literals": require("@babel/plugin-transform-template-literals"),
- "transform-typeof-symbol": require("@babel/plugin-transform-typeof-symbol"),
- "transform-unicode-regex": require("@babel/plugin-transform-unicode-regex"),
- "transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"),
- "transform-new-target": require("@babel/plugin-transform-new-target"),
- "proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"),
- "proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"),
- "transform-regenerator": require("@babel/plugin-transform-regenerator"),
- "proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex")
-};
-exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/built-in-definitions.js b/node_modules/@babel/preset-env/lib/built-in-definitions.js
deleted file mode 100644
index 57e700b0..00000000
--- a/node_modules/@babel/preset-env/lib/built-in-definitions.js
+++ /dev/null
@@ -1,168 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.definitions = void 0;
-const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"];
-const CommonIterators = ["es6.string.iterator"].concat(ArrayNatureIterators);
-const definitions = {
- builtins: {
- DataView: "es6.typed.data-view",
- Float32Array: "es6.typed.float32-array",
- Float64Array: "es6.typed.float64-array",
- Int8Array: "es6.typed.int8-array",
- Int16Array: "es6.typed.int16-array",
- Int32Array: "es6.typed.int32-array",
- Map: ["es6.map"].concat(CommonIterators),
- Number: "es6.number.constructor",
- Promise: ["es6.object.to-string", "es6.promise"],
- RegExp: ["es6.regexp.constructor"],
- Set: ["es6.set"].concat(CommonIterators),
- Symbol: ["es6.symbol", "es7.symbol.async-iterator"],
- Uint8Array: "es6.typed.uint8-array",
- Uint8ClampedArray: "es6.typed.uint8-clamped-array",
- Uint16Array: "es6.typed.uint16-array",
- Uint32Array: "es6.typed.uint32-array",
- WeakMap: ["es6.weak-map"].concat(CommonIterators),
- WeakSet: ["es6.weak-set"].concat(CommonIterators)
- },
- instanceMethods: {
- __defineGetter__: ["es7.object.define-getter"],
- __defineSetter__: ["es7.object.define-setter"],
- __lookupGetter__: ["es7.object.lookup-getter"],
- __lookupSetter__: ["es7.object.lookup-setter"],
- anchor: ["es6.string.anchor"],
- big: ["es6.string.big"],
- bind: ["es6.function.bind"],
- blink: ["es6.string.blink"],
- bold: ["es6.string.bold"],
- codePointAt: ["es6.string.code-point-at"],
- copyWithin: ["es6.array.copy-within"],
- endsWith: ["es6.string.ends-with"],
- entries: ArrayNatureIterators,
- every: ["es6.array.is-array"],
- fill: ["es6.array.fill"],
- filter: ["es6.array.filter"],
- find: ["es6.array.find"],
- findIndex: ["es6.array.find-index"],
- fixed: ["es6.string.fixed"],
- flags: ["es6.regexp.flags"],
- fontcolor: ["es6.string.fontcolor"],
- fontsize: ["es6.string.fontsize"],
- forEach: ["es6.array.for-each", "web.dom.iterable"],
- includes: ["es6.string.includes", "es7.array.includes"],
- indexOf: ["es6.array.index-of"],
- italics: ["es6.string.italics"],
- keys: ArrayNatureIterators,
- lastIndexOf: ["es6.array.last-index-of"],
- link: ["es6.string.link"],
- map: ["es6.array.map"],
- match: ["es6.regexp.match"],
- name: ["es6.function.name"],
- padStart: ["es7.string.pad-start"],
- padEnd: ["es7.string.pad-end"],
- reduce: ["es6.array.reduce"],
- reduceRight: ["es6.array.reduce-right"],
- repeat: ["es6.string.repeat"],
- replace: ["es6.regexp.replace"],
- search: ["es6.regexp.search"],
- slice: ["es6.array.slice"],
- small: ["es6.string.small"],
- some: ["es6.array.some"],
- sort: ["es6.array.sort"],
- split: ["es6.regexp.split"],
- startsWith: ["es6.string.starts-with"],
- strike: ["es6.string.strike"],
- sub: ["es6.string.sub"],
- sup: ["es6.string.sup"],
- toISOString: ["es6.date.to-iso-string"],
- toJSON: ["es6.date.to-json"],
- toString: ["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"],
- trim: ["es6.string.trim"],
- values: ArrayNatureIterators
- },
- staticMethods: {
- Array: {
- from: ["es6.array.from", "es6.string.iterator"],
- isArray: "es6.array.is-array",
- of: "es6.array.of"
- },
- Date: {
- now: "es6.date.now"
- },
- Object: {
- assign: "es6.object.assign",
- create: "es6.object.create",
- defineProperty: "es6.object.define-property",
- defineProperties: "es6.object.define-properties",
- entries: "es7.object.entries",
- freeze: "es6.object.freeze",
- getOwnPropertyDescriptors: "es7.object.get-own-property-descriptors",
- getOwnPropertySymbols: "es6.object.get-own-property-symbols",
- is: "es6.object.is",
- isExtensible: "es6.object.is-extensible",
- isFrozen: "es6.object.is-frozen",
- isSealed: "es6.object.is-sealed",
- keys: "es6.object.keys",
- preventExtensions: "es6.object.prevent-extensions",
- seal: "es6.object.seal",
- setPrototypeOf: "es6.object.set-prototype-of",
- values: "es7.object.values"
- },
- Math: {
- acosh: "es6.math.acosh",
- asinh: "es6.math.asinh",
- atanh: "es6.math.atanh",
- cbrt: "es6.math.cbrt",
- clz32: "es6.math.clz32",
- cosh: "es6.math.cosh",
- expm1: "es6.math.expm1",
- fround: "es6.math.fround",
- hypot: "es6.math.hypot",
- imul: "es6.math.imul",
- log1p: "es6.math.log1p",
- log10: "es6.math.log10",
- log2: "es6.math.log2",
- sign: "es6.math.sign",
- sinh: "es6.math.sinh",
- tanh: "es6.math.tanh",
- trunc: "es6.math.trunc"
- },
- String: {
- fromCodePoint: "es6.string.from-code-point",
- raw: "es6.string.raw"
- },
- Number: {
- EPSILON: "es6.number.epsilon",
- MIN_SAFE_INTEGER: "es6.number.min-safe-integer",
- MAX_SAFE_INTEGER: "es6.number.max-safe-integer",
- isFinite: "es6.number.is-finite",
- isInteger: "es6.number.is-integer",
- isSafeInteger: "es6.number.is-safe-integer",
- isNaN: "es6.number.is-nan",
- parseFloat: "es6.number.parse-float",
- parseInt: "es6.number.parse-int"
- },
- Promise: {
- all: CommonIterators,
- race: CommonIterators
- },
- Reflect: {
- apply: "es6.reflect.apply",
- construct: "es6.reflect.construct",
- defineProperty: "es6.reflect.define-property",
- deleteProperty: "es6.reflect.delete-property",
- get: "es6.reflect.get",
- getOwnPropertyDescriptor: "es6.reflect.get-own-property-descriptor",
- getPrototypeOf: "es6.reflect.get-prototype-of",
- has: "es6.reflect.has",
- isExtensible: "es6.reflect.is-extensible",
- ownKeys: "es6.reflect.own-keys",
- preventExtensions: "es6.reflect.prevent-extensions",
- set: "es6.reflect.set",
- setPrototypeOf: "es6.reflect.set-prototype-of"
- }
- }
-};
-exports.definitions = definitions; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/debug.js b/node_modules/@babel/preset-env/lib/debug.js
deleted file mode 100644
index 57bd263d..00000000
--- a/node_modules/@babel/preset-env/lib/debug.js
+++ /dev/null
@@ -1,91 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.logUsagePolyfills = exports.logEntryPolyfills = exports.logPlugin = exports.logMessage = void 0;
-
-function _semver() {
- const data = _interopRequireDefault(require("semver"));
-
- _semver = function _semver() {
- return data;
- };
-
- return data;
-}
-
-var _utils = require("./utils");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const wordEnds = size => {
- return size > 1 ? "s" : "";
-};
-
-const logMessage = (message, context) => {
- const pre = context ? `[${context}] ` : "";
- const logStr = ` ${pre}${message}`;
- console.log(logStr);
-};
-
-exports.logMessage = logMessage;
-
-const logPlugin = (item, targetVersions, list, context) => {
- const minVersions = list[item] || {};
- const filteredList = Object.keys(targetVersions).reduce((result, env) => {
- const minVersion = minVersions[env];
- const targetVersion = targetVersions[env];
-
- if (!minVersion) {
- result[env] = (0, _utils.prettifyVersion)(targetVersion);
- } else {
- const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
- const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
-
- if (!targetIsUnreleased && (minIsUnreleased || _semver().default.lt(targetVersion, (0, _utils.semverify)(minVersion)))) {
- result[env] = (0, _utils.prettifyVersion)(targetVersion);
- }
- }
-
- return result;
- }, {});
- const formattedTargets = JSON.stringify(filteredList).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
- logMessage(`${item} ${formattedTargets}`, context);
-};
-
-exports.logPlugin = logPlugin;
-
-const logEntryPolyfills = (importPolyfillIncluded, polyfills, filename, onDebug) => {
- if (!importPolyfillIncluded) {
- console.log(`
-[${filename}] \`import '@babel/polyfill'\` was not found.`);
- return;
- }
-
- if (!polyfills.size) {
- console.log(`
-[${filename}] Based on your targets, none were added.`);
- return;
- }
-
- console.log(`
-[${filename}] Replaced \`@babel/polyfill\` with the following polyfill${wordEnds(polyfills.size)}:`);
- onDebug(polyfills);
-};
-
-exports.logEntryPolyfills = logEntryPolyfills;
-
-const logUsagePolyfills = (polyfills, filename, onDebug) => {
- if (!polyfills.size) {
- console.log(`
-[${filename}] Based on your code and targets, none were added.`);
- return;
- }
-
- console.log(`
-[${filename}] Added following polyfill${wordEnds(polyfills.size)}:`);
- onDebug(polyfills);
-};
-
-exports.logUsagePolyfills = logUsagePolyfills; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/default-includes.js b/node_modules/@babel/preset-env/lib/default-includes.js
deleted file mode 100644
index 0579abfb..00000000
--- a/node_modules/@babel/preset-env/lib/default-includes.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.defaultWebIncludes = void 0;
-const defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
-exports.defaultWebIncludes = defaultWebIncludes; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/defaults.js b/node_modules/@babel/preset-env/lib/defaults.js
deleted file mode 100644
index e1d714b7..00000000
--- a/node_modules/@babel/preset-env/lib/defaults.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.getOptionSpecificExcludesFor = exports.getPlatformSpecificDefaultFor = void 0;
-const defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
-const defaultExcludesForLooseMode = ["transform-typeof-symbol"];
-
-const getPlatformSpecificDefaultFor = targets => {
- const targetNames = Object.keys(targets);
- const isAnyTarget = !targetNames.length;
- const isWebTarget = targetNames.some(name => name !== "node");
- return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
-};
-
-exports.getPlatformSpecificDefaultFor = getPlatformSpecificDefaultFor;
-
-const getOptionSpecificExcludesFor = ({
- loose
-}) => {
- if (loose) {
- return defaultExcludesForLooseMode;
- }
-
- return null;
-};
-
-exports.getOptionSpecificExcludesFor = getOptionSpecificExcludesFor; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/index.js b/node_modules/@babel/preset-env/lib/index.js
deleted file mode 100644
index cbf730f1..00000000
--- a/node_modules/@babel/preset-env/lib/index.js
+++ /dev/null
@@ -1,253 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = exports.transformIncludesAndExcludes = exports.isPluginRequired = void 0;
-
-function _semver() {
- const data = _interopRequireDefault(require("semver"));
-
- _semver = function _semver() {
- return data;
- };
-
- return data;
-}
-
-var _builtIns = _interopRequireDefault(require("../data/built-ins.json"));
-
-var _debug = require("./debug");
-
-var _defaults = require("./defaults");
-
-var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
-
-var _normalizeOptions2 = _interopRequireDefault(require("./normalize-options.js"));
-
-var _plugins = _interopRequireDefault(require("../data/plugins.json"));
-
-var _shippedProposals = require("../data/shipped-proposals.js");
-
-var _useBuiltInsEntryPlugin = _interopRequireDefault(require("./use-built-ins-entry-plugin"));
-
-var _useBuiltInsPlugin = _interopRequireDefault(require("./use-built-ins-plugin"));
-
-var _targetsParser = _interopRequireDefault(require("./targets-parser"));
-
-var _availablePlugins = _interopRequireDefault(require("./available-plugins"));
-
-var _utils = require("./utils");
-
-function _helperPluginUtils() {
- const data = require("@babel/helper-plugin-utils");
-
- _helperPluginUtils = function _helperPluginUtils() {
- return data;
- };
-
- return data;
-}
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const getPlugin = pluginName => {
- const plugin = _availablePlugins.default[pluginName];
-
- if (!plugin) {
- throw new Error(`Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`);
- }
-
- return plugin;
-};
-
-const builtInsListWithoutProposals = (0, _utils.filterStageFromList)(_builtIns.default, _shippedProposals.builtIns);
-const pluginListWithoutProposals = (0, _utils.filterStageFromList)(_plugins.default, _shippedProposals.features);
-
-const isPluginRequired = (supportedEnvironments, plugin) => {
- const targetEnvironments = Object.keys(supportedEnvironments);
-
- if (targetEnvironments.length === 0) {
- return true;
- }
-
- const isRequiredForEnvironments = targetEnvironments.filter(environment => {
- if (!plugin[environment]) {
- return true;
- }
-
- const lowestImplementedVersion = plugin[environment];
- const lowestTargetedVersion = supportedEnvironments[environment];
-
- if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) {
- return false;
- } else if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
- return true;
- }
-
- if (!_semver().default.valid(lowestTargetedVersion)) {
- throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + "Versions must be in semver format (major.minor.patch)");
- }
-
- return _semver().default.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion);
- });
- return isRequiredForEnvironments.length > 0;
-};
-
-exports.isPluginRequired = isPluginRequired;
-
-const getBuiltInTargets = targets => {
- const builtInTargets = Object.assign({}, targets);
-
- if (builtInTargets.uglify != null) {
- delete builtInTargets.uglify;
- }
-
- return builtInTargets;
-};
-
-const transformIncludesAndExcludes = opts => {
- return opts.reduce((result, opt) => {
- const target = opt.match(/^(es\d+|web)\./) ? "builtIns" : "plugins";
- result[target].add(opt);
- return result;
- }, {
- all: opts,
- plugins: new Set(),
- builtIns: new Set()
- });
-};
-
-exports.transformIncludesAndExcludes = transformIncludesAndExcludes;
-
-const filterItems = (list, includes, excludes, targets, defaultIncludes, defaultExcludes) => {
- const result = new Set();
-
- for (const item in list) {
- if (!excludes.has(item) && (isPluginRequired(targets, list[item]) || includes.has(item))) {
- result.add(item);
- } else {
- const shippedProposalsSyntax = _shippedProposals.pluginSyntaxMap.get(item);
-
- if (shippedProposalsSyntax) {
- result.add(shippedProposalsSyntax);
- }
- }
- }
-
- if (defaultIncludes) {
- defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));
- }
-
- if (defaultExcludes) {
- defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));
- }
-
- return result;
-};
-
-var _default = (0, _helperPluginUtils().declare)((api, opts) => {
- api.assertVersion(7);
-
- const _normalizeOptions = (0, _normalizeOptions2.default)(opts),
- configPath = _normalizeOptions.configPath,
- debug = _normalizeOptions.debug,
- optionsExclude = _normalizeOptions.exclude,
- forceAllTransforms = _normalizeOptions.forceAllTransforms,
- ignoreBrowserslistConfig = _normalizeOptions.ignoreBrowserslistConfig,
- optionsInclude = _normalizeOptions.include,
- loose = _normalizeOptions.loose,
- modules = _normalizeOptions.modules,
- shippedProposals = _normalizeOptions.shippedProposals,
- spec = _normalizeOptions.spec,
- optionsTargets = _normalizeOptions.targets,
- useBuiltIns = _normalizeOptions.useBuiltIns;
-
- let hasUglifyTarget = false;
-
- if (optionsTargets && optionsTargets.uglify) {
- hasUglifyTarget = true;
- delete optionsTargets.uglify;
- console.log("");
- console.log("The uglify target has been deprecated. Set the top level");
- console.log("option `forceAllTransforms: true` instead.");
- console.log("");
- }
-
- if (optionsTargets && optionsTargets.esmodules && optionsTargets.browsers) {
- console.log("");
- console.log("@babel/preset-env: esmodules and browsers targets have been specified together.");
- console.log(`\`browsers\` target, \`${optionsTargets.browsers}\` will be ignored.`);
- console.log("");
- }
-
- const targets = (0, _targetsParser.default)(optionsTargets, {
- ignoreBrowserslistConfig,
- configPath
- });
- const include = transformIncludesAndExcludes(optionsInclude);
- const exclude = transformIncludesAndExcludes(optionsExclude);
- const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
- const transformations = filterItems(shippedProposals ? _plugins.default : pluginListWithoutProposals, include.plugins, exclude.plugins, transformTargets, null, (0, _defaults.getOptionSpecificExcludesFor)({
- loose
- }));
- let polyfills;
- let polyfillTargets;
-
- if (useBuiltIns) {
- polyfillTargets = getBuiltInTargets(targets);
- polyfills = filterItems(shippedProposals ? _builtIns.default : builtInsListWithoutProposals, include.builtIns, exclude.builtIns, polyfillTargets, (0, _defaults.getPlatformSpecificDefaultFor)(polyfillTargets));
- }
-
- const plugins = [];
- const pluginUseBuiltIns = useBuiltIns !== false;
-
- if (modules !== false && _moduleTransformations.default[modules]) {
- plugins.push([getPlugin(_moduleTransformations.default[modules]), {
- loose
- }]);
- }
-
- transformations.forEach(pluginName => plugins.push([getPlugin(pluginName), {
- spec,
- loose,
- useBuiltIns: pluginUseBuiltIns
- }]));
- const regenerator = transformations.has("transform-regenerator");
-
- if (debug) {
- console.log("@babel/preset-env: `DEBUG` option");
- console.log("\nUsing targets:");
- console.log(JSON.stringify((0, _utils.prettifyTargets)(targets), null, 2));
- console.log(`\nUsing modules transform: ${modules.toString()}`);
- console.log("\nUsing plugins:");
- transformations.forEach(transform => {
- (0, _debug.logPlugin)(transform, targets, _plugins.default);
- });
-
- if (!useBuiltIns) {
- console.log("\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.");
- } else {
- console.log(`
-Using polyfills with \`${useBuiltIns}\` option:`);
- }
- }
-
- if (useBuiltIns === "usage" || useBuiltIns === "entry") {
- const pluginOptions = {
- debug,
- polyfills,
- regenerator,
- onDebug: (polyfills, context) => {
- polyfills.forEach(polyfill => (0, _debug.logPlugin)(polyfill, polyfillTargets, _builtIns.default, context));
- }
- };
- plugins.push([useBuiltIns === "usage" ? _useBuiltInsPlugin.default : _useBuiltInsEntryPlugin.default, pluginOptions]);
- }
-
- return {
- plugins
- };
-});
-
-exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/module-transformations.js b/node_modules/@babel/preset-env/lib/module-transformations.js
deleted file mode 100644
index f565785a..00000000
--- a/node_modules/@babel/preset-env/lib/module-transformations.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-var _default = {
- amd: "transform-modules-amd",
- commonjs: "transform-modules-commonjs",
- cjs: "transform-modules-commonjs",
- systemjs: "transform-modules-systemjs",
- umd: "transform-modules-umd"
-};
-exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/normalize-options.js b/node_modules/@babel/preset-env/lib/normalize-options.js
deleted file mode 100644
index 178795a3..00000000
--- a/node_modules/@babel/preset-env/lib/normalize-options.js
+++ /dev/null
@@ -1,152 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = normalizeOptions;
-exports.validateUseBuiltInsOption = exports.objectToBrowserslist = exports.validateModulesOption = exports.validateIgnoreBrowserslistConfig = exports.validateBoolOption = exports.validateConfigPathOption = exports.checkDuplicateIncludeExcludes = exports.normalizePluginName = void 0;
-
-function _invariant() {
- const data = _interopRequireDefault(require("invariant"));
-
- _invariant = function _invariant() {
- return data;
- };
-
- return data;
-}
-
-function _browserslist() {
- const data = _interopRequireDefault(require("browserslist"));
-
- _browserslist = function _browserslist() {
- return data;
- };
-
- return data;
-}
-
-var _builtIns = _interopRequireDefault(require("../data/built-ins.json"));
-
-var _defaultIncludes = require("./default-includes");
-
-var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
-
-var _plugins = _interopRequireDefault(require("../data/plugins.json"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const validIncludesAndExcludes = new Set([...Object.keys(_plugins.default), ...Object.keys(_moduleTransformations.default).map(m => _moduleTransformations.default[m]), ...Object.keys(_builtIns.default), ..._defaultIncludes.defaultWebIncludes]);
-
-const pluginToRegExp = plugin => {
- if (plugin instanceof RegExp) return plugin;
-
- try {
- return new RegExp(`^${normalizePluginName(plugin)}$`);
- } catch (e) {
- return null;
- }
-};
-
-const selectPlugins = regexp => Array.from(validIncludesAndExcludes).filter(item => regexp instanceof RegExp && regexp.test(item));
-
-const flatten = array => [].concat(...array);
-
-const expandIncludesAndExcludes = (plugins = [], type) => {
- if (plugins.length === 0) return [];
- const selectedPlugins = plugins.map(plugin => selectPlugins(pluginToRegExp(plugin)));
- const invalidRegExpList = plugins.filter((p, i) => selectedPlugins[i].length === 0);
- (0, _invariant().default)(invalidRegExpList.length === 0, `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(", ")}' passed to the '${type}' option are not
- valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`);
- return flatten(selectedPlugins);
-};
-
-const validBrowserslistTargets = [...Object.keys(_browserslist().default.data), ...Object.keys(_browserslist().default.aliases)];
-
-const normalizePluginName = plugin => plugin.replace(/^babel-plugin-/, "");
-
-exports.normalizePluginName = normalizePluginName;
-
-const checkDuplicateIncludeExcludes = (include = [], exclude = []) => {
- const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);
- (0, _invariant().default)(duplicates.length === 0, `Invalid Option: The plugins/built-ins '${duplicates.join(", ")}' were found in both the "include" and
- "exclude" options.`);
-};
-
-exports.checkDuplicateIncludeExcludes = checkDuplicateIncludeExcludes;
-
-const validateConfigPathOption = (configPath = process.cwd()) => {
- (0, _invariant().default)(typeof configPath === "string", `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`);
- return configPath;
-};
-
-exports.validateConfigPathOption = validateConfigPathOption;
-
-const validateBoolOption = (name, value, defaultValue) => {
- if (typeof value === "undefined") {
- value = defaultValue;
- }
-
- if (typeof value !== "boolean") {
- throw new Error(`Preset env: '${name}' option must be a boolean.`);
- }
-
- return value;
-};
-
-exports.validateBoolOption = validateBoolOption;
-
-const validateIgnoreBrowserslistConfig = ignoreBrowserslistConfig => validateBoolOption("ignoreBrowserslistConfig", ignoreBrowserslistConfig, false);
-
-exports.validateIgnoreBrowserslistConfig = validateIgnoreBrowserslistConfig;
-
-const validateModulesOption = (modulesOpt = "commonjs") => {
- (0, _invariant().default)(modulesOpt === false || Object.keys(_moduleTransformations.default).indexOf(modulesOpt) > -1, `Invalid Option: The 'modules' option must be either 'false' to indicate no modules, or a
- module type which can be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'.`);
- return modulesOpt;
-};
-
-exports.validateModulesOption = validateModulesOption;
-
-const objectToBrowserslist = object => {
- return Object.keys(object).reduce((list, targetName) => {
- if (validBrowserslistTargets.indexOf(targetName) >= 0) {
- const targetVersion = object[targetName];
- return list.concat(`${targetName} ${targetVersion}`);
- }
-
- return list;
- }, []);
-};
-
-exports.objectToBrowserslist = objectToBrowserslist;
-
-const validateUseBuiltInsOption = (builtInsOpt = false) => {
- (0, _invariant().default)(builtInsOpt === "usage" || builtInsOpt === false || builtInsOpt === "entry", `Invalid Option: The 'useBuiltIns' option must be either
- 'false' (default) to indicate no polyfill,
- '"entry"' to indicate replacing the entry polyfill, or
- '"usage"' to import only used polyfills per file`);
- return builtInsOpt;
-};
-
-exports.validateUseBuiltInsOption = validateUseBuiltInsOption;
-
-function normalizeOptions(opts) {
- const include = expandIncludesAndExcludes(opts.include, "include");
- const exclude = expandIncludesAndExcludes(opts.exclude, "exclude");
- checkDuplicateIncludeExcludes(include, exclude);
- return {
- configPath: validateConfigPathOption(opts.configPath),
- debug: opts.debug,
- include,
- exclude,
- forceAllTransforms: validateBoolOption("forceAllTransforms", opts.forceAllTransforms, false),
- ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(opts.ignoreBrowserslistConfig),
- loose: validateBoolOption("loose", opts.loose, false),
- modules: validateModulesOption(opts.modules),
- shippedProposals: validateBoolOption("shippedProposals", opts.shippedProposals, false),
- spec: validateBoolOption("loose", opts.spec, false),
- targets: Object.assign({}, opts.targets),
- useBuiltIns: validateUseBuiltInsOption(opts.useBuiltIns)
- };
-} \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/targets-parser.js b/node_modules/@babel/preset-env/lib/targets-parser.js
deleted file mode 100644
index 5202a4a4..00000000
--- a/node_modules/@babel/preset-env/lib/targets-parser.js
+++ /dev/null
@@ -1,172 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = exports.semverMin = void 0;
-
-function _browserslist() {
- const data = _interopRequireDefault(require("browserslist"));
-
- _browserslist = function _browserslist() {
- return data;
- };
-
- return data;
-}
-
-function _semver() {
- const data = _interopRequireDefault(require("semver"));
-
- _semver = function _semver() {
- return data;
- };
-
- return data;
-}
-
-var _utils = require("./utils");
-
-var _normalizeOptions = require("./normalize-options");
-
-var _builtInModules = _interopRequireDefault(require("../data/built-in-modules.json"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const browserNameMap = {
- android: "android",
- chrome: "chrome",
- and_chr: "chrome",
- edge: "edge",
- firefox: "firefox",
- ie: "ie",
- ios_saf: "ios",
- safari: "safari"
-};
-
-const isBrowsersQueryValid = browsers => typeof browsers === "string" || Array.isArray(browsers);
-
-const semverMin = (first, second) => {
- return first && _semver().default.lt(first, second) ? first : second;
-};
-
-exports.semverMin = semverMin;
-
-const mergeBrowsers = (fromQuery, fromTarget) => {
- return Object.keys(fromTarget).reduce((queryObj, targKey) => {
- if (targKey !== "browsers") {
- queryObj[targKey] = fromTarget[targKey];
- }
-
- return queryObj;
- }, fromQuery);
-};
-
-const getLowestVersions = browsers => {
- return browsers.reduce((all, browser) => {
- const _browser$split = browser.split(" "),
- browserName = _browser$split[0],
- browserVersion = _browser$split[1];
-
- const normalizedBrowserName = browserNameMap[browserName];
-
- if (!normalizedBrowserName) {
- return all;
- }
-
- try {
- const splitVersion = browserVersion.split("-")[0].toLowerCase();
-
- if ((0, _utils.isUnreleasedVersion)(splitVersion, browserName)) {
- all[normalizedBrowserName] = (0, _utils.getLowestUnreleased)(all[normalizedBrowserName], splitVersion, browserName);
- }
-
- const parsedBrowserVersion = (0, _utils.semverify)(splitVersion);
- all[normalizedBrowserName] = semverMin(all[normalizedBrowserName], parsedBrowserVersion);
- } catch (e) {}
-
- return all;
- }, {});
-};
-
-const outputDecimalWarning = decimalTargets => {
- if (!decimalTargets || !decimalTargets.length) {
- return;
- }
-
- console.log("Warning, the following targets are using a decimal version:");
- console.log("");
- decimalTargets.forEach(({
- target,
- value
- }) => console.log(` ${target}: ${value}`));
- console.log("");
- console.log("We recommend using a string for minor/patch versions to avoid numbers like 6.10");
- console.log("getting parsed as 6.1, which can lead to unexpected behavior.");
- console.log("");
-};
-
-const targetParserMap = {
- __default: (target, value) => {
- const version = (0, _utils.isUnreleasedVersion)(value, target) ? value.toLowerCase() : (0, _utils.semverify)(value);
- return [target, version];
- },
- node: (target, value) => {
- const parsed = value === true || value === "current" ? process.versions.node : (0, _utils.semverify)(value);
- return [target, parsed];
- }
-};
-
-const getTargets = (targets = {}, options = {}) => {
- const targetOpts = {};
-
- if (targets.esmodules) {
- const supportsESModules = _builtInModules.default["es6.module"];
- targets.browsers = Object.keys(supportsESModules).map(browser => `${browser} ${supportsESModules[browser]}`).join(", ");
- }
-
- const queryIsValid = isBrowsersQueryValid(targets.browsers);
- const browsersquery = queryIsValid ? targets.browsers : null;
-
- if (queryIsValid || !options.ignoreBrowserslistConfig) {
- _browserslist().default.defaults = (0, _normalizeOptions.objectToBrowserslist)(targets);
- const browsers = (0, _browserslist().default)(browsersquery, {
- path: options.configPath
- });
- const queryBrowsers = getLowestVersions(browsers);
- targets = mergeBrowsers(queryBrowsers, targets);
- }
-
- const parsed = Object.keys(targets).filter(value => value !== "esmodules").sort().reduce((results, target) => {
- if (target !== "browsers") {
- const value = targets[target];
-
- if (typeof value === "number" && value % 1 !== 0) {
- results.decimalWarnings.push({
- target,
- value
- });
- }
-
- const parser = targetParserMap[target] || targetParserMap.__default;
-
- const _parser = parser(target, value),
- parsedTarget = _parser[0],
- parsedValue = _parser[1];
-
- if (parsedValue) {
- results.targets[parsedTarget] = parsedValue;
- }
- }
-
- return results;
- }, {
- targets: targetOpts,
- decimalWarnings: []
- });
- outputDecimalWarning(parsed.decimalWarnings);
- return parsed.targets;
-};
-
-var _default = getTargets;
-exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/use-built-ins-entry-plugin.js b/node_modules/@babel/preset-env/lib/use-built-ins-entry-plugin.js
deleted file mode 100644
index 27cbe952..00000000
--- a/node_modules/@babel/preset-env/lib/use-built-ins-entry-plugin.js
+++ /dev/null
@@ -1,79 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = _default;
-
-var _debug = require("./debug");
-
-var _utils = require("./utils");
-
-function _default({
- types: t
-}) {
- function replaceWithPolyfillImports(path, polyfills, regenerator) {
- if (regenerator) {
- (0, _utils.createImport)(path, "regenerator-runtime");
- }
-
- const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills;
-
- for (var _iterator = Array.from(items).reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
-
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
-
- const p = _ref;
- (0, _utils.createImport)(path, p);
- }
-
- path.remove();
- }
-
- const isPolyfillImport = {
- ImportDeclaration(path, state) {
- if (path.node.specifiers.length === 0 && (0, _utils.isPolyfillSource)(path.node.source.value)) {
- this.importPolyfillIncluded = true;
- replaceWithPolyfillImports(path, state.opts.polyfills, state.opts.regenerator);
- }
- },
-
- Program(path, state) {
- path.get("body").forEach(bodyPath => {
- if ((0, _utils.isRequire)(t, bodyPath)) {
- replaceWithPolyfillImports(bodyPath, state.opts.polyfills, state.opts.regenerator);
- }
- });
- }
-
- };
- return {
- name: "transform-polyfill-require",
- visitor: isPolyfillImport,
-
- pre() {
- this.numPolyfillImports = 0;
- this.importPolyfillIncluded = false;
- },
-
- post() {
- const _this$opts = this.opts,
- debug = _this$opts.debug,
- onDebug = _this$opts.onDebug,
- polyfills = _this$opts.polyfills;
-
- if (debug) {
- (0, _debug.logEntryPolyfills)(this.importPolyfillIncluded, polyfills, this.file.opts.filename, onDebug);
- }
- }
-
- };
-} \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/use-built-ins-plugin.js b/node_modules/@babel/preset-env/lib/use-built-ins-plugin.js
deleted file mode 100644
index cf00b794..00000000
--- a/node_modules/@babel/preset-env/lib/use-built-ins-plugin.js
+++ /dev/null
@@ -1,245 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = _default;
-
-var _builtInDefinitions = require("./built-in-definitions");
-
-var _debug = require("./debug");
-
-var _utils = require("./utils");
-
-function has(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-function getType(target) {
- if (Array.isArray(target)) return "array";
- return typeof target;
-}
-
-function _default({
- types: t
-}) {
- function addImport(path, builtIn, builtIns) {
- if (builtIn && !builtIns.has(builtIn)) {
- builtIns.add(builtIn);
- (0, _utils.createImport)(path, builtIn);
- }
- }
-
- function addUnsupported(path, polyfills, builtIn, builtIns) {
- if (Array.isArray(builtIn)) {
- for (var _iterator = builtIn, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
-
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
-
- const i = _ref;
-
- if (polyfills.has(i)) {
- addImport(path, i, builtIns);
- }
- }
- } else {
- if (polyfills.has(builtIn)) {
- addImport(path, builtIn, builtIns);
- }
- }
- }
-
- const addAndRemovePolyfillImports = {
- ImportDeclaration(path) {
- if (path.node.specifiers.length === 0 && (0, _utils.isPolyfillSource)(path.node.source.value)) {
- console.warn(`
- When setting \`useBuiltIns: 'usage'\`, polyfills are automatically imported when needed.
- Please remove the \`import '@babel/polyfill'\` call or use \`useBuiltIns: 'entry'\` instead.`);
- path.remove();
- }
- },
-
- Program: {
- enter(path) {
- path.get("body").forEach(bodyPath => {
- if ((0, _utils.isRequire)(t, bodyPath)) {
- console.warn(`
- When setting \`useBuiltIns: 'usage'\`, polyfills are automatically imported when needed.
- Please remove the \`require('@babel/polyfill')\` call or use \`useBuiltIns: 'entry'\` instead.`);
- bodyPath.remove();
- }
- });
- }
-
- },
-
- ReferencedIdentifier(path, state) {
- const node = path.node,
- parent = path.parent,
- scope = path.scope;
- if (t.isMemberExpression(parent)) return;
- if (!has(_builtInDefinitions.definitions.builtins, node.name)) return;
- if (scope.getBindingIdentifier(node.name)) return;
- const builtIn = _builtInDefinitions.definitions.builtins[node.name];
- addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
- },
-
- CallExpression(path) {
- if (path.node.arguments.length) return;
- const callee = path.node.callee;
- if (!t.isMemberExpression(callee)) return;
- if (!callee.computed) return;
-
- if (!path.get("callee.property").matchesPattern("Symbol.iterator")) {
- return;
- }
-
- addImport(path, "web.dom.iterable", this.builtIns);
- },
-
- BinaryExpression(path) {
- if (path.node.operator !== "in") return;
- if (!path.get("left").matchesPattern("Symbol.iterator")) return;
- addImport(path, "web.dom.iterable", this.builtIns);
- },
-
- YieldExpression(path) {
- if (!path.node.delegate) return;
- addImport(path, "web.dom.iterable", this.builtIns);
- },
-
- MemberExpression: {
- enter(path, state) {
- if (!path.isReferenced()) return;
- const node = path.node;
- const obj = node.object;
- const prop = node.property;
- if (!t.isReferenced(obj, node)) return;
- let instanceType;
- let evaluatedPropType = obj.name;
- let propName = prop.name;
-
- if (node.computed) {
- if (t.isStringLiteral(prop)) {
- propName = prop.value;
- } else {
- const res = path.get("property").evaluate();
-
- if (res.confident && res.value) {
- propName = res.value;
- }
- }
- }
-
- if (path.scope.getBindingIdentifier(obj.name)) {
- const result = path.get("object").evaluate();
-
- if (result.value) {
- instanceType = getType(result.value);
- } else if (result.deopt && result.deopt.isIdentifier()) {
- evaluatedPropType = result.deopt.node.name;
- }
- }
-
- if (has(_builtInDefinitions.definitions.staticMethods, evaluatedPropType)) {
- const staticMethods = _builtInDefinitions.definitions.staticMethods[evaluatedPropType];
-
- if (has(staticMethods, propName)) {
- const builtIn = staticMethods[propName];
- addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
- }
- }
-
- if (has(_builtInDefinitions.definitions.instanceMethods, propName)) {
- let builtIn = _builtInDefinitions.definitions.instanceMethods[propName];
-
- if (instanceType) {
- builtIn = builtIn.filter(item => item.includes(instanceType));
- }
-
- addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
- }
- },
-
- exit(path, state) {
- if (!path.isReferenced()) return;
- const node = path.node;
- const obj = node.object;
- if (!has(_builtInDefinitions.definitions.builtins, obj.name)) return;
- if (path.scope.getBindingIdentifier(obj.name)) return;
- const builtIn = _builtInDefinitions.definitions.builtins[obj.name];
- addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
- }
-
- },
-
- VariableDeclarator(path, state) {
- if (!path.isReferenced()) return;
- const node = path.node;
- const obj = node.init;
- if (!t.isObjectPattern(node.id)) return;
- if (!t.isReferenced(obj, node)) return;
- if (obj && path.scope.getBindingIdentifier(obj.name)) return;
-
- for (var _iterator2 = node.id.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
-
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
-
- let prop = _ref2;
- prop = prop.key;
-
- if (!node.computed && t.isIdentifier(prop) && has(_builtInDefinitions.definitions.instanceMethods, prop.name)) {
- const builtIn = _builtInDefinitions.definitions.instanceMethods[prop.name];
- addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
- }
- }
- },
-
- Function(path, state) {
- if (!this.usesRegenerator && (path.node.generator || path.node.async)) {
- this.usesRegenerator = true;
-
- if (state.opts.regenerator) {
- addImport(path, "regenerator-runtime", this.builtIns);
- }
- }
- }
-
- };
- return {
- name: "use-built-ins",
-
- pre() {
- this.builtIns = new Set();
- this.usesRegenerator = false;
- },
-
- post() {
- const _this$opts = this.opts,
- debug = _this$opts.debug,
- onDebug = _this$opts.onDebug;
-
- if (debug) {
- (0, _debug.logUsagePolyfills)(this.builtIns, this.file.opts.filename, onDebug);
- }
- },
-
- visitor: addAndRemovePolyfillImports
- };
-} \ No newline at end of file
diff --git a/node_modules/@babel/preset-env/lib/utils.js b/node_modules/@babel/preset-env/lib/utils.js
deleted file mode 100644
index f09c4da5..00000000
--- a/node_modules/@babel/preset-env/lib/utils.js
+++ /dev/null
@@ -1,139 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.isRequire = exports.createImport = exports.getModulePath = exports.isPolyfillSource = exports.filterStageFromList = exports.getLowestUnreleased = exports.isUnreleasedVersion = exports.prettifyTargets = exports.prettifyVersion = exports.semverify = void 0;
-
-function _semver() {
- const data = _interopRequireDefault(require("semver"));
-
- _semver = function _semver() {
- return data;
- };
-
- return data;
-}
-
-function _helperModuleImports() {
- const data = require("@babel/helper-module-imports");
-
- _helperModuleImports = function _helperModuleImports() {
- return data;
- };
-
- return data;
-}
-
-var _unreleasedLabels = _interopRequireDefault(require("../data/unreleased-labels"));
-
-var _targetsParser = require("./targets-parser");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const semverify = version => {
- if (typeof version === "string" && _semver().default.valid(version)) {
- return version;
- }
-
- const split = version.toString().split(".");
-
- while (split.length < 3) {
- split.push("0");
- }
-
- return split.join(".");
-};
-
-exports.semverify = semverify;
-
-const prettifyVersion = version => {
- if (typeof version !== "string") {
- return version;
- }
-
- const parts = [_semver().default.major(version)];
-
- const minor = _semver().default.minor(version);
-
- const patch = _semver().default.patch(version);
-
- if (minor || patch) {
- parts.push(minor);
- }
-
- if (patch) {
- parts.push(patch);
- }
-
- return parts.join(".");
-};
-
-exports.prettifyVersion = prettifyVersion;
-
-const prettifyTargets = targets => {
- return Object.keys(targets).reduce((results, target) => {
- let value = targets[target];
- const unreleasedLabel = _unreleasedLabels.default[target];
-
- if (typeof value === "string" && unreleasedLabel !== value) {
- value = prettifyVersion(value);
- }
-
- results[target] = value;
- return results;
- }, {});
-};
-
-exports.prettifyTargets = prettifyTargets;
-
-const isUnreleasedVersion = (version, env) => {
- const unreleasedLabel = _unreleasedLabels.default[env];
- return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
-};
-
-exports.isUnreleasedVersion = isUnreleasedVersion;
-
-const getLowestUnreleased = (a, b, env) => {
- const unreleasedLabel = _unreleasedLabels.default[env];
- const hasUnreleased = [a, b].some(item => item === unreleasedLabel);
-
- if (hasUnreleased) {
- return a === hasUnreleased ? b : a || b;
- }
-
- return (0, _targetsParser.semverMin)(a, b);
-};
-
-exports.getLowestUnreleased = getLowestUnreleased;
-
-const filterStageFromList = (list, stageList) => {
- return Object.keys(list).reduce((result, item) => {
- if (!stageList[item]) {
- result[item] = list[item];
- }
-
- return result;
- }, {});
-};
-
-exports.filterStageFromList = filterStageFromList;
-
-const isPolyfillSource = source => source === "@babel/polyfill" || source === "core-js";
-
-exports.isPolyfillSource = isPolyfillSource;
-const modulePathMap = {
- "regenerator-runtime": "regenerator-runtime/runtime"
-};
-
-const getModulePath = mod => modulePathMap[mod] || `core-js/modules/${mod}`;
-
-exports.getModulePath = getModulePath;
-
-const createImport = (path, mod) => (0, _helperModuleImports().addSideEffect)(path, getModulePath(mod));
-
-exports.createImport = createImport;
-
-const isRequire = (t, path) => t.isExpressionStatement(path.node) && t.isCallExpression(path.node.expression) && t.isIdentifier(path.node.expression.callee) && path.node.expression.callee.name === "require" && path.node.expression.arguments.length === 1 && t.isStringLiteral(path.node.expression.arguments[0]) && isPolyfillSource(path.node.expression.arguments[0].value);
-
-exports.isRequire = isRequire; \ No newline at end of file