Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
22
my-app/node_modules/@babel/helper-function-name/LICENSE
generated
vendored
Executable file
22
my-app/node_modules/@babel/helper-function-name/LICENSE
generated
vendored
Executable 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
my-app/node_modules/@babel/helper-function-name/README.md
generated
vendored
Executable file
19
my-app/node_modules/@babel/helper-function-name/README.md
generated
vendored
Executable file
|
@ -0,0 +1,19 @@
|
|||
# @babel/helper-function-name
|
||||
|
||||
> Helper function to change the property 'name' of every function
|
||||
|
||||
See our website [@babel/helper-function-name](https://babeljs.io/docs/babel-helper-function-name) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-function-name
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-function-name
|
||||
```
|
170
my-app/node_modules/@babel/helper-function-name/lib/index.js
generated
vendored
Executable file
170
my-app/node_modules/@babel/helper-function-name/lib/index.js
generated
vendored
Executable file
|
@ -0,0 +1,170 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
var _template = require("@babel/template");
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
NOT_LOCAL_BINDING,
|
||||
cloneNode,
|
||||
identifier,
|
||||
isAssignmentExpression,
|
||||
isAssignmentPattern,
|
||||
isFunction,
|
||||
isIdentifier,
|
||||
isLiteral,
|
||||
isNullLiteral,
|
||||
isObjectMethod,
|
||||
isObjectProperty,
|
||||
isRegExpLiteral,
|
||||
isRestElement,
|
||||
isTemplateLiteral,
|
||||
isVariableDeclarator,
|
||||
toBindingIdentifierName
|
||||
} = _t;
|
||||
function getFunctionArity(node) {
|
||||
const count = node.params.findIndex(param => isAssignmentPattern(param) || isRestElement(param));
|
||||
return count === -1 ? node.params.length : count;
|
||||
}
|
||||
const buildPropertyMethodAssignmentWrapper = _template.default.statement(`
|
||||
(function (FUNCTION_KEY) {
|
||||
function FUNCTION_ID() {
|
||||
return FUNCTION_KEY.apply(this, arguments);
|
||||
}
|
||||
|
||||
FUNCTION_ID.toString = function () {
|
||||
return FUNCTION_KEY.toString();
|
||||
}
|
||||
|
||||
return FUNCTION_ID;
|
||||
})(FUNCTION)
|
||||
`);
|
||||
const buildGeneratorPropertyMethodAssignmentWrapper = _template.default.statement(`
|
||||
(function (FUNCTION_KEY) {
|
||||
function* FUNCTION_ID() {
|
||||
return yield* FUNCTION_KEY.apply(this, arguments);
|
||||
}
|
||||
|
||||
FUNCTION_ID.toString = function () {
|
||||
return FUNCTION_KEY.toString();
|
||||
};
|
||||
|
||||
return FUNCTION_ID;
|
||||
})(FUNCTION)
|
||||
`);
|
||||
const visitor = {
|
||||
"ReferencedIdentifier|BindingIdentifier"(path, state) {
|
||||
if (path.node.name !== state.name) return;
|
||||
const localDeclar = path.scope.getBindingIdentifier(state.name);
|
||||
if (localDeclar !== state.outerDeclar) return;
|
||||
state.selfReference = true;
|
||||
path.stop();
|
||||
}
|
||||
};
|
||||
function getNameFromLiteralId(id) {
|
||||
if (isNullLiteral(id)) {
|
||||
return "null";
|
||||
}
|
||||
if (isRegExpLiteral(id)) {
|
||||
return `_${id.pattern}_${id.flags}`;
|
||||
}
|
||||
if (isTemplateLiteral(id)) {
|
||||
return id.quasis.map(quasi => quasi.value.raw).join("");
|
||||
}
|
||||
if (id.value !== undefined) {
|
||||
return id.value + "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
function wrap(state, method, id, scope) {
|
||||
if (state.selfReference) {
|
||||
if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
|
||||
scope.rename(id.name);
|
||||
} else {
|
||||
if (!isFunction(method)) return;
|
||||
let build = buildPropertyMethodAssignmentWrapper;
|
||||
if (method.generator) {
|
||||
build = buildGeneratorPropertyMethodAssignmentWrapper;
|
||||
}
|
||||
const template = build({
|
||||
FUNCTION: method,
|
||||
FUNCTION_ID: id,
|
||||
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
|
||||
}).expression;
|
||||
const params = template.callee.body.body[0].params;
|
||||
for (let i = 0, len = getFunctionArity(method); i < len; i++) {
|
||||
params.push(scope.generateUidIdentifier("x"));
|
||||
}
|
||||
return template;
|
||||
}
|
||||
}
|
||||
method.id = id;
|
||||
scope.getProgramParent().references[id.name] = true;
|
||||
}
|
||||
function visit(node, name, scope) {
|
||||
const state = {
|
||||
selfAssignment: false,
|
||||
selfReference: false,
|
||||
outerDeclar: scope.getBindingIdentifier(name),
|
||||
name: name
|
||||
};
|
||||
const binding = scope.getOwnBinding(name);
|
||||
if (binding) {
|
||||
if (binding.kind === "param") {
|
||||
state.selfReference = true;
|
||||
} else {}
|
||||
} else if (state.outerDeclar || scope.hasGlobal(name)) {
|
||||
scope.traverse(node, visitor, state);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
function _default({
|
||||
node,
|
||||
parent,
|
||||
scope,
|
||||
id
|
||||
}, localBinding = false, supportUnicodeId = false) {
|
||||
if (node.id) return;
|
||||
if ((isObjectProperty(parent) || isObjectMethod(parent, {
|
||||
kind: "method"
|
||||
})) && (!parent.computed || isLiteral(parent.key))) {
|
||||
id = parent.key;
|
||||
} else if (isVariableDeclarator(parent)) {
|
||||
id = parent.id;
|
||||
if (isIdentifier(id) && !localBinding) {
|
||||
const binding = scope.parent.getBinding(id.name);
|
||||
if (binding && binding.constant && scope.getBinding(id.name) === binding) {
|
||||
node.id = cloneNode(id);
|
||||
node.id[NOT_LOCAL_BINDING] = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (isAssignmentExpression(parent, {
|
||||
operator: "="
|
||||
})) {
|
||||
id = parent.left;
|
||||
} else if (!id) {
|
||||
return;
|
||||
}
|
||||
let name;
|
||||
if (id && isLiteral(id)) {
|
||||
name = getNameFromLiteralId(id);
|
||||
} else if (id && isIdentifier(id)) {
|
||||
name = id.name;
|
||||
}
|
||||
if (name === undefined) {
|
||||
return;
|
||||
}
|
||||
if (!supportUnicodeId && isFunction(node) && /[\uD800-\uDFFF]/.test(name)) {
|
||||
return;
|
||||
}
|
||||
name = toBindingIdentifierName(name);
|
||||
const newId = identifier(name);
|
||||
newId[NOT_LOCAL_BINDING] = true;
|
||||
const state = visit(node, name, scope);
|
||||
return wrap(state, node, newId, scope) || node;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
my-app/node_modules/@babel/helper-function-name/lib/index.js.map
generated
vendored
Executable file
1
my-app/node_modules/@babel/helper-function-name/lib/index.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
25
my-app/node_modules/@babel/helper-function-name/package.json
generated
vendored
Executable file
25
my-app/node_modules/@babel/helper-function-name/package.json
generated
vendored
Executable file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "@babel/helper-function-name",
|
||||
"version": "7.23.0",
|
||||
"description": "Helper function to change the property 'name' of every function",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-function-name"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-function-name",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/types": "^7.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue