Commit 2101a218 authored by Alfakhori's avatar Alfakhori
Browse files

Merge branch 'Rosenstein' into 'master'

update some ui

See merge request !1
parents bf137ad8 91e89eab
# @babel/preset-env
> A Babel preset for each environment.
See our website [@babel/preset-env](https://babeljs.io/docs/en/next/babel-preset-env.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20preset-env%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/preset-env
```
or using yarn:
```sh
yarn add @babel/preset-env --dev
```
const typedArrayMethods = [
"typed arrays / %TypedArray%.from",
"typed arrays / %TypedArray%.of",
"typed arrays / %TypedArray%.prototype.subarray",
"typed arrays / %TypedArray%.prototype.join",
"typed arrays / %TypedArray%.prototype.indexOf",
"typed arrays / %TypedArray%.prototype.lastIndexOf",
"typed arrays / %TypedArray%.prototype.slice",
"typed arrays / %TypedArray%.prototype.every",
"typed arrays / %TypedArray%.prototype.filter",
"typed arrays / %TypedArray%.prototype.forEach",
"typed arrays / %TypedArray%.prototype.map",
"typed arrays / %TypedArray%.prototype.reduce",
"typed arrays / %TypedArray%.prototype.reduceRight",
"typed arrays / %TypedArray%.prototype.reverse",
"typed arrays / %TypedArray%.prototype.some",
"typed arrays / %TypedArray%.prototype.sort",
"typed arrays / %TypedArray%.prototype.copyWithin",
"typed arrays / %TypedArray%.prototype.find",
"typed arrays / %TypedArray%.prototype.findIndex",
"typed arrays / %TypedArray%.prototype.fill",
"typed arrays / %TypedArray%.prototype.keys",
"typed arrays / %TypedArray%.prototype.values",
"typed arrays / %TypedArray%.prototype.entries",
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
"typed arrays / %TypedArray%[Symbol.species]",
];
const es = {
// compat-table missing babel6 mapping
// "es6.array.concat": {
// features: [
// "well-known symbols / Symbol.isConcatSpreadable",
// "well-known symbols / Symbol.species, Array.prototype.concat",
// ]
// },
"es6.array.copy-within": "Array.prototype methods / Array.prototype.copyWithin",
"es6.array.every": "Array methods / Array.prototype.every",
"es6.array.fill": "Array.prototype methods / Array.prototype.fill",
"es6.array.filter": {
features: [
"Array methods / Array.prototype.filter",
// compat-table missing babel6 mapping
// "well-known symbols / Symbol.species, Array.prototype.filter",
],
},
"es6.array.find": "Array.prototype methods / Array.prototype.find",
"es6.array.find-index": "Array.prototype methods / Array.prototype.findIndex",
"es6.array.for-each": "Array methods / Array.prototype.forEach",
"es6.array.from": "Array static methods / Array.from",
"es7.array.includes": "Array.prototype.includes",
"es6.array.index-of": "Array methods / Array.prototype.indexOf",
"es6.array.is-array": "Array methods / Array.isArray",
// "es.array.join": "", required tests for that
"es6.array.iterator": {
features: [
"Array.prototype methods / Array.prototype.keys",
// can use Symbol.iterator, not implemented in many environments
// "Array.prototype methods / Array.prototype.values",
"Array.prototype methods / Array.prototype.entries",
],
},
"es6.array.last-index-of": "Array methods / Array.prototype.lastIndexOf",
"es6.array.map": {
features: [
"Array methods / Array.prototype.map",
// compat-table missing babel6 mapping
// "well-known symbols / Symbol.species, Array.prototype.map",
],
},
"es6.array.of": "Array static methods / Array.of",
"es6.array.reduce": "Array methods / Array.prototype.reduce",
"es6.array.reduce-right": "Array methods / Array.prototype.reduceRight",
// compat-table missing babel6 mapping
// "es6.array.slice": "well-known symbols / Symbol.species, Array.prototype.slice",
"es6.array.some": "Array methods / Array.prototype.some",
"es6.array.sort": "Array methods / Array.prototype.sort",
"es6.array.species": "Array static methods / Array[Symbol.species]",
// compat-table missing babel6 mapping
//"es6.array.splice": "well-known symbols / Symbol.species, Array.prototype.splice",
"es6.date.now": "Date methods / Date.now",
"es6.date.to-iso-string": "Date methods / Date.prototype.toISOString",
"es6.date.to-json": "Date methods / Date.prototype.toJSON",
"es6.date.to-primitive": "Date.prototype[Symbol.toPrimitive]",
"es6.date.to-string": "miscellaneous / Invalid Date",
"es6.function.bind": "Function.prototype.bind",
"es6.function.has-instance": "well-known symbols / Symbol.hasInstance",
"es6.function.name": {
features: [
"function \"name\" property / function statements",
"function \"name\" property / function expressions",
],
},
"es6.map": "Map",
"es6.math.acosh": "Math methods / Math.acosh",
"es6.math.asinh": "Math methods / Math.asinh",
"es6.math.atanh": "Math methods / Math.atanh",
"es6.math.cbrt": "Math methods / Math.cbrt",
"es6.math.clz32": "Math methods / Math.clz32",
"es6.math.cosh": "Math methods / Math.cosh",
"es6.math.expm1": "Math methods / Math.expm1",
"es6.math.fround": "Math methods / Math.fround",
"es6.math.hypot": "Math methods / Math.hypot",
"es6.math.imul": "Math methods / Math.imul",
"es6.math.log1p": "Math methods / Math.log1p",
"es6.math.log10": "Math methods / Math.log10",
"es6.math.log2": "Math methods / Math.log2",
"es6.math.sign": "Math methods / Math.sign",
"es6.math.sinh": "Math methods / Math.sinh",
"es6.math.tanh": "Math methods / Math.tanh",
"es6.math.trunc": "Math methods / Math.trunc",
"es6.number.constructor": {
features: [
"octal and binary literals / octal supported by Number()",
"octal and binary literals / binary supported by Number()",
],
},
"es6.number.epsilon": "Number properties / Number.EPSILON",
"es6.number.is-finite": "Number properties / Number.isFinite",
"es6.number.is-integer": "Number properties / Number.isInteger",
"es6.number.is-nan": "Number properties / Number.isNaN",
"es6.number.is-safe-integer": "Number properties / Number.isSafeInteger",
"es6.number.max-safe-integer": "Number properties / Number.MAX_SAFE_INTEGER",
"es6.number.min-safe-integer": "Number properties / Number.MIN_SAFE_INTEGER",
"es6.number.parse-float": "Number properties / Number.parseFloat",
"es6.number.parse-int": "Number properties / Number.parseInt",
"es6.object.assign": {
features: ["Object static methods / Object.assign", "Symbol"],
},
"es6.object.create": "Object static methods / Object.create",
"es7.object.define-getter": {
features: [
"Object.prototype getter/setter methods / __defineGetter__",
"Object.prototype getter/setter methods / __defineGetter__, symbols",
"Object.prototype getter/setter methods / __defineGetter__, ToObject(this)",
],
},
"es7.object.define-setter": {
features: [
"Object.prototype getter/setter methods / __defineSetter__",
"Object.prototype getter/setter methods / __defineSetter__, symbols",
"Object.prototype getter/setter methods / __defineSetter__, ToObject(this)",
],
},
"es6.object.define-property": "Object static methods / Object.defineProperty",
"es6.object.define-properties": "Object static methods / Object.defineProperties",
"es7.object.entries": "Object static methods / Object.entries",
"es6.object.freeze": "Object static methods accept primitives / Object.freeze",
"es6.object.get-own-property-descriptor": "Object static methods accept primitives / Object.getOwnPropertyDescriptor",
"es7.object.get-own-property-descriptors": "Object static methods / Object.getOwnPropertyDescriptors",
"es6.object.get-own-property-names": "Object static methods accept primitives / Object.getOwnPropertyNames",
"es6.object.get-prototype-of": "Object static methods accept primitives / Object.getPrototypeOf",
"es7.object.lookup-getter": {
features: [
"Object.prototype getter/setter methods / __lookupGetter__",
"Object.prototype getter/setter methods / __lookupGetter__, prototype chain",
"Object.prototype getter/setter methods / __lookupGetter__, symbols",
"Object.prototype getter/setter methods / __lookupGetter__, ToObject(this)",
"Object.prototype getter/setter methods / __lookupGetter__, data properties can shadow accessors",
],
},
"es7.object.lookup-setter": {
features: [
"Object.prototype getter/setter methods / __lookupSetter__",
"Object.prototype getter/setter methods / __lookupSetter__, prototype chain",
"Object.prototype getter/setter methods / __lookupSetter__, symbols",
"Object.prototype getter/setter methods / __lookupSetter__, ToObject(this)",
"Object.prototype getter/setter methods / __lookupSetter__, data properties can shadow accessors",
],
},
"es6.object.prevent-extensions": "Object static methods accept primitives / Object.preventExtensions",
"es6.object.is": "Object static methods / Object.is",
"es6.object.is-frozen": "Object static methods accept primitives / Object.isFrozen",
"es6.object.is-sealed": "Object static methods accept primitives / Object.isSealed",
"es6.object.is-extensible": "Object static methods accept primitives / Object.isExtensible",
"es6.object.keys": "Object static methods accept primitives / Object.keys",
"es6.object.seal": "Object static methods accept primitives / Object.seal",
"es6.object.set-prototype-of": "Object static methods / Object.setPrototypeOf",
"es7.object.values": "Object static methods / Object.values",
"es6.promise": {
features: [
// required unhandled rejection tracking tests
"Promise",
"well-known symbols / Symbol.species, Promise.prototype.then",
],
},
"es7.promise.finally": "Promise.prototype.finally",
"es6.reflect.apply": "Reflect / Reflect.apply",
"es6.reflect.construct": "Reflect / Reflect.construct",
"es6.reflect.define-property": "Reflect / Reflect.defineProperty",
"es6.reflect.delete-property": "Reflect / Reflect.deleteProperty",
"es6.reflect.get": "Reflect / Reflect.get",
"es6.reflect.get-own-property-descriptor": "Reflect / Reflect.getOwnPropertyDescriptor",
"es6.reflect.get-prototype-of": "Reflect / Reflect.getPrototypeOf",
"es6.reflect.has": "Reflect / Reflect.has",
"es6.reflect.is-extensible": "Reflect / Reflect.isExtensible",
"es6.reflect.own-keys": "Reflect / Reflect.ownKeys",
"es6.reflect.prevent-extensions": "Reflect / Reflect.preventExtensions",
"es6.reflect.set": "Reflect / Reflect.set",
"es6.reflect.set-prototype-of": "Reflect / Reflect.setPrototypeOf",
"es6.regexp.constructor": {
features: [
"miscellaneous / RegExp constructor can alter flags",
"well-known symbols / Symbol.match, RegExp constructor",
],
},
"es6.regexp.flags": "RegExp.prototype properties / RegExp.prototype.flags",
"es6.regexp.match": "RegExp.prototype properties / RegExp.prototype[Symbol.match]",
"es6.regexp.replace": "RegExp.prototype properties / RegExp.prototype[Symbol.replace]",
"es6.regexp.split": "RegExp.prototype properties / RegExp.prototype[Symbol.split]",
"es6.regexp.search": "RegExp.prototype properties / RegExp.prototype[Symbol.search]",
"es6.regexp.to-string": "miscellaneous / RegExp.prototype.toString generic and uses \"flags\" property",
// This is explicit due to prevent the stage-1 Set proposals under the
// category "Set methods" from being included.
"es6.set": {
features: [
"Set / basic functionality",
"Set / constructor arguments",
"Set / constructor requires new",
"Set / constructor accepts null",
"Set / constructor invokes add",
"Set / iterator closing",
"Set / Set.prototype.add returns this",
"Set / -0 key converts to +0",
"Set / Set.prototype.size",
"Set / Set.prototype.delete",
"Set / Set.prototype.clear",
"Set / Set.prototype.forEach",
"Set / Set.prototype.keys",
"Set / Set.prototype.values",
"Set / Set.prototype.entries",
"Set / Set.prototype[Symbol.iterator]",
"Set / Set.prototype isn't an instance",
"Set / Set iterator prototype chain",
"Set / Set[Symbol.species]",
],
},
"es6.symbol": {
features: [
"Symbol",
"Object static methods / Object.getOwnPropertySymbols",
"well-known symbols / Symbol.hasInstance",
"well-known symbols / Symbol.isConcatSpreadable",
"well-known symbols / Symbol.iterator",
"well-known symbols / Symbol.match",
"well-known symbols / Symbol.replace",
"well-known symbols / Symbol.search",
"well-known symbols / Symbol.species",
"well-known symbols / Symbol.split",
"well-known symbols / Symbol.toPrimitive",
"well-known symbols / Symbol.toStringTag",
"well-known symbols / Symbol.unscopables",
],
},
"es7.symbol.async-iterator": "Asynchronous Iterators",
"es6.string.anchor": "String.prototype HTML methods",
"es6.string.big": "String.prototype HTML methods",
"es6.string.blink": "String.prototype HTML methods",
"es6.string.bold": "String.prototype HTML methods",
"es6.string.code-point-at": "String.prototype methods / String.prototype.codePointAt",
"es6.string.ends-with": "String.prototype methods / String.prototype.endsWith",
"es6.string.fixed": "String.prototype HTML methods",
"es6.string.fontcolor": "String.prototype HTML methods",
"es6.string.fontsize": "String.prototype HTML methods",
"es6.string.from-code-point": "String static methods / String.fromCodePoint",
"es6.string.includes": "String.prototype methods / String.prototype.includes",
"es6.string.italics": "String.prototype HTML methods",
"es6.string.iterator": "String.prototype methods / String.prototype[Symbol.iterator]",
"es6.string.link": "String.prototype HTML methods",
// "String.prototype methods / String.prototype.normalize" not implemented
"es7.string.pad-start": "String padding / String.prototype.padStart",
"es7.string.pad-end": "String padding / String.prototype.padEnd",
"es6.string.raw": "String static methods / String.raw",
"es6.string.repeat": "String.prototype methods / String.prototype.repeat",
"es6.string.small": "String.prototype HTML methods",
"es6.string.starts-with": "String.prototype methods / String.prototype.startsWith",
"es6.string.strike": "String.prototype HTML methods",
"es6.string.sub": "String.prototype HTML methods",
"es6.string.sup": "String.prototype HTML methods",
"es6.string.trim": "String properties and methods / String.prototype.trim",
"es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
"es6.typed.data-view": "typed arrays / DataView",
"es6.typed.int8-array": {
features: ["typed arrays / Int8Array"].concat(typedArrayMethods),
},
"es6.typed.uint8-array": {
features: ["typed arrays / Uint8Array"].concat(typedArrayMethods),
},
"es6.typed.uint8-clamped-array": {
features: ["typed arrays / Uint8ClampedArray"].concat(typedArrayMethods),
},
"es6.typed.int16-array": {
features: ["typed arrays / Int16Array"].concat(typedArrayMethods),
},
"es6.typed.uint16-array": {
features: ["typed arrays / Uint16Array"].concat(typedArrayMethods),
},
"es6.typed.int32-array": {
features: ["typed arrays / Int32Array"].concat(typedArrayMethods),
},
"es6.typed.uint32-array": {
features: ["typed arrays / Uint32Array"].concat(typedArrayMethods),
},
"es6.typed.float32-array": {
features: ["typed arrays / Float32Array"].concat(typedArrayMethods),
},
"es6.typed.float64-array": {
features: ["typed arrays / Float64Array"].concat(typedArrayMethods),
},
"es6.weak-map": "WeakMap",
"es6.weak-set": "WeakSet",
};
const proposals = require("./shipped-proposals").builtIns;
module.exports = Object.assign({}, es, proposals);
{
"es6.module": {
"edge": "16",
"firefox": "60",
"chrome": "61",
"safari": "10.1",
"opera": "48",
"ios_saf": "10.3",
"and_ff": "60"
}
}
{
"es6.array.copy-within": {
"chrome": "45",
"edge": "12",
"firefox": "32",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "32",
"electron": "0.35"
},
"es6.array.every": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.fill": {
"chrome": "45",
"edge": "12",
"firefox": "31",
"safari": "7.1",
"node": "4",
"ios": "8",
"opera": "32",
"electron": "0.35"
},
"es6.array.filter": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.find": {
"chrome": "45",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "4",
"ios": "8",
"opera": "32",
"electron": "0.35"
},
"es6.array.find-index": {
"chrome": "45",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "4",
"ios": "8",
"opera": "32",
"electron": "0.35"
},
"es6.array.for-each": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.from": {
"chrome": "51",
"edge": "15",
"firefox": "36",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es7.array.includes": {
"chrome": "47",
"edge": "14",
"firefox": "43",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "34",
"electron": "0.36"
},
"es6.array.index-of": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.is-array": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "4",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.iterator": {
"chrome": "38",
"edge": "12",
"firefox": "28",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.array.last-index-of": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.map": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.of": {
"chrome": "45",
"edge": "12",
"firefox": "25",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "32",
"electron": "0.35"
},
"es6.array.reduce": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "3",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.reduce-right": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "3",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.some": {
"chrome": "5",
"opera": "10.10",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.array.sort": {
"chrome": "63",
"opera": "50",
"edge": "12",
"firefox": "5",
"safari": "10.1",
"node": "10.0",
"ie": "9",
"ios": "10.3",
"electron": "3"
},
"es6.array.species": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.date.now": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "2",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.date.to-iso-string": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "3.5",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.date.to-json": {
"chrome": "5",
"opera": "12.10",
"edge": "12",
"firefox": "4",
"safari": "10",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "10",
"electron": "1.1"
},
"es6.date.to-primitive": {
"chrome": "47",
"edge": "15",
"firefox": "44",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "34",
"electron": "0.36"
},
"es6.date.to-string": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.12",
"ie": "10",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.function.bind": {
"chrome": "7",
"opera": "12",
"edge": "12",
"firefox": "4",
"safari": "5.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "7",
"phantom": "2"
},
"es6.function.has-instance": {
"chrome": "51",
"edge": "15",
"firefox": "50",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.function.name": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "2",
"safari": "4",
"node": "0.12",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.map": {
"chrome": "51",
"edge": "15",
"firefox": "53",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.math.acosh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.asinh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.atanh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.cbrt": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.clz32": {
"chrome": "38",
"edge": "12",
"firefox": "31",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "25",
"electron": "0.2"
},
"es6.math.cosh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.expm1": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.fround": {
"chrome": "38",
"edge": "12",
"firefox": "26",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.hypot": {
"chrome": "38",
"edge": "12",
"firefox": "27",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.imul": {
"chrome": "30",
"edge": "12",
"firefox": "23",
"safari": "7",
"node": "0.12",
"android": "4.4",
"ios": "7",
"opera": "17",
"electron": "0.2"
},
"es6.math.log1p": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.log10": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.log2": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.sign": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "25",
"electron": "0.2"
},
"es6.math.sinh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.tanh": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.math.trunc": {
"chrome": "38",
"edge": "12",
"firefox": "25",
"safari": "7.1",
"node": "0.12",
"ios": "8",
"opera": "25",
"electron": "0.2"
},
"es6.number.constructor": {
"chrome": "41",
"edge": "12",
"firefox": "36",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.number.epsilon": {
"chrome": "34",
"edge": "12",
"firefox": "25",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.is-finite": {
"chrome": "19",
"edge": "12",
"firefox": "16",
"safari": "9",
"node": "0.12",
"android": "4.1",
"ios": "9",
"electron": "0.2"
},
"es6.number.is-integer": {
"chrome": "34",
"edge": "12",
"firefox": "16",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.is-nan": {
"chrome": "19",
"edge": "12",
"firefox": "15",
"safari": "9",
"node": "0.12",
"android": "4.1",
"ios": "9",
"electron": "0.2"
},
"es6.number.is-safe-integer": {
"chrome": "34",
"edge": "12",
"firefox": "32",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.max-safe-integer": {
"chrome": "34",
"edge": "12",
"firefox": "31",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.min-safe-integer": {
"chrome": "34",
"edge": "12",
"firefox": "31",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.parse-float": {
"chrome": "34",
"edge": "12",
"firefox": "25",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.number.parse-int": {
"chrome": "34",
"edge": "12",
"firefox": "25",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es6.object.assign": {
"chrome": "49",
"edge": "13",
"firefox": "36",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.object.create": {
"chrome": "5",
"opera": "12",
"edge": "12",
"firefox": "4",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es7.object.define-getter": {
"chrome": "62",
"edge": "16",
"firefox": "48",
"safari": "9",
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
},
"es7.object.define-setter": {
"chrome": "62",
"edge": "16",
"firefox": "48",
"safari": "9",
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
},
"es6.object.define-property": {
"chrome": "5",
"opera": "12",
"edge": "12",
"firefox": "4",
"safari": "5.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.object.define-properties": {
"chrome": "5",
"opera": "12",
"edge": "12",
"firefox": "4",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es7.object.entries": {
"chrome": "54",
"edge": "14",
"firefox": "47",
"safari": "10.1",
"node": "7",
"ios": "10.3",
"opera": "41",
"electron": "1.5"
},
"es6.object.freeze": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.get-own-property-descriptor": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es7.object.get-own-property-descriptors": {
"chrome": "54",
"edge": "15",
"firefox": "50",
"safari": "10.1",
"node": "7",
"ios": "10.3",
"opera": "41",
"electron": "1.5"
},
"es6.object.get-own-property-names": {
"chrome": "40",
"edge": "12",
"firefox": "33",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "27",
"electron": "0.21"
},
"es6.object.get-prototype-of": {
"chrome": "44",
"edge": "12",
"firefox": "3.5",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es7.object.lookup-getter": {
"chrome": "62",
"firefox": "36",
"safari": "9",
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
},
"es7.object.lookup-setter": {
"chrome": "62",
"firefox": "36",
"safari": "9",
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
},
"es6.object.prevent-extensions": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.is": {
"chrome": "19",
"edge": "12",
"firefox": "22",
"safari": "9",
"node": "0.12",
"android": "4.1",
"ios": "9",
"electron": "0.2"
},
"es6.object.is-frozen": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.is-sealed": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.is-extensible": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.keys": {
"chrome": "40",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "27",
"electron": "0.21"
},
"es6.object.seal": {
"chrome": "44",
"edge": "12",
"firefox": "35",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"es6.object.set-prototype-of": {
"chrome": "34",
"edge": "12",
"firefox": "31",
"safari": "9",
"node": "0.12",
"ie": "11",
"ios": "9",
"opera": "21",
"electron": "0.2"
},
"es7.object.values": {
"chrome": "54",
"edge": "14",
"firefox": "47",
"safari": "10.1",
"node": "7",
"ios": "10.3",
"opera": "41",
"electron": "1.5"
},
"es6.promise": {
"chrome": "51",
"edge": "14",
"firefox": "45",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es7.promise.finally": {
"chrome": "63",
"edge": "18",
"firefox": "58",
"safari": "11.1",
"node": "10.0",
"ios": "11.3",
"opera": "50",
"electron": "3"
},
"es6.reflect.apply": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.construct": {
"chrome": "49",
"edge": "13",
"firefox": "44",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.define-property": {
"chrome": "49",
"edge": "13",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.delete-property": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.get": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.get-own-property-descriptor": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.get-prototype-of": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.has": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.is-extensible": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.own-keys": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.prevent-extensions": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.set": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.reflect.set-prototype-of": {
"chrome": "49",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"es6.regexp.constructor": {
"chrome": "50",
"firefox": "40",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.regexp.flags": {
"chrome": "49",
"firefox": "37",
"safari": "9",
"node": "6",
"ios": "9",
"opera": "36",
"electron": "1"
},
"es6.regexp.match": {
"chrome": "50",
"firefox": "49",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.regexp.replace": {
"chrome": "50",
"firefox": "49",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.regexp.split": {
"chrome": "50",
"firefox": "49",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.regexp.search": {
"chrome": "50",
"firefox": "49",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.regexp.to-string": {
"chrome": "50",
"firefox": "39",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"es6.set": {
"chrome": "51",
"edge": "15",
"firefox": "53",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.symbol": {
"chrome": "51",
"firefox": "51",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es7.symbol.async-iterator": {
"chrome": "63",
"firefox": "57",
"safari": "12",
"node": "10.0",
"ios": "12",
"opera": "50",
"electron": "3"
},
"es6.string.anchor": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.big": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.blink": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.bold": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.code-point-at": {
"chrome": "41",
"edge": "12",
"firefox": "29",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.ends-with": {
"chrome": "41",
"edge": "12",
"firefox": "29",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.fixed": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.fontcolor": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.fontsize": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.from-code-point": {
"chrome": "41",
"edge": "12",
"firefox": "29",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.includes": {
"chrome": "41",
"edge": "12",
"firefox": "40",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.italics": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.iterator": {
"chrome": "38",
"edge": "12",
"firefox": "36",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "25",
"electron": "0.2"
},
"es6.string.link": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es7.string.pad-start": {
"chrome": "57",
"edge": "15",
"firefox": "48",
"safari": "10",
"node": "8",
"ios": "10",
"opera": "44",
"electron": "1.7"
},
"es7.string.pad-end": {
"chrome": "57",
"edge": "15",
"firefox": "48",
"safari": "10",
"node": "8",
"ios": "10",
"opera": "44",
"electron": "1.7"
},
"es6.string.raw": {
"chrome": "41",
"edge": "12",
"firefox": "34",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.repeat": {
"chrome": "41",
"edge": "12",
"firefox": "24",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.small": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.starts-with": {
"chrome": "41",
"edge": "12",
"firefox": "29",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"es6.string.strike": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.sub": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.sup": {
"chrome": "5",
"edge": "12",
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"ios": "7",
"phantom": "2",
"electron": "1.1"
},
"es6.string.trim": {
"chrome": "5",
"opera": "10.50",
"edge": "12",
"firefox": "3.5",
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.typed.array-buffer": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.data-view": {
"chrome": "5",
"opera": "12",
"edge": "12",
"firefox": "15",
"safari": "5.1",
"node": "0.12",
"ie": "10",
"android": "4.0",
"ios": "6",
"phantom": "2",
"electron": "1.1"
},
"es6.typed.int8-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.uint8-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.uint8-clamped-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.int16-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.uint16-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.int32-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.uint32-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.float32-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.typed.float64-array": {
"chrome": "51",
"edge": "13",
"firefox": "48",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"es6.weak-map": {
"chrome": "51",
"edge": "15",
"firefox": "53",
"safari": "9",
"node": "6.5",
"ios": "9",
"opera": "38",
"electron": "1.2"
},
"es6.weak-set": {
"chrome": "51",
"edge": "15",
"firefox": "53",
"safari": "9",
"node": "6.5",
"ios": "9",
"opera": "38",
"electron": "1.2"
},
"es7.array.flat-map": {
"chrome": "69",
"firefox": "62",
"safari": "12",
"node": "11.0",
"ios": "12",
"opera": "56",
"electron": "4"
}
}
const es = {
"transform-template-literals": {
features: ["template literals"],
},
"transform-literals": {
features: ["Unicode code point escapes"],
},
"transform-function-name": {
features: ['function "name" property'],
},
"transform-arrow-functions": {
features: ["arrow functions"],
},
"transform-block-scoped-functions": {
features: ["block-level function declaration"],
},
"transform-classes": {
features: ["class", "super"],
},
"transform-object-super": {
features: ["super"],
},
"transform-shorthand-properties": {
features: ["object literal extensions / shorthand properties"],
},
"transform-duplicate-keys": {
features: ["miscellaneous / duplicate property names in strict mode"],
},
"transform-computed-properties": {
features: ["object literal extensions / computed properties"],
},
"transform-for-of": {
features: ["for..of loops"],
},
"transform-sticky-regex": {
features: [
'RegExp "y" and "u" flags / "y" flag, lastIndex',
'RegExp "y" and "u" flags / "y" flag',
],
},
// We want to apply this prior to unicode regex so that "." and "u"
// are properly handled.
//
// Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112
"transform-dotall-regex": "s (dotAll) flag for regular expressions",
"transform-unicode-regex": {
features: [
'RegExp "y" and "u" flags / "u" flag, case folding',
'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes',
'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters',
'RegExp "y" and "u" flags / "u" flag',
],
},
"transform-spread": {
features: "spread syntax for iterable objects",
},
"transform-parameters": {
features: [
"default function parameters",
"rest parameters",
"destructuring, parameters / defaults, arrow function",
],
},
"transform-destructuring": {
features: [
"destructuring, assignment",
"destructuring, declarations",
"destructuring, parameters",
],
},
"transform-block-scoping": {
features: ["const", "let"],
},
"transform-typeof-symbol": {
features: ["Symbol / typeof support"],
},
"transform-new-target": {
features: ["new.target"],
},
"transform-regenerator": {
features: ["generators"],
},
"transform-exponentiation-operator": {
features: ["exponentiation (**) operator"],
},
"transform-async-to-generator": {
features: ["async functions"],
},
"proposal-async-generator-functions": "Asynchronous Iterators",
"proposal-object-rest-spread": "object rest/spread properties",
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes",
"proposal-json-strings": "JSON superset",
"proposal-optional-catch-binding": "optional catch binding",
"transform-named-capturing-groups-regex": "RegExp named capture groups",
};
const proposals = require("./shipped-proposals").features;
module.exports = Object.assign({}, es, proposals);
{
"transform-template-literals": {
"chrome": "41",
"edge": "13",
"firefox": "34",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "28",
"electron": "0.24"
},
"transform-literals": {
"chrome": "44",
"edge": "12",
"firefox": "53",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "31",
"electron": "0.31"
},
"transform-function-name": {
"chrome": "51",
"firefox": "53",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"transform-arrow-functions": {
"chrome": "47",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "34",
"electron": "0.36"
},
"transform-block-scoped-functions": {
"chrome": "41",
"edge": "12",
"firefox": "46",
"safari": "10",
"node": "4",
"ie": "11",
"ios": "10",
"opera": "28",
"electron": "0.24"
},
"transform-classes": {
"chrome": "46",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "5",
"ios": "10",
"opera": "33",
"electron": "0.36"
},
"transform-object-super": {
"chrome": "46",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "5",
"ios": "10",
"opera": "33",
"electron": "0.36"
},
"transform-shorthand-properties": {
"chrome": "43",
"edge": "12",
"firefox": "33",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "30",
"electron": "0.29"
},
"transform-duplicate-keys": {
"chrome": "42",
"edge": "12",
"firefox": "34",
"safari": "9",
"node": "4",
"ios": "9",
"opera": "29",
"electron": "0.27"
},
"transform-computed-properties": {
"chrome": "44",
"edge": "12",
"firefox": "34",
"safari": "7.1",
"node": "4",
"ios": "8",
"opera": "31",
"electron": "0.31"
},
"transform-for-of": {
"chrome": "51",
"edge": "15",
"firefox": "53",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"transform-sticky-regex": {
"chrome": "49",
"edge": "13",
"firefox": "3",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"transform-dotall-regex": {
"chrome": "62",
"safari": "11.1",
"node": "8.10",
"ios": "11.3",
"opera": "49",
"electron": "3"
},
"transform-unicode-regex": {
"chrome": "50",
"edge": "13",
"firefox": "46",
"safari": "12",
"node": "6",
"ios": "12",
"opera": "37",
"electron": "1.1"
},
"transform-spread": {
"chrome": "46",
"edge": "13",
"firefox": "36",
"safari": "10",
"node": "5",
"ios": "10",
"opera": "33",
"electron": "0.36"
},
"transform-parameters": {
"chrome": "49",
"edge": "18",
"firefox": "53",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "36",
"electron": "1"
},
"transform-destructuring": {
"chrome": "51",
"edge": "18",
"firefox": "53",
"safari": "10",
"node": "6.5",
"ios": "10",
"opera": "38",
"electron": "1.2"
},
"transform-block-scoping": {
"chrome": "49",
"edge": "14",
"firefox": "51",
"safari": "10.1",
"node": "6",
"ios": "10.3",
"opera": "36",
"electron": "1"
},
"transform-typeof-symbol": {
"chrome": "38",
"edge": "12",
"firefox": "36",
"safari": "9",
"node": "0.12",
"ios": "9",
"opera": "25",
"electron": "0.2"
},
"transform-new-target": {
"chrome": "46",
"edge": "14",
"firefox": "41",
"safari": "10",
"node": "5",
"ios": "10",
"opera": "33",
"electron": "0.36"
},
"transform-regenerator": {
"chrome": "50",
"edge": "13",
"firefox": "53",
"safari": "10",
"node": "6",
"ios": "10",
"opera": "37",
"electron": "1.1"
},
"transform-exponentiation-operator": {
"chrome": "52",
"edge": "14",
"firefox": "52",
"safari": "10.1",
"node": "7",
"ios": "10.3",
"opera": "39",
"electron": "1.3"
},
"transform-async-to-generator": {
"chrome": "55",
"edge": "15",
"firefox": "52",
"safari": "11",
"node": "7.6",
"ios": "11",
"opera": "42",
"electron": "1.6"
},
"proposal-async-generator-functions": {
"chrome": "63",
"firefox": "57",
"safari": "12",
"node": "10.0",
"ios": "12",
"opera": "50",
"electron": "3"
},
"proposal-object-rest-spread": {
"chrome": "60",
"firefox": "55",
"safari": "11.1",
"node": "8.3",
"ios": "11.3",
"opera": "47",
"electron": "2.1"
},
"proposal-unicode-property-regex": {
"chrome": "64",
"safari": "11.1",
"node": "10.0",
"ios": "11.3",
"opera": "51",
"electron": "3"
},
"proposal-json-strings": {
"chrome": "66",
"firefox": "62",
"safari": "12",
"node": "10.0",
"ios": "12",
"opera": "53",
"electron": "3"
},
"proposal-optional-catch-binding": {
"chrome": "66",
"firefox": "58",
"safari": "11.1",
"node": "10.0",
"ios": "11.3",
"opera": "53",
"electron": "3"
},
"transform-named-capturing-groups-regex": {
"chrome": "64",
"safari": "11.1",
"node": "10.0",
"ios": "11.3",
"opera": "51",
"electron": "3"
}
}
// These mappings represent the builtin/feature proposals that have been
// shipped by browsers, and are enabled by the `shippedProposals` option.
const builtIns = {
"es7.array.flat-map": "Array.prototype.{flat, flatMap} / Array.prototype.flatMap"
};
const features = {};
const pluginSyntaxMap = new Map([
["proposal-async-generator-functions", "syntax-async-generators"],
["proposal-object-rest-spread", "syntax-object-rest-spread"],
["proposal-optional-catch-binding", "syntax-optional-catch-binding"],
["proposal-unicode-property-regex", null],
["proposal-json-strings", "syntax-json-strings"],
]);
module.exports = { builtIns, features, pluginSyntaxMap };
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
"syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
"syntax-json-strings": require("@babel/plugin-syntax-json-strings"),
"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"),
"proposal-json-strings": require("@babel/plugin-proposal-json-strings"),
"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-named-capturing-groups-regex": require("@babel/plugin-transform-named-capturing-groups-regex"),
"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
"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"],
finally: ["es7.promise.finally"],
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
"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 () {
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
"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
"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
"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 () {
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 _normalizeOptions = _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 () {
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;
};
function supportsStaticESM(caller) {
return !!(caller && caller.supportsStaticESM);
}
var _default = (0, _helperPluginUtils().declare)((api, opts) => {
api.assertVersion(7);
const {
configPath,
debug,
exclude: optionsExclude,
forceAllTransforms,
ignoreBrowserslistConfig,
include: optionsInclude,
loose,
modules,
shippedProposals,
spec,
targets: optionsTargets,
useBuiltIns
} = (0, _normalizeOptions.default)(opts);
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] && (modules !== "auto" || !api.caller || !api.caller(supportsStaticESM))) {
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
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
auto: "transform-modules-commonjs",
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
"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 () {
return data;
};
return data;
}
function _browserslist() {
const data = _interopRequireDefault(require("browserslist"));
_browserslist = function () {
return data;
};
return data;
}
var _builtIns = _interopRequireDefault(require("../data/built-ins.json"));
var _defaultIncludes = require("./default-includes");
var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
var _targetsParser = require("./targets-parser");
var _utils = require("./utils");
var _plugins = _interopRequireDefault(require("../data/plugins.json"));
var _options = require("./options");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const validateTopLevelOptions = options => {
for (const option in options) {
if (!_options.TopLevelOptions[option]) {
const validOptions = (0, _utils.getValues)(_options.TopLevelOptions);
throw new Error(`Invalid Option: ${option} is not a valid top-level option.
Maybe you meant to use '${(0, _utils.findSuggestion)(validOptions, option)}'?`);
}
}
};
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\/|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 normalizeTargets = targets => {
if ((0, _targetsParser.isBrowsersQueryValid)(targets)) {
return {
browsers: targets
};
}
return Object.assign({}, targets);
};
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(_options.TopLevelOptions.ignoreBrowserslistConfig, ignoreBrowserslistConfig, false);
exports.validateIgnoreBrowserslistConfig = validateIgnoreBrowserslistConfig;
const validateModulesOption = (modulesOpt = _options.ModulesOption.auto) => {
(0, _invariant().default)(_options.ModulesOption[modulesOpt] || _options.ModulesOption[modulesOpt] === _options.ModulesOption.false, `Invalid Option: The 'modules' option must be one of \n` + ` - 'false' to indicate no module processing\n` + ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` + ` - 'auto' (default) which will automatically select 'false' if the current\n` + ` process is known to support ES module syntax, or "commonjs" otherwise\n`);
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)(_options.UseBuiltInsOption[builtInsOpt] || _options.UseBuiltInsOption[builtInsOpt] === _options.UseBuiltInsOption.false, `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) {
validateTopLevelOptions(opts);
const include = expandIncludesAndExcludes(opts.include, _options.TopLevelOptions.include);
const exclude = expandIncludesAndExcludes(opts.exclude, _options.TopLevelOptions.exclude);
checkDuplicateIncludeExcludes(include, exclude);
return {
configPath: validateConfigPathOption(opts.configPath),
debug: validateBoolOption(_options.TopLevelOptions.debug, opts.debug, false),
include,
exclude,
forceAllTransforms: validateBoolOption(_options.TopLevelOptions.forceAllTransforms, opts.forceAllTransforms, false),
ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(opts.ignoreBrowserslistConfig),
loose: validateBoolOption(_options.TopLevelOptions.loose, opts.loose, false),
modules: validateModulesOption(opts.modules),
shippedProposals: validateBoolOption(_options.TopLevelOptions.shippedProposals, opts.shippedProposals, false),
spec: validateBoolOption(_options.TopLevelOptions.spec, opts.spec, false),
targets: normalizeTargets(opts.targets),
useBuiltIns: validateUseBuiltInsOption(opts.useBuiltIns)
};
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TargetNames = exports.UseBuiltInsOption = exports.ModulesOption = exports.TopLevelOptions = void 0;
const TopLevelOptions = {
configPath: "configPath",
debug: "debug",
exclude: "exclude",
forceAllTransforms: "forceAllTransforms",
ignoreBrowserslistConfig: "ignoreBrowserslistConfig",
include: "include",
loose: "loose",
modules: "modules",
shippedProposals: "shippedProposals",
spec: "spec",
targets: "targets",
useBuiltIns: "useBuiltIns"
};
exports.TopLevelOptions = TopLevelOptions;
const ModulesOption = {
false: false,
auto: "auto",
amd: "amd",
commonjs: "commonjs",
cjs: "cjs",
systemjs: "systemjs",
umd: "umd"
};
exports.ModulesOption = ModulesOption;
const UseBuiltInsOption = {
false: false,
entry: "entry",
usage: "usage"
};
exports.UseBuiltInsOption = UseBuiltInsOption;
const TargetNames = {
esmodules: "esmodules",
node: "node",
browsers: "browsers",
chrome: "chrome",
opera: "opera",
edge: "edge",
firefox: "firefox",
safari: "safari",
ie: "ie",
ios: "ios",
android: "android",
electron: "electron"
};
exports.TargetNames = TargetNames;
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.semverMin = exports.isBrowsersQueryValid = void 0;
function _browserslist() {
const data = _interopRequireDefault(require("browserslist"));
_browserslist = function () {
return data;
};
return data;
}
function _invariant() {
const data = _interopRequireDefault(require("invariant"));
_invariant = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
var _utils = require("./utils");
var _normalizeOptions = require("./normalize-options");
var _builtInModules = _interopRequireDefault(require("../data/built-in-modules.json"));
var _options = require("./options");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const browserslistDefaults = _browserslist().default.defaults;
const validateTargetNames = (validTargets, targets) => {
for (const target in targets) {
if (!_options.TargetNames[target]) {
const validOptions = (0, _utils.getValues)(_options.TargetNames);
throw new Error(`Invalid Option: '${target}' is not a valid target
Maybe you meant to use '${(0, _utils.findSuggestion)(validOptions, target)}'?`);
}
}
};
const browserNameMap = {
and_chr: "chrome",
android: "android",
chrome: "chrome",
edge: "edge",
firefox: "firefox",
ie: "ie",
ios_saf: "ios",
node: "node",
opera: "opera",
safari: "safari"
};
const isBrowsersQueryValid = browsers => typeof browsers === "string" || Array.isArray(browsers);
exports.isBrowsersQueryValid = isBrowsersQueryValid;
const validateBrowsers = browsers => {
(0, _invariant().default)(typeof browsers === "undefined" || isBrowsersQueryValid(browsers), `Invalid Option: '${browsers}' is not a valid browserslist query`);
return 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 !== _options.TargetNames.browsers) {
queryObj[targKey] = fromTarget[targKey];
}
return queryObj;
}, fromQuery);
};
const getLowestVersions = browsers => {
return browsers.reduce((all, browser) => {
const [browserName, browserVersion] = browser.split(" ");
const normalizedBrowserName = browserNameMap[browserName];
if (!normalizedBrowserName) {
return all;
}
try {
const splitVersion = browserVersion.split("-")[0].toLowerCase();
const isSplitUnreleased = (0, _utils.isUnreleasedVersion)(splitVersion, browserName);
if (!all[normalizedBrowserName]) {
all[normalizedBrowserName] = isSplitUnreleased ? splitVersion : (0, _utils.semverify)(splitVersion);
return all;
}
const version = all[normalizedBrowserName];
const isUnreleased = (0, _utils.isUnreleasedVersion)(version, browserName);
if (isUnreleased && isSplitUnreleased) {
all[normalizedBrowserName] = (0, _utils.getLowestUnreleased)(version, splitVersion, browserName);
} else if (isUnreleased) {
all[normalizedBrowserName] = (0, _utils.semverify)(splitVersion);
} else if (!isUnreleased && !isSplitUnreleased) {
const parsedBrowserVersion = (0, _utils.semverify)(splitVersion);
all[normalizedBrowserName] = semverMin(version, 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 semverifyTarget = (target, value) => {
try {
return (0, _utils.semverify)(value);
} catch (error) {
throw new Error(`Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`);
}
};
const targetParserMap = {
__default: (target, value) => {
const version = (0, _utils.isUnreleasedVersion)(value, target) ? value.toLowerCase() : semverifyTarget(target, value);
return [target, version];
},
node: (target, value) => {
const parsed = value === true || value === "current" ? process.versions.node : semverifyTarget(target, value);
return [target, parsed];
}
};
const getTargets = (targets = {}, options = {}) => {
const targetOpts = {};
validateTargetNames(targets);
if (targets.esmodules) {
const supportsESModules = _builtInModules.default["es6.module"];
targets.browsers = Object.keys(supportsESModules).map(browser => `${browser} ${supportsESModules[browser]}`).join(", ");
}
const browsersquery = validateBrowsers(targets.browsers);
const shouldParseBrowsers = !!targets.browsers;
const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !Object.keys(targets).length;
if (shouldParseBrowsers || shouldSearchForConfig) {
_browserslist().default.defaults = (0, _normalizeOptions.objectToBrowserslist)(targets);
const browsers = (0, _browserslist().default)(browsersquery, {
path: options.configPath
});
const queryBrowsers = getLowestVersions(browsers);
targets = mergeBrowsers(queryBrowsers, targets);
_browserslist().default.defaults = browserslistDefaults;
}
const parsed = Object.keys(targets).filter(value => value !== _options.TargetNames.esmodules).sort().reduce((results, target) => {
if (target !== _options.TargetNames.browsers) {
const value = targets[target];
if (typeof value === "number" && value % 1 !== 0) {
results.decimalWarnings.push({
target,
value
});
}
const parser = targetParserMap[target] || targetParserMap.__default;
const [parsedTarget, parsedValue] = parser(target, value);
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
"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 (const p of Array.from(items).reverse()) {
(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 {
debug,
onDebug,
polyfills
} = this.opts;
if (debug) {
(0, _debug.logEntryPolyfills)(this.importPolyfillIncluded, polyfills, this.file.opts.filename, onDebug);
}
}
};
}
\ No newline at end of file
"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 (const i of builtIn) {
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,
parent,
scope
} = path;
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;
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;
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;
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 (let prop of node.id.properties) {
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 {
debug,
onDebug
} = this.opts;
if (debug) {
(0, _debug.logUsagePolyfills)(this.builtIns, this.file.opts.filename, onDebug);
}
},
visitor: addAndRemovePolyfillImports
};
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment