feat: initial commit
This commit is contained in:
22
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/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/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md
generated
vendored
Normal file
19
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
|
||||
|
||||
> Transform optional chaining operators to workaround https://crbug.com/v8/11558
|
||||
|
||||
See our website [@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining](https://babeljs.io/docs/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining --dev
|
||||
```
|
66
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js
generated
vendored
Normal file
66
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
||||
var pluginTransformOptionalChaining = require('@babel/plugin-transform-optional-chaining');
|
||||
var helperSkipTransparentExpressionWrappers = require('@babel/helper-skip-transparent-expression-wrappers');
|
||||
var core = require('@babel/core');
|
||||
|
||||
function matchAffectedArguments(argumentNodes) {
|
||||
const spreadIndex = argumentNodes.findIndex(node => core.types.isSpreadElement(node));
|
||||
return spreadIndex >= 0 && spreadIndex !== argumentNodes.length - 1;
|
||||
}
|
||||
function shouldTransform(path) {
|
||||
let optionalPath = path;
|
||||
const chains = [];
|
||||
for (;;) {
|
||||
if (optionalPath.isOptionalMemberExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("object"));
|
||||
} else if (optionalPath.isOptionalCallExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("callee"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < chains.length; i++) {
|
||||
const node = chains[i];
|
||||
if (core.types.isOptionalCallExpression(node) && matchAffectedArguments(node.arguments)) {
|
||||
if (node.optional) {
|
||||
return true;
|
||||
}
|
||||
const callee = chains[i + 1];
|
||||
if (core.types.isOptionalMemberExpression(callee, {
|
||||
optional: true
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var index = helperPluginUtils.declare(api => {
|
||||
var _api$assumption, _api$assumption2;
|
||||
api.assertVersion(7);
|
||||
const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : false;
|
||||
const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : false;
|
||||
return {
|
||||
name: "bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
visitor: {
|
||||
"OptionalCallExpression|OptionalMemberExpression"(path) {
|
||||
if (shouldTransform(path)) {
|
||||
pluginTransformOptionalChaining.transform(path, {
|
||||
noDocumentAll,
|
||||
pureGetters
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = index;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/package.json
generated
vendored
Normal file
45
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/package.json
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"version": "7.24.7",
|
||||
"description": "Transform optional chaining operators to workaround https://crbug.com/v8/11558",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin",
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.24.7",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.24.7",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.24.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.24.7",
|
||||
"@babel/traverse": "^7.24.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
23
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/tsconfig.json
generated
vendored
Normal file
23
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/tsconfig.json
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/* This file is automatically generated by scripts/generators/tsconfig.js */
|
||||
{
|
||||
"extends": [
|
||||
"../../tsconfig.base.json",
|
||||
"../../tsconfig.paths.json"
|
||||
],
|
||||
"include": [
|
||||
"../../packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/src/**/*.ts",
|
||||
"../../lib/globals.d.ts",
|
||||
"../../scripts/repo-utils/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/babel-helper-plugin-utils"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/babel-helper-skip-transparent-expression-wrappers"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/babel-plugin-transform-optional-chaining"
|
||||
}
|
||||
]
|
||||
}
|
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/tsconfig.tsbuildinfo
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user