mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-14 00:34:17 +07:00
Improve code quality and write tests
This commit is contained in:
103
node_modules/@babel/preset-env/CONTRIBUTING.md
generated
vendored
Normal file
103
node_modules/@babel/preset-env/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
# Contributing
|
||||
|
||||
## Adding a new plugin or polyfill to support (when approved in the next ECMAScript version)
|
||||
|
||||
### Update [`plugin-features.js`](https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugin-features.js)
|
||||
|
||||
*Example:*
|
||||
|
||||
If you were going to add `**` which is in ES2016:
|
||||
|
||||
Find the relevant entries on [compat-table](https://kangax.github.io/compat-table/es2016plus/#test-exponentiation_(**)_operator):
|
||||
|
||||
`exponentiation (**) operator`
|
||||
|
||||
Find the corresponding babel plugin:
|
||||
|
||||
`@babel/plugin-transform-exponentiation-operator`
|
||||
|
||||
And add them in this structure:
|
||||
|
||||
```js
|
||||
// es2016
|
||||
"@babel/plugin-transform-exponentiation-operator": {
|
||||
features: [
|
||||
"exponentiation (**) operator",
|
||||
],
|
||||
},
|
||||
```
|
||||
|
||||
### Update data for `core-js@2` polyfilling
|
||||
|
||||
*Example:*
|
||||
|
||||
In case you want to add `Object.values` which is in ES2017:
|
||||
|
||||
Find the relevant feature and subfeature on [compat-table](https://kangax.github.io/compat-table/es2016plus/#test-Object_static_methods_Object.values)
|
||||
and split it with `/`:
|
||||
|
||||
`Object static methods / Object.values`
|
||||
|
||||
Find the corresponding module on [`core-js@2`](https://github.com/zloirock/core-js/tree/v2/modules):
|
||||
|
||||
`es7.object.values.js`
|
||||
|
||||
Find required ES version in [`corejs2-built-in-features.js`](https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/corejs2-built-in-features.js) and add the new feature:
|
||||
|
||||
```js
|
||||
const es = {
|
||||
//...
|
||||
"es7.object.values": "Object static methods / Object.values"
|
||||
}
|
||||
```
|
||||
|
||||
If you wan to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related `core-js` modules to [this file](https://github.com/babel/babel/blob/master/packages/babel-preset-env/polyfills/corejs2/built-in-definitions.js).
|
||||
|
||||
### Update data for `core-js@3` polyfilling
|
||||
|
||||
Just update the version of [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) in dependencies.
|
||||
|
||||
If you wan to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related [`core-js`](https://github.com/zloirock/core-js/tree/master/packages/core-js/modules) modules to [this file](https://github.com/babel/babel/blob/master/packages/babel-preset-env/polyfills/corejs3/built-in-definitions.js).
|
||||
|
||||
If you want to mark a new proposal as shipped, add it to [this list](https://github.com/babel/babel/blob/master/packages/babel-preset-env/polyfills/corejs3/shipped-proposals.js).
|
||||
|
||||
### Update [`plugins.json`](https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugins.json)
|
||||
|
||||
Until `compat-table` is a standalone npm module for data we are using the git url
|
||||
|
||||
`"compat-table": "kangax/compat-table#[latest-commit-hash]"`,
|
||||
|
||||
So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same.
|
||||
|
||||
## Tests
|
||||
|
||||
### Running tests locally
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
### Checking code coverage locally
|
||||
|
||||
```bash
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
### Writing tests
|
||||
|
||||
#### General
|
||||
|
||||
All the tests for `@babel/preset-env` exist in the `test/fixtures` folder. The
|
||||
test setup and conventions are exactly the same as testing a Babel plugin, so
|
||||
please read our [documentation on writing tests](https://github.com/babel/babel/blob/master/CONTRIBUTING.md#babel-plugin-x).
|
||||
|
||||
#### Testing the `debug` option
|
||||
|
||||
Testing debug output to `stdout` is similar. Under the `test/debug-fixtures`,
|
||||
create a folder with a descriptive name of your test, and add the following:
|
||||
|
||||
* Add a `options.json` file (just as the other tests, this is essentially a
|
||||
`.babelrc`) with the desired test configuration (required)
|
||||
* Add a `stdout.txt` file with the expected debug output. For added
|
||||
convenience, if there is no `stdout.txt` present, the test runner will
|
||||
generate one for you.
|
22
node_modules/@babel/preset-env/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/preset-env/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/preset-env/README.md
generated
vendored
Normal file
19
node_modules/@babel/preset-env/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @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
|
||||
```
|
12
node_modules/@babel/preset-env/data/built-in-modules.json
generated
vendored
Normal file
12
node_modules/@babel/preset-env/data/built-in-modules.json
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"es6.module": {
|
||||
"edge": "16",
|
||||
"firefox": "60",
|
||||
"chrome": "61",
|
||||
"safari": "10.1",
|
||||
"opera": "48",
|
||||
"ios_saf": "10.3",
|
||||
"and_chr": "71",
|
||||
"and_ff": "64"
|
||||
}
|
||||
}
|
4
node_modules/@babel/preset-env/data/built-ins.json.js
generated
vendored
Normal file
4
node_modules/@babel/preset-env/data/built-ins.json.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// TODO: Remove in Babel 8
|
||||
// https://github.com/vuejs/vue-cli/issues/3671
|
||||
|
||||
module.exports = require("./corejs2-built-ins.json");
|
335
node_modules/@babel/preset-env/data/corejs2-built-in-features.js
generated
vendored
Normal file
335
node_modules/@babel/preset-env/data/corejs2-built-in-features.js
generated
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
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",
|
||||
"es7.array.flat-map": "Array.prototype.{flat, flatMap} / Array.prototype.flatMap",
|
||||
"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.to-string": "well-known symbols / Symbol.toStringTag",
|
||||
"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",
|
||||
"es7.string.trim-left": "string trimming / String.prototype.trimStart",
|
||||
"es7.string.trim-right": "string trimming / String.prototype.trimEnd",
|
||||
|
||||
"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);
|
1657
node_modules/@babel/preset-env/data/corejs2-built-ins.json
generated
vendored
Normal file
1657
node_modules/@babel/preset-env/data/corejs2-built-ins.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
108
node_modules/@babel/preset-env/data/plugin-features.js
generated
vendored
Normal file
108
node_modules/@babel/preset-env/data/plugin-features.js
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
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",
|
||||
],
|
||||
},
|
||||
"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",
|
||||
"transform-member-expression-literals": "Object/array literal extensions / Reserved words as property names",
|
||||
"transform-property-literals": "Object/array literal extensions / Reserved words as property names",
|
||||
"transform-reserved-words": "Miscellaneous / Unreserved words",
|
||||
};
|
||||
|
||||
const proposals = require("./shipped-proposals").features;
|
||||
|
||||
module.exports = Object.assign({}, es, proposals);
|
347
node_modules/@babel/preset-env/data/plugins.json
generated
vendored
Normal file
347
node_modules/@babel/preset-env/data/plugins.json
generated
vendored
Normal file
@ -0,0 +1,347 @@
|
||||
{
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"node": "4",
|
||||
"samsung": "3.4",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"transform-literals": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-arrow-functions": {
|
||||
"chrome": "47",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "34",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-block-scoped-functions": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "46",
|
||||
"safari": "10",
|
||||
"node": "4",
|
||||
"ie": "11",
|
||||
"ios": "10",
|
||||
"samsung": "3.4",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"transform-classes": {
|
||||
"chrome": "46",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-object-super": {
|
||||
"chrome": "46",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-shorthand-properties": {
|
||||
"chrome": "43",
|
||||
"edge": "12",
|
||||
"firefox": "33",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"opera": "30",
|
||||
"electron": "0.29"
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
"chrome": "42",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"opera": "29",
|
||||
"electron": "0.27"
|
||||
},
|
||||
"transform-computed-properties": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"samsung": "4",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"transform-for-of": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-sticky-regex": {
|
||||
"chrome": "49",
|
||||
"edge": "13",
|
||||
"firefox": "3",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"transform-dotall-regex": {
|
||||
"chrome": "62",
|
||||
"safari": "11.1",
|
||||
"node": "8.10",
|
||||
"ios": "11.3",
|
||||
"samsung": "8.2",
|
||||
"opera": "49",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"transform-unicode-regex": {
|
||||
"chrome": "50",
|
||||
"edge": "13",
|
||||
"firefox": "46",
|
||||
"safari": "12",
|
||||
"node": "6",
|
||||
"ios": "12",
|
||||
"samsung": "5",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-spread": {
|
||||
"chrome": "46",
|
||||
"edge": "13",
|
||||
"firefox": "36",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"edge": "18",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"transform-destructuring": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "49",
|
||||
"edge": "14",
|
||||
"firefox": "51",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"transform-typeof-symbol": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "36",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"samsung": "3",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"transform-new-target": {
|
||||
"chrome": "46",
|
||||
"edge": "14",
|
||||
"firefox": "41",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-regenerator": {
|
||||
"chrome": "50",
|
||||
"edge": "13",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-exponentiation-operator": {
|
||||
"chrome": "52",
|
||||
"edge": "14",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"samsung": "6.2",
|
||||
"opera": "39",
|
||||
"electron": "1.3"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "11",
|
||||
"node": "7.6",
|
||||
"ios": "11",
|
||||
"samsung": "6.2",
|
||||
"opera": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"proposal-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"firefox": "57",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"ios": "12",
|
||||
"samsung": "8.2",
|
||||
"opera": "50",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"proposal-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"firefox": "55",
|
||||
"safari": "11.1",
|
||||
"node": "8.3",
|
||||
"ios": "11.3",
|
||||
"samsung": "8.2",
|
||||
"opera": "47",
|
||||
"electron": "2.1"
|
||||
},
|
||||
"proposal-unicode-property-regex": {
|
||||
"chrome": "64",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"ios": "11.3",
|
||||
"opera": "51",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"proposal-json-strings": {
|
||||
"chrome": "66",
|
||||
"firefox": "62",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"ios": "12",
|
||||
"opera": "53",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"proposal-optional-catch-binding": {
|
||||
"chrome": "66",
|
||||
"firefox": "58",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"ios": "11.3",
|
||||
"opera": "53",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"transform-named-capturing-groups-regex": {
|
||||
"chrome": "64",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"ios": "11.3",
|
||||
"opera": "51",
|
||||
"electron": "3.1"
|
||||
},
|
||||
"transform-member-expression-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"samsung": "2.1",
|
||||
"electron": "5"
|
||||
},
|
||||
"transform-property-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"samsung": "2.1",
|
||||
"electron": "5"
|
||||
},
|
||||
"transform-reserved-words": {
|
||||
"chrome": "13",
|
||||
"opera": "10.50",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"ie": "9",
|
||||
"android": "4.4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"samsung": "2.1",
|
||||
"electron": "0.2"
|
||||
}
|
||||
}
|
14
node_modules/@babel/preset-env/data/shipped-proposals.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/data/shipped-proposals.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// These mappings represent the syntax proposals that have been
|
||||
// shipped by browsers, and are enabled by the `shippedProposals` option.
|
||||
|
||||
const proposalPlugins = {};
|
||||
|
||||
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 = { proposalPlugins, pluginSyntaxMap };
|
3
node_modules/@babel/preset-env/data/unreleased-labels.js
generated
vendored
Normal file
3
node_modules/@babel/preset-env/data/unreleased-labels.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
safari: "tp",
|
||||
};
|
51
node_modules/@babel/preset-env/lib/available-plugins.js
generated
vendored
Normal file
51
node_modules/@babel/preset-env/lib/available-plugins.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
"syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
|
||||
"syntax-dynamic-import": require("@babel/plugin-syntax-dynamic-import"),
|
||||
"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-dynamic-import": require("@babel/plugin-proposal-dynamic-import"),
|
||||
"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-member-expression-literals": require("@babel/plugin-transform-member-expression-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-property-literals": require("@babel/plugin-transform-property-literals"),
|
||||
"transform-reserved-words": require("@babel/plugin-transform-reserved-words"),
|
||||
"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;
|
84
node_modules/@babel/preset-env/lib/debug.js
generated
vendored
Normal file
84
node_modules/@babel/preset-env/lib/debug.js
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.logUsagePolyfills = exports.logEntryPolyfills = exports.logPluginOrPolyfill = 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 logPluginOrPolyfill = (item, targetVersions, list) => {
|
||||
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.toString(), (0, _utils.semverify)(minVersion)))) {
|
||||
result[env] = (0, _utils.prettifyVersion)(targetVersion);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
const formattedTargets = JSON.stringify(filteredList).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
|
||||
console.log(` ${item} ${formattedTargets}`);
|
||||
};
|
||||
|
||||
exports.logPluginOrPolyfill = logPluginOrPolyfill;
|
||||
|
||||
const logEntryPolyfills = (polyfillName, importPolyfillIncluded, polyfills, filename, polyfillTargets, allBuiltInsList) => {
|
||||
if (!importPolyfillIncluded) {
|
||||
console.log(`\n[${filename}] Import of ${polyfillName} was not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!polyfills.size) {
|
||||
console.log(`\n[${filename}] Based on your targets, polyfills were not added.`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(polyfills.size)}:`);
|
||||
|
||||
for (const polyfill of polyfills) {
|
||||
logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
|
||||
}
|
||||
};
|
||||
|
||||
exports.logEntryPolyfills = logEntryPolyfills;
|
||||
|
||||
const logUsagePolyfills = (polyfills, filename, polyfillTargets, allBuiltInsList) => {
|
||||
if (!polyfills.size) {
|
||||
console.log(`\n[${filename}] Based on your code and targets, core-js polyfills were not added.`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`\n[${filename}] Added following core-js polyfill${wordEnds(polyfills.size)}:`);
|
||||
|
||||
for (const polyfill of polyfills) {
|
||||
logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
|
||||
}
|
||||
};
|
||||
|
||||
exports.logUsagePolyfills = logUsagePolyfills;
|
79
node_modules/@babel/preset-env/lib/filter-items.js
generated
vendored
Normal file
79
node_modules/@babel/preset-env/lib/filter-items.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isPluginRequired = isPluginRequired;
|
||||
exports.default = _default;
|
||||
|
||||
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 }; }
|
||||
|
||||
function 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;
|
||||
}
|
||||
|
||||
if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!_semver().default.valid(lowestTargetedVersion.toString())) {
|
||||
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.toString());
|
||||
});
|
||||
return isRequiredForEnvironments.length > 0;
|
||||
}
|
||||
|
||||
function _default(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
|
||||
const result = new Set();
|
||||
|
||||
for (const item in list) {
|
||||
if (!excludes.has(item) && (isPluginRequired(targets, list[item]) || includes.has(item))) {
|
||||
result.add(item);
|
||||
} else if (pluginSyntaxMap) {
|
||||
const shippedProposalsSyntax = 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;
|
||||
}
|
13
node_modules/@babel/preset-env/lib/get-option-specific-excludes.js
generated
vendored
Normal file
13
node_modules/@babel/preset-env/lib/get-option-specific-excludes.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
const defaultExcludesForLooseMode = ["transform-typeof-symbol"];
|
||||
|
||||
function _default({
|
||||
loose
|
||||
}) {
|
||||
return loose ? defaultExcludesForLooseMode : null;
|
||||
}
|
284
node_modules/@babel/preset-env/lib/index.js
generated
vendored
Normal file
284
node_modules/@babel/preset-env/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,284 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isPluginRequired", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _filterItems.isPluginRequired;
|
||||
}
|
||||
});
|
||||
exports.default = exports.getPolyfillPlugins = exports.getModulesPluginNames = exports.transformIncludesAndExcludes = void 0;
|
||||
|
||||
function _semver() {
|
||||
const data = require("semver");
|
||||
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _debug = require("./debug");
|
||||
|
||||
var _getOptionSpecificExcludes = _interopRequireDefault(require("./get-option-specific-excludes"));
|
||||
|
||||
var _filterItems = _interopRequireWildcard(require("./filter-items"));
|
||||
|
||||
var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
|
||||
|
||||
var _normalizeOptions = _interopRequireDefault(require("./normalize-options"));
|
||||
|
||||
var _plugins = _interopRequireDefault(require("../data/plugins.json"));
|
||||
|
||||
var _shippedProposals = require("../data/shipped-proposals");
|
||||
|
||||
var _usagePlugin = _interopRequireDefault(require("./polyfills/corejs2/usage-plugin"));
|
||||
|
||||
var _usagePlugin2 = _interopRequireDefault(require("./polyfills/corejs3/usage-plugin"));
|
||||
|
||||
var _usagePlugin3 = _interopRequireDefault(require("./polyfills/regenerator/usage-plugin"));
|
||||
|
||||
var _entryPlugin = _interopRequireDefault(require("./polyfills/corejs2/entry-plugin"));
|
||||
|
||||
var _entryPlugin2 = _interopRequireDefault(require("./polyfills/corejs3/entry-plugin"));
|
||||
|
||||
var _entryPlugin3 = _interopRequireDefault(require("./polyfills/regenerator/entry-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 _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const pluginListWithoutProposals = (0, _utils.filterStageFromList)(_plugins.default, _shippedProposals.proposalPlugins);
|
||||
|
||||
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 transformIncludesAndExcludes = opts => {
|
||||
return opts.reduce((result, opt) => {
|
||||
const target = opt.match(/^(es|es6|es7|esnext|web)\./) ? "builtIns" : "plugins";
|
||||
result[target].add(opt);
|
||||
return result;
|
||||
}, {
|
||||
all: opts,
|
||||
plugins: new Set(),
|
||||
builtIns: new Set()
|
||||
});
|
||||
};
|
||||
|
||||
exports.transformIncludesAndExcludes = transformIncludesAndExcludes;
|
||||
|
||||
const getModulesPluginNames = ({
|
||||
modules,
|
||||
transformations,
|
||||
shouldTransformESM,
|
||||
shouldTransformDynamicImport
|
||||
}) => {
|
||||
const modulesPluginNames = [];
|
||||
|
||||
if (modules !== false && transformations[modules]) {
|
||||
if (shouldTransformESM) {
|
||||
modulesPluginNames.push(transformations[modules]);
|
||||
}
|
||||
|
||||
if (shouldTransformDynamicImport && shouldTransformESM && modules !== "umd") {
|
||||
modulesPluginNames.push("proposal-dynamic-import");
|
||||
} else {
|
||||
if (shouldTransformDynamicImport) {
|
||||
console.warn("Dynamic import can only be supported when transforming ES modules" + " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.");
|
||||
}
|
||||
|
||||
modulesPluginNames.push("syntax-dynamic-import");
|
||||
}
|
||||
} else {
|
||||
modulesPluginNames.push("syntax-dynamic-import");
|
||||
}
|
||||
|
||||
return modulesPluginNames;
|
||||
};
|
||||
|
||||
exports.getModulesPluginNames = getModulesPluginNames;
|
||||
|
||||
const getPolyfillPlugins = ({
|
||||
useBuiltIns,
|
||||
corejs,
|
||||
polyfillTargets,
|
||||
include,
|
||||
exclude,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator,
|
||||
debug
|
||||
}) => {
|
||||
const polyfillPlugins = [];
|
||||
|
||||
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
|
||||
const pluginOptions = {
|
||||
corejs,
|
||||
polyfillTargets,
|
||||
include,
|
||||
exclude,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator,
|
||||
debug
|
||||
};
|
||||
|
||||
if (corejs) {
|
||||
if (useBuiltIns === "usage") {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([_usagePlugin.default, pluginOptions]);
|
||||
} else {
|
||||
polyfillPlugins.push([_usagePlugin2.default, pluginOptions]);
|
||||
}
|
||||
|
||||
if (regenerator) {
|
||||
polyfillPlugins.push([_usagePlugin3.default, pluginOptions]);
|
||||
}
|
||||
} else {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([_entryPlugin.default, pluginOptions]);
|
||||
} else {
|
||||
polyfillPlugins.push([_entryPlugin2.default, pluginOptions]);
|
||||
|
||||
if (!regenerator) {
|
||||
polyfillPlugins.push([_entryPlugin3.default, pluginOptions]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return polyfillPlugins;
|
||||
};
|
||||
|
||||
exports.getPolyfillPlugins = getPolyfillPlugins;
|
||||
|
||||
function supportsStaticESM(caller) {
|
||||
return !!(caller && caller.supportsStaticESM);
|
||||
}
|
||||
|
||||
function supportsDynamicImport(caller) {
|
||||
return !!(caller && caller.supportsDynamicImport);
|
||||
}
|
||||
|
||||
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,
|
||||
corejs: {
|
||||
version: corejs,
|
||||
proposals
|
||||
}
|
||||
} = (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 modulesPluginNames = getModulesPluginNames({
|
||||
modules,
|
||||
transformations: _moduleTransformations.default,
|
||||
shouldTransformESM: modules !== "auto" || !api.caller || !api.caller(supportsStaticESM),
|
||||
shouldTransformDynamicImport: modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport)
|
||||
});
|
||||
const pluginNames = (0, _filterItems.default)(shippedProposals ? _plugins.default : pluginListWithoutProposals, include.plugins, exclude.plugins, transformTargets, modulesPluginNames, (0, _getOptionSpecificExcludes.default)({
|
||||
loose
|
||||
}), _shippedProposals.pluginSyntaxMap);
|
||||
const polyfillPlugins = getPolyfillPlugins({
|
||||
useBuiltIns,
|
||||
corejs,
|
||||
polyfillTargets: targets,
|
||||
include: include.builtIns,
|
||||
exclude: exclude.builtIns,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator: pluginNames.has("transform-regenerator"),
|
||||
debug
|
||||
});
|
||||
const pluginUseBuiltIns = useBuiltIns !== false;
|
||||
const plugins = Array.from(pluginNames).map(pluginName => [getPlugin(pluginName), {
|
||||
spec,
|
||||
loose,
|
||||
useBuiltIns: pluginUseBuiltIns
|
||||
}]).concat(polyfillPlugins);
|
||||
|
||||
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:");
|
||||
pluginNames.forEach(pluginName => {
|
||||
(0, _debug.logPluginOrPolyfill)(pluginName, targets, _plugins.default);
|
||||
});
|
||||
|
||||
if (!useBuiltIns) {
|
||||
console.log("\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.");
|
||||
} else {
|
||||
console.log(`\nUsing polyfills with \`${useBuiltIns}\` option:`);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
plugins
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
15
node_modules/@babel/preset-env/lib/module-transformations.js
generated
vendored
Normal file
15
node_modules/@babel/preset-env/lib/module-transformations.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"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;
|
212
node_modules/@babel/preset-env/lib/normalize-options.js
generated
vendored
Normal file
212
node_modules/@babel/preset-env/lib/normalize-options.js
generated
vendored
Normal file
@ -0,0 +1,212 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeCoreJSOption = normalizeCoreJSOption;
|
||||
exports.default = normalizeOptions;
|
||||
exports.validateUseBuiltInsOption = exports.validateModulesOption = exports.validateIgnoreBrowserslistConfig = exports.validateBoolOption = exports.validateConfigPathOption = exports.checkDuplicateIncludeExcludes = exports.normalizePluginName = void 0;
|
||||
|
||||
function _data() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/data"));
|
||||
|
||||
_data = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _invariant() {
|
||||
const data = _interopRequireDefault(require("invariant"));
|
||||
|
||||
_invariant = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _semver() {
|
||||
const data = require("semver");
|
||||
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _corejs2BuiltIns = _interopRequireDefault(require("../data/corejs2-built-ins.json"));
|
||||
|
||||
var _plugins = _interopRequireDefault(require("../data/plugins.json"));
|
||||
|
||||
var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
var _getPlatformSpecificDefault = require("./polyfills/corejs2/get-platform-specific-default");
|
||||
|
||||
var _targetsParser = require("./targets-parser");
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const validateTopLevelOptions = options => {
|
||||
const validOptions = Object.keys(_options.TopLevelOptions);
|
||||
|
||||
for (const option in options) {
|
||||
if (!_options.TopLevelOptions[option]) {
|
||||
throw new Error(`Invalid Option: ${option} is not a valid top-level option.
|
||||
Maybe you meant to use '${(0, _utils.findSuggestion)(validOptions, option)}'?`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const allPluginsList = Object.keys(_plugins.default);
|
||||
const modulePlugins = ["proposal-dynamic-import", ...Object.keys(_moduleTransformations.default).map(m => _moduleTransformations.default[m])];
|
||||
|
||||
const getValidIncludesAndExcludes = (type, corejs) => new Set([...allPluginsList, ...(type === "exclude" ? modulePlugins : []), ...(corejs ? corejs == 2 ? [...Object.keys(_corejs2BuiltIns.default), ..._getPlatformSpecificDefault.defaultWebIncludes] : Object.keys(_data().default) : [])]);
|
||||
|
||||
const pluginToRegExp = plugin => {
|
||||
if (plugin instanceof RegExp) return plugin;
|
||||
|
||||
try {
|
||||
return new RegExp(`^${normalizePluginName(plugin)}$`);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const selectPlugins = (regexp, type, corejs) => Array.from(getValidIncludesAndExcludes(type, corejs)).filter(item => regexp instanceof RegExp && regexp.test(item));
|
||||
|
||||
const flatten = array => [].concat(...array);
|
||||
|
||||
const expandIncludesAndExcludes = (plugins = [], type, corejs) => {
|
||||
if (plugins.length === 0) return [];
|
||||
const selectedPlugins = plugins.map(plugin => selectPlugins(pluginToRegExp(plugin), type, corejs));
|
||||
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 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.toString()] || _options.ModulesOption[modulesOpt.toString()] === _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 validateUseBuiltInsOption = (builtInsOpt = false) => {
|
||||
(0, _invariant().default)(_options.UseBuiltInsOption[builtInsOpt.toString()] || _options.UseBuiltInsOption[builtInsOpt.toString()] === _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 normalizeCoreJSOption(corejs, useBuiltIns) {
|
||||
let proposals = false;
|
||||
let rawVersion;
|
||||
|
||||
if (useBuiltIns && corejs === undefined) {
|
||||
rawVersion = 2;
|
||||
console.warn("\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + "core-js version. Currently, we assume version 2.x when no version " + "is passed. Since this default version will likely change in future " + "versions of Babel, we recommend explicitly setting the core-js version " + "you are using via the `corejs` option.\n" + "\nYou should also be sure that the version you pass to the `corejs` " + "option matches the version specified in your `package.json`'s " + "`dependencies` section. If it doesn't, you need to run one of the " + "following commands:\n\n" + " npm install --save core-js@2 npm install --save core-js@3\n" + " yarn add core-js@2 yarn add core-js@3\n");
|
||||
} else if (typeof corejs === "object" && corejs !== null) {
|
||||
rawVersion = corejs.version;
|
||||
proposals = Boolean(corejs.proposals);
|
||||
} else {
|
||||
rawVersion = corejs;
|
||||
}
|
||||
|
||||
const version = rawVersion ? (0, _semver().coerce)(String(rawVersion)) : false;
|
||||
|
||||
if (!useBuiltIns && version) {
|
||||
console.log("\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n");
|
||||
}
|
||||
|
||||
if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {
|
||||
throw new RangeError("Invalid Option: The version passed to `corejs` is invalid. Currently, " + "only core-js@2 and core-js@3 are supported.");
|
||||
}
|
||||
|
||||
return {
|
||||
version,
|
||||
proposals
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeOptions(opts) {
|
||||
validateTopLevelOptions(opts);
|
||||
const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);
|
||||
const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);
|
||||
const include = expandIncludesAndExcludes(opts.include, _options.TopLevelOptions.include, !!corejs.version && corejs.version.major);
|
||||
const exclude = expandIncludesAndExcludes(opts.exclude, _options.TopLevelOptions.exclude, !!corejs.version && corejs.version.major);
|
||||
checkDuplicateIncludeExcludes(include, exclude);
|
||||
const shippedProposals = validateBoolOption(_options.TopLevelOptions.shippedProposals, opts.shippedProposals, false) || corejs.proposals;
|
||||
return {
|
||||
configPath: validateConfigPathOption(opts.configPath),
|
||||
corejs,
|
||||
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,
|
||||
spec: validateBoolOption(_options.TopLevelOptions.spec, opts.spec, false),
|
||||
targets: normalizeTargets(opts.targets),
|
||||
useBuiltIns: useBuiltIns
|
||||
};
|
||||
}
|
55
node_modules/@babel/preset-env/lib/options.js
generated
vendored
Normal file
55
node_modules/@babel/preset-env/lib/options.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TargetNames = exports.UseBuiltInsOption = exports.ModulesOption = exports.TopLevelOptions = void 0;
|
||||
const TopLevelOptions = {
|
||||
configPath: "configPath",
|
||||
corejs: "corejs",
|
||||
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",
|
||||
samsung: "samsung",
|
||||
uglify: "uglify"
|
||||
};
|
||||
exports.TargetNames = TargetNames;
|
175
node_modules/@babel/preset-env/lib/polyfills/corejs2/built-in-definitions.js
generated
vendored
Normal file
175
node_modules/@babel/preset-env/lib/polyfills/corejs2/built-in-definitions.js
generated
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.StaticProperties = exports.InstanceProperties = exports.BuiltIns = void 0;
|
||||
const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"];
|
||||
const CommonIterators = ["es6.string.iterator", ...ArrayNatureIterators];
|
||||
const PromiseDependencies = ["es6.object.to-string", "es6.promise"];
|
||||
const 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", ...CommonIterators],
|
||||
Number: "es6.number.constructor",
|
||||
Promise: PromiseDependencies,
|
||||
RegExp: ["es6.regexp.constructor"],
|
||||
Set: ["es6.set", ...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", ...CommonIterators],
|
||||
WeakSet: ["es6.weak-set", ...CommonIterators]
|
||||
};
|
||||
exports.BuiltIns = BuiltIns;
|
||||
const InstanceProperties = {
|
||||
__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", ...PromiseDependencies],
|
||||
find: ["es6.array.find"],
|
||||
findIndex: ["es6.array.find-index"],
|
||||
fixed: ["es6.string.fixed"],
|
||||
flags: ["es6.regexp.flags"],
|
||||
flatMap: ["es7.array.flat-map"],
|
||||
fontcolor: ["es6.string.fontcolor"],
|
||||
fontsize: ["es6.string.fontsize"],
|
||||
forEach: ["es6.array.for-each"],
|
||||
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"],
|
||||
trimEnd: ["es7.string.trim-right"],
|
||||
trimLeft: ["es7.string.trim-left"],
|
||||
trimRight: ["es7.string.trim-right"],
|
||||
trimStart: ["es7.string.trim-left"],
|
||||
values: ArrayNatureIterators
|
||||
};
|
||||
exports.InstanceProperties = InstanceProperties;
|
||||
const StaticProperties = {
|
||||
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.symbol",
|
||||
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.StaticProperties = StaticProperties;
|
75
node_modules/@babel/preset-env/lib/polyfills/corejs2/entry-plugin.js
generated
vendored
Normal file
75
node_modules/@babel/preset-env/lib/polyfills/corejs2/entry-plugin.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _corejs2BuiltIns = _interopRequireDefault(require("../../../data/corejs2-built-ins.json"));
|
||||
|
||||
var _getPlatformSpecificDefault = _interopRequireDefault(require("./get-platform-specific-default"));
|
||||
|
||||
var _filterItems = _interopRequireDefault(require("../../filter-items"));
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
var _debug = require("../../debug");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default(_, {
|
||||
include,
|
||||
exclude,
|
||||
polyfillTargets,
|
||||
regenerator,
|
||||
debug
|
||||
}) {
|
||||
const polyfills = (0, _filterItems.default)(_corejs2BuiltIns.default, include, exclude, polyfillTargets, (0, _getPlatformSpecificDefault.default)(polyfillTargets));
|
||||
const isPolyfillImport = {
|
||||
ImportDeclaration(path) {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getImportSource)(path))) {
|
||||
this.replaceBySeparateModulesImport(path);
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getRequireSource)(bodyPath))) {
|
||||
this.replaceBySeparateModulesImport(bodyPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "corejs2-entry",
|
||||
visitor: isPolyfillImport,
|
||||
|
||||
pre() {
|
||||
this.importPolyfillIncluded = false;
|
||||
|
||||
this.replaceBySeparateModulesImport = function (path) {
|
||||
this.importPolyfillIncluded = true;
|
||||
|
||||
if (regenerator) {
|
||||
(0, _utils.createImport)(path, "regenerator-runtime");
|
||||
}
|
||||
|
||||
const modules = Array.from(polyfills).reverse();
|
||||
|
||||
for (const module of modules) {
|
||||
(0, _utils.createImport)(path, module);
|
||||
}
|
||||
|
||||
path.remove();
|
||||
};
|
||||
},
|
||||
|
||||
post() {
|
||||
if (debug) {
|
||||
(0, _debug.logEntryPolyfills)("@babel/polyfill", this.importPolyfillIncluded, polyfills, this.file.opts.filename, polyfillTargets, _corejs2BuiltIns.default);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
16
node_modules/@babel/preset-env/lib/polyfills/corejs2/get-platform-specific-default.js
generated
vendored
Normal file
16
node_modules/@babel/preset-env/lib/polyfills/corejs2/get-platform-specific-default.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
exports.defaultWebIncludes = void 0;
|
||||
const defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
|
||||
exports.defaultWebIncludes = defaultWebIncludes;
|
||||
|
||||
function _default(targets) {
|
||||
const targetNames = Object.keys(targets);
|
||||
const isAnyTarget = !targetNames.length;
|
||||
const isWebTarget = targetNames.some(name => name !== "node");
|
||||
return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
|
||||
}
|
219
node_modules/@babel/preset-env/lib/polyfills/corejs2/usage-plugin.js
generated
vendored
Normal file
219
node_modules/@babel/preset-env/lib/polyfills/corejs2/usage-plugin.js
generated
vendored
Normal file
@ -0,0 +1,219 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _corejs2BuiltIns = _interopRequireDefault(require("../../../data/corejs2-built-ins.json"));
|
||||
|
||||
var _getPlatformSpecificDefault = _interopRequireDefault(require("./get-platform-specific-default"));
|
||||
|
||||
var _filterItems = _interopRequireDefault(require("../../filter-items"));
|
||||
|
||||
var _builtInDefinitions = require("./built-in-definitions");
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
var _debug = require("../../debug");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const NO_DIRECT_POLYFILL_IMPORT = `
|
||||
When setting \`useBuiltIns: 'usage'\`, polyfills are automatically imported when needed.
|
||||
Please remove the \`import '@babel/polyfill'\` call or use \`useBuiltIns: 'entry'\` instead.`;
|
||||
|
||||
function _default({
|
||||
types: t
|
||||
}, {
|
||||
include,
|
||||
exclude,
|
||||
polyfillTargets,
|
||||
debug
|
||||
}) {
|
||||
const polyfills = (0, _filterItems.default)(_corejs2BuiltIns.default, include, exclude, polyfillTargets, (0, _getPlatformSpecificDefault.default)(polyfillTargets));
|
||||
const addAndRemovePolyfillImports = {
|
||||
ImportDeclaration(path) {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getImportSource)(path))) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT);
|
||||
path.remove();
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getRequireSource)(bodyPath))) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT);
|
||||
bodyPath.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
ReferencedIdentifier({
|
||||
node: {
|
||||
name
|
||||
},
|
||||
parent,
|
||||
scope
|
||||
}) {
|
||||
if (t.isMemberExpression(parent)) return;
|
||||
if (!(0, _utils.has)(_builtInDefinitions.BuiltIns, name)) return;
|
||||
if (scope.getBindingIdentifier(name)) return;
|
||||
const BuiltInDependencies = _builtInDefinitions.BuiltIns[name];
|
||||
this.addUnsupported(BuiltInDependencies);
|
||||
},
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
this.addImport("web.dom.iterable");
|
||||
},
|
||||
|
||||
BinaryExpression(path) {
|
||||
if (path.node.operator !== "in") return;
|
||||
if (!path.get("left").matchesPattern("Symbol.iterator")) return;
|
||||
this.addImport("web.dom.iterable");
|
||||
},
|
||||
|
||||
YieldExpression(path) {
|
||||
if (path.node.delegate) {
|
||||
this.addImport("web.dom.iterable");
|
||||
}
|
||||
},
|
||||
|
||||
MemberExpression: {
|
||||
enter(path) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
const {
|
||||
object,
|
||||
property
|
||||
} = node;
|
||||
if ((0, _utils.isNamespaced)(path.get("object"))) return;
|
||||
let evaluatedPropType = object.name;
|
||||
let propertyName = "";
|
||||
let instanceType = "";
|
||||
|
||||
if (node.computed) {
|
||||
if (t.isStringLiteral(property)) {
|
||||
propertyName = property.value;
|
||||
} else {
|
||||
const result = path.get("property").evaluate();
|
||||
|
||||
if (result.confident && result.value) {
|
||||
propertyName = result.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
propertyName = property.name;
|
||||
}
|
||||
|
||||
if (path.scope.getBindingIdentifier(object.name)) {
|
||||
const result = path.get("object").evaluate();
|
||||
|
||||
if (result.value) {
|
||||
instanceType = (0, _utils.getType)(result.value);
|
||||
} else if (result.deopt && result.deopt.isIdentifier()) {
|
||||
evaluatedPropType = result.deopt.node.name;
|
||||
}
|
||||
}
|
||||
|
||||
if ((0, _utils.has)(_builtInDefinitions.StaticProperties, evaluatedPropType)) {
|
||||
const BuiltInProperties = _builtInDefinitions.StaticProperties[evaluatedPropType];
|
||||
|
||||
if ((0, _utils.has)(BuiltInProperties, propertyName)) {
|
||||
const StaticPropertyDependencies = BuiltInProperties[propertyName];
|
||||
this.addUnsupported(StaticPropertyDependencies);
|
||||
}
|
||||
}
|
||||
|
||||
if ((0, _utils.has)(_builtInDefinitions.InstanceProperties, propertyName)) {
|
||||
let InstancePropertyDependencies = _builtInDefinitions.InstanceProperties[propertyName];
|
||||
|
||||
if (instanceType) {
|
||||
InstancePropertyDependencies = InstancePropertyDependencies.filter(module => module.includes(instanceType));
|
||||
}
|
||||
|
||||
this.addUnsupported(InstancePropertyDependencies);
|
||||
}
|
||||
},
|
||||
|
||||
exit(path) {
|
||||
const {
|
||||
name
|
||||
} = path.node.object;
|
||||
if (!(0, _utils.has)(_builtInDefinitions.BuiltIns, name)) return;
|
||||
if (path.scope.getBindingIdentifier(name)) return;
|
||||
const BuiltInDependencies = _builtInDefinitions.BuiltIns[name];
|
||||
this.addUnsupported(BuiltInDependencies);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
VariableDeclarator(path) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
const {
|
||||
id,
|
||||
init
|
||||
} = node;
|
||||
if (!t.isObjectPattern(id)) return;
|
||||
if (init && path.scope.getBindingIdentifier(init.name)) return;
|
||||
|
||||
for (const _ref of id.properties) {
|
||||
const {
|
||||
key
|
||||
} = _ref;
|
||||
|
||||
if (!node.computed && t.isIdentifier(key) && (0, _utils.has)(_builtInDefinitions.InstanceProperties, key.name)) {
|
||||
const InstancePropertyDependencies = _builtInDefinitions.InstanceProperties[key.name];
|
||||
this.addUnsupported(InstancePropertyDependencies);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "corejs2-usage",
|
||||
|
||||
pre({
|
||||
path
|
||||
}) {
|
||||
this.polyfillsSet = new Set();
|
||||
|
||||
this.addImport = function (builtIn) {
|
||||
if (!this.polyfillsSet.has(builtIn)) {
|
||||
this.polyfillsSet.add(builtIn);
|
||||
(0, _utils.createImport)(path, builtIn);
|
||||
}
|
||||
};
|
||||
|
||||
this.addUnsupported = function (builtIn) {
|
||||
const modules = Array.isArray(builtIn) ? builtIn : [builtIn];
|
||||
|
||||
for (const module of modules) {
|
||||
if (polyfills.has(module)) {
|
||||
this.addImport(module);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
post() {
|
||||
if (debug) {
|
||||
(0, _debug.logUsagePolyfills)(this.polyfillsSet, this.file.opts.filename, polyfillTargets, _corejs2BuiltIns.default);
|
||||
}
|
||||
},
|
||||
|
||||
visitor: addAndRemovePolyfillImports
|
||||
};
|
||||
}
|
304
node_modules/@babel/preset-env/lib/polyfills/corejs3/built-in-definitions.js
generated
vendored
Normal file
304
node_modules/@babel/preset-env/lib/polyfills/corejs3/built-in-definitions.js
generated
vendored
Normal file
@ -0,0 +1,304 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.PossibleGlobalObjects = exports.CommonInstanceDependencies = exports.StaticProperties = exports.InstanceProperties = exports.BuiltIns = exports.PromiseDependencies = exports.CommonIterators = void 0;
|
||||
const ArrayNatureIterators = ["es.array.iterator", "web.dom-collections.iterator"];
|
||||
const CommonIterators = ["es.string.iterator", ...ArrayNatureIterators];
|
||||
exports.CommonIterators = CommonIterators;
|
||||
const ArrayNatureIteratorsWithTag = ["es.object.to-string", ...ArrayNatureIterators];
|
||||
const CommonIteratorsWithTag = ["es.object.to-string", ...CommonIterators];
|
||||
const TypedArrayDependencies = ["es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-string", "es.object.to-string", "es.array.iterator", "es.array-buffer.slice"];
|
||||
const TypedArrayStaticMethods = {
|
||||
from: "es.typed-array.from",
|
||||
of: "es.typed-array.of"
|
||||
};
|
||||
const PromiseDependencies = ["es.promise", "es.object.to-string"];
|
||||
exports.PromiseDependencies = PromiseDependencies;
|
||||
const PromiseDependenciesWithIterators = [...PromiseDependencies, ...CommonIterators];
|
||||
const SymbolDependencies = ["es.symbol", "es.symbol.description", "es.object.to-string"];
|
||||
const MapDependencies = ["es.map", "esnext.map.delete-all", "esnext.map.every", "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", "esnext.map.map-values", "esnext.map.merge", "esnext.map.reduce", "esnext.map.some", "esnext.map.update", ...CommonIteratorsWithTag];
|
||||
const SetDependencies = ["es.set", "esnext.set.add-all", "esnext.set.delete-all", "esnext.set.difference", "esnext.set.every", "esnext.set.filter", "esnext.set.find", "esnext.set.intersection", "esnext.set.is-disjoint-from", "esnext.set.is-subset-of", "esnext.set.is-superset-of", "esnext.set.join", "esnext.set.map", "esnext.set.reduce", "esnext.set.some", "esnext.set.symmetric-difference", "esnext.set.union", ...CommonIteratorsWithTag];
|
||||
const WeakMapDependencies = ["es.weak-map", "esnext.weak-map.delete-all", ...CommonIteratorsWithTag];
|
||||
const WeakSetDependencies = ["es.weak-set", "esnext.weak-set.add-all", "esnext.weak-set.delete-all", ...CommonIteratorsWithTag];
|
||||
const URLSearchParamsDependencies = ["web.url", ...CommonIteratorsWithTag];
|
||||
const BuiltIns = {
|
||||
AggregateError: ["esnext.aggregate-error", ...CommonIterators],
|
||||
ArrayBuffer: ["es.array-buffer.constructor", "es.array-buffer.slice", "es.object.to-string"],
|
||||
DataView: ["es.data-view", "es.array-buffer.slice", "es.object.to-string"],
|
||||
Date: ["es.date.to-string"],
|
||||
Float32Array: ["es.typed-array.float32-array", ...TypedArrayDependencies],
|
||||
Float64Array: ["es.typed-array.float64-array", ...TypedArrayDependencies],
|
||||
Int8Array: ["es.typed-array.int8-array", ...TypedArrayDependencies],
|
||||
Int16Array: ["es.typed-array.int16-array", ...TypedArrayDependencies],
|
||||
Int32Array: ["es.typed-array.int32-array", ...TypedArrayDependencies],
|
||||
Uint8Array: ["es.typed-array.uint8-array", ...TypedArrayDependencies],
|
||||
Uint8ClampedArray: ["es.typed-array.uint8-clamped-array", ...TypedArrayDependencies],
|
||||
Uint16Array: ["es.typed-array.uint16-array", ...TypedArrayDependencies],
|
||||
Uint32Array: ["es.typed-array.uint32-array", ...TypedArrayDependencies],
|
||||
Map: MapDependencies,
|
||||
Number: ["es.number.constructor"],
|
||||
Observable: ["esnext.observable", "esnext.symbol.observable", "es.object.to-string", ...CommonIteratorsWithTag],
|
||||
Promise: PromiseDependencies,
|
||||
RegExp: ["es.regexp.constructor", "es.regexp.exec", "es.regexp.to-string"],
|
||||
Set: SetDependencies,
|
||||
Symbol: SymbolDependencies,
|
||||
URL: ["web.url", ...URLSearchParamsDependencies],
|
||||
URLSearchParams: URLSearchParamsDependencies,
|
||||
WeakMap: WeakMapDependencies,
|
||||
WeakSet: WeakSetDependencies,
|
||||
clearImmediate: ["web.immediate"],
|
||||
compositeKey: ["esnext.composite-key"],
|
||||
compositeSymbol: ["esnext.composite-symbol", ...SymbolDependencies],
|
||||
fetch: PromiseDependencies,
|
||||
globalThis: ["esnext.global-this"],
|
||||
parseFloat: ["es.parse-float"],
|
||||
parseInt: ["es.parse-int"],
|
||||
queueMicrotask: ["web.queue-microtask"],
|
||||
setTimeout: ["web.timers"],
|
||||
setInterval: ["web.timers"],
|
||||
setImmediate: ["web.immediate"]
|
||||
};
|
||||
exports.BuiltIns = BuiltIns;
|
||||
const InstanceProperties = {
|
||||
at: ["esnext.string.at"],
|
||||
anchor: ["es.string.anchor"],
|
||||
big: ["es.string.big"],
|
||||
bind: ["es.function.bind"],
|
||||
blink: ["es.string.blink"],
|
||||
bold: ["es.string.bold"],
|
||||
codePointAt: ["es.string.code-point-at"],
|
||||
codePoints: ["esnext.string.code-points"],
|
||||
concat: ["es.array.concat"],
|
||||
copyWithin: ["es.array.copy-within"],
|
||||
description: ["es.symbol", "es.symbol.description"],
|
||||
endsWith: ["es.string.ends-with"],
|
||||
entries: ArrayNatureIteratorsWithTag,
|
||||
every: ["es.array.every"],
|
||||
exec: ["es.regexp.exec"],
|
||||
fill: ["es.array.fill"],
|
||||
filter: ["es.array.filter"],
|
||||
finally: ["es.promise.finally", ...PromiseDependencies],
|
||||
find: ["es.array.find"],
|
||||
findIndex: ["es.array.find-index"],
|
||||
fixed: ["es.string.fixed"],
|
||||
flags: ["es.regexp.flags"],
|
||||
flat: ["es.array.flat", "es.array.unscopables.flat"],
|
||||
flatMap: ["es.array.flat-map", "es.array.unscopables.flat-map"],
|
||||
fontcolor: ["es.string.fontcolor"],
|
||||
fontsize: ["es.string.fontsize"],
|
||||
forEach: ["es.array.for-each", "web.dom-collections.for-each"],
|
||||
includes: ["es.array.includes", "es.string.includes"],
|
||||
indexOf: ["es.array.index-of"],
|
||||
italic: ["es.string.italics"],
|
||||
join: ["es.array.join"],
|
||||
keys: ArrayNatureIteratorsWithTag,
|
||||
lastIndex: ["esnext.array.last-index"],
|
||||
lastIndexOf: ["es.array.last-index-of"],
|
||||
lastItem: ["esnext.array.last-item"],
|
||||
link: ["es.string.link"],
|
||||
match: ["es.string.match", "es.regexp.exec"],
|
||||
matchAll: ["esnext.string.match-all"],
|
||||
map: ["es.array.map"],
|
||||
name: ["es.function.name"],
|
||||
padEnd: ["es.string.pad-end"],
|
||||
padStart: ["es.string.pad-start"],
|
||||
reduce: ["es.array.reduce"],
|
||||
reduceRight: ["es.array.reduce-right"],
|
||||
repeat: ["es.string.repeat"],
|
||||
replace: ["es.string.replace", "es.regexp.exec"],
|
||||
replaceAll: ["esnext.string.replace-all"],
|
||||
reverse: ["es.array.reverse"],
|
||||
search: ["es.string.search", "es.regexp.exec"],
|
||||
slice: ["es.array.slice"],
|
||||
small: ["es.string.small"],
|
||||
some: ["es.array.some"],
|
||||
sort: ["es.array.sort"],
|
||||
splice: ["es.array.splice"],
|
||||
split: ["es.string.split", "es.regexp.exec"],
|
||||
startsWith: ["es.string.starts-with"],
|
||||
strike: ["es.string.strike"],
|
||||
sub: ["es.string.sub"],
|
||||
sup: ["es.string.sup"],
|
||||
toFixed: ["es.number.to-fixed"],
|
||||
toISOString: ["es.date.to-iso-string"],
|
||||
toJSON: ["es.date.to-json", "web.url.to-json"],
|
||||
toPrecision: ["es.number.to-precision"],
|
||||
toString: ["es.object.to-string", "es.regexp.to-string", "es.date.to-string"],
|
||||
trim: ["es.string.trim"],
|
||||
trimEnd: ["es.string.trim-end"],
|
||||
trimLeft: ["es.string.trim-start"],
|
||||
trimRight: ["es.string.trim-end"],
|
||||
trimStart: ["es.string.trim-start"],
|
||||
values: ArrayNatureIteratorsWithTag,
|
||||
__defineGetter__: ["es.object.define-getter"],
|
||||
__defineSetter__: ["es.object.define-setter"],
|
||||
__lookupGetter__: ["es.object.lookup-getter"],
|
||||
__lookupSetter__: ["es.object.lookup-setter"]
|
||||
};
|
||||
exports.InstanceProperties = InstanceProperties;
|
||||
const StaticProperties = {
|
||||
Array: {
|
||||
from: ["es.array.from", "es.string.iterator"],
|
||||
isArray: ["es.array.is-array"],
|
||||
of: ["es.array.of"]
|
||||
},
|
||||
Date: {
|
||||
now: "es.date.now"
|
||||
},
|
||||
Object: {
|
||||
assign: "es.object.assign",
|
||||
create: "es.object.create",
|
||||
defineProperty: "es.object.define-property",
|
||||
defineProperties: "es.object.define-properties",
|
||||
entries: "es.object.entries",
|
||||
freeze: "es.object.freeze",
|
||||
fromEntries: ["es.object.from-entries", "es.array.iterator"],
|
||||
getOwnPropertyDescriptor: "es.object.get-own-property-descriptor",
|
||||
getOwnPropertyDescriptors: "es.object.get-own-property-descriptors",
|
||||
getOwnPropertyNames: "es.object.get-own-property-names",
|
||||
getOwnPropertySymbols: "es.symbol",
|
||||
getPrototypeOf: "es.object.get-prototype-of",
|
||||
is: "es.object.is",
|
||||
isExtensible: "es.object.is-extensible",
|
||||
isFrozen: "es.object.is-frozen",
|
||||
isSealed: "es.object.is-sealed",
|
||||
keys: "es.object.keys",
|
||||
preventExtensions: "es.object.prevent-extensions",
|
||||
seal: "es.object.seal",
|
||||
setPrototypeOf: "es.object.set-prototype-of",
|
||||
values: "es.object.values"
|
||||
},
|
||||
Math: {
|
||||
DEG_PER_RAD: "esnext.math.deg-per-rad",
|
||||
RAD_PER_DEG: "esnext.math.rad-per-deg",
|
||||
acosh: "es.math.acosh",
|
||||
asinh: "es.math.asinh",
|
||||
atanh: "es.math.atanh",
|
||||
cbrt: "es.math.cbrt",
|
||||
clamp: "esnext.math.clamp",
|
||||
clz32: "es.math.clz32",
|
||||
cosh: "es.math.cosh",
|
||||
degrees: "esnext.math.degrees",
|
||||
expm1: "es.math.expm1",
|
||||
fround: "es.math.fround",
|
||||
fscale: "esnext.math.fscale",
|
||||
hypot: "es.math.hypot",
|
||||
iaddh: "esnext.math.iaddh",
|
||||
imul: "es.math.imul",
|
||||
imulh: "esnext.math.imulh",
|
||||
isubh: "esnext.math.isubh",
|
||||
log1p: "es.math.log1p",
|
||||
log10: "es.math.log10",
|
||||
log2: "es.math.log2",
|
||||
radians: "esnext.math.radians",
|
||||
scale: "esnext.math.scale",
|
||||
seededPRNG: "esnext.math.seeded-prng",
|
||||
sign: "es.math.sign",
|
||||
signbit: "esnext.math.signbit",
|
||||
sinh: "es.math.sinh",
|
||||
tanh: "es.math.tanh",
|
||||
trunc: "es.math.trunc",
|
||||
umulh: "esnext.math.umulh"
|
||||
},
|
||||
String: {
|
||||
fromCodePoint: "es.string.from-code-point",
|
||||
raw: "es.string.raw"
|
||||
},
|
||||
Number: {
|
||||
EPSILON: "es.number.epsilon",
|
||||
MIN_SAFE_INTEGER: "es.number.min-safe-integer",
|
||||
MAX_SAFE_INTEGER: "es.number.max-safe-integer",
|
||||
fromString: "esnext.number.from-string",
|
||||
isFinite: "es.number.is-finite",
|
||||
isInteger: "es.number.is-integer",
|
||||
isSafeInteger: "es.number.is-safe-integer",
|
||||
isNaN: "es.number.is-nan",
|
||||
parseFloat: "es.number.parse-float",
|
||||
parseInt: "es.number.parse-int"
|
||||
},
|
||||
Map: {
|
||||
from: ["esnext.map.from", ...MapDependencies],
|
||||
groupBy: ["esnext.map.group-by", ...MapDependencies],
|
||||
keyBy: ["esnext.map.key-by", ...MapDependencies],
|
||||
of: ["esnext.map.of", ...MapDependencies]
|
||||
},
|
||||
Set: {
|
||||
from: ["esnext.set.from", ...SetDependencies],
|
||||
of: ["esnext.set.of", ...SetDependencies]
|
||||
},
|
||||
WeakMap: {
|
||||
from: ["esnext.weak-map.from", ...WeakMapDependencies],
|
||||
of: ["esnext.weak-map.of", ...WeakMapDependencies]
|
||||
},
|
||||
WeakSet: {
|
||||
from: ["esnext.weak-set.from", ...WeakSetDependencies],
|
||||
of: ["esnext.weak-set.of", ...WeakSetDependencies]
|
||||
},
|
||||
Promise: {
|
||||
all: PromiseDependenciesWithIterators,
|
||||
allSettled: ["esnext.promise.all-settled", ...PromiseDependenciesWithIterators],
|
||||
any: ["esnext.promise.any", ...PromiseDependenciesWithIterators],
|
||||
race: PromiseDependenciesWithIterators,
|
||||
try: ["esnext.promise.try", ...PromiseDependenciesWithIterators]
|
||||
},
|
||||
Reflect: {
|
||||
apply: "es.reflect.apply",
|
||||
construct: "es.reflect.construct",
|
||||
defineMetadata: "esnext.reflect.define-metadata",
|
||||
defineProperty: "es.reflect.define-property",
|
||||
deleteMetadata: "esnext.reflect.delete-metadata",
|
||||
deleteProperty: "es.reflect.delete-property",
|
||||
get: "es.reflect.get",
|
||||
getMetadata: "esnext.reflect.get-metadata",
|
||||
getMetadataKeys: "esnext.reflect.get-metadata-keys",
|
||||
getOwnMetadata: "esnext.reflect.get-own-metadata",
|
||||
getOwnMetadataKeys: "esnext.reflect.get-own-metadata-keys",
|
||||
getOwnPropertyDescriptor: "es.reflect.get-own-property-descriptor",
|
||||
getPrototypeOf: "es.reflect.get-prototype-of",
|
||||
has: "es.reflect.has",
|
||||
hasMetadata: "esnext.reflect.has-metadata",
|
||||
hasOwnMetadata: "esnext.reflect.has-own-metadata",
|
||||
isExtensible: "es.reflect.is-extensible",
|
||||
metadata: "esnext.reflect.metadata",
|
||||
ownKeys: "es.reflect.own-keys",
|
||||
preventExtensions: "es.reflect.prevent-extensions",
|
||||
set: "es.reflect.set",
|
||||
setPrototypeOf: "es.reflect.set-prototype-of"
|
||||
},
|
||||
Symbol: {
|
||||
asyncIterator: ["es.symbol.async-iterator"],
|
||||
dispose: ["esnext.symbol.dispose"],
|
||||
hasInstance: ["es.symbol.has-instance", "es.function.has-instance"],
|
||||
isConcatSpreadable: ["es.symbol.is-concat-spreadable", "es.array.concat"],
|
||||
iterator: ["es.symbol.iterator", ...CommonIteratorsWithTag],
|
||||
match: ["es.symbol.match", "es.string.match"],
|
||||
observable: ["esnext.symbol.observable"],
|
||||
patternMatch: ["esnext.symbol.pattern-match"],
|
||||
replace: ["es.symbol.replace", "es.string.replace"],
|
||||
search: ["es.symbol.search", "es.string.search"],
|
||||
species: ["es.symbol.species", "es.array.species"],
|
||||
split: ["es.symbol.split", "es.string.split"],
|
||||
toPrimitive: ["es.symbol.to-primitive", "es.date.to-primitive"],
|
||||
toStringTag: ["es.symbol.to-string-tag", "es.object.to-string", "es.math.to-string-tag", "es.json.to-string-tag"],
|
||||
unscopables: ["es.symbol.unscopables"]
|
||||
},
|
||||
ArrayBuffer: {
|
||||
isView: ["es.array-buffer.is-view"]
|
||||
},
|
||||
Int8Array: TypedArrayStaticMethods,
|
||||
Uint8Array: TypedArrayStaticMethods,
|
||||
Uint8ClampedArray: TypedArrayStaticMethods,
|
||||
Int16Array: TypedArrayStaticMethods,
|
||||
Uint16Array: TypedArrayStaticMethods,
|
||||
Int32Array: TypedArrayStaticMethods,
|
||||
Uint32Array: TypedArrayStaticMethods,
|
||||
Float32Array: TypedArrayStaticMethods,
|
||||
Float64Array: TypedArrayStaticMethods
|
||||
};
|
||||
exports.StaticProperties = StaticProperties;
|
||||
const CommonInstanceDependencies = new Set(["es.object.to-string", "es.object.define-getter", "es.object.define-setter", "es.object.lookup-getter", "es.object.lookup-setter", "es.regexp.exec"]);
|
||||
exports.CommonInstanceDependencies = CommonInstanceDependencies;
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
exports.PossibleGlobalObjects = PossibleGlobalObjects;
|
137
node_modules/@babel/preset-env/lib/polyfills/corejs3/entry-plugin.js
generated
vendored
Normal file
137
node_modules/@babel/preset-env/lib/polyfills/corejs3/entry-plugin.js
generated
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _data() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/data"));
|
||||
|
||||
_data = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _entries() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/entries"));
|
||||
|
||||
_entries = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getModulesListForTargetVersion() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/get-modules-list-for-target-version"));
|
||||
|
||||
_getModulesListForTargetVersion = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _filterItems = _interopRequireDefault(require("../../filter-items"));
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
var _debug = require("../../debug");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isBabelPolyfillSource(source) {
|
||||
return source === "@babel/polyfill" || source === "babel-polyfill";
|
||||
}
|
||||
|
||||
function isCoreJSSource(source) {
|
||||
if (typeof source === "string") {
|
||||
source = source.replace(/\\/g, "/").replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase();
|
||||
}
|
||||
|
||||
return (0, _utils.has)(_entries().default, source) && _entries().default[source];
|
||||
}
|
||||
|
||||
const BABEL_POLYFILL_DEPRECATION = `
|
||||
\`@babel/polyfill\` is deprecated. Please, use required parts of \`core-js\`
|
||||
and \`regenerator-runtime/runtime\` separately`;
|
||||
|
||||
function _default(_, {
|
||||
corejs,
|
||||
include,
|
||||
exclude,
|
||||
polyfillTargets,
|
||||
debug
|
||||
}) {
|
||||
const polyfills = (0, _filterItems.default)(_data().default, include, exclude, polyfillTargets, null);
|
||||
const available = new Set((0, _getModulesListForTargetVersion().default)(corejs.version));
|
||||
const isPolyfillImport = {
|
||||
ImportDeclaration(path) {
|
||||
const source = (0, _utils.getImportSource)(path);
|
||||
if (!source) return;
|
||||
|
||||
if (isBabelPolyfillSource(source)) {
|
||||
console.warn(BABEL_POLYFILL_DEPRECATION);
|
||||
} else {
|
||||
const modules = isCoreJSSource(source);
|
||||
|
||||
if (modules) {
|
||||
this.replaceBySeparateModulesImport(path, modules);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
const source = (0, _utils.getRequireSource)(bodyPath);
|
||||
if (!source) return;
|
||||
|
||||
if (isBabelPolyfillSource(source)) {
|
||||
console.warn(BABEL_POLYFILL_DEPRECATION);
|
||||
} else {
|
||||
const modules = isCoreJSSource(source);
|
||||
|
||||
if (modules) {
|
||||
this.replaceBySeparateModulesImport(bodyPath, modules);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "corejs3-entry",
|
||||
visitor: isPolyfillImport,
|
||||
|
||||
pre() {
|
||||
this.polyfillsSet = new Set();
|
||||
|
||||
this.replaceBySeparateModulesImport = function (path, modules) {
|
||||
for (const module of modules) {
|
||||
this.polyfillsSet.add(module);
|
||||
}
|
||||
|
||||
path.remove();
|
||||
};
|
||||
},
|
||||
|
||||
post({
|
||||
path
|
||||
}) {
|
||||
const filtered = (0, _utils.intersection)(polyfills, this.polyfillsSet, available);
|
||||
const reversed = Array.from(filtered).reverse();
|
||||
|
||||
for (const module of reversed) {
|
||||
(0, _utils.createImport)(path, module);
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
(0, _debug.logEntryPolyfills)("core-js", this.polyfillsSet.size > 0, filtered, this.file.opts.filename, polyfillTargets, _data().default);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
8
node_modules/@babel/preset-env/lib/polyfills/corejs3/shipped-proposals.js
generated
vendored
Normal file
8
node_modules/@babel/preset-env/lib/polyfills/corejs3/shipped-proposals.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = ["esnext.global-this", "esnext.string.match-all"];
|
||||
exports.default = _default;
|
288
node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
generated
vendored
Normal file
288
node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _data() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/data"));
|
||||
|
||||
_data = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _shippedProposals = _interopRequireDefault(require("./shipped-proposals"));
|
||||
|
||||
function _getModulesListForTargetVersion() {
|
||||
const data = _interopRequireDefault(require("core-js-compat/get-modules-list-for-target-version"));
|
||||
|
||||
_getModulesListForTargetVersion = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _filterItems = _interopRequireDefault(require("../../filter-items"));
|
||||
|
||||
var _builtInDefinitions = require("./built-in-definitions");
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
var _debug = require("../../debug");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const NO_DIRECT_POLYFILL_IMPORT = `
|
||||
When setting \`useBuiltIns: 'usage'\`, polyfills are automatically imported when needed.
|
||||
Please remove the direct import of \`core-js\` or use \`useBuiltIns: 'entry'\` instead.`;
|
||||
const corejs3PolyfillsWithoutProposals = Object.keys(_data().default).filter(name => !name.startsWith("esnext.")).reduce((memo, key) => {
|
||||
memo[key] = _data().default[key];
|
||||
return memo;
|
||||
}, {});
|
||||
|
||||
const corejs3PolyfillsWithShippedProposals = _shippedProposals.default.reduce((memo, key) => {
|
||||
memo[key] = _data().default[key];
|
||||
return memo;
|
||||
}, Object.assign({}, corejs3PolyfillsWithoutProposals));
|
||||
|
||||
function _default(_, {
|
||||
corejs,
|
||||
include,
|
||||
exclude,
|
||||
polyfillTargets,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
debug
|
||||
}) {
|
||||
const polyfills = (0, _filterItems.default)(proposals ? _data().default : shippedProposals ? corejs3PolyfillsWithShippedProposals : corejs3PolyfillsWithoutProposals, include, exclude, polyfillTargets, null);
|
||||
const available = new Set((0, _getModulesListForTargetVersion().default)(corejs.version));
|
||||
|
||||
function resolveKey(path, computed) {
|
||||
const {
|
||||
node,
|
||||
parent,
|
||||
scope
|
||||
} = path;
|
||||
if (path.isStringLiteral()) return node.value;
|
||||
const {
|
||||
name
|
||||
} = node;
|
||||
const isIdentifier = path.isIdentifier();
|
||||
if (isIdentifier && !(computed || parent.computed)) return name;
|
||||
|
||||
if (!isIdentifier || scope.getBindingIdentifier(name)) {
|
||||
const {
|
||||
value
|
||||
} = path.evaluate();
|
||||
if (typeof value === "string") return value;
|
||||
}
|
||||
}
|
||||
|
||||
function resolveSource(path) {
|
||||
const {
|
||||
node,
|
||||
scope
|
||||
} = path;
|
||||
let builtIn, instanceType;
|
||||
|
||||
if (node) {
|
||||
builtIn = node.name;
|
||||
|
||||
if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {
|
||||
const {
|
||||
deopt,
|
||||
value
|
||||
} = path.evaluate();
|
||||
|
||||
if (value !== undefined) {
|
||||
instanceType = (0, _utils.getType)(value);
|
||||
} else if (deopt && deopt.isIdentifier()) {
|
||||
builtIn = deopt.node.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
builtIn,
|
||||
instanceType,
|
||||
isNamespaced: (0, _utils.isNamespaced)(path)
|
||||
};
|
||||
}
|
||||
|
||||
const addAndRemovePolyfillImports = {
|
||||
ImportDeclaration(path) {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getImportSource)(path))) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT);
|
||||
path.remove();
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if ((0, _utils.isPolyfillSource)((0, _utils.getRequireSource)(bodyPath))) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT);
|
||||
bodyPath.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Import() {
|
||||
this.addUnsupported(_builtInDefinitions.PromiseDependencies);
|
||||
},
|
||||
|
||||
Function({
|
||||
node
|
||||
}) {
|
||||
if (node.async) {
|
||||
this.addUnsupported(_builtInDefinitions.PromiseDependencies);
|
||||
}
|
||||
},
|
||||
|
||||
"ForOfStatement|ArrayPattern"() {
|
||||
this.addUnsupported(_builtInDefinitions.CommonIterators);
|
||||
},
|
||||
|
||||
SpreadElement({
|
||||
parentPath
|
||||
}) {
|
||||
if (!parentPath.isObjectExpression()) {
|
||||
this.addUnsupported(_builtInDefinitions.CommonIterators);
|
||||
}
|
||||
},
|
||||
|
||||
YieldExpression({
|
||||
node
|
||||
}) {
|
||||
if (node.delegate) {
|
||||
this.addUnsupported(_builtInDefinitions.CommonIterators);
|
||||
}
|
||||
},
|
||||
|
||||
ReferencedIdentifier({
|
||||
node: {
|
||||
name
|
||||
},
|
||||
scope
|
||||
}) {
|
||||
if (scope.getBindingIdentifier(name)) return;
|
||||
this.addBuiltInDependencies(name);
|
||||
},
|
||||
|
||||
MemberExpression(path) {
|
||||
const source = resolveSource(path.get("object"));
|
||||
const key = resolveKey(path.get("property"));
|
||||
this.addPropertyDependencies(source, key);
|
||||
},
|
||||
|
||||
ObjectPattern(path) {
|
||||
const {
|
||||
parentPath,
|
||||
parent,
|
||||
key
|
||||
} = path;
|
||||
let source;
|
||||
|
||||
if (parentPath.isVariableDeclarator()) {
|
||||
source = resolveSource(parentPath.get("init"));
|
||||
} else if (parentPath.isAssignmentExpression()) {
|
||||
source = resolveSource(parentPath.get("right"));
|
||||
} else if (parentPath.isFunctionExpression()) {
|
||||
const grand = parentPath.parentPath;
|
||||
|
||||
if (grand.isCallExpression() || grand.isNewExpression()) {
|
||||
if (grand.node.callee === parent) {
|
||||
source = resolveSource(grand.get("arguments")[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const property of path.get("properties")) {
|
||||
if (property.isObjectProperty()) {
|
||||
const key = resolveKey(property.get("key"));
|
||||
this.addPropertyDependencies(source, key);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
BinaryExpression(path) {
|
||||
if (path.node.operator !== "in") return;
|
||||
const source = resolveSource(path.get("right"));
|
||||
const key = resolveKey(path.get("left"), true);
|
||||
this.addPropertyDependencies(source, key);
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "corejs3-usage",
|
||||
|
||||
pre() {
|
||||
this.polyfillsSet = new Set();
|
||||
|
||||
this.addUnsupported = function (builtIn) {
|
||||
const modules = Array.isArray(builtIn) ? builtIn : [builtIn];
|
||||
|
||||
for (const module of modules) {
|
||||
this.polyfillsSet.add(module);
|
||||
}
|
||||
};
|
||||
|
||||
this.addBuiltInDependencies = function (builtIn) {
|
||||
if ((0, _utils.has)(_builtInDefinitions.BuiltIns, builtIn)) {
|
||||
const BuiltInDependencies = _builtInDefinitions.BuiltIns[builtIn];
|
||||
this.addUnsupported(BuiltInDependencies);
|
||||
}
|
||||
};
|
||||
|
||||
this.addPropertyDependencies = function (source = {}, key) {
|
||||
const {
|
||||
builtIn,
|
||||
instanceType,
|
||||
isNamespaced
|
||||
} = source;
|
||||
if (isNamespaced) return;
|
||||
|
||||
if (_builtInDefinitions.PossibleGlobalObjects.has(builtIn)) {
|
||||
this.addBuiltInDependencies(key);
|
||||
} else if ((0, _utils.has)(_builtInDefinitions.StaticProperties, builtIn)) {
|
||||
const BuiltInProperties = _builtInDefinitions.StaticProperties[builtIn];
|
||||
|
||||
if ((0, _utils.has)(BuiltInProperties, key)) {
|
||||
const StaticPropertyDependencies = BuiltInProperties[key];
|
||||
return this.addUnsupported(StaticPropertyDependencies);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(0, _utils.has)(_builtInDefinitions.InstanceProperties, key)) return;
|
||||
let InstancePropertyDependencies = _builtInDefinitions.InstanceProperties[key];
|
||||
|
||||
if (instanceType) {
|
||||
InstancePropertyDependencies = InstancePropertyDependencies.filter(m => m.includes(instanceType) || _builtInDefinitions.CommonInstanceDependencies.has(m));
|
||||
}
|
||||
|
||||
this.addUnsupported(InstancePropertyDependencies);
|
||||
};
|
||||
},
|
||||
|
||||
post({
|
||||
path
|
||||
}) {
|
||||
const filtered = (0, _utils.intersection)(polyfills, this.polyfillsSet, available);
|
||||
const reversed = Array.from(filtered).reverse();
|
||||
|
||||
for (const module of reversed) {
|
||||
(0, _utils.createImport)(path, module);
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
(0, _debug.logUsagePolyfills)(filtered, this.file.opts.filename, polyfillTargets, _data().default);
|
||||
}
|
||||
},
|
||||
|
||||
visitor: addAndRemovePolyfillImports
|
||||
};
|
||||
}
|
48
node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
generated
vendored
Normal file
48
node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
function isRegeneratorSource(source) {
|
||||
return source === "regenerator-runtime/runtime";
|
||||
}
|
||||
|
||||
function _default() {
|
||||
const visitor = {
|
||||
ImportDeclaration(path) {
|
||||
if (isRegeneratorSource((0, _utils.getImportSource)(path))) {
|
||||
this.regeneratorImportExcluded = true;
|
||||
path.remove();
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if (isRegeneratorSource((0, _utils.getRequireSource)(bodyPath))) {
|
||||
this.regeneratorImportExcluded = true;
|
||||
bodyPath.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "regenerator-entry",
|
||||
visitor,
|
||||
|
||||
pre() {
|
||||
this.regeneratorImportExcluded = false;
|
||||
},
|
||||
|
||||
post() {
|
||||
if (this.opts.debug && this.regeneratorImportExcluded) {
|
||||
console.log(`\n[${this.file.opts.filename}] Based on your targets, regenerator-runtime import excluded.`);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
39
node_modules/@babel/preset-env/lib/polyfills/regenerator/usage-plugin.js
generated
vendored
Normal file
39
node_modules/@babel/preset-env/lib/polyfills/regenerator/usage-plugin.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _utils = require("../../utils");
|
||||
|
||||
function _default() {
|
||||
return {
|
||||
name: "regenerator-usage",
|
||||
|
||||
pre() {
|
||||
this.usesRegenerator = false;
|
||||
},
|
||||
|
||||
visitor: {
|
||||
Function(path) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
|
||||
if (!this.usesRegenerator && (node.generator || node.async)) {
|
||||
this.usesRegenerator = true;
|
||||
(0, _utils.createImport)(path, "regenerator-runtime");
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
post() {
|
||||
if (this.opts.debug && this.usesRegenerator) {
|
||||
console.log(`\n[${this.file.opts.filename}] Based on your code and targets, added regenerator-runtime.`);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
242
node_modules/@babel/preset-env/lib/targets-parser.js
generated
vendored
Normal file
242
node_modules/@babel/preset-env/lib/targets-parser.js
generated
vendored
Normal file
@ -0,0 +1,242 @@
|
||||
"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 _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 validBrowserslistTargets = [...Object.keys(_browserslist().default.data), ...Object.keys(_browserslist().default.aliases)];
|
||||
|
||||
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;
|
||||
}, []);
|
||||
};
|
||||
|
||||
const validateTargetNames = targets => {
|
||||
const validTargets = Object.keys(_options.TargetNames);
|
||||
|
||||
for (const target in targets) {
|
||||
if (!_options.TargetNames[target]) {
|
||||
throw new Error(`Invalid Option: '${target}' is not a valid target
|
||||
Maybe you meant to use '${(0, _utils.findSuggestion)(validTargets, target)}'?`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const browserNameMap = {
|
||||
and_chr: "chrome",
|
||||
and_ff: "firefox",
|
||||
android: "android",
|
||||
chrome: "chrome",
|
||||
edge: "edge",
|
||||
firefox: "firefox",
|
||||
ie: "ie",
|
||||
ie_mob: "ie",
|
||||
ios_saf: "ios",
|
||||
node: "node",
|
||||
op_mob: "opera",
|
||||
opera: "opera",
|
||||
safari: "safari",
|
||||
samsung: "samsung"
|
||||
};
|
||||
|
||||
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 hasTargets = Object.keys(targets).length > 0;
|
||||
const shouldParseBrowsers = !!targets.browsers;
|
||||
const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets;
|
||||
|
||||
if (shouldParseBrowsers || shouldSearchForConfig) {
|
||||
if (!hasTargets) {
|
||||
_browserslist().default.defaults = objectToBrowserslist(targets);
|
||||
}
|
||||
|
||||
const browsers = (0, _browserslist().default)(browsersquery, {
|
||||
path: options.configPath,
|
||||
mobileToDesktop: true
|
||||
});
|
||||
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;
|
229
node_modules/@babel/preset-env/lib/utils.js
generated
vendored
Normal file
229
node_modules/@babel/preset-env/lib/utils.js
generated
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getType = getType;
|
||||
exports.semverify = semverify;
|
||||
exports.intersection = intersection;
|
||||
exports.findSuggestion = findSuggestion;
|
||||
exports.prettifyVersion = prettifyVersion;
|
||||
exports.prettifyTargets = prettifyTargets;
|
||||
exports.isUnreleasedVersion = isUnreleasedVersion;
|
||||
exports.getLowestUnreleased = getLowestUnreleased;
|
||||
exports.filterStageFromList = filterStageFromList;
|
||||
exports.getImportSource = getImportSource;
|
||||
exports.getRequireSource = getRequireSource;
|
||||
exports.isPolyfillSource = isPolyfillSource;
|
||||
exports.getModulePath = getModulePath;
|
||||
exports.createImport = createImport;
|
||||
exports.isNamespaced = isNamespaced;
|
||||
exports.has = void 0;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = 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;
|
||||
}
|
||||
|
||||
function _jsLevenshtein() {
|
||||
const data = _interopRequireDefault(require("js-levenshtein"));
|
||||
|
||||
_jsLevenshtein = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _helperModuleImports() {
|
||||
const data = require("@babel/helper-module-imports");
|
||||
|
||||
_helperModuleImports = function () {
|
||||
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 }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);
|
||||
exports.has = has;
|
||||
|
||||
function getType(target) {
|
||||
return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
|
||||
}
|
||||
|
||||
const versionRegExp = /^(\d+|\d+.\d+)$/;
|
||||
|
||||
function semverify(version) {
|
||||
if (typeof version === "string" && _semver().default.valid(version)) {
|
||||
return version;
|
||||
}
|
||||
|
||||
(0, _invariant().default)(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`);
|
||||
const split = version.toString().split(".");
|
||||
|
||||
while (split.length < 3) {
|
||||
split.push("0");
|
||||
}
|
||||
|
||||
return split.join(".");
|
||||
}
|
||||
|
||||
function intersection(first, second, third) {
|
||||
const result = new Set();
|
||||
|
||||
for (const el of first) {
|
||||
if (second.has(el) && third.has(el)) result.add(el);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function findSuggestion(options, option) {
|
||||
let levenshteinValue = Infinity;
|
||||
return options.reduce((suggestion, validOption) => {
|
||||
const value = (0, _jsLevenshtein().default)(validOption, option);
|
||||
|
||||
if (value < levenshteinValue) {
|
||||
levenshteinValue = value;
|
||||
return validOption;
|
||||
}
|
||||
|
||||
return suggestion;
|
||||
}, undefined);
|
||||
}
|
||||
|
||||
function 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(".");
|
||||
}
|
||||
|
||||
function 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;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function isUnreleasedVersion(version, env) {
|
||||
const unreleasedLabel = _unreleasedLabels.default[env];
|
||||
return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
|
||||
}
|
||||
|
||||
function 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);
|
||||
}
|
||||
|
||||
function filterStageFromList(list, stageList) {
|
||||
return Object.keys(list).reduce((result, item) => {
|
||||
if (!stageList[item]) {
|
||||
result[item] = list[item];
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function getImportSource({
|
||||
node
|
||||
}) {
|
||||
if (node.specifiers.length === 0) return node.source.value;
|
||||
}
|
||||
|
||||
function getRequireSource({
|
||||
node
|
||||
}) {
|
||||
if (!t().isExpressionStatement(node)) return;
|
||||
const {
|
||||
expression
|
||||
} = node;
|
||||
const isRequire = t().isCallExpression(expression) && t().isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t().isStringLiteral(expression.arguments[0]);
|
||||
if (isRequire) return expression.arguments[0].value;
|
||||
}
|
||||
|
||||
function isPolyfillSource(source) {
|
||||
return source === "@babel/polyfill" || source === "core-js";
|
||||
}
|
||||
|
||||
const modulePathMap = {
|
||||
"regenerator-runtime": "regenerator-runtime/runtime"
|
||||
};
|
||||
|
||||
function getModulePath(mod) {
|
||||
return modulePathMap[mod] || `core-js/modules/${mod}`;
|
||||
}
|
||||
|
||||
function createImport(path, mod) {
|
||||
return (0, _helperModuleImports().addSideEffect)(path, getModulePath(mod));
|
||||
}
|
||||
|
||||
function isNamespaced(path) {
|
||||
if (!path.node) return false;
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return false;
|
||||
return binding.path.isImportNamespaceSpecifier();
|
||||
}
|
15
node_modules/@babel/preset-env/node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/@babel/preset-env/node_modules/.bin/semver
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../semver/bin/semver" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../semver/bin/semver" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/@babel/preset-env/node_modules/.bin/semver.cmd
generated
vendored
Normal file
7
node_modules/@babel/preset-env/node_modules/.bin/semver.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\semver\bin\semver" %*
|
||||
)
|
22
node_modules/@babel/preset-env/node_modules/@babel/types/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/preset-env/node_modules/@babel/types/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/preset-env/node_modules/@babel/types/README.md
generated
vendored
Normal file
19
node_modules/@babel/preset-env/node_modules/@babel/types/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/types
|
||||
|
||||
> Babel Types is a Lodash-esque utility library for AST nodes
|
||||
|
||||
See our website [@babel/types](https://babeljs.io/docs/en/next/babel-types.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/types
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/types --dev
|
||||
```
|
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/asserts/assertNode.js
generated
vendored
Normal file
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/asserts/assertNode.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = assertNode;
|
||||
|
||||
var _isNode = _interopRequireDefault(require("../validators/isNode"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function assertNode(node) {
|
||||
if (!(0, _isNode.default)(node)) {
|
||||
const type = node && node.type || JSON.stringify(node);
|
||||
throw new TypeError(`Not a valid node of type "${type}"`);
|
||||
}
|
||||
}
|
1374
node_modules/@babel/preset-env/node_modules/@babel/types/lib/asserts/generated/index.js
generated
vendored
Normal file
1374
node_modules/@babel/preset-env/node_modules/@babel/types/lib/asserts/generated/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
50
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/builder.js
generated
vendored
Normal file
50
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/builder.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = builder;
|
||||
|
||||
function _clone() {
|
||||
const data = _interopRequireDefault(require("lodash/clone"));
|
||||
|
||||
_clone = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
var _validate = _interopRequireDefault(require("../validators/validate"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function builder(type, ...args) {
|
||||
const keys = _definitions.BUILDER_KEYS[type];
|
||||
const countArgs = args.length;
|
||||
|
||||
if (countArgs > keys.length) {
|
||||
throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
|
||||
}
|
||||
|
||||
const node = {
|
||||
type
|
||||
};
|
||||
let i = 0;
|
||||
keys.forEach(key => {
|
||||
const field = _definitions.NODE_FIELDS[type][key];
|
||||
let arg;
|
||||
if (i < countArgs) arg = args[i];
|
||||
if (arg === undefined) arg = (0, _clone().default)(field.default);
|
||||
node[key] = arg;
|
||||
i++;
|
||||
});
|
||||
|
||||
for (const key of Object.keys(node)) {
|
||||
(0, _validate.default)(node, key, node[key]);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
28
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
generated
vendored
Normal file
28
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createTypeAnnotationBasedOnTypeof;
|
||||
|
||||
var _generated = require("../generated");
|
||||
|
||||
function createTypeAnnotationBasedOnTypeof(type) {
|
||||
if (type === "string") {
|
||||
return (0, _generated.stringTypeAnnotation)();
|
||||
} else if (type === "number") {
|
||||
return (0, _generated.numberTypeAnnotation)();
|
||||
} else if (type === "undefined") {
|
||||
return (0, _generated.voidTypeAnnotation)();
|
||||
} else if (type === "boolean") {
|
||||
return (0, _generated.booleanTypeAnnotation)();
|
||||
} else if (type === "function") {
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function"));
|
||||
} else if (type === "object") {
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object"));
|
||||
} else if (type === "symbol") {
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol"));
|
||||
} else {
|
||||
throw new Error("Invalid typeof value");
|
||||
}
|
||||
}
|
22
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
generated
vendored
Normal file
22
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createUnionTypeAnnotation;
|
||||
|
||||
var _generated = require("../generated");
|
||||
|
||||
var _removeTypeDuplicates = _interopRequireDefault(require("../../modifications/flow/removeTypeDuplicates"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function createUnionTypeAnnotation(types) {
|
||||
const flattened = (0, _removeTypeDuplicates.default)(types);
|
||||
|
||||
if (flattened.length === 1) {
|
||||
return flattened[0];
|
||||
} else {
|
||||
return (0, _generated.unionTypeAnnotation)(flattened);
|
||||
}
|
||||
}
|
1158
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/generated/index.js
generated
vendored
Normal file
1158
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/generated/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
31
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/react/buildChildren.js
generated
vendored
Normal file
31
node_modules/@babel/preset-env/node_modules/@babel/types/lib/builders/react/buildChildren.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = buildChildren;
|
||||
|
||||
var _generated = require("../../validators/generated");
|
||||
|
||||
var _cleanJSXElementLiteralChild = _interopRequireDefault(require("../../utils/react/cleanJSXElementLiteralChild"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function buildChildren(node) {
|
||||
const elements = [];
|
||||
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
let child = node.children[i];
|
||||
|
||||
if ((0, _generated.isJSXText)(child)) {
|
||||
(0, _cleanJSXElementLiteralChild.default)(child, elements);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression;
|
||||
if ((0, _generated.isJSXEmptyExpression)(child)) continue;
|
||||
elements.push(child);
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/clone.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/clone.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = clone;
|
||||
|
||||
var _cloneNode = _interopRequireDefault(require("./cloneNode"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function clone(node) {
|
||||
return (0, _cloneNode.default)(node, false);
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneDeep.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneDeep.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneDeep;
|
||||
|
||||
var _cloneNode = _interopRequireDefault(require("./cloneNode"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function cloneDeep(node) {
|
||||
return (0, _cloneNode.default)(node);
|
||||
}
|
78
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneNode.js
generated
vendored
Normal file
78
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneNode.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneNode;
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
const has = Function.call.bind(Object.prototype.hasOwnProperty);
|
||||
|
||||
function cloneIfNode(obj, deep) {
|
||||
if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") {
|
||||
return cloneNode(obj, deep);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function cloneIfNodeOrArray(obj, deep) {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(node => cloneIfNode(node, deep));
|
||||
}
|
||||
|
||||
return cloneIfNode(obj, deep);
|
||||
}
|
||||
|
||||
function cloneNode(node, deep = true) {
|
||||
if (!node) return node;
|
||||
const {
|
||||
type
|
||||
} = node;
|
||||
const newNode = {
|
||||
type
|
||||
};
|
||||
|
||||
if (type === "Identifier") {
|
||||
newNode.name = node.name;
|
||||
|
||||
if (has(node, "optional") && typeof node.optional === "boolean") {
|
||||
newNode.optional = node.optional;
|
||||
}
|
||||
|
||||
if (has(node, "typeAnnotation")) {
|
||||
newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true) : node.typeAnnotation;
|
||||
}
|
||||
} else if (!has(_definitions.NODE_FIELDS, type)) {
|
||||
throw new Error(`Unknown node type: "${type}"`);
|
||||
} else {
|
||||
for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {
|
||||
if (has(node, field)) {
|
||||
newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (has(node, "loc")) {
|
||||
newNode.loc = node.loc;
|
||||
}
|
||||
|
||||
if (has(node, "leadingComments")) {
|
||||
newNode.leadingComments = node.leadingComments;
|
||||
}
|
||||
|
||||
if (has(node, "innerComments")) {
|
||||
newNode.innerComments = node.innerComments;
|
||||
}
|
||||
|
||||
if (has(node, "trailingComments")) {
|
||||
newNode.trailingComments = node.trailingComments;
|
||||
}
|
||||
|
||||
if (has(node, "extra")) {
|
||||
newNode.extra = Object.assign({}, node.extra);
|
||||
}
|
||||
|
||||
return newNode;
|
||||
}
|
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
generated
vendored
Normal file
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneWithoutLoc;
|
||||
|
||||
var _clone = _interopRequireDefault(require("./clone"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function cloneWithoutLoc(node) {
|
||||
const newNode = (0, _clone.default)(node);
|
||||
newNode.loc = null;
|
||||
return newNode;
|
||||
}
|
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/addComment.js
generated
vendored
Normal file
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/addComment.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addComment;
|
||||
|
||||
var _addComments = _interopRequireDefault(require("./addComments"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function addComment(node, type, content, line) {
|
||||
return (0, _addComments.default)(node, type, [{
|
||||
type: line ? "CommentLine" : "CommentBlock",
|
||||
value: content
|
||||
}]);
|
||||
}
|
23
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/addComments.js
generated
vendored
Normal file
23
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/addComments.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addComments;
|
||||
|
||||
function addComments(node, type, comments) {
|
||||
if (!comments || !node) return node;
|
||||
const key = `${type}Comments`;
|
||||
|
||||
if (node[key]) {
|
||||
if (type === "leading") {
|
||||
node[key] = comments.concat(node[key]);
|
||||
} else {
|
||||
node[key] = node[key].concat(comments);
|
||||
}
|
||||
} else {
|
||||
node[key] = comments;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritInnerComments.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritInnerComments.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inheritInnerComments;
|
||||
|
||||
var _inherit = _interopRequireDefault(require("../utils/inherit"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inheritInnerComments(child, parent) {
|
||||
(0, _inherit.default)("innerComments", child, parent);
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritLeadingComments.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritLeadingComments.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inheritLeadingComments;
|
||||
|
||||
var _inherit = _interopRequireDefault(require("../utils/inherit"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inheritLeadingComments(child, parent) {
|
||||
(0, _inherit.default)("leadingComments", child, parent);
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritTrailingComments.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritTrailingComments.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inheritTrailingComments;
|
||||
|
||||
var _inherit = _interopRequireDefault(require("../utils/inherit"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inheritTrailingComments(child, parent) {
|
||||
(0, _inherit.default)("trailingComments", child, parent);
|
||||
}
|
21
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritsComments.js
generated
vendored
Normal file
21
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/inheritsComments.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inheritsComments;
|
||||
|
||||
var _inheritTrailingComments = _interopRequireDefault(require("./inheritTrailingComments"));
|
||||
|
||||
var _inheritLeadingComments = _interopRequireDefault(require("./inheritLeadingComments"));
|
||||
|
||||
var _inheritInnerComments = _interopRequireDefault(require("./inheritInnerComments"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inheritsComments(child, parent) {
|
||||
(0, _inheritTrailingComments.default)(child, parent);
|
||||
(0, _inheritLeadingComments.default)(child, parent);
|
||||
(0, _inheritInnerComments.default)(child, parent);
|
||||
return child;
|
||||
}
|
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/removeComments.js
generated
vendored
Normal file
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/comments/removeComments.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeComments;
|
||||
|
||||
var _constants = require("../constants");
|
||||
|
||||
function removeComments(node) {
|
||||
_constants.COMMENT_KEYS.forEach(key => {
|
||||
node[key] = null;
|
||||
});
|
||||
|
||||
return node;
|
||||
}
|
93
node_modules/@babel/preset-env/node_modules/@babel/types/lib/constants/generated/index.js
generated
vendored
Normal file
93
node_modules/@babel/preset-env/node_modules/@babel/types/lib/constants/generated/index.js
generated
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0;
|
||||
|
||||
var _definitions = require("../../definitions");
|
||||
|
||||
const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"];
|
||||
exports.EXPRESSION_TYPES = EXPRESSION_TYPES;
|
||||
const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"];
|
||||
exports.BINARY_TYPES = BINARY_TYPES;
|
||||
const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"];
|
||||
exports.SCOPABLE_TYPES = SCOPABLE_TYPES;
|
||||
const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"];
|
||||
exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
|
||||
const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"];
|
||||
exports.BLOCK_TYPES = BLOCK_TYPES;
|
||||
const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"];
|
||||
exports.STATEMENT_TYPES = STATEMENT_TYPES;
|
||||
const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"];
|
||||
exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
|
||||
const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"];
|
||||
exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
|
||||
const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"];
|
||||
exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
|
||||
const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"];
|
||||
exports.LOOP_TYPES = LOOP_TYPES;
|
||||
const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"];
|
||||
exports.WHILE_TYPES = WHILE_TYPES;
|
||||
const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
|
||||
exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
|
||||
const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"];
|
||||
exports.FOR_TYPES = FOR_TYPES;
|
||||
const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"];
|
||||
exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
|
||||
const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"];
|
||||
exports.FUNCTION_TYPES = FUNCTION_TYPES;
|
||||
const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"];
|
||||
exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
|
||||
const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"];
|
||||
exports.PUREISH_TYPES = PUREISH_TYPES;
|
||||
const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"];
|
||||
exports.DECLARATION_TYPES = DECLARATION_TYPES;
|
||||
const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"];
|
||||
exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
|
||||
const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"];
|
||||
exports.LVAL_TYPES = LVAL_TYPES;
|
||||
const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"];
|
||||
exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
|
||||
const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"];
|
||||
exports.LITERAL_TYPES = LITERAL_TYPES;
|
||||
const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"];
|
||||
exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
|
||||
const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
|
||||
exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
|
||||
const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"];
|
||||
exports.METHOD_TYPES = METHOD_TYPES;
|
||||
const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"];
|
||||
exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
|
||||
const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"];
|
||||
exports.PROPERTY_TYPES = PROPERTY_TYPES;
|
||||
const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"];
|
||||
exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
|
||||
const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"];
|
||||
exports.PATTERN_TYPES = PATTERN_TYPES;
|
||||
const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"];
|
||||
exports.CLASS_TYPES = CLASS_TYPES;
|
||||
const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
|
||||
exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
|
||||
const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
|
||||
exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
|
||||
const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
|
||||
exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
|
||||
const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"];
|
||||
exports.FLOW_TYPES = FLOW_TYPES;
|
||||
const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"];
|
||||
exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
|
||||
const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
|
||||
exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
|
||||
const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
|
||||
exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
|
||||
const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"];
|
||||
exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
|
||||
const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"];
|
||||
exports.JSX_TYPES = JSX_TYPES;
|
||||
const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"];
|
||||
exports.PRIVATE_TYPES = PRIVATE_TYPES;
|
||||
const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"];
|
||||
exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
|
||||
const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"];
|
||||
exports.TSTYPE_TYPES = TSTYPE_TYPES;
|
47
node_modules/@babel/preset-env/node_modules/@babel/types/lib/constants/index.js
generated
vendored
Normal file
47
node_modules/@babel/preset-env/node_modules/@babel/types/lib/constants/index.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0;
|
||||
const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
|
||||
exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
|
||||
const FLATTENABLE_KEYS = ["body", "expressions"];
|
||||
exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
|
||||
const FOR_INIT_KEYS = ["left", "init"];
|
||||
exports.FOR_INIT_KEYS = FOR_INIT_KEYS;
|
||||
const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
|
||||
exports.COMMENT_KEYS = COMMENT_KEYS;
|
||||
const LOGICAL_OPERATORS = ["||", "&&", "??"];
|
||||
exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
|
||||
const UPDATE_OPERATORS = ["++", "--"];
|
||||
exports.UPDATE_OPERATORS = UPDATE_OPERATORS;
|
||||
const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
|
||||
exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
|
||||
const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
|
||||
exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
|
||||
const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
|
||||
exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
|
||||
const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
|
||||
exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
|
||||
const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
|
||||
exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
|
||||
const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
|
||||
exports.BINARY_OPERATORS = BINARY_OPERATORS;
|
||||
const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
|
||||
exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
|
||||
const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
|
||||
exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
|
||||
const STRING_UNARY_OPERATORS = ["typeof"];
|
||||
exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
|
||||
const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
|
||||
exports.UNARY_OPERATORS = UNARY_OPERATORS;
|
||||
const INHERIT_KEYS = {
|
||||
optional: ["typeAnnotation", "typeParameters", "returnType"],
|
||||
force: ["start", "loc", "end"]
|
||||
};
|
||||
exports.INHERIT_KEYS = INHERIT_KEYS;
|
||||
const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
|
||||
exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
|
||||
const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
|
||||
exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/ensureBlock.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/ensureBlock.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = ensureBlock;
|
||||
|
||||
var _toBlock = _interopRequireDefault(require("./toBlock"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ensureBlock(node, key = "body") {
|
||||
return node[key] = (0, _toBlock.default)(node[key], node);
|
||||
}
|
73
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
generated
vendored
Normal file
73
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = gatherSequenceExpressions;
|
||||
|
||||
var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBindingIdentifiers"));
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
var _generated2 = require("../builders/generated");
|
||||
|
||||
var _cloneNode = _interopRequireDefault(require("../clone/cloneNode"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function gatherSequenceExpressions(nodes, scope, declars) {
|
||||
const exprs = [];
|
||||
let ensureLastUndefined = true;
|
||||
|
||||
for (const node of nodes) {
|
||||
ensureLastUndefined = false;
|
||||
|
||||
if ((0, _generated.isExpression)(node)) {
|
||||
exprs.push(node);
|
||||
} else if ((0, _generated.isExpressionStatement)(node)) {
|
||||
exprs.push(node.expression);
|
||||
} else if ((0, _generated.isVariableDeclaration)(node)) {
|
||||
if (node.kind !== "var") return;
|
||||
|
||||
for (const declar of node.declarations) {
|
||||
const bindings = (0, _getBindingIdentifiers.default)(declar);
|
||||
|
||||
for (const key of Object.keys(bindings)) {
|
||||
declars.push({
|
||||
kind: node.kind,
|
||||
id: (0, _cloneNode.default)(bindings[key])
|
||||
});
|
||||
}
|
||||
|
||||
if (declar.init) {
|
||||
exprs.push((0, _generated2.assignmentExpression)("=", declar.id, declar.init));
|
||||
}
|
||||
}
|
||||
|
||||
ensureLastUndefined = true;
|
||||
} else if ((0, _generated.isIfStatement)(node)) {
|
||||
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
|
||||
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
|
||||
if (!consequent || !alternate) return;
|
||||
exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate));
|
||||
} else if ((0, _generated.isBlockStatement)(node)) {
|
||||
const body = gatherSequenceExpressions(node.body, scope, declars);
|
||||
if (!body) return;
|
||||
exprs.push(body);
|
||||
} else if ((0, _generated.isEmptyStatement)(node)) {
|
||||
ensureLastUndefined = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ensureLastUndefined) {
|
||||
exprs.push(scope.buildUndefinedNode());
|
||||
}
|
||||
|
||||
if (exprs.length === 1) {
|
||||
return exprs[0];
|
||||
} else {
|
||||
return (0, _generated2.sequenceExpression)(exprs);
|
||||
}
|
||||
}
|
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
generated
vendored
Normal file
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toBindingIdentifierName;
|
||||
|
||||
var _toIdentifier = _interopRequireDefault(require("./toIdentifier"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function toBindingIdentifierName(name) {
|
||||
name = (0, _toIdentifier.default)(name);
|
||||
if (name === "eval" || name === "arguments") name = "_" + name;
|
||||
return name;
|
||||
}
|
34
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toBlock.js
generated
vendored
Normal file
34
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toBlock.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toBlock;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
var _generated2 = require("../builders/generated");
|
||||
|
||||
function toBlock(node, parent) {
|
||||
if ((0, _generated.isBlockStatement)(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
let blockNodes = [];
|
||||
|
||||
if ((0, _generated.isEmptyStatement)(node)) {
|
||||
blockNodes = [];
|
||||
} else {
|
||||
if (!(0, _generated.isStatement)(node)) {
|
||||
if ((0, _generated.isFunction)(parent)) {
|
||||
node = (0, _generated2.returnStatement)(node);
|
||||
} else {
|
||||
node = (0, _generated2.expressionStatement)(node);
|
||||
}
|
||||
}
|
||||
|
||||
blockNodes = [node];
|
||||
}
|
||||
|
||||
return (0, _generated2.blockStatement)(blockNodes);
|
||||
}
|
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toComputedKey.js
generated
vendored
Normal file
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toComputedKey.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toComputedKey;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
var _generated2 = require("../builders/generated");
|
||||
|
||||
function toComputedKey(node, key = node.key || node.property) {
|
||||
if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name);
|
||||
return key;
|
||||
}
|
30
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toExpression.js
generated
vendored
Normal file
30
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toExpression.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toExpression;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
function toExpression(node) {
|
||||
if ((0, _generated.isExpressionStatement)(node)) {
|
||||
node = node.expression;
|
||||
}
|
||||
|
||||
if ((0, _generated.isExpression)(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if ((0, _generated.isClass)(node)) {
|
||||
node.type = "ClassExpression";
|
||||
} else if ((0, _generated.isFunction)(node)) {
|
||||
node.type = "FunctionExpression";
|
||||
}
|
||||
|
||||
if (!(0, _generated.isExpression)(node)) {
|
||||
throw new Error(`cannot turn ${node.type} to an expression`);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
25
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toIdentifier.js
generated
vendored
Normal file
25
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toIdentifier.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toIdentifier;
|
||||
|
||||
var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function toIdentifier(name) {
|
||||
name = name + "";
|
||||
name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
|
||||
name = name.replace(/^[-0-9]+/, "");
|
||||
name = name.replace(/[-\s]+(.)?/g, function (match, c) {
|
||||
return c ? c.toUpperCase() : "";
|
||||
});
|
||||
|
||||
if (!(0, _isValidIdentifier.default)(name)) {
|
||||
name = `_${name}`;
|
||||
}
|
||||
|
||||
return name || "_";
|
||||
}
|
48
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toKeyAlias.js
generated
vendored
Normal file
48
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toKeyAlias.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toKeyAlias;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
var _cloneNode = _interopRequireDefault(require("../clone/cloneNode"));
|
||||
|
||||
var _removePropertiesDeep = _interopRequireDefault(require("../modifications/removePropertiesDeep"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function toKeyAlias(node, key = node.key) {
|
||||
let alias;
|
||||
|
||||
if (node.kind === "method") {
|
||||
return toKeyAlias.increment() + "";
|
||||
} else if ((0, _generated.isIdentifier)(key)) {
|
||||
alias = key.name;
|
||||
} else if ((0, _generated.isStringLiteral)(key)) {
|
||||
alias = JSON.stringify(key.value);
|
||||
} else {
|
||||
alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
|
||||
}
|
||||
|
||||
if (node.computed) {
|
||||
alias = `[${alias}]`;
|
||||
}
|
||||
|
||||
if (node.static) {
|
||||
alias = `static:${alias}`;
|
||||
}
|
||||
|
||||
return alias;
|
||||
}
|
||||
|
||||
toKeyAlias.uid = 0;
|
||||
|
||||
toKeyAlias.increment = function () {
|
||||
if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
|
||||
return toKeyAlias.uid = 0;
|
||||
} else {
|
||||
return toKeyAlias.uid++;
|
||||
}
|
||||
};
|
23
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toSequenceExpression.js
generated
vendored
Normal file
23
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toSequenceExpression.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toSequenceExpression;
|
||||
|
||||
var _gatherSequenceExpressions = _interopRequireDefault(require("./gatherSequenceExpressions"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function toSequenceExpression(nodes, scope) {
|
||||
if (!nodes || !nodes.length) return;
|
||||
const declars = [];
|
||||
const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
|
||||
if (!result) return;
|
||||
|
||||
for (const declar of declars) {
|
||||
scope.push(declar);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
44
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toStatement.js
generated
vendored
Normal file
44
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/toStatement.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toStatement;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
var _generated2 = require("../builders/generated");
|
||||
|
||||
function toStatement(node, ignore) {
|
||||
if ((0, _generated.isStatement)(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
let mustHaveId = false;
|
||||
let newType;
|
||||
|
||||
if ((0, _generated.isClass)(node)) {
|
||||
mustHaveId = true;
|
||||
newType = "ClassDeclaration";
|
||||
} else if ((0, _generated.isFunction)(node)) {
|
||||
mustHaveId = true;
|
||||
newType = "FunctionDeclaration";
|
||||
} else if ((0, _generated.isAssignmentExpression)(node)) {
|
||||
return (0, _generated2.expressionStatement)(node);
|
||||
}
|
||||
|
||||
if (mustHaveId && !node.id) {
|
||||
newType = false;
|
||||
}
|
||||
|
||||
if (!newType) {
|
||||
if (ignore) {
|
||||
return false;
|
||||
} else {
|
||||
throw new Error(`cannot turn ${node.type} to a statement`);
|
||||
}
|
||||
}
|
||||
|
||||
node.type = newType;
|
||||
return node;
|
||||
}
|
104
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/valueToNode.js
generated
vendored
Normal file
104
node_modules/@babel/preset-env/node_modules/@babel/types/lib/converters/valueToNode.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = valueToNode;
|
||||
|
||||
function _isPlainObject() {
|
||||
const data = _interopRequireDefault(require("lodash/isPlainObject"));
|
||||
|
||||
_isPlainObject = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _isRegExp() {
|
||||
const data = _interopRequireDefault(require("lodash/isRegExp"));
|
||||
|
||||
_isRegExp = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier"));
|
||||
|
||||
var _generated = require("../builders/generated");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function valueToNode(value) {
|
||||
if (value === undefined) {
|
||||
return (0, _generated.identifier)("undefined");
|
||||
}
|
||||
|
||||
if (value === true || value === false) {
|
||||
return (0, _generated.booleanLiteral)(value);
|
||||
}
|
||||
|
||||
if (value === null) {
|
||||
return (0, _generated.nullLiteral)();
|
||||
}
|
||||
|
||||
if (typeof value === "string") {
|
||||
return (0, _generated.stringLiteral)(value);
|
||||
}
|
||||
|
||||
if (typeof value === "number") {
|
||||
let result;
|
||||
|
||||
if (Number.isFinite(value)) {
|
||||
result = (0, _generated.numericLiteral)(Math.abs(value));
|
||||
} else {
|
||||
let numerator;
|
||||
|
||||
if (Number.isNaN(value)) {
|
||||
numerator = (0, _generated.numericLiteral)(0);
|
||||
} else {
|
||||
numerator = (0, _generated.numericLiteral)(1);
|
||||
}
|
||||
|
||||
result = (0, _generated.binaryExpression)("/", numerator, (0, _generated.numericLiteral)(0));
|
||||
}
|
||||
|
||||
if (value < 0 || Object.is(value, -0)) {
|
||||
result = (0, _generated.unaryExpression)("-", result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((0, _isRegExp().default)(value)) {
|
||||
const pattern = value.source;
|
||||
const flags = value.toString().match(/\/([a-z]+|)$/)[1];
|
||||
return (0, _generated.regExpLiteral)(pattern, flags);
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return (0, _generated.arrayExpression)(value.map(valueToNode));
|
||||
}
|
||||
|
||||
if ((0, _isPlainObject().default)(value)) {
|
||||
const props = [];
|
||||
|
||||
for (const key of Object.keys(value)) {
|
||||
let nodeKey;
|
||||
|
||||
if ((0, _isValidIdentifier.default)(key)) {
|
||||
nodeKey = (0, _generated.identifier)(key);
|
||||
} else {
|
||||
nodeKey = (0, _generated.stringLiteral)(key);
|
||||
}
|
||||
|
||||
props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key])));
|
||||
}
|
||||
|
||||
return (0, _generated.objectExpression)(props);
|
||||
}
|
||||
|
||||
throw new Error("don't know how to turn this value into a node");
|
||||
}
|
725
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/core.js
generated
vendored
Normal file
725
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/core.js
generated
vendored
Normal file
@ -0,0 +1,725 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0;
|
||||
|
||||
var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier"));
|
||||
|
||||
var _constants = require("../constants");
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
(0, _utils.default)("ArrayExpression", {
|
||||
fields: {
|
||||
elements: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
|
||||
default: []
|
||||
}
|
||||
},
|
||||
visitor: ["elements"],
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("AssignmentExpression", {
|
||||
fields: {
|
||||
operator: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
},
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("LVal")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
},
|
||||
builder: ["operator", "left", "right"],
|
||||
visitor: ["left", "right"],
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("BinaryExpression", {
|
||||
builder: ["operator", "left", "right"],
|
||||
fields: {
|
||||
operator: {
|
||||
validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS)
|
||||
},
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
},
|
||||
visitor: ["left", "right"],
|
||||
aliases: ["Binary", "Expression"]
|
||||
});
|
||||
(0, _utils.default)("InterpreterDirective", {
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("Directive", {
|
||||
visitor: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertNodeType)("DirectiveLiteral")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DirectiveLiteral", {
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("BlockStatement", {
|
||||
builder: ["body", "directives"],
|
||||
visitor: ["directives", "body"],
|
||||
fields: {
|
||||
directives: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
|
||||
default: []
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
|
||||
}
|
||||
},
|
||||
aliases: ["Scopable", "BlockParent", "Block", "Statement"]
|
||||
});
|
||||
(0, _utils.default)("BreakStatement", {
|
||||
visitor: ["label"],
|
||||
fields: {
|
||||
label: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
}
|
||||
},
|
||||
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
|
||||
});
|
||||
(0, _utils.default)("CallExpression", {
|
||||
visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
|
||||
builder: ["callee", "arguments"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
callee: {
|
||||
validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
|
||||
},
|
||||
arguments: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertOneOf)(true, false),
|
||||
optional: true
|
||||
},
|
||||
typeArguments: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
|
||||
optional: true
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("CatchClause", {
|
||||
visitor: ["param", "body"],
|
||||
fields: {
|
||||
param: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
},
|
||||
aliases: ["Scopable", "BlockParent"]
|
||||
});
|
||||
(0, _utils.default)("ConditionalExpression", {
|
||||
visitor: ["test", "consequent", "alternate"],
|
||||
fields: {
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
consequent: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
alternate: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
},
|
||||
aliases: ["Expression", "Conditional"]
|
||||
});
|
||||
(0, _utils.default)("ContinueStatement", {
|
||||
visitor: ["label"],
|
||||
fields: {
|
||||
label: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
}
|
||||
},
|
||||
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
|
||||
});
|
||||
(0, _utils.default)("DebuggerStatement", {
|
||||
aliases: ["Statement"]
|
||||
});
|
||||
(0, _utils.default)("DoWhileStatement", {
|
||||
visitor: ["test", "body"],
|
||||
fields: {
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
}
|
||||
},
|
||||
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
|
||||
});
|
||||
(0, _utils.default)("EmptyStatement", {
|
||||
aliases: ["Statement"]
|
||||
});
|
||||
(0, _utils.default)("ExpressionStatement", {
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
},
|
||||
aliases: ["Statement", "ExpressionWrapper"]
|
||||
});
|
||||
(0, _utils.default)("File", {
|
||||
builder: ["program", "comments", "tokens"],
|
||||
visitor: ["program"],
|
||||
fields: {
|
||||
program: {
|
||||
validate: (0, _utils.assertNodeType)("Program")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ForInStatement", {
|
||||
visitor: ["left", "right", "body"],
|
||||
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
|
||||
fields: {
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ForStatement", {
|
||||
visitor: ["init", "test", "update", "body"],
|
||||
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
|
||||
fields: {
|
||||
init: {
|
||||
validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
|
||||
optional: true
|
||||
},
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
},
|
||||
update: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
}
|
||||
}
|
||||
});
|
||||
const functionCommon = {
|
||||
params: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
|
||||
},
|
||||
generator: {
|
||||
default: false,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
async: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
}
|
||||
};
|
||||
exports.functionCommon = functionCommon;
|
||||
const functionTypeAnnotationCommon = {
|
||||
returnType: {
|
||||
validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
|
||||
optional: true
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
|
||||
optional: true
|
||||
}
|
||||
};
|
||||
exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
|
||||
const functionDeclarationCommon = Object.assign({}, functionCommon, {
|
||||
declare: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
id: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
}
|
||||
});
|
||||
exports.functionDeclarationCommon = functionDeclarationCommon;
|
||||
(0, _utils.default)("FunctionDeclaration", {
|
||||
builder: ["id", "params", "body", "generator", "async"],
|
||||
visitor: ["id", "params", "body", "returnType", "typeParameters"],
|
||||
fields: Object.assign({}, functionDeclarationCommon, {}, functionTypeAnnotationCommon, {
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
}),
|
||||
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"]
|
||||
});
|
||||
(0, _utils.default)("FunctionExpression", {
|
||||
inherits: "FunctionDeclaration",
|
||||
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
|
||||
fields: Object.assign({}, functionCommon, {}, functionTypeAnnotationCommon, {
|
||||
id: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
})
|
||||
});
|
||||
const patternLikeCommon = {
|
||||
typeAnnotation: {
|
||||
validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
|
||||
optional: true
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
|
||||
}
|
||||
};
|
||||
exports.patternLikeCommon = patternLikeCommon;
|
||||
(0, _utils.default)("Identifier", {
|
||||
builder: ["name"],
|
||||
visitor: ["typeAnnotation", "decorators"],
|
||||
aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
|
||||
fields: Object.assign({}, patternLikeCommon, {
|
||||
name: {
|
||||
validate: (0, _utils.chain)(function (node, key, val) {
|
||||
if (!(0, _isValidIdentifier.default)(val)) {}
|
||||
}, (0, _utils.assertValueType)("string"))
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("IfStatement", {
|
||||
visitor: ["test", "consequent", "alternate"],
|
||||
aliases: ["Statement", "Conditional"],
|
||||
fields: {
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
consequent: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
},
|
||||
alternate: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("LabeledStatement", {
|
||||
visitor: ["label", "body"],
|
||||
aliases: ["Statement"],
|
||||
fields: {
|
||||
label: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("StringLiteral", {
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
},
|
||||
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
|
||||
});
|
||||
(0, _utils.default)("NumericLiteral", {
|
||||
builder: ["value"],
|
||||
deprecatedAlias: "NumberLiteral",
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("number")
|
||||
}
|
||||
},
|
||||
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
|
||||
});
|
||||
(0, _utils.default)("NullLiteral", {
|
||||
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
|
||||
});
|
||||
(0, _utils.default)("BooleanLiteral", {
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
}
|
||||
},
|
||||
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
|
||||
});
|
||||
(0, _utils.default)("RegExpLiteral", {
|
||||
builder: ["pattern", "flags"],
|
||||
deprecatedAlias: "RegexLiteral",
|
||||
aliases: ["Expression", "Literal"],
|
||||
fields: {
|
||||
pattern: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
},
|
||||
flags: {
|
||||
validate: (0, _utils.assertValueType)("string"),
|
||||
default: ""
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("LogicalExpression", {
|
||||
builder: ["operator", "left", "right"],
|
||||
visitor: ["left", "right"],
|
||||
aliases: ["Binary", "Expression"],
|
||||
fields: {
|
||||
operator: {
|
||||
validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS)
|
||||
},
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("MemberExpression", {
|
||||
builder: ["object", "property", "computed", "optional"],
|
||||
visitor: ["object", "property"],
|
||||
aliases: ["Expression", "LVal"],
|
||||
fields: {
|
||||
object: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
property: {
|
||||
validate: function () {
|
||||
const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
|
||||
const computed = (0, _utils.assertNodeType)("Expression");
|
||||
return function (node, key, val) {
|
||||
const validator = node.computed ? computed : normal;
|
||||
validator(node, key, val);
|
||||
};
|
||||
}()
|
||||
},
|
||||
computed: {
|
||||
default: false
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertOneOf)(true, false),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("NewExpression", {
|
||||
inherits: "CallExpression"
|
||||
});
|
||||
(0, _utils.default)("Program", {
|
||||
visitor: ["directives", "body"],
|
||||
builder: ["body", "directives", "sourceType", "interpreter"],
|
||||
fields: {
|
||||
sourceFile: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
},
|
||||
sourceType: {
|
||||
validate: (0, _utils.assertOneOf)("script", "module"),
|
||||
default: "script"
|
||||
},
|
||||
interpreter: {
|
||||
validate: (0, _utils.assertNodeType)("InterpreterDirective"),
|
||||
default: null,
|
||||
optional: true
|
||||
},
|
||||
directives: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
|
||||
default: []
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
|
||||
}
|
||||
},
|
||||
aliases: ["Scopable", "BlockParent", "Block"]
|
||||
});
|
||||
(0, _utils.default)("ObjectExpression", {
|
||||
visitor: ["properties"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
properties: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectMethod", {
|
||||
builder: ["kind", "key", "params", "body", "computed"],
|
||||
fields: Object.assign({}, functionCommon, {}, functionTypeAnnotationCommon, {
|
||||
kind: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("method", "get", "set")),
|
||||
default: "method"
|
||||
},
|
||||
computed: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
},
|
||||
key: {
|
||||
validate: function () {
|
||||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
|
||||
const computed = (0, _utils.assertNodeType)("Expression");
|
||||
return function (node, key, val) {
|
||||
const validator = node.computed ? computed : normal;
|
||||
validator(node, key, val);
|
||||
};
|
||||
}()
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
}),
|
||||
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
||||
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
|
||||
});
|
||||
(0, _utils.default)("ObjectProperty", {
|
||||
builder: ["key", "value", "computed", "shorthand", "decorators"],
|
||||
fields: {
|
||||
computed: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
},
|
||||
key: {
|
||||
validate: function () {
|
||||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
|
||||
const computed = (0, _utils.assertNodeType)("Expression");
|
||||
return function (node, key, val) {
|
||||
const validator = node.computed ? computed : normal;
|
||||
validator(node, key, val);
|
||||
};
|
||||
}()
|
||||
},
|
||||
value: {
|
||||
validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
|
||||
},
|
||||
shorthand: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
}
|
||||
},
|
||||
visitor: ["key", "value", "decorators"],
|
||||
aliases: ["UserWhitespacable", "Property", "ObjectMember"]
|
||||
});
|
||||
(0, _utils.default)("RestElement", {
|
||||
visitor: ["argument", "typeAnnotation"],
|
||||
builder: ["argument"],
|
||||
aliases: ["LVal", "PatternLike"],
|
||||
deprecatedAlias: "RestProperty",
|
||||
fields: Object.assign({}, patternLikeCommon, {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("LVal")
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ReturnStatement", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
|
||||
fields: {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("SequenceExpression", {
|
||||
visitor: ["expressions"],
|
||||
fields: {
|
||||
expressions: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
|
||||
}
|
||||
},
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("ParenthesizedExpression", {
|
||||
visitor: ["expression"],
|
||||
aliases: ["Expression", "ExpressionWrapper"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("SwitchCase", {
|
||||
visitor: ["test", "consequent"],
|
||||
fields: {
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
},
|
||||
consequent: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("SwitchStatement", {
|
||||
visitor: ["discriminant", "cases"],
|
||||
aliases: ["Statement", "BlockParent", "Scopable"],
|
||||
fields: {
|
||||
discriminant: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
cases: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ThisExpression", {
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("ThrowStatement", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
|
||||
fields: {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TryStatement", {
|
||||
visitor: ["block", "handler", "finalizer"],
|
||||
aliases: ["Statement"],
|
||||
fields: {
|
||||
block: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
},
|
||||
handler: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("CatchClause")
|
||||
},
|
||||
finalizer: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("UnaryExpression", {
|
||||
builder: ["operator", "argument", "prefix"],
|
||||
fields: {
|
||||
prefix: {
|
||||
default: true
|
||||
},
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
operator: {
|
||||
validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS)
|
||||
}
|
||||
},
|
||||
visitor: ["argument"],
|
||||
aliases: ["UnaryLike", "Expression"]
|
||||
});
|
||||
(0, _utils.default)("UpdateExpression", {
|
||||
builder: ["operator", "argument", "prefix"],
|
||||
fields: {
|
||||
prefix: {
|
||||
default: false
|
||||
},
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
operator: {
|
||||
validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS)
|
||||
}
|
||||
},
|
||||
visitor: ["argument"],
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("VariableDeclaration", {
|
||||
builder: ["kind", "declarations"],
|
||||
visitor: ["declarations"],
|
||||
aliases: ["Statement", "Declaration"],
|
||||
fields: {
|
||||
declare: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
kind: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("var", "let", "const"))
|
||||
},
|
||||
declarations: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("VariableDeclarator", {
|
||||
visitor: ["id", "init"],
|
||||
fields: {
|
||||
id: {
|
||||
validate: (0, _utils.assertNodeType)("LVal")
|
||||
},
|
||||
definite: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
init: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("WhileStatement", {
|
||||
visitor: ["test", "body"],
|
||||
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
|
||||
fields: {
|
||||
test: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement", "Statement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("WithStatement", {
|
||||
visitor: ["object", "body"],
|
||||
aliases: ["Statement"],
|
||||
fields: {
|
||||
object: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement", "Statement")
|
||||
}
|
||||
}
|
||||
});
|
401
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/es2015.js
generated
vendored
Normal file
401
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/es2015.js
generated
vendored
Normal file
@ -0,0 +1,401 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0;
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
var _core = require("./core");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
(0, _utils.default)("AssignmentPattern", {
|
||||
visitor: ["left", "right", "decorators"],
|
||||
builder: ["left", "right"],
|
||||
aliases: ["Pattern", "PatternLike", "LVal"],
|
||||
fields: Object.assign({}, _core.patternLikeCommon, {
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ArrayPattern", {
|
||||
visitor: ["elements", "typeAnnotation"],
|
||||
builder: ["elements"],
|
||||
aliases: ["Pattern", "PatternLike", "LVal"],
|
||||
fields: Object.assign({}, _core.patternLikeCommon, {
|
||||
elements: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("PatternLike")))
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ArrowFunctionExpression", {
|
||||
builder: ["params", "body", "async"],
|
||||
visitor: ["params", "body", "returnType", "typeParameters"],
|
||||
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
|
||||
fields: Object.assign({}, _core.functionCommon, {}, _core.functionTypeAnnotationCommon, {
|
||||
expression: {
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ClassBody", {
|
||||
visitor: ["body"],
|
||||
fields: {
|
||||
body: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
|
||||
}
|
||||
}
|
||||
});
|
||||
const classCommon = {
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
|
||||
optional: true
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("ClassBody")
|
||||
},
|
||||
superClass: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
superTypeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
||||
optional: true
|
||||
},
|
||||
implements: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
|
||||
optional: true
|
||||
}
|
||||
};
|
||||
(0, _utils.default)("ClassDeclaration", {
|
||||
builder: ["id", "superClass", "body", "decorators"],
|
||||
visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
|
||||
aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
|
||||
fields: Object.assign({}, classCommon, {
|
||||
declare: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
abstract: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
id: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier"),
|
||||
optional: true
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ClassExpression", {
|
||||
inherits: "ClassDeclaration",
|
||||
aliases: ["Scopable", "Class", "Expression", "Pureish"],
|
||||
fields: Object.assign({}, classCommon, {
|
||||
id: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("ClassBody")
|
||||
},
|
||||
superClass: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ExportAllDeclaration", {
|
||||
visitor: ["source"],
|
||||
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
||||
fields: {
|
||||
source: {
|
||||
validate: (0, _utils.assertNodeType)("StringLiteral")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExportDefaultDeclaration", {
|
||||
visitor: ["declaration"],
|
||||
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
||||
fields: {
|
||||
declaration: {
|
||||
validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExportNamedDeclaration", {
|
||||
visitor: ["declaration", "specifiers", "source"],
|
||||
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
||||
fields: {
|
||||
declaration: {
|
||||
validate: (0, _utils.assertNodeType)("Declaration"),
|
||||
optional: true
|
||||
},
|
||||
specifiers: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier")))
|
||||
},
|
||||
source: {
|
||||
validate: (0, _utils.assertNodeType)("StringLiteral"),
|
||||
optional: true
|
||||
},
|
||||
exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExportSpecifier", {
|
||||
visitor: ["local", "exported"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
local: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
exported: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ForOfStatement", {
|
||||
visitor: ["left", "right", "body"],
|
||||
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
|
||||
fields: {
|
||||
left: {
|
||||
validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal")
|
||||
},
|
||||
right: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("Statement")
|
||||
},
|
||||
await: {
|
||||
default: false,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ImportDeclaration", {
|
||||
visitor: ["specifiers", "source"],
|
||||
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
|
||||
fields: {
|
||||
specifiers: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
|
||||
},
|
||||
source: {
|
||||
validate: (0, _utils.assertNodeType)("StringLiteral")
|
||||
},
|
||||
importKind: {
|
||||
validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ImportDefaultSpecifier", {
|
||||
visitor: ["local"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
local: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ImportNamespaceSpecifier", {
|
||||
visitor: ["local"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
local: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ImportSpecifier", {
|
||||
visitor: ["local", "imported"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
local: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
imported: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
importKind: {
|
||||
validate: (0, _utils.assertOneOf)("type", "typeof"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("MetaProperty", {
|
||||
visitor: ["meta", "property"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
meta: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
property: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
const classMethodOrPropertyCommon = {
|
||||
abstract: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
accessibility: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
|
||||
optional: true
|
||||
},
|
||||
static: {
|
||||
default: false,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
computed: {
|
||||
default: false,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
key: {
|
||||
validate: (0, _utils.chain)(function () {
|
||||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
|
||||
const computed = (0, _utils.assertNodeType)("Expression");
|
||||
return function (node, key, val) {
|
||||
const validator = node.computed ? computed : normal;
|
||||
validator(node, key, val);
|
||||
};
|
||||
}(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
|
||||
}
|
||||
};
|
||||
exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
|
||||
const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, {}, classMethodOrPropertyCommon, {
|
||||
kind: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("get", "set", "method", "constructor")),
|
||||
default: "method"
|
||||
},
|
||||
access: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
|
||||
optional: true
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
}
|
||||
});
|
||||
exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
|
||||
(0, _utils.default)("ClassMethod", {
|
||||
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
|
||||
builder: ["kind", "key", "params", "body", "computed", "static"],
|
||||
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
||||
fields: Object.assign({}, classMethodOrDeclareMethodCommon, {}, _core.functionTypeAnnotationCommon, {
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("ObjectPattern", {
|
||||
visitor: ["properties", "typeAnnotation", "decorators"],
|
||||
builder: ["properties"],
|
||||
aliases: ["Pattern", "PatternLike", "LVal"],
|
||||
fields: Object.assign({}, _core.patternLikeCommon, {
|
||||
properties: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("SpreadElement", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["UnaryLike"],
|
||||
deprecatedAlias: "SpreadProperty",
|
||||
fields: {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("Super", {
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("TaggedTemplateExpression", {
|
||||
visitor: ["tag", "quasi"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
tag: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
quasi: {
|
||||
validate: (0, _utils.assertNodeType)("TemplateLiteral")
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TemplateElement", {
|
||||
builder: ["value", "tail"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertShape)({
|
||||
raw: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
},
|
||||
cooked: {
|
||||
validate: (0, _utils.assertValueType)("string"),
|
||||
optional: true
|
||||
}
|
||||
})
|
||||
},
|
||||
tail: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TemplateLiteral", {
|
||||
visitor: ["quasis", "expressions"],
|
||||
aliases: ["Expression", "Literal"],
|
||||
fields: {
|
||||
quasis: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
|
||||
},
|
||||
expressions: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("YieldExpression", {
|
||||
builder: ["argument", "delegate"],
|
||||
visitor: ["argument"],
|
||||
aliases: ["Expression", "Terminatorless"],
|
||||
fields: {
|
||||
delegate: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
},
|
||||
argument: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
209
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/experimental.js
generated
vendored
Normal file
209
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/experimental.js
generated
vendored
Normal file
@ -0,0 +1,209 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
var _es = require("./es2015");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
(0, _utils.default)("ArgumentPlaceholder", {});
|
||||
(0, _utils.default)("AwaitExpression", {
|
||||
builder: ["argument"],
|
||||
visitor: ["argument"],
|
||||
aliases: ["Expression", "Terminatorless"],
|
||||
fields: {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("BindExpression", {
|
||||
visitor: ["object", "callee"],
|
||||
aliases: ["Expression"],
|
||||
fields: {}
|
||||
});
|
||||
(0, _utils.default)("ClassProperty", {
|
||||
visitor: ["key", "value", "typeAnnotation", "decorators"],
|
||||
builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
|
||||
aliases: ["Property"],
|
||||
fields: Object.assign({}, _es.classMethodOrPropertyCommon, {
|
||||
value: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
},
|
||||
definite: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
typeAnnotation: {
|
||||
validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
|
||||
optional: true
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
},
|
||||
readonly: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("OptionalMemberExpression", {
|
||||
builder: ["object", "property", "computed", "optional"],
|
||||
visitor: ["object", "property"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
object: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
property: {
|
||||
validate: function () {
|
||||
const normal = (0, _utils.assertNodeType)("Identifier");
|
||||
const computed = (0, _utils.assertNodeType)("Expression");
|
||||
return function (node, key, val) {
|
||||
const validator = node.computed ? computed : normal;
|
||||
validator(node, key, val);
|
||||
};
|
||||
}()
|
||||
},
|
||||
computed: {
|
||||
default: false
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("PipelineTopicExpression", {
|
||||
builder: ["expression"],
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("PipelineBareFunction", {
|
||||
builder: ["callee"],
|
||||
visitor: ["callee"],
|
||||
fields: {
|
||||
callee: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("PipelinePrimaryTopicReference", {
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("OptionalCallExpression", {
|
||||
visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
|
||||
builder: ["callee", "arguments", "optional"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
callee: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
},
|
||||
arguments: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName")))
|
||||
},
|
||||
optional: {
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
typeArguments: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
|
||||
optional: true
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ClassPrivateProperty", {
|
||||
visitor: ["key", "value", "decorators"],
|
||||
builder: ["key", "value", "decorators"],
|
||||
aliases: ["Property", "Private"],
|
||||
fields: {
|
||||
key: {
|
||||
validate: (0, _utils.assertNodeType)("PrivateName")
|
||||
},
|
||||
value: {
|
||||
validate: (0, _utils.assertNodeType)("Expression"),
|
||||
optional: true
|
||||
},
|
||||
decorators: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ClassPrivateMethod", {
|
||||
builder: ["kind", "key", "params", "body", "static"],
|
||||
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
||||
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
|
||||
fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, {
|
||||
key: {
|
||||
validate: (0, _utils.assertNodeType)("PrivateName")
|
||||
},
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("Import", {
|
||||
aliases: ["Expression"]
|
||||
});
|
||||
(0, _utils.default)("Decorator", {
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DoExpression", {
|
||||
visitor: ["body"],
|
||||
aliases: ["Expression"],
|
||||
fields: {
|
||||
body: {
|
||||
validate: (0, _utils.assertNodeType)("BlockStatement")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExportDefaultSpecifier", {
|
||||
visitor: ["exported"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
exported: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExportNamespaceSpecifier", {
|
||||
visitor: ["exported"],
|
||||
aliases: ["ModuleSpecifier"],
|
||||
fields: {
|
||||
exported: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("PrivateName", {
|
||||
visitor: ["id"],
|
||||
aliases: ["Private"],
|
||||
fields: {
|
||||
id: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("BigIntLiteral", {
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
},
|
||||
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
|
||||
});
|
386
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/flow.js
generated
vendored
Normal file
386
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/flow.js
generated
vendored
Normal file
@ -0,0 +1,386 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
|
||||
(0, _utils.default)(name, {
|
||||
builder: ["id", "typeParameters", "extends", "body"],
|
||||
visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)(typeParameterType),
|
||||
extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
|
||||
mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
|
||||
implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")),
|
||||
body: (0, _utils.validateType)("ObjectTypeAnnotation")
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
(0, _utils.default)("AnyTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("ArrayTypeAnnotation", {
|
||||
visitor: ["elementType"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
elementType: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("BooleanTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("BooleanLiteralTypeAnnotation", {
|
||||
builder: ["value"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("NullLiteralTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("ClassImplements", {
|
||||
visitor: ["id", "typeParameters"],
|
||||
aliases: ["Flow"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
defineInterfaceishType("DeclareClass");
|
||||
(0, _utils.default)("DeclareFunction", {
|
||||
visitor: ["id"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
|
||||
}
|
||||
});
|
||||
defineInterfaceishType("DeclareInterface");
|
||||
(0, _utils.default)("DeclareModule", {
|
||||
builder: ["id", "body", "kind"],
|
||||
visitor: ["id", "body"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
|
||||
body: (0, _utils.validateType)("BlockStatement"),
|
||||
kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareModuleExports", {
|
||||
visitor: ["typeAnnotation"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareTypeAlias", {
|
||||
visitor: ["id", "typeParameters", "right"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
|
||||
right: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareOpaqueType", {
|
||||
visitor: ["id", "typeParameters", "supertype"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
|
||||
supertype: (0, _utils.validateOptionalType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareVariable", {
|
||||
visitor: ["id"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareExportDeclaration", {
|
||||
visitor: ["declaration", "specifiers", "source"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
declaration: (0, _utils.validateOptionalType)("Flow"),
|
||||
specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
|
||||
source: (0, _utils.validateOptionalType)("StringLiteral"),
|
||||
default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclareExportAllDeclaration", {
|
||||
visitor: ["source"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
source: (0, _utils.validateType)("StringLiteral"),
|
||||
exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("DeclaredPredicate", {
|
||||
visitor: ["value"],
|
||||
aliases: ["Flow", "FlowPredicate"],
|
||||
fields: {
|
||||
value: (0, _utils.validateType)("Flow")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ExistsTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType"]
|
||||
});
|
||||
(0, _utils.default)("FunctionTypeAnnotation", {
|
||||
visitor: ["typeParameters", "params", "rest", "returnType"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
|
||||
params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")),
|
||||
rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
|
||||
returnType: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("FunctionTypeParam", {
|
||||
visitor: ["name", "typeAnnotation"],
|
||||
aliases: ["Flow"],
|
||||
fields: {
|
||||
name: (0, _utils.validateOptionalType)("Identifier"),
|
||||
typeAnnotation: (0, _utils.validateType)("FlowType"),
|
||||
optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("GenericTypeAnnotation", {
|
||||
visitor: ["id", "typeParameters"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("InferredPredicate", {
|
||||
aliases: ["Flow", "FlowPredicate"]
|
||||
});
|
||||
(0, _utils.default)("InterfaceExtends", {
|
||||
visitor: ["id", "typeParameters"],
|
||||
aliases: ["Flow"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
defineInterfaceishType("InterfaceDeclaration");
|
||||
(0, _utils.default)("InterfaceTypeAnnotation", {
|
||||
visitor: ["extends", "body"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
|
||||
body: (0, _utils.validateType)("ObjectTypeAnnotation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("IntersectionTypeAnnotation", {
|
||||
visitor: ["types"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("MixedTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("EmptyTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("NullableTypeAnnotation", {
|
||||
visitor: ["typeAnnotation"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("NumberLiteralTypeAnnotation", {
|
||||
builder: ["value"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("NumberTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeAnnotation", {
|
||||
visitor: ["properties", "indexers", "callProperties", "internalSlots"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
|
||||
fields: {
|
||||
properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
|
||||
indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")),
|
||||
callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")),
|
||||
internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")),
|
||||
exact: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
default: false
|
||||
},
|
||||
inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeInternalSlot", {
|
||||
visitor: ["id", "value", "optional", "static", "method"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
value: (0, _utils.validateType)("FlowType"),
|
||||
optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeCallProperty", {
|
||||
visitor: ["value"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
value: (0, _utils.validateType)("FlowType"),
|
||||
static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeIndexer", {
|
||||
visitor: ["id", "key", "value", "variance"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
id: (0, _utils.validateOptionalType)("Identifier"),
|
||||
key: (0, _utils.validateType)("FlowType"),
|
||||
value: (0, _utils.validateType)("FlowType"),
|
||||
static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
variance: (0, _utils.validateOptionalType)("Variance")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeProperty", {
|
||||
visitor: ["key", "value", "variance"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
key: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
|
||||
value: (0, _utils.validateType)("FlowType"),
|
||||
kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
|
||||
static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
|
||||
variance: (0, _utils.validateOptionalType)("Variance")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("ObjectTypeSpreadProperty", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
argument: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("OpaqueType", {
|
||||
visitor: ["id", "typeParameters", "supertype", "impltype"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
|
||||
supertype: (0, _utils.validateOptionalType)("FlowType"),
|
||||
impltype: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("QualifiedTypeIdentifier", {
|
||||
visitor: ["id", "qualification"],
|
||||
aliases: ["Flow"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"])
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("StringLiteralTypeAnnotation", {
|
||||
builder: ["value"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("StringTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("ThisTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
||||
(0, _utils.default)("TupleTypeAnnotation", {
|
||||
visitor: ["types"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeofTypeAnnotation", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
argument: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeAlias", {
|
||||
visitor: ["id", "typeParameters", "right"],
|
||||
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
|
||||
right: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeAnnotation", {
|
||||
aliases: ["Flow"],
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("FlowType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeCastExpression", {
|
||||
visitor: ["expression", "typeAnnotation"],
|
||||
aliases: ["Flow", "ExpressionWrapper", "Expression"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("Expression"),
|
||||
typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeParameter", {
|
||||
aliases: ["Flow"],
|
||||
visitor: ["bound", "default", "variance"],
|
||||
fields: {
|
||||
name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
|
||||
bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
|
||||
default: (0, _utils.validateOptionalType)("FlowType"),
|
||||
variance: (0, _utils.validateOptionalType)("Variance")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeParameterDeclaration", {
|
||||
aliases: ["Flow"],
|
||||
visitor: ["params"],
|
||||
fields: {
|
||||
params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TypeParameterInstantiation", {
|
||||
aliases: ["Flow"],
|
||||
visitor: ["params"],
|
||||
fields: {
|
||||
params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("UnionTypeAnnotation", {
|
||||
visitor: ["types"],
|
||||
aliases: ["Flow", "FlowType"],
|
||||
fields: {
|
||||
types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("Variance", {
|
||||
aliases: ["Flow"],
|
||||
builder: ["kind"],
|
||||
fields: {
|
||||
kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("VoidTypeAnnotation", {
|
||||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
|
||||
});
|
101
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/index.js
generated
vendored
Normal file
101
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/index.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "VISITOR_KEYS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.VISITOR_KEYS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "ALIAS_KEYS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.ALIAS_KEYS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.FLIPPED_ALIAS_KEYS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "NODE_FIELDS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.NODE_FIELDS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "BUILDER_KEYS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.BUILDER_KEYS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "DEPRECATED_KEYS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils.DEPRECATED_KEYS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "PLACEHOLDERS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _placeholders.PLACEHOLDERS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _placeholders.PLACEHOLDERS_ALIAS;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
|
||||
}
|
||||
});
|
||||
exports.TYPES = void 0;
|
||||
|
||||
function _toFastProperties() {
|
||||
const data = _interopRequireDefault(require("to-fast-properties"));
|
||||
|
||||
_toFastProperties = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
require("./core");
|
||||
|
||||
require("./es2015");
|
||||
|
||||
require("./flow");
|
||||
|
||||
require("./jsx");
|
||||
|
||||
require("./misc");
|
||||
|
||||
require("./experimental");
|
||||
|
||||
require("./typescript");
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
var _placeholders = require("./placeholders");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
(0, _toFastProperties().default)(_utils.VISITOR_KEYS);
|
||||
(0, _toFastProperties().default)(_utils.ALIAS_KEYS);
|
||||
(0, _toFastProperties().default)(_utils.FLIPPED_ALIAS_KEYS);
|
||||
(0, _toFastProperties().default)(_utils.NODE_FIELDS);
|
||||
(0, _toFastProperties().default)(_utils.BUILDER_KEYS);
|
||||
(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS);
|
||||
(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_ALIAS);
|
||||
(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);
|
||||
const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
|
||||
exports.TYPES = TYPES;
|
160
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/jsx.js
generated
vendored
Normal file
160
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/jsx.js
generated
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
(0, _utils.default)("JSXAttribute", {
|
||||
visitor: ["name", "value"],
|
||||
aliases: ["JSX", "Immutable"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
|
||||
},
|
||||
value: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXClosingElement", {
|
||||
visitor: ["name"],
|
||||
aliases: ["JSX", "Immutable"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXElement", {
|
||||
builder: ["openingElement", "closingElement", "children", "selfClosing"],
|
||||
visitor: ["openingElement", "children", "closingElement"],
|
||||
aliases: ["JSX", "Immutable", "Expression"],
|
||||
fields: {
|
||||
openingElement: {
|
||||
validate: (0, _utils.assertNodeType)("JSXOpeningElement")
|
||||
},
|
||||
closingElement: {
|
||||
optional: true,
|
||||
validate: (0, _utils.assertNodeType)("JSXClosingElement")
|
||||
},
|
||||
children: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXEmptyExpression", {
|
||||
aliases: ["JSX"]
|
||||
});
|
||||
(0, _utils.default)("JSXExpressionContainer", {
|
||||
visitor: ["expression"],
|
||||
aliases: ["JSX", "Immutable"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXSpreadChild", {
|
||||
visitor: ["expression"],
|
||||
aliases: ["JSX", "Immutable"],
|
||||
fields: {
|
||||
expression: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXIdentifier", {
|
||||
builder: ["name"],
|
||||
aliases: ["JSX"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXMemberExpression", {
|
||||
visitor: ["object", "property"],
|
||||
aliases: ["JSX"],
|
||||
fields: {
|
||||
object: {
|
||||
validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
|
||||
},
|
||||
property: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXNamespacedName", {
|
||||
visitor: ["namespace", "name"],
|
||||
aliases: ["JSX"],
|
||||
fields: {
|
||||
namespace: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier")
|
||||
},
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXOpeningElement", {
|
||||
builder: ["name", "attributes", "selfClosing"],
|
||||
visitor: ["name", "attributes"],
|
||||
aliases: ["JSX", "Immutable"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
|
||||
},
|
||||
selfClosing: {
|
||||
default: false,
|
||||
validate: (0, _utils.assertValueType)("boolean")
|
||||
},
|
||||
attributes: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXSpreadAttribute", {
|
||||
visitor: ["argument"],
|
||||
aliases: ["JSX"],
|
||||
fields: {
|
||||
argument: {
|
||||
validate: (0, _utils.assertNodeType)("Expression")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXText", {
|
||||
aliases: ["JSX", "Immutable"],
|
||||
builder: ["value"],
|
||||
fields: {
|
||||
value: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXFragment", {
|
||||
builder: ["openingFragment", "closingFragment", "children"],
|
||||
visitor: ["openingFragment", "children", "closingFragment"],
|
||||
aliases: ["JSX", "Immutable", "Expression"],
|
||||
fields: {
|
||||
openingFragment: {
|
||||
validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
|
||||
},
|
||||
closingFragment: {
|
||||
validate: (0, _utils.assertNodeType)("JSXClosingFragment")
|
||||
},
|
||||
children: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("JSXOpeningFragment", {
|
||||
aliases: ["JSX", "Immutable"]
|
||||
});
|
||||
(0, _utils.default)("JSXClosingFragment", {
|
||||
aliases: ["JSX", "Immutable"]
|
||||
});
|
31
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/misc.js
generated
vendored
Normal file
31
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/misc.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
var _placeholders = require("./placeholders");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
(0, _utils.default)("Noop", {
|
||||
visitor: []
|
||||
});
|
||||
(0, _utils.default)("Placeholder", {
|
||||
visitor: [],
|
||||
builder: ["expectedNode", "name"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
expectedNode: {
|
||||
validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("V8IntrinsicIdentifier", {
|
||||
builder: ["name"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/placeholders.js
generated
vendored
Normal file
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/placeholders.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0;
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
|
||||
exports.PLACEHOLDERS = PLACEHOLDERS;
|
||||
const PLACEHOLDERS_ALIAS = {
|
||||
Declaration: ["Statement"],
|
||||
Pattern: ["PatternLike", "LVal"]
|
||||
};
|
||||
exports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
|
||||
|
||||
for (const type of PLACEHOLDERS) {
|
||||
const alias = _utils.ALIAS_KEYS[type];
|
||||
if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
|
||||
}
|
||||
|
||||
const PLACEHOLDERS_FLIPPED_ALIAS = {};
|
||||
exports.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
|
||||
Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
|
||||
PLACEHOLDERS_ALIAS[type].forEach(alias => {
|
||||
if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
|
||||
PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
|
||||
}
|
||||
|
||||
PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
|
||||
});
|
||||
});
|
413
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/typescript.js
generated
vendored
Normal file
413
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/typescript.js
generated
vendored
Normal file
@ -0,0 +1,413 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
var _core = require("./core");
|
||||
|
||||
var _es = require("./es2015");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
const bool = (0, _utils.assertValueType)("boolean");
|
||||
const tSFunctionTypeAnnotationCommon = {
|
||||
returnType: {
|
||||
validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
|
||||
optional: true
|
||||
},
|
||||
typeParameters: {
|
||||
validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
|
||||
optional: true
|
||||
}
|
||||
};
|
||||
(0, _utils.default)("TSParameterProperty", {
|
||||
aliases: ["LVal"],
|
||||
visitor: ["parameter"],
|
||||
fields: {
|
||||
accessibility: {
|
||||
validate: (0, _utils.assertOneOf)("public", "private", "protected"),
|
||||
optional: true
|
||||
},
|
||||
readonly: {
|
||||
validate: (0, _utils.assertValueType)("boolean"),
|
||||
optional: true
|
||||
},
|
||||
parameter: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSDeclareFunction", {
|
||||
aliases: ["Statement", "Declaration"],
|
||||
visitor: ["id", "typeParameters", "params", "returnType"],
|
||||
fields: Object.assign({}, _core.functionDeclarationCommon, {}, tSFunctionTypeAnnotationCommon)
|
||||
});
|
||||
(0, _utils.default)("TSDeclareMethod", {
|
||||
visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
|
||||
fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, {}, tSFunctionTypeAnnotationCommon)
|
||||
});
|
||||
(0, _utils.default)("TSQualifiedName", {
|
||||
aliases: ["TSEntityName"],
|
||||
visitor: ["left", "right"],
|
||||
fields: {
|
||||
left: (0, _utils.validateType)("TSEntityName"),
|
||||
right: (0, _utils.validateType)("Identifier")
|
||||
}
|
||||
});
|
||||
const signatureDeclarationCommon = {
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
|
||||
parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
|
||||
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
|
||||
};
|
||||
const callConstructSignatureDeclaration = {
|
||||
aliases: ["TSTypeElement"],
|
||||
visitor: ["typeParameters", "parameters", "typeAnnotation"],
|
||||
fields: signatureDeclarationCommon
|
||||
};
|
||||
(0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
|
||||
(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
|
||||
const namedTypeElementCommon = {
|
||||
key: (0, _utils.validateType)("Expression"),
|
||||
computed: (0, _utils.validate)(bool),
|
||||
optional: (0, _utils.validateOptional)(bool)
|
||||
};
|
||||
(0, _utils.default)("TSPropertySignature", {
|
||||
aliases: ["TSTypeElement"],
|
||||
visitor: ["key", "typeAnnotation", "initializer"],
|
||||
fields: Object.assign({}, namedTypeElementCommon, {
|
||||
readonly: (0, _utils.validateOptional)(bool),
|
||||
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
|
||||
initializer: (0, _utils.validateOptionalType)("Expression")
|
||||
})
|
||||
});
|
||||
(0, _utils.default)("TSMethodSignature", {
|
||||
aliases: ["TSTypeElement"],
|
||||
visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
|
||||
fields: Object.assign({}, signatureDeclarationCommon, {}, namedTypeElementCommon)
|
||||
});
|
||||
(0, _utils.default)("TSIndexSignature", {
|
||||
aliases: ["TSTypeElement"],
|
||||
visitor: ["parameters", "typeAnnotation"],
|
||||
fields: {
|
||||
readonly: (0, _utils.validateOptional)(bool),
|
||||
parameters: (0, _utils.validateArrayOfType)("Identifier"),
|
||||
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
|
||||
}
|
||||
});
|
||||
const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
|
||||
|
||||
for (const type of tsKeywordTypes) {
|
||||
(0, _utils.default)(type, {
|
||||
aliases: ["TSType"],
|
||||
visitor: [],
|
||||
fields: {}
|
||||
});
|
||||
}
|
||||
|
||||
(0, _utils.default)("TSThisType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: [],
|
||||
fields: {}
|
||||
});
|
||||
const fnOrCtr = {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeParameters", "parameters", "typeAnnotation"],
|
||||
fields: signatureDeclarationCommon
|
||||
};
|
||||
(0, _utils.default)("TSFunctionType", fnOrCtr);
|
||||
(0, _utils.default)("TSConstructorType", fnOrCtr);
|
||||
(0, _utils.default)("TSTypeReference", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeName", "typeParameters"],
|
||||
fields: {
|
||||
typeName: (0, _utils.validateType)("TSEntityName"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypePredicate", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["parameterName", "typeAnnotation"],
|
||||
fields: {
|
||||
parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
|
||||
typeAnnotation: (0, _utils.validateType)("TSTypeAnnotation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeQuery", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["exprName"],
|
||||
fields: {
|
||||
exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeLiteral", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["members"],
|
||||
fields: {
|
||||
members: (0, _utils.validateArrayOfType)("TSTypeElement")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSArrayType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["elementType"],
|
||||
fields: {
|
||||
elementType: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTupleType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["elementTypes"],
|
||||
fields: {
|
||||
elementTypes: (0, _utils.validateArrayOfType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSOptionalType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSRestType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
const unionOrIntersection = {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["types"],
|
||||
fields: {
|
||||
types: (0, _utils.validateArrayOfType)("TSType")
|
||||
}
|
||||
};
|
||||
(0, _utils.default)("TSUnionType", unionOrIntersection);
|
||||
(0, _utils.default)("TSIntersectionType", unionOrIntersection);
|
||||
(0, _utils.default)("TSConditionalType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["checkType", "extendsType", "trueType", "falseType"],
|
||||
fields: {
|
||||
checkType: (0, _utils.validateType)("TSType"),
|
||||
extendsType: (0, _utils.validateType)("TSType"),
|
||||
trueType: (0, _utils.validateType)("TSType"),
|
||||
falseType: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSInferType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeParameter"],
|
||||
fields: {
|
||||
typeParameter: (0, _utils.validateType)("TSTypeParameter")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSParenthesizedType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeOperator", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSIndexedAccessType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["objectType", "indexType"],
|
||||
fields: {
|
||||
objectType: (0, _utils.validateType)("TSType"),
|
||||
indexType: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSMappedType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["typeParameter", "typeAnnotation"],
|
||||
fields: {
|
||||
readonly: (0, _utils.validateOptional)(bool),
|
||||
typeParameter: (0, _utils.validateType)("TSTypeParameter"),
|
||||
optional: (0, _utils.validateOptional)(bool),
|
||||
typeAnnotation: (0, _utils.validateOptionalType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSLiteralType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["literal"],
|
||||
fields: {
|
||||
literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral"])
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSExpressionWithTypeArguments", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["expression", "typeParameters"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("TSEntityName"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSInterfaceDeclaration", {
|
||||
aliases: ["Statement", "Declaration"],
|
||||
visitor: ["id", "typeParameters", "extends", "body"],
|
||||
fields: {
|
||||
declare: (0, _utils.validateOptional)(bool),
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
|
||||
extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
|
||||
body: (0, _utils.validateType)("TSInterfaceBody")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSInterfaceBody", {
|
||||
visitor: ["body"],
|
||||
fields: {
|
||||
body: (0, _utils.validateArrayOfType)("TSTypeElement")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeAliasDeclaration", {
|
||||
aliases: ["Statement", "Declaration"],
|
||||
visitor: ["id", "typeParameters", "typeAnnotation"],
|
||||
fields: {
|
||||
declare: (0, _utils.validateOptional)(bool),
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSAsExpression", {
|
||||
aliases: ["Expression"],
|
||||
visitor: ["expression", "typeAnnotation"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("Expression"),
|
||||
typeAnnotation: (0, _utils.validateType)("TSType")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeAssertion", {
|
||||
aliases: ["Expression"],
|
||||
visitor: ["typeAnnotation", "expression"],
|
||||
fields: {
|
||||
typeAnnotation: (0, _utils.validateType)("TSType"),
|
||||
expression: (0, _utils.validateType)("Expression")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSEnumDeclaration", {
|
||||
aliases: ["Statement", "Declaration"],
|
||||
visitor: ["id", "members"],
|
||||
fields: {
|
||||
declare: (0, _utils.validateOptional)(bool),
|
||||
const: (0, _utils.validateOptional)(bool),
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
members: (0, _utils.validateArrayOfType)("TSEnumMember"),
|
||||
initializer: (0, _utils.validateOptionalType)("Expression")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSEnumMember", {
|
||||
visitor: ["id", "initializer"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
|
||||
initializer: (0, _utils.validateOptionalType)("Expression")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSModuleDeclaration", {
|
||||
aliases: ["Statement", "Declaration"],
|
||||
visitor: ["id", "body"],
|
||||
fields: {
|
||||
declare: (0, _utils.validateOptional)(bool),
|
||||
global: (0, _utils.validateOptional)(bool),
|
||||
id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
|
||||
body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSModuleBlock", {
|
||||
aliases: ["Scopable", "Block", "BlockParent"],
|
||||
visitor: ["body"],
|
||||
fields: {
|
||||
body: (0, _utils.validateArrayOfType)("Statement")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSImportType", {
|
||||
aliases: ["TSType"],
|
||||
visitor: ["argument", "qualifier", "typeParameters"],
|
||||
fields: {
|
||||
argument: (0, _utils.validateType)("StringLiteral"),
|
||||
qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
|
||||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSImportEqualsDeclaration", {
|
||||
aliases: ["Statement"],
|
||||
visitor: ["id", "moduleReference"],
|
||||
fields: {
|
||||
isExport: (0, _utils.validate)(bool),
|
||||
id: (0, _utils.validateType)("Identifier"),
|
||||
moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"])
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSExternalModuleReference", {
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("StringLiteral")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSNonNullExpression", {
|
||||
aliases: ["Expression"],
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("Expression")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSExportAssignment", {
|
||||
aliases: ["Statement"],
|
||||
visitor: ["expression"],
|
||||
fields: {
|
||||
expression: (0, _utils.validateType)("Expression")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSNamespaceExportDeclaration", {
|
||||
aliases: ["Statement"],
|
||||
visitor: ["id"],
|
||||
fields: {
|
||||
id: (0, _utils.validateType)("Identifier")
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeAnnotation", {
|
||||
visitor: ["typeAnnotation"],
|
||||
fields: {
|
||||
typeAnnotation: {
|
||||
validate: (0, _utils.assertNodeType)("TSType")
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeParameterInstantiation", {
|
||||
visitor: ["params"],
|
||||
fields: {
|
||||
params: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeParameterDeclaration", {
|
||||
visitor: ["params"],
|
||||
fields: {
|
||||
params: {
|
||||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _utils.default)("TSTypeParameter", {
|
||||
builder: ["constraint", "default", "name"],
|
||||
visitor: ["constraint", "default"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
},
|
||||
constraint: {
|
||||
validate: (0, _utils.assertNodeType)("TSType"),
|
||||
optional: true
|
||||
},
|
||||
default: {
|
||||
validate: (0, _utils.assertNodeType)("TSType"),
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
});
|
249
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/utils.js
generated
vendored
Normal file
249
node_modules/@babel/preset-env/node_modules/@babel/types/lib/definitions/utils.js
generated
vendored
Normal file
@ -0,0 +1,249 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.typeIs = typeIs;
|
||||
exports.validateType = validateType;
|
||||
exports.validateOptional = validateOptional;
|
||||
exports.validateOptionalType = validateOptionalType;
|
||||
exports.arrayOf = arrayOf;
|
||||
exports.arrayOfType = arrayOfType;
|
||||
exports.validateArrayOfType = validateArrayOfType;
|
||||
exports.assertEach = assertEach;
|
||||
exports.assertOneOf = assertOneOf;
|
||||
exports.assertNodeType = assertNodeType;
|
||||
exports.assertNodeOrValueType = assertNodeOrValueType;
|
||||
exports.assertValueType = assertValueType;
|
||||
exports.assertShape = assertShape;
|
||||
exports.chain = chain;
|
||||
exports.default = defineType;
|
||||
exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0;
|
||||
|
||||
var _is = _interopRequireDefault(require("../validators/is"));
|
||||
|
||||
var _validate = require("../validators/validate");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const VISITOR_KEYS = {};
|
||||
exports.VISITOR_KEYS = VISITOR_KEYS;
|
||||
const ALIAS_KEYS = {};
|
||||
exports.ALIAS_KEYS = ALIAS_KEYS;
|
||||
const FLIPPED_ALIAS_KEYS = {};
|
||||
exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
|
||||
const NODE_FIELDS = {};
|
||||
exports.NODE_FIELDS = NODE_FIELDS;
|
||||
const BUILDER_KEYS = {};
|
||||
exports.BUILDER_KEYS = BUILDER_KEYS;
|
||||
const DEPRECATED_KEYS = {};
|
||||
exports.DEPRECATED_KEYS = DEPRECATED_KEYS;
|
||||
|
||||
function getType(val) {
|
||||
if (Array.isArray(val)) {
|
||||
return "array";
|
||||
} else if (val === null) {
|
||||
return "null";
|
||||
} else if (val === undefined) {
|
||||
return "undefined";
|
||||
} else {
|
||||
return typeof val;
|
||||
}
|
||||
}
|
||||
|
||||
function validate(validate) {
|
||||
return {
|
||||
validate
|
||||
};
|
||||
}
|
||||
|
||||
function typeIs(typeName) {
|
||||
return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
|
||||
}
|
||||
|
||||
function validateType(typeName) {
|
||||
return validate(typeIs(typeName));
|
||||
}
|
||||
|
||||
function validateOptional(validate) {
|
||||
return {
|
||||
validate,
|
||||
optional: true
|
||||
};
|
||||
}
|
||||
|
||||
function validateOptionalType(typeName) {
|
||||
return {
|
||||
validate: typeIs(typeName),
|
||||
optional: true
|
||||
};
|
||||
}
|
||||
|
||||
function arrayOf(elementType) {
|
||||
return chain(assertValueType("array"), assertEach(elementType));
|
||||
}
|
||||
|
||||
function arrayOfType(typeName) {
|
||||
return arrayOf(typeIs(typeName));
|
||||
}
|
||||
|
||||
function validateArrayOfType(typeName) {
|
||||
return validate(arrayOfType(typeName));
|
||||
}
|
||||
|
||||
function assertEach(callback) {
|
||||
function validator(node, key, val) {
|
||||
if (!Array.isArray(val)) return;
|
||||
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
callback(node, `${key}[${i}]`, val[i]);
|
||||
}
|
||||
}
|
||||
|
||||
validator.each = callback;
|
||||
return validator;
|
||||
}
|
||||
|
||||
function assertOneOf(...values) {
|
||||
function validate(node, key, val) {
|
||||
if (values.indexOf(val) < 0) {
|
||||
throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
|
||||
}
|
||||
}
|
||||
|
||||
validate.oneOf = values;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function assertNodeType(...types) {
|
||||
function validate(node, key, val) {
|
||||
let valid = false;
|
||||
|
||||
for (const type of types) {
|
||||
if ((0, _is.default)(type, val)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`);
|
||||
}
|
||||
}
|
||||
|
||||
validate.oneOfNodeTypes = types;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function assertNodeOrValueType(...types) {
|
||||
function validate(node, key, val) {
|
||||
let valid = false;
|
||||
|
||||
for (const type of types) {
|
||||
if (getType(val) === type || (0, _is.default)(type, val)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`);
|
||||
}
|
||||
}
|
||||
|
||||
validate.oneOfNodeOrValueTypes = types;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function assertValueType(type) {
|
||||
function validate(node, key, val) {
|
||||
const valid = getType(val) === type;
|
||||
|
||||
if (!valid) {
|
||||
throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
|
||||
}
|
||||
}
|
||||
|
||||
validate.type = type;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function assertShape(shape) {
|
||||
function validate(node, key, val) {
|
||||
const errors = [];
|
||||
|
||||
for (const property of Object.keys(shape)) {
|
||||
try {
|
||||
(0, _validate.validateField)(node, property, val[property], shape[property]);
|
||||
} catch (error) {
|
||||
if (error instanceof TypeError) {
|
||||
errors.push(error.message);
|
||||
continue;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.length) {
|
||||
throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
|
||||
}
|
||||
}
|
||||
|
||||
validate.shapeOf = shape;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function chain(...fns) {
|
||||
function validate(...args) {
|
||||
for (const fn of fns) {
|
||||
fn(...args);
|
||||
}
|
||||
}
|
||||
|
||||
validate.chainOf = fns;
|
||||
return validate;
|
||||
}
|
||||
|
||||
function defineType(type, opts = {}) {
|
||||
const inherits = opts.inherits && store[opts.inherits] || {};
|
||||
const fields = opts.fields || inherits.fields || {};
|
||||
const visitor = opts.visitor || inherits.visitor || [];
|
||||
const aliases = opts.aliases || inherits.aliases || [];
|
||||
const builder = opts.builder || inherits.builder || opts.visitor || [];
|
||||
|
||||
if (opts.deprecatedAlias) {
|
||||
DEPRECATED_KEYS[opts.deprecatedAlias] = type;
|
||||
}
|
||||
|
||||
for (const key of visitor.concat(builder)) {
|
||||
fields[key] = fields[key] || {};
|
||||
}
|
||||
|
||||
for (const key of Object.keys(fields)) {
|
||||
const field = fields[key];
|
||||
|
||||
if (builder.indexOf(key) === -1) {
|
||||
field.optional = true;
|
||||
}
|
||||
|
||||
if (field.default === undefined) {
|
||||
field.default = null;
|
||||
} else if (!field.validate) {
|
||||
field.validate = assertValueType(getType(field.default));
|
||||
}
|
||||
}
|
||||
|
||||
VISITOR_KEYS[type] = opts.visitor = visitor;
|
||||
BUILDER_KEYS[type] = opts.builder = builder;
|
||||
NODE_FIELDS[type] = opts.fields = fields;
|
||||
ALIAS_KEYS[type] = opts.aliases = aliases;
|
||||
aliases.forEach(alias => {
|
||||
FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
|
||||
FLIPPED_ALIAS_KEYS[alias].push(type);
|
||||
});
|
||||
store[type] = opts;
|
||||
}
|
||||
|
||||
const store = {};
|
2108
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.d.ts
generated
vendored
Normal file
2108
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.d.ts
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
579
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.js
generated
vendored
Normal file
579
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,579 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
react: true,
|
||||
assertNode: true,
|
||||
createTypeAnnotationBasedOnTypeof: true,
|
||||
createUnionTypeAnnotation: true,
|
||||
cloneNode: true,
|
||||
clone: true,
|
||||
cloneDeep: true,
|
||||
cloneWithoutLoc: true,
|
||||
addComment: true,
|
||||
addComments: true,
|
||||
inheritInnerComments: true,
|
||||
inheritLeadingComments: true,
|
||||
inheritsComments: true,
|
||||
inheritTrailingComments: true,
|
||||
removeComments: true,
|
||||
ensureBlock: true,
|
||||
toBindingIdentifierName: true,
|
||||
toBlock: true,
|
||||
toComputedKey: true,
|
||||
toExpression: true,
|
||||
toIdentifier: true,
|
||||
toKeyAlias: true,
|
||||
toSequenceExpression: true,
|
||||
toStatement: true,
|
||||
valueToNode: true,
|
||||
appendToMemberExpression: true,
|
||||
inherits: true,
|
||||
prependToMemberExpression: true,
|
||||
removeProperties: true,
|
||||
removePropertiesDeep: true,
|
||||
removeTypeDuplicates: true,
|
||||
getBindingIdentifiers: true,
|
||||
getOuterBindingIdentifiers: true,
|
||||
traverse: true,
|
||||
traverseFast: true,
|
||||
shallowEqual: true,
|
||||
is: true,
|
||||
isBinding: true,
|
||||
isBlockScoped: true,
|
||||
isImmutable: true,
|
||||
isLet: true,
|
||||
isNode: true,
|
||||
isNodesEquivalent: true,
|
||||
isPlaceholderType: true,
|
||||
isReferenced: true,
|
||||
isScope: true,
|
||||
isSpecifierDefault: true,
|
||||
isType: true,
|
||||
isValidES3Identifier: true,
|
||||
isValidIdentifier: true,
|
||||
isVar: true,
|
||||
matchesPattern: true,
|
||||
validate: true,
|
||||
buildMatchMemberExpression: true
|
||||
};
|
||||
Object.defineProperty(exports, "assertNode", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _assertNode.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _createTypeAnnotationBasedOnTypeof.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createUnionTypeAnnotation", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _createUnionTypeAnnotation.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "cloneNode", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _cloneNode.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "clone", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _clone.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "cloneDeep", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _cloneDeep.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "cloneWithoutLoc", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _cloneWithoutLoc.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "addComment", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _addComment.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "addComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _addComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "inheritInnerComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _inheritInnerComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "inheritLeadingComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _inheritLeadingComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "inheritsComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _inheritsComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "inheritTrailingComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _inheritTrailingComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "removeComments", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _removeComments.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "ensureBlock", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _ensureBlock.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toBindingIdentifierName", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toBindingIdentifierName.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toBlock", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toBlock.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toComputedKey", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toComputedKey.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toExpression", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toExpression.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toIdentifier", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toIdentifier.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toKeyAlias", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toKeyAlias.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toSequenceExpression", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toSequenceExpression.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "toStatement", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _toStatement.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "valueToNode", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _valueToNode.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "appendToMemberExpression", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _appendToMemberExpression.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "inherits", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _inherits.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "prependToMemberExpression", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _prependToMemberExpression.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "removeProperties", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _removeProperties.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "removePropertiesDeep", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _removePropertiesDeep.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "removeTypeDuplicates", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _removeTypeDuplicates.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getBindingIdentifiers", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _getBindingIdentifiers.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getOuterBindingIdentifiers", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _getOuterBindingIdentifiers.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "traverse", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _traverse.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "traverseFast", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _traverseFast.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "shallowEqual", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _shallowEqual.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "is", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _is.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isBinding", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isBinding.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isBlockScoped", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isBlockScoped.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isImmutable", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isImmutable.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isLet", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isLet.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isNode", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isNode.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isNodesEquivalent", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isNodesEquivalent.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isPlaceholderType", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isPlaceholderType.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isReferenced", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isReferenced.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isScope", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isScope.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isSpecifierDefault", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isSpecifierDefault.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isType", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isType.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isValidES3Identifier", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isValidES3Identifier.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isValidIdentifier", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isValidIdentifier.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isVar", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _isVar.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "matchesPattern", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _matchesPattern.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "validate", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _validate.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "buildMatchMemberExpression", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buildMatchMemberExpression.default;
|
||||
}
|
||||
});
|
||||
exports.react = void 0;
|
||||
|
||||
var _isReactComponent = _interopRequireDefault(require("./validators/react/isReactComponent"));
|
||||
|
||||
var _isCompatTag = _interopRequireDefault(require("./validators/react/isCompatTag"));
|
||||
|
||||
var _buildChildren = _interopRequireDefault(require("./builders/react/buildChildren"));
|
||||
|
||||
var _assertNode = _interopRequireDefault(require("./asserts/assertNode"));
|
||||
|
||||
var _generated = require("./asserts/generated");
|
||||
|
||||
Object.keys(_generated).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _generated[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(require("./builders/flow/createTypeAnnotationBasedOnTypeof"));
|
||||
|
||||
var _createUnionTypeAnnotation = _interopRequireDefault(require("./builders/flow/createUnionTypeAnnotation"));
|
||||
|
||||
var _generated2 = require("./builders/generated");
|
||||
|
||||
Object.keys(_generated2).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _generated2[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _cloneNode = _interopRequireDefault(require("./clone/cloneNode"));
|
||||
|
||||
var _clone = _interopRequireDefault(require("./clone/clone"));
|
||||
|
||||
var _cloneDeep = _interopRequireDefault(require("./clone/cloneDeep"));
|
||||
|
||||
var _cloneWithoutLoc = _interopRequireDefault(require("./clone/cloneWithoutLoc"));
|
||||
|
||||
var _addComment = _interopRequireDefault(require("./comments/addComment"));
|
||||
|
||||
var _addComments = _interopRequireDefault(require("./comments/addComments"));
|
||||
|
||||
var _inheritInnerComments = _interopRequireDefault(require("./comments/inheritInnerComments"));
|
||||
|
||||
var _inheritLeadingComments = _interopRequireDefault(require("./comments/inheritLeadingComments"));
|
||||
|
||||
var _inheritsComments = _interopRequireDefault(require("./comments/inheritsComments"));
|
||||
|
||||
var _inheritTrailingComments = _interopRequireDefault(require("./comments/inheritTrailingComments"));
|
||||
|
||||
var _removeComments = _interopRequireDefault(require("./comments/removeComments"));
|
||||
|
||||
var _generated3 = require("./constants/generated");
|
||||
|
||||
Object.keys(_generated3).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _generated3[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
Object.keys(_constants).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _constants[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _ensureBlock = _interopRequireDefault(require("./converters/ensureBlock"));
|
||||
|
||||
var _toBindingIdentifierName = _interopRequireDefault(require("./converters/toBindingIdentifierName"));
|
||||
|
||||
var _toBlock = _interopRequireDefault(require("./converters/toBlock"));
|
||||
|
||||
var _toComputedKey = _interopRequireDefault(require("./converters/toComputedKey"));
|
||||
|
||||
var _toExpression = _interopRequireDefault(require("./converters/toExpression"));
|
||||
|
||||
var _toIdentifier = _interopRequireDefault(require("./converters/toIdentifier"));
|
||||
|
||||
var _toKeyAlias = _interopRequireDefault(require("./converters/toKeyAlias"));
|
||||
|
||||
var _toSequenceExpression = _interopRequireDefault(require("./converters/toSequenceExpression"));
|
||||
|
||||
var _toStatement = _interopRequireDefault(require("./converters/toStatement"));
|
||||
|
||||
var _valueToNode = _interopRequireDefault(require("./converters/valueToNode"));
|
||||
|
||||
var _definitions = require("./definitions");
|
||||
|
||||
Object.keys(_definitions).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _definitions[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _appendToMemberExpression = _interopRequireDefault(require("./modifications/appendToMemberExpression"));
|
||||
|
||||
var _inherits = _interopRequireDefault(require("./modifications/inherits"));
|
||||
|
||||
var _prependToMemberExpression = _interopRequireDefault(require("./modifications/prependToMemberExpression"));
|
||||
|
||||
var _removeProperties = _interopRequireDefault(require("./modifications/removeProperties"));
|
||||
|
||||
var _removePropertiesDeep = _interopRequireDefault(require("./modifications/removePropertiesDeep"));
|
||||
|
||||
var _removeTypeDuplicates = _interopRequireDefault(require("./modifications/flow/removeTypeDuplicates"));
|
||||
|
||||
var _getBindingIdentifiers = _interopRequireDefault(require("./retrievers/getBindingIdentifiers"));
|
||||
|
||||
var _getOuterBindingIdentifiers = _interopRequireDefault(require("./retrievers/getOuterBindingIdentifiers"));
|
||||
|
||||
var _traverse = _interopRequireDefault(require("./traverse/traverse"));
|
||||
|
||||
var _traverseFast = _interopRequireDefault(require("./traverse/traverseFast"));
|
||||
|
||||
var _shallowEqual = _interopRequireDefault(require("./utils/shallowEqual"));
|
||||
|
||||
var _is = _interopRequireDefault(require("./validators/is"));
|
||||
|
||||
var _isBinding = _interopRequireDefault(require("./validators/isBinding"));
|
||||
|
||||
var _isBlockScoped = _interopRequireDefault(require("./validators/isBlockScoped"));
|
||||
|
||||
var _isImmutable = _interopRequireDefault(require("./validators/isImmutable"));
|
||||
|
||||
var _isLet = _interopRequireDefault(require("./validators/isLet"));
|
||||
|
||||
var _isNode = _interopRequireDefault(require("./validators/isNode"));
|
||||
|
||||
var _isNodesEquivalent = _interopRequireDefault(require("./validators/isNodesEquivalent"));
|
||||
|
||||
var _isPlaceholderType = _interopRequireDefault(require("./validators/isPlaceholderType"));
|
||||
|
||||
var _isReferenced = _interopRequireDefault(require("./validators/isReferenced"));
|
||||
|
||||
var _isScope = _interopRequireDefault(require("./validators/isScope"));
|
||||
|
||||
var _isSpecifierDefault = _interopRequireDefault(require("./validators/isSpecifierDefault"));
|
||||
|
||||
var _isType = _interopRequireDefault(require("./validators/isType"));
|
||||
|
||||
var _isValidES3Identifier = _interopRequireDefault(require("./validators/isValidES3Identifier"));
|
||||
|
||||
var _isValidIdentifier = _interopRequireDefault(require("./validators/isValidIdentifier"));
|
||||
|
||||
var _isVar = _interopRequireDefault(require("./validators/isVar"));
|
||||
|
||||
var _matchesPattern = _interopRequireDefault(require("./validators/matchesPattern"));
|
||||
|
||||
var _validate = _interopRequireDefault(require("./validators/validate"));
|
||||
|
||||
var _buildMatchMemberExpression = _interopRequireDefault(require("./validators/buildMatchMemberExpression"));
|
||||
|
||||
var _generated4 = require("./validators/generated");
|
||||
|
||||
Object.keys(_generated4).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _generated4[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const react = {
|
||||
isReactComponent: _isReactComponent.default,
|
||||
isCompatTag: _isCompatTag.default,
|
||||
buildChildren: _buildChildren.default
|
||||
};
|
||||
exports.react = react;
|
2010
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.js.flow
generated
vendored
Normal file
2010
node_modules/@babel/preset-env/node_modules/@babel/types/lib/index.js.flow
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
generated
vendored
Normal file
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = appendToMemberExpression;
|
||||
|
||||
var _generated = require("../builders/generated");
|
||||
|
||||
function appendToMemberExpression(member, append, computed = false) {
|
||||
member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed);
|
||||
member.property = append;
|
||||
member.computed = !!computed;
|
||||
return member;
|
||||
}
|
74
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
generated
vendored
Normal file
74
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeTypeDuplicates;
|
||||
|
||||
var _generated = require("../../validators/generated");
|
||||
|
||||
function removeTypeDuplicates(nodes) {
|
||||
const generics = {};
|
||||
const bases = {};
|
||||
const typeGroups = [];
|
||||
const types = [];
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i];
|
||||
if (!node) continue;
|
||||
|
||||
if (types.indexOf(node) >= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
||||
return [node];
|
||||
}
|
||||
|
||||
if ((0, _generated.isFlowBaseAnnotation)(node)) {
|
||||
bases[node.type] = node;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isUnionTypeAnnotation)(node)) {
|
||||
if (typeGroups.indexOf(node.types) < 0) {
|
||||
nodes = nodes.concat(node.types);
|
||||
typeGroups.push(node.types);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isGenericTypeAnnotation)(node)) {
|
||||
const name = node.id.name;
|
||||
|
||||
if (generics[name]) {
|
||||
let existing = generics[name];
|
||||
|
||||
if (existing.typeParameters) {
|
||||
if (node.typeParameters) {
|
||||
existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
|
||||
}
|
||||
} else {
|
||||
existing = node.typeParameters;
|
||||
}
|
||||
} else {
|
||||
generics[name] = node;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
types.push(node);
|
||||
}
|
||||
|
||||
for (const type of Object.keys(bases)) {
|
||||
types.push(bases[type]);
|
||||
}
|
||||
|
||||
for (const name of Object.keys(generics)) {
|
||||
types.push(generics[name]);
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/inherits.js
generated
vendored
Normal file
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/inherits.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inherits;
|
||||
|
||||
var _constants = require("../constants");
|
||||
|
||||
var _inheritsComments = _interopRequireDefault(require("../comments/inheritsComments"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inherits(child, parent) {
|
||||
if (!child || !parent) return child;
|
||||
|
||||
for (const key of _constants.INHERIT_KEYS.optional) {
|
||||
if (child[key] == null) {
|
||||
child[key] = parent[key];
|
||||
}
|
||||
}
|
||||
|
||||
for (const key of Object.keys(parent)) {
|
||||
if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
|
||||
}
|
||||
|
||||
for (const key of _constants.INHERIT_KEYS.force) {
|
||||
child[key] = parent[key];
|
||||
}
|
||||
|
||||
(0, _inheritsComments.default)(child, parent);
|
||||
return child;
|
||||
}
|
13
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
generated
vendored
Normal file
13
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = prependToMemberExpression;
|
||||
|
||||
var _generated = require("../builders/generated");
|
||||
|
||||
function prependToMemberExpression(member, prepend) {
|
||||
member.object = (0, _generated.memberExpression)(prepend, member.object);
|
||||
return member;
|
||||
}
|
30
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/removeProperties.js
generated
vendored
Normal file
30
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/removeProperties.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeProperties;
|
||||
|
||||
var _constants = require("../constants");
|
||||
|
||||
const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
|
||||
|
||||
const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
|
||||
|
||||
function removeProperties(node, opts = {}) {
|
||||
const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
|
||||
|
||||
for (const key of map) {
|
||||
if (node[key] != null) node[key] = undefined;
|
||||
}
|
||||
|
||||
for (const key of Object.keys(node)) {
|
||||
if (key[0] === "_" && node[key] != null) node[key] = undefined;
|
||||
}
|
||||
|
||||
const symbols = Object.getOwnPropertySymbols(node);
|
||||
|
||||
for (const sym of symbols) {
|
||||
node[sym] = null;
|
||||
}
|
||||
}
|
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
generated
vendored
Normal file
17
node_modules/@babel/preset-env/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removePropertiesDeep;
|
||||
|
||||
var _traverseFast = _interopRequireDefault(require("../traverse/traverseFast"));
|
||||
|
||||
var _removeProperties = _interopRequireDefault(require("./removeProperties"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function removePropertiesDeep(tree, opts) {
|
||||
(0, _traverseFast.default)(tree, _removeProperties.default, opts);
|
||||
return tree;
|
||||
}
|
103
node_modules/@babel/preset-env/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
generated
vendored
Normal file
103
node_modules/@babel/preset-env/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getBindingIdentifiers;
|
||||
|
||||
var _generated = require("../validators/generated");
|
||||
|
||||
function getBindingIdentifiers(node, duplicates, outerOnly) {
|
||||
let search = [].concat(node);
|
||||
const ids = Object.create(null);
|
||||
|
||||
while (search.length) {
|
||||
const id = search.shift();
|
||||
if (!id) continue;
|
||||
const keys = getBindingIdentifiers.keys[id.type];
|
||||
|
||||
if ((0, _generated.isIdentifier)(id)) {
|
||||
if (duplicates) {
|
||||
const _ids = ids[id.name] = ids[id.name] || [];
|
||||
|
||||
_ids.push(id);
|
||||
} else {
|
||||
ids[id.name] = id;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isExportDeclaration)(id)) {
|
||||
if ((0, _generated.isDeclaration)(id.declaration)) {
|
||||
search.push(id.declaration);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (outerOnly) {
|
||||
if ((0, _generated.isFunctionDeclaration)(id)) {
|
||||
search.push(id.id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((0, _generated.isFunctionExpression)(id)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (keys) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
|
||||
if (id[key]) {
|
||||
search = search.concat(id[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
getBindingIdentifiers.keys = {
|
||||
DeclareClass: ["id"],
|
||||
DeclareFunction: ["id"],
|
||||
DeclareModule: ["id"],
|
||||
DeclareVariable: ["id"],
|
||||
DeclareInterface: ["id"],
|
||||
DeclareTypeAlias: ["id"],
|
||||
DeclareOpaqueType: ["id"],
|
||||
InterfaceDeclaration: ["id"],
|
||||
TypeAlias: ["id"],
|
||||
OpaqueType: ["id"],
|
||||
CatchClause: ["param"],
|
||||
LabeledStatement: ["label"],
|
||||
UnaryExpression: ["argument"],
|
||||
AssignmentExpression: ["left"],
|
||||
ImportSpecifier: ["local"],
|
||||
ImportNamespaceSpecifier: ["local"],
|
||||
ImportDefaultSpecifier: ["local"],
|
||||
ImportDeclaration: ["specifiers"],
|
||||
ExportSpecifier: ["exported"],
|
||||
ExportNamespaceSpecifier: ["exported"],
|
||||
ExportDefaultSpecifier: ["exported"],
|
||||
FunctionDeclaration: ["id", "params"],
|
||||
FunctionExpression: ["id", "params"],
|
||||
ArrowFunctionExpression: ["params"],
|
||||
ObjectMethod: ["params"],
|
||||
ClassMethod: ["params"],
|
||||
ForInStatement: ["left"],
|
||||
ForOfStatement: ["left"],
|
||||
ClassDeclaration: ["id"],
|
||||
ClassExpression: ["id"],
|
||||
RestElement: ["argument"],
|
||||
UpdateExpression: ["argument"],
|
||||
ObjectProperty: ["value"],
|
||||
AssignmentPattern: ["left"],
|
||||
ArrayPattern: ["elements"],
|
||||
ObjectPattern: ["properties"],
|
||||
VariableDeclaration: ["declarations"],
|
||||
VariableDeclarator: ["id"]
|
||||
};
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getOuterBindingIdentifiers;
|
||||
|
||||
var _getBindingIdentifiers = _interopRequireDefault(require("./getBindingIdentifiers"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function getOuterBindingIdentifiers(node, duplicates) {
|
||||
return (0, _getBindingIdentifiers.default)(node, duplicates, true);
|
||||
}
|
55
node_modules/@babel/preset-env/node_modules/@babel/types/lib/traverse/traverse.js
generated
vendored
Normal file
55
node_modules/@babel/preset-env/node_modules/@babel/types/lib/traverse/traverse.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = traverse;
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
function traverse(node, handlers, state) {
|
||||
if (typeof handlers === "function") {
|
||||
handlers = {
|
||||
enter: handlers
|
||||
};
|
||||
}
|
||||
|
||||
const {
|
||||
enter,
|
||||
exit
|
||||
} = handlers;
|
||||
traverseSimpleImpl(node, enter, exit, state, []);
|
||||
}
|
||||
|
||||
function traverseSimpleImpl(node, enter, exit, state, ancestors) {
|
||||
const keys = _definitions.VISITOR_KEYS[node.type];
|
||||
if (!keys) return;
|
||||
if (enter) enter(node, ancestors, state);
|
||||
|
||||
for (const key of keys) {
|
||||
const subNode = node[key];
|
||||
|
||||
if (Array.isArray(subNode)) {
|
||||
for (let i = 0; i < subNode.length; i++) {
|
||||
const child = subNode[i];
|
||||
if (!child) continue;
|
||||
ancestors.push({
|
||||
node,
|
||||
key,
|
||||
index: i
|
||||
});
|
||||
traverseSimpleImpl(child, enter, exit, state, ancestors);
|
||||
ancestors.pop();
|
||||
}
|
||||
} else if (subNode) {
|
||||
ancestors.push({
|
||||
node,
|
||||
key
|
||||
});
|
||||
traverseSimpleImpl(subNode, enter, exit, state, ancestors);
|
||||
ancestors.pop();
|
||||
}
|
||||
}
|
||||
|
||||
if (exit) exit(node, ancestors, state);
|
||||
}
|
28
node_modules/@babel/preset-env/node_modules/@babel/types/lib/traverse/traverseFast.js
generated
vendored
Normal file
28
node_modules/@babel/preset-env/node_modules/@babel/types/lib/traverse/traverseFast.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = traverseFast;
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
function traverseFast(node, enter, opts) {
|
||||
if (!node) return;
|
||||
const keys = _definitions.VISITOR_KEYS[node.type];
|
||||
if (!keys) return;
|
||||
opts = opts || {};
|
||||
enter(node, opts);
|
||||
|
||||
for (const key of keys) {
|
||||
const subNode = node[key];
|
||||
|
||||
if (Array.isArray(subNode)) {
|
||||
for (const node of subNode) {
|
||||
traverseFast(node, enter, opts);
|
||||
}
|
||||
} else {
|
||||
traverseFast(subNode, enter, opts);
|
||||
}
|
||||
}
|
||||
}
|
24
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/inherit.js
generated
vendored
Normal file
24
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/inherit.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inherit;
|
||||
|
||||
function _uniq() {
|
||||
const data = _interopRequireDefault(require("lodash/uniq"));
|
||||
|
||||
_uniq = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function inherit(key, child, parent) {
|
||||
if (child && parent) {
|
||||
child[key] = (0, _uniq().default)([].concat(child[key], parent[key]).filter(Boolean));
|
||||
}
|
||||
}
|
47
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
generated
vendored
Normal file
47
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cleanJSXElementLiteralChild;
|
||||
|
||||
var _generated = require("../../builders/generated");
|
||||
|
||||
function cleanJSXElementLiteralChild(child, args) {
|
||||
const lines = child.value.split(/\r\n|\n|\r/);
|
||||
let lastNonEmptyLine = 0;
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (lines[i].match(/[^ \t]/)) {
|
||||
lastNonEmptyLine = i;
|
||||
}
|
||||
}
|
||||
|
||||
let str = "";
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
const isFirstLine = i === 0;
|
||||
const isLastLine = i === lines.length - 1;
|
||||
const isLastNonEmptyLine = i === lastNonEmptyLine;
|
||||
let trimmedLine = line.replace(/\t/g, " ");
|
||||
|
||||
if (!isFirstLine) {
|
||||
trimmedLine = trimmedLine.replace(/^[ ]+/, "");
|
||||
}
|
||||
|
||||
if (!isLastLine) {
|
||||
trimmedLine = trimmedLine.replace(/[ ]+$/, "");
|
||||
}
|
||||
|
||||
if (trimmedLine) {
|
||||
if (!isLastNonEmptyLine) {
|
||||
trimmedLine += " ";
|
||||
}
|
||||
|
||||
str += trimmedLine;
|
||||
}
|
||||
}
|
||||
|
||||
if (str) args.push((0, _generated.stringLiteral)(str));
|
||||
}
|
18
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/shallowEqual.js
generated
vendored
Normal file
18
node_modules/@babel/preset-env/node_modules/@babel/types/lib/utils/shallowEqual.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = shallowEqual;
|
||||
|
||||
function shallowEqual(actual, expected) {
|
||||
const keys = Object.keys(expected);
|
||||
|
||||
for (const key of keys) {
|
||||
if (actual[key] !== expected[key]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
generated
vendored
Normal file
15
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = buildMatchMemberExpression;
|
||||
|
||||
var _matchesPattern = _interopRequireDefault(require("./matchesPattern"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function buildMatchMemberExpression(match, allowPartial) {
|
||||
const parts = match.split(".");
|
||||
return member => (0, _matchesPattern.default)(member, parts, allowPartial);
|
||||
}
|
4349
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/generated/index.js
generated
vendored
Normal file
4349
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/generated/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
35
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/is.js
generated
vendored
Normal file
35
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/is.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = is;
|
||||
|
||||
var _shallowEqual = _interopRequireDefault(require("../utils/shallowEqual"));
|
||||
|
||||
var _isType = _interopRequireDefault(require("./isType"));
|
||||
|
||||
var _isPlaceholderType = _interopRequireDefault(require("./isPlaceholderType"));
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function is(type, node, opts) {
|
||||
if (!node) return false;
|
||||
const matches = (0, _isType.default)(node.type, type);
|
||||
|
||||
if (!matches) {
|
||||
if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
|
||||
return (0, _isPlaceholderType.default)(node.expectedNode, type);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
} else {
|
||||
return (0, _shallowEqual.default)(node, opts);
|
||||
}
|
||||
}
|
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isBinding.js
generated
vendored
Normal file
33
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isBinding.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isBinding;
|
||||
|
||||
var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBindingIdentifiers"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isBinding(node, parent, grandparent) {
|
||||
if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const keys = _getBindingIdentifiers.default.keys[parent.type];
|
||||
|
||||
if (keys) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
const val = parent[key];
|
||||
|
||||
if (Array.isArray(val)) {
|
||||
if (val.indexOf(node) >= 0) return true;
|
||||
} else {
|
||||
if (val === node) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isBlockScoped.js
generated
vendored
Normal file
16
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isBlockScoped.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isBlockScoped;
|
||||
|
||||
var _generated = require("./generated");
|
||||
|
||||
var _isLet = _interopRequireDefault(require("./isLet"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isBlockScoped(node) {
|
||||
return (0, _generated.isFunctionDeclaration)(node) || (0, _generated.isClassDeclaration)(node) || (0, _isLet.default)(node);
|
||||
}
|
26
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isImmutable.js
generated
vendored
Normal file
26
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isImmutable.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isImmutable;
|
||||
|
||||
var _isType = _interopRequireDefault(require("./isType"));
|
||||
|
||||
var _generated = require("./generated");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isImmutable(node) {
|
||||
if ((0, _isType.default)(node.type, "Immutable")) return true;
|
||||
|
||||
if ((0, _generated.isIdentifier)(node)) {
|
||||
if (node.name === "undefined") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isLet.js
generated
vendored
Normal file
14
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isLet.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isLet;
|
||||
|
||||
var _generated = require("./generated");
|
||||
|
||||
var _constants = require("../constants");
|
||||
|
||||
function isLet(node) {
|
||||
return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
|
||||
}
|
12
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isNode.js
generated
vendored
Normal file
12
node_modules/@babel/preset-env/node_modules/@babel/types/lib/validators/isNode.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isNode;
|
||||
|
||||
var _definitions = require("../definitions");
|
||||
|
||||
function isNode(node) {
|
||||
return !!(node && _definitions.VISITOR_KEYS[node.type]);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user