feat: initial commit

This commit is contained in:
Carlos
2024-08-12 22:57:35 -04:00
commit 6f68ae8259
13140 changed files with 1104801 additions and 0 deletions

View 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.

View 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
```

View 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

File diff suppressed because one or more lines are too long

View 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"
}

View 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"
}
]
}

File diff suppressed because one or more lines are too long