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/plugin-transform-private-property-in-object/LICENSE
generated
vendored
Executable file
22
my-app/node_modules/@babel/plugin-transform-private-property-in-object/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/plugin-transform-private-property-in-object/README.md
generated
vendored
Executable file
19
my-app/node_modules/@babel/plugin-transform-private-property-in-object/README.md
generated
vendored
Executable file
|
@ -0,0 +1,19 @@
|
|||
# @babel/plugin-transform-private-property-in-object
|
||||
|
||||
> This plugin transforms checks for a private property in an object
|
||||
|
||||
See our website [@babel/plugin-transform-private-property-in-object](https://babeljs.io/docs/babel-plugin-transform-private-property-in-object) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-transform-private-property-in-object
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-transform-private-property-in-object --dev
|
||||
```
|
126
my-app/node_modules/@babel/plugin-transform-private-property-in-object/lib/index.js
generated
vendored
Executable file
126
my-app/node_modules/@babel/plugin-transform-private-property-in-object/lib/index.js
generated
vendored
Executable file
|
@ -0,0 +1,126 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin");
|
||||
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
|
||||
var _default = exports.default = (0, _helperPluginUtils.declare)((api, opt) => {
|
||||
api.assertVersion(7);
|
||||
const {
|
||||
types: t,
|
||||
template
|
||||
} = api;
|
||||
const {
|
||||
loose
|
||||
} = opt;
|
||||
const classWeakSets = new WeakMap();
|
||||
const fieldsWeakSets = new WeakMap();
|
||||
function unshadow(name, targetScope, scope) {
|
||||
while (scope !== targetScope) {
|
||||
if (scope.hasOwnBinding(name)) scope.rename(name);
|
||||
scope = scope.parent;
|
||||
}
|
||||
}
|
||||
function injectToFieldInit(fieldPath, expr, before = false) {
|
||||
if (fieldPath.node.value) {
|
||||
const value = fieldPath.get("value");
|
||||
if (before) {
|
||||
value.insertBefore(expr);
|
||||
} else {
|
||||
value.insertAfter(expr);
|
||||
}
|
||||
} else {
|
||||
fieldPath.set("value", t.unaryExpression("void", expr));
|
||||
}
|
||||
}
|
||||
function injectInitialization(classPath, init) {
|
||||
let firstFieldPath;
|
||||
let constructorPath;
|
||||
for (const el of classPath.get("body.body")) {
|
||||
if ((el.isClassProperty() || el.isClassPrivateProperty()) && !el.node.static) {
|
||||
firstFieldPath = el;
|
||||
break;
|
||||
}
|
||||
if (!constructorPath && el.isClassMethod({
|
||||
kind: "constructor"
|
||||
})) {
|
||||
constructorPath = el;
|
||||
}
|
||||
}
|
||||
if (firstFieldPath) {
|
||||
injectToFieldInit(firstFieldPath, init, true);
|
||||
} else {
|
||||
(0, _helperCreateClassFeaturesPlugin.injectInitialization)(classPath, constructorPath, [t.expressionStatement(init)]);
|
||||
}
|
||||
}
|
||||
function getWeakSetId(weakSets, outerClass, reference, name = "", inject) {
|
||||
let id = weakSets.get(reference.node);
|
||||
if (!id) {
|
||||
id = outerClass.scope.generateUidIdentifier(`${name || ""} brandCheck`);
|
||||
weakSets.set(reference.node, id);
|
||||
inject(reference, template.expression.ast`${t.cloneNode(id)}.add(this)`);
|
||||
const newExpr = t.newExpression(t.identifier("WeakSet"), []);
|
||||
(0, _helperAnnotateAsPure.default)(newExpr);
|
||||
outerClass.insertBefore(template.ast`var ${id} = ${newExpr}`);
|
||||
}
|
||||
return t.cloneNode(id);
|
||||
}
|
||||
return {
|
||||
name: "transform-private-property-in-object",
|
||||
inherits: require("@babel/plugin-syntax-private-property-in-object").default,
|
||||
pre() {
|
||||
(0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.privateIn, loose);
|
||||
},
|
||||
visitor: {
|
||||
BinaryExpression(path, state) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
const {
|
||||
file
|
||||
} = state;
|
||||
if (node.operator !== "in") return;
|
||||
if (!t.isPrivateName(node.left)) return;
|
||||
const {
|
||||
name
|
||||
} = node.left.id;
|
||||
let privateElement;
|
||||
const outerClass = path.findParent(path => {
|
||||
if (!path.isClass()) return false;
|
||||
privateElement = path.get("body.body").find(({
|
||||
node
|
||||
}) => t.isPrivate(node) && node.key.id.name === name);
|
||||
return !!privateElement;
|
||||
});
|
||||
if (outerClass.parentPath.scope.path.isPattern()) {
|
||||
outerClass.replaceWith(template.ast`(() => ${outerClass.node})()`);
|
||||
return;
|
||||
}
|
||||
if (privateElement.node.type === "ClassPrivateMethod") {
|
||||
if (privateElement.node.static) {
|
||||
if (outerClass.node.id) {
|
||||
unshadow(outerClass.node.id.name, outerClass.scope, path.scope);
|
||||
} else {
|
||||
outerClass.set("id", path.scope.generateUidIdentifier("class"));
|
||||
}
|
||||
path.replaceWith(template.expression.ast`
|
||||
${t.cloneNode(outerClass.node.id)} === ${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)}
|
||||
`);
|
||||
} else {
|
||||
var _outerClass$node$id;
|
||||
const id = getWeakSetId(classWeakSets, outerClass, outerClass, (_outerClass$node$id = outerClass.node.id) == null ? void 0 : _outerClass$node$id.name, injectInitialization);
|
||||
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`);
|
||||
}
|
||||
} else {
|
||||
const id = getWeakSetId(fieldsWeakSets, outerClass, privateElement, privateElement.node.key.id.name, injectToFieldInit);
|
||||
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
my-app/node_modules/@babel/plugin-transform-private-property-in-object/lib/index.js.map
generated
vendored
Executable file
1
my-app/node_modules/@babel/plugin-transform-private-property-in-object/lib/index.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
37
my-app/node_modules/@babel/plugin-transform-private-property-in-object/package.json
generated
vendored
Executable file
37
my-app/node_modules/@babel/plugin-transform-private-property-in-object/package.json
generated
vendored
Executable file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "@babel/plugin-transform-private-property-in-object",
|
||||
"version": "7.23.4",
|
||||
"description": "This plugin transforms checks for a private property in an object",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-private-property-in-object"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-private-property-in-object",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.22.5",
|
||||
"@babel/helper-create-class-features-plugin": "^7.22.15",
|
||||
"@babel/helper-plugin-utils": "^7.22.5",
|
||||
"@babel/plugin-syntax-private-property-in-object": "^7.14.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.3",
|
||||
"@babel/helper-plugin-test-runner": "^7.22.5"
|
||||
},
|
||||
"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