main page
This commit is contained in:
172
node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
Normal file
172
node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _t = require("@babel/types");
|
||||
var _t2 = _t;
|
||||
const {
|
||||
react
|
||||
} = _t;
|
||||
const {
|
||||
cloneNode,
|
||||
jsxExpressionContainer,
|
||||
variableDeclaration,
|
||||
variableDeclarator
|
||||
} = _t2;
|
||||
const referenceVisitor = {
|
||||
ReferencedIdentifier(path, state) {
|
||||
if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
|
||||
return;
|
||||
}
|
||||
if (path.node.name === "this") {
|
||||
let scope = path.scope;
|
||||
do {
|
||||
if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
|
||||
break;
|
||||
}
|
||||
} while (scope = scope.parent);
|
||||
if (scope) state.breakOnScopePaths.push(scope.path);
|
||||
}
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return;
|
||||
for (const violation of binding.constantViolations) {
|
||||
if (violation.scope !== binding.path.scope) {
|
||||
state.mutableBinding = true;
|
||||
path.stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (binding !== state.scope.getBinding(path.node.name)) return;
|
||||
state.bindings[path.node.name] = binding;
|
||||
}
|
||||
};
|
||||
class PathHoister {
|
||||
constructor(path, scope) {
|
||||
this.breakOnScopePaths = void 0;
|
||||
this.bindings = void 0;
|
||||
this.mutableBinding = void 0;
|
||||
this.scopes = void 0;
|
||||
this.scope = void 0;
|
||||
this.path = void 0;
|
||||
this.attachAfter = void 0;
|
||||
this.breakOnScopePaths = [];
|
||||
this.bindings = {};
|
||||
this.mutableBinding = false;
|
||||
this.scopes = [];
|
||||
this.scope = scope;
|
||||
this.path = path;
|
||||
this.attachAfter = false;
|
||||
}
|
||||
isCompatibleScope(scope) {
|
||||
for (const key of Object.keys(this.bindings)) {
|
||||
const binding = this.bindings[key];
|
||||
if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
getCompatibleScopes() {
|
||||
let scope = this.path.scope;
|
||||
do {
|
||||
if (this.isCompatibleScope(scope)) {
|
||||
this.scopes.push(scope);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if (this.breakOnScopePaths.includes(scope.path)) {
|
||||
break;
|
||||
}
|
||||
} while (scope = scope.parent);
|
||||
}
|
||||
getAttachmentPath() {
|
||||
let path = this._getAttachmentPath();
|
||||
if (!path) return;
|
||||
let targetScope = path.scope;
|
||||
if (targetScope.path === path) {
|
||||
targetScope = path.scope.parent;
|
||||
}
|
||||
if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
|
||||
for (const name of Object.keys(this.bindings)) {
|
||||
if (!targetScope.hasOwnBinding(name)) continue;
|
||||
const binding = this.bindings[name];
|
||||
if (binding.kind === "param" || binding.path.parentKey === "params") {
|
||||
continue;
|
||||
}
|
||||
const bindingParentPath = this.getAttachmentParentForPath(binding.path);
|
||||
if (bindingParentPath.key >= path.key) {
|
||||
this.attachAfter = true;
|
||||
path = binding.path;
|
||||
for (const violationPath of binding.constantViolations) {
|
||||
if (this.getAttachmentParentForPath(violationPath).key > path.key) {
|
||||
path = violationPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
_getAttachmentPath() {
|
||||
const scopes = this.scopes;
|
||||
const scope = scopes.pop();
|
||||
if (!scope) return;
|
||||
if (scope.path.isFunction()) {
|
||||
if (this.hasOwnParamBindings(scope)) {
|
||||
if (this.scope === scope) return;
|
||||
const bodies = scope.path.get("body").get("body");
|
||||
for (let i = 0; i < bodies.length; i++) {
|
||||
if (bodies[i].node._blockHoist) continue;
|
||||
return bodies[i];
|
||||
}
|
||||
} else {
|
||||
return this.getNextScopeAttachmentParent();
|
||||
}
|
||||
} else if (scope.path.isProgram()) {
|
||||
return this.getNextScopeAttachmentParent();
|
||||
}
|
||||
}
|
||||
getNextScopeAttachmentParent() {
|
||||
const scope = this.scopes.pop();
|
||||
if (scope) return this.getAttachmentParentForPath(scope.path);
|
||||
}
|
||||
getAttachmentParentForPath(path) {
|
||||
do {
|
||||
if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
|
||||
return path;
|
||||
}
|
||||
} while (path = path.parentPath);
|
||||
return path;
|
||||
}
|
||||
hasOwnParamBindings(scope) {
|
||||
for (const name of Object.keys(this.bindings)) {
|
||||
if (!scope.hasOwnBinding(name)) continue;
|
||||
const binding = this.bindings[name];
|
||||
if (binding.kind === "param" && binding.constant) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
run() {
|
||||
this.path.traverse(referenceVisitor, this);
|
||||
if (this.mutableBinding) return;
|
||||
this.getCompatibleScopes();
|
||||
const attachTo = this.getAttachmentPath();
|
||||
if (!attachTo) return;
|
||||
if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
|
||||
let uid = attachTo.scope.generateUidIdentifier("ref");
|
||||
const declarator = variableDeclarator(uid, this.path.node);
|
||||
const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
|
||||
const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : variableDeclaration("var", [declarator])]);
|
||||
const parent = this.path.parentPath;
|
||||
if (parent.isJSXElement() && this.path.container === parent.node.children) {
|
||||
uid = jsxExpressionContainer(uid);
|
||||
}
|
||||
this.path.replaceWith(cloneNode(uid));
|
||||
return attached.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
|
||||
}
|
||||
}
|
||||
exports.default = PathHoister;
|
||||
|
||||
//# sourceMappingURL=hoister.js.map
|
||||
1
node_modules/@babel/traverse/lib/path/lib/hoister.js.map
generated
vendored
Normal file
1
node_modules/@babel/traverse/lib/path/lib/hoister.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
38
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
Normal file
38
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hooks = void 0;
|
||||
const hooks = exports.hooks = [function (self, parent) {
|
||||
const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
|
||||
if (removeParent) {
|
||||
parent.remove();
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
|
||||
parent.replaceWith(parent.node.expressions[0]);
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isBinary()) {
|
||||
if (self.key === "left") {
|
||||
parent.replaceWith(parent.node.right);
|
||||
} else {
|
||||
parent.replaceWith(parent.node.left);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isIfStatement() && self.key === "consequent" || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
|
||||
self.replaceWith({
|
||||
type: "BlockStatement",
|
||||
directives: [],
|
||||
body: []
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}];
|
||||
|
||||
//# sourceMappingURL=removal-hooks.js.map
|
||||
1
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map
generated
vendored
Normal file
1
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["hooks","exports","self","parent","removeParent","key","isWhile","isSwitchCase","isExportDeclaration","isLabeledStatement","listKey","isVariableDeclaration","node","declarations","length","isExpressionStatement","remove","isSequenceExpression","expressions","replaceWith","isBinary","right","left","isIfStatement","isLoop","isArrowFunctionExpression","type","directives","body"],"sources":["../../../src/path/lib/removal-hooks.ts"],"sourcesContent":["// this file contains hooks that handle ancestry cleanup of parent nodes when removing children\n\nimport type NodePath from \"../index.ts\";\nimport type * as t from \"@babel/types\";\n/**\n * Pre hooks should be used for either rejecting removal or delegating removal\n */\n\nexport const hooks = [\n function (self: NodePath, parent: NodePath) {\n const removeParent =\n // while (NODE);\n // removing the test of a while/switch, we can either just remove it entirely *or* turn the\n // `test` into `true` unlikely that the latter will ever be what's wanted so we just remove\n // the loop to avoid infinite recursion\n (self.key === \"test\" && (parent.isWhile() || parent.isSwitchCase())) ||\n // export NODE;\n // just remove a declaration for an export as this is no longer valid\n (self.key === \"declaration\" && parent.isExportDeclaration()) ||\n // label: NODE\n // stray labeled statement with no body\n (self.key === \"body\" && parent.isLabeledStatement()) ||\n // let NODE;\n // remove an entire declaration if there are no declarators left\n (self.listKey === \"declarations\" &&\n parent.isVariableDeclaration() &&\n parent.node.declarations.length === 1) ||\n // NODE;\n // remove the entire expression statement if there's no expression\n (self.key === \"expression\" && parent.isExpressionStatement());\n\n if (removeParent) {\n parent.remove();\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {\n // (node, NODE);\n // we've just removed the second element of a sequence expression so let's turn that sequence\n // expression into a regular expression\n parent.replaceWith(parent.node.expressions[0]);\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (parent.isBinary()) {\n // left + NODE;\n // NODE + right;\n // we're in a binary expression, better remove it and replace it with the last expression\n if (self.key === \"left\") {\n parent.replaceWith(parent.node.right);\n } else {\n // key === \"right\"\n parent.replaceWith(parent.node.left);\n }\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (\n (parent.isIfStatement() && self.key === \"consequent\") ||\n (self.key === \"body\" &&\n (parent.isLoop() || parent.isArrowFunctionExpression()))\n ) {\n self.replaceWith({\n type: \"BlockStatement\",\n directives: [],\n body: [],\n } satisfies t.BlockStatement);\n return true;\n }\n },\n];\n"],"mappings":";;;;;;AAQO,MAAMA,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,CACnB,UAAUE,IAAc,EAAEC,MAAgB,EAAE;EAC1C,MAAMC,YAAY,GAKfF,IAAI,CAACG,GAAG,KAAK,MAAM,KAAKF,MAAM,CAACG,OAAO,CAAC,CAAC,IAAIH,MAAM,CAACI,YAAY,CAAC,CAAC,CAAC,IAGlEL,IAAI,CAACG,GAAG,KAAK,aAAa,IAAIF,MAAM,CAACK,mBAAmB,CAAC,CAAE,IAG3DN,IAAI,CAACG,GAAG,KAAK,MAAM,IAAIF,MAAM,CAACM,kBAAkB,CAAC,CAAE,IAGnDP,IAAI,CAACQ,OAAO,KAAK,cAAc,IAC9BP,MAAM,CAACQ,qBAAqB,CAAC,CAAC,IAC9BR,MAAM,CAACS,IAAI,CAACC,YAAY,CAACC,MAAM,KAAK,CAAE,IAGvCZ,IAAI,CAACG,GAAG,KAAK,YAAY,IAAIF,MAAM,CAACY,qBAAqB,CAAC,CAAE;EAE/D,IAAIX,YAAY,EAAE;IAChBD,MAAM,CAACa,MAAM,CAAC,CAAC;IACf,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUd,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IAAIA,MAAM,CAACc,oBAAoB,CAAC,CAAC,IAAId,MAAM,CAACS,IAAI,CAACM,WAAW,CAACJ,MAAM,KAAK,CAAC,EAAE;IAIzEX,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACM,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9C,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUhB,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IAAIA,MAAM,CAACiB,QAAQ,CAAC,CAAC,EAAE;IAIrB,IAAIlB,IAAI,CAACG,GAAG,KAAK,MAAM,EAAE;MACvBF,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACS,KAAK,CAAC;IACvC,CAAC,MAAM;MAELlB,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACU,IAAI,CAAC;IACtC;IACA,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUpB,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IACGA,MAAM,CAACoB,aAAa,CAAC,CAAC,IAAIrB,IAAI,CAACG,GAAG,KAAK,YAAY,IACnDH,IAAI,CAACG,GAAG,KAAK,MAAM,KACjBF,MAAM,CAACqB,MAAM,CAAC,CAAC,IAAIrB,MAAM,CAACsB,yBAAyB,CAAC,CAAC,CAAE,EAC1D;IACAvB,IAAI,CAACiB,WAAW,CAAC;MACfO,IAAI,EAAE,gBAAgB;MACtBC,UAAU,EAAE,EAAE;MACdC,IAAI,EAAE;IACR,CAA4B,CAAC;IAC7B,OAAO,IAAI;EACb;AACF,CAAC,CACF","ignoreList":[]}
|
||||
164
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
generated
vendored
Normal file
164
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isBindingIdentifier = isBindingIdentifier;
|
||||
exports.isBlockScoped = isBlockScoped;
|
||||
exports.isExpression = isExpression;
|
||||
exports.isFlow = isFlow;
|
||||
exports.isForAwaitStatement = isForAwaitStatement;
|
||||
exports.isGenerated = isGenerated;
|
||||
exports.isPure = isPure;
|
||||
exports.isReferenced = isReferenced;
|
||||
exports.isReferencedIdentifier = isReferencedIdentifier;
|
||||
exports.isReferencedMemberExpression = isReferencedMemberExpression;
|
||||
exports.isRestProperty = isRestProperty;
|
||||
exports.isScope = isScope;
|
||||
exports.isSpreadProperty = isSpreadProperty;
|
||||
exports.isStatement = isStatement;
|
||||
exports.isUser = isUser;
|
||||
exports.isVar = isVar;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isBinding,
|
||||
isBlockScoped: nodeIsBlockScoped,
|
||||
isExportDeclaration,
|
||||
isExpression: nodeIsExpression,
|
||||
isFlow: nodeIsFlow,
|
||||
isForStatement,
|
||||
isForXStatement,
|
||||
isIdentifier,
|
||||
isImportDeclaration,
|
||||
isImportSpecifier,
|
||||
isJSXIdentifier,
|
||||
isJSXMemberExpression,
|
||||
isMemberExpression,
|
||||
isRestElement: nodeIsRestElement,
|
||||
isReferenced: nodeIsReferenced,
|
||||
isScope: nodeIsScope,
|
||||
isStatement: nodeIsStatement,
|
||||
isVar: nodeIsVar,
|
||||
isVariableDeclaration,
|
||||
react,
|
||||
isForOfStatement
|
||||
} = _t;
|
||||
const {
|
||||
isCompatTag
|
||||
} = react;
|
||||
function isReferencedIdentifier(opts) {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = this;
|
||||
if (isIdentifier(node, opts)) {
|
||||
return nodeIsReferenced(node, parent, this.parentPath.parent);
|
||||
} else if (isJSXIdentifier(node, opts)) {
|
||||
if (!isJSXMemberExpression(parent) && isCompatTag(node.name)) return false;
|
||||
return nodeIsReferenced(node, parent, this.parentPath.parent);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isReferencedMemberExpression() {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = this;
|
||||
return isMemberExpression(node) && nodeIsReferenced(node, parent);
|
||||
}
|
||||
function isBindingIdentifier() {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = this;
|
||||
const grandparent = this.parentPath.parent;
|
||||
return isIdentifier(node) && isBinding(node, parent, grandparent);
|
||||
}
|
||||
function isStatement() {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = this;
|
||||
if (nodeIsStatement(node)) {
|
||||
if (isVariableDeclaration(node)) {
|
||||
if (isForXStatement(parent, {
|
||||
left: node
|
||||
})) return false;
|
||||
if (isForStatement(parent, {
|
||||
init: node
|
||||
})) return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isExpression() {
|
||||
if (this.isIdentifier()) {
|
||||
return this.isReferencedIdentifier();
|
||||
} else {
|
||||
return nodeIsExpression(this.node);
|
||||
}
|
||||
}
|
||||
function isScope() {
|
||||
return nodeIsScope(this.node, this.parent);
|
||||
}
|
||||
function isReferenced() {
|
||||
return nodeIsReferenced(this.node, this.parent);
|
||||
}
|
||||
function isBlockScoped() {
|
||||
return nodeIsBlockScoped(this.node);
|
||||
}
|
||||
function isVar() {
|
||||
return nodeIsVar(this.node);
|
||||
}
|
||||
function isUser() {
|
||||
var _this$node;
|
||||
return !!((_this$node = this.node) != null && _this$node.loc);
|
||||
}
|
||||
function isGenerated() {
|
||||
return !this.isUser();
|
||||
}
|
||||
function isPure(constantsOnly) {
|
||||
return this.scope.isPure(this.node, constantsOnly);
|
||||
}
|
||||
function isFlow() {
|
||||
const {
|
||||
node
|
||||
} = this;
|
||||
if (nodeIsFlow(node)) {
|
||||
return true;
|
||||
} else if (isImportDeclaration(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else if (isExportDeclaration(node)) {
|
||||
return node.exportKind === "type";
|
||||
} else if (isImportSpecifier(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isRestProperty() {
|
||||
var _this$parentPath;
|
||||
return nodeIsRestElement(this.node) && ((_this$parentPath = this.parentPath) == null ? void 0 : _this$parentPath.isObjectPattern());
|
||||
}
|
||||
function isSpreadProperty() {
|
||||
var _this$parentPath2;
|
||||
return nodeIsRestElement(this.node) && ((_this$parentPath2 = this.parentPath) == null ? void 0 : _this$parentPath2.isObjectExpression());
|
||||
}
|
||||
function isForAwaitStatement() {
|
||||
return isForOfStatement(this.node, {
|
||||
await: true
|
||||
});
|
||||
}
|
||||
{
|
||||
exports.isExistentialTypeParam = function isExistentialTypeParam() {
|
||||
throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.");
|
||||
};
|
||||
exports.isNumericLiteralTypeAnnotation = function isNumericLiteralTypeAnnotation() {
|
||||
throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.");
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=virtual-types-validator.js.map
|
||||
1
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map
generated
vendored
Normal file
1
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
26
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
Normal file
26
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Var = exports.User = exports.Statement = exports.SpreadProperty = exports.Scope = exports.RestProperty = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = exports.Referenced = exports.Pure = exports.NumericLiteralTypeAnnotation = exports.Generated = exports.ForAwaitStatement = exports.Flow = exports.Expression = exports.ExistentialTypeParam = exports.BlockScoped = exports.BindingIdentifier = void 0;
|
||||
const ReferencedIdentifier = exports.ReferencedIdentifier = ["Identifier", "JSXIdentifier"];
|
||||
const ReferencedMemberExpression = exports.ReferencedMemberExpression = ["MemberExpression"];
|
||||
const BindingIdentifier = exports.BindingIdentifier = ["Identifier"];
|
||||
const Statement = exports.Statement = ["Statement"];
|
||||
const Expression = exports.Expression = ["Expression"];
|
||||
const Scope = exports.Scope = ["Scopable", "Pattern"];
|
||||
const Referenced = exports.Referenced = null;
|
||||
const BlockScoped = exports.BlockScoped = ["FunctionDeclaration", "ClassDeclaration", "VariableDeclaration"];
|
||||
const Var = exports.Var = ["VariableDeclaration"];
|
||||
const User = exports.User = null;
|
||||
const Generated = exports.Generated = null;
|
||||
const Pure = exports.Pure = null;
|
||||
const Flow = exports.Flow = ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"];
|
||||
const RestProperty = exports.RestProperty = ["RestElement"];
|
||||
const SpreadProperty = exports.SpreadProperty = ["RestElement"];
|
||||
const ExistentialTypeParam = exports.ExistentialTypeParam = ["ExistsTypeAnnotation"];
|
||||
const NumericLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = ["NumberLiteralTypeAnnotation"];
|
||||
const ForAwaitStatement = exports.ForAwaitStatement = ["ForOfStatement"];
|
||||
|
||||
//# sourceMappingURL=virtual-types.js.map
|
||||
1
node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map
generated
vendored
Normal file
1
node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["ReferencedIdentifier","exports","ReferencedMemberExpression","BindingIdentifier","Statement","Expression","Scope","Referenced","BlockScoped","Var","User","Generated","Pure","Flow","RestProperty","SpreadProperty","ExistentialTypeParam","NumericLiteralTypeAnnotation","ForAwaitStatement"],"sources":["../../../src/path/lib/virtual-types.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nexport interface VirtualTypeAliases {\n BindingIdentifier: t.Identifier;\n BlockScoped:\n | t.FunctionDeclaration\n | t.ClassDeclaration\n | t.VariableDeclaration;\n ExistentialTypeParam: t.ExistsTypeAnnotation;\n Expression: t.Expression;\n Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;\n ForAwaitStatement: t.ForOfStatement;\n Generated: t.Node;\n NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;\n Pure: t.Node;\n Referenced: t.Node;\n ReferencedIdentifier: t.Identifier | t.JSXIdentifier;\n ReferencedMemberExpression: t.MemberExpression;\n RestProperty: t.RestElement;\n Scope: t.Scopable | t.Pattern;\n SpreadProperty: t.RestElement;\n Statement: t.Statement;\n User: t.Node;\n Var: t.VariableDeclaration;\n}\n\ntype VirtualTypeMapping = readonly (t.Node[\"type\"] | keyof t.Aliases)[] | null;\n\nexport const ReferencedIdentifier: VirtualTypeMapping = [\n \"Identifier\",\n \"JSXIdentifier\",\n] as const;\n\nexport const ReferencedMemberExpression: VirtualTypeMapping = [\n \"MemberExpression\",\n] as const;\n\nexport const BindingIdentifier: VirtualTypeMapping = [\"Identifier\"] as const;\n\nexport const Statement: VirtualTypeMapping = [\"Statement\"] as const;\n\nexport const Expression: VirtualTypeMapping = [\"Expression\"] as const;\n\nexport const Scope: VirtualTypeMapping = [\"Scopable\", \"Pattern\"] as const;\n\nexport const Referenced: VirtualTypeMapping = null;\n\nexport const BlockScoped: VirtualTypeMapping = [\n \"FunctionDeclaration\",\n \"ClassDeclaration\",\n \"VariableDeclaration\",\n] as const;\n\nexport const Var: VirtualTypeMapping = [\"VariableDeclaration\"];\n\nexport const User: VirtualTypeMapping = null;\n\nexport const Generated: VirtualTypeMapping = null;\n\nexport const Pure: VirtualTypeMapping = null;\n\nexport const Flow: VirtualTypeMapping = [\n \"Flow\",\n \"ImportDeclaration\",\n \"ExportDeclaration\",\n \"ImportSpecifier\",\n] as const;\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const SpreadProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const ExistentialTypeParam: VirtualTypeMapping = [\n \"ExistsTypeAnnotation\",\n] as const;\n\nexport const NumericLiteralTypeAnnotation: VirtualTypeMapping = [\n \"NumberLiteralTypeAnnotation\",\n] as const;\n\nexport const ForAwaitStatement: VirtualTypeMapping = [\n \"ForOfStatement\",\n] as const;\n"],"mappings":";;;;;;AA4BO,MAAMA,oBAAwC,GAAAC,OAAA,CAAAD,oBAAA,GAAG,CACtD,YAAY,EACZ,eAAe,CACP;AAEH,MAAME,0BAA8C,GAAAD,OAAA,CAAAC,0BAAA,GAAG,CAC5D,kBAAkB,CACV;AAEH,MAAMC,iBAAqC,GAAAF,OAAA,CAAAE,iBAAA,GAAG,CAAC,YAAY,CAAU;AAErE,MAAMC,SAA6B,GAAAH,OAAA,CAAAG,SAAA,GAAG,CAAC,WAAW,CAAU;AAE5D,MAAMC,UAA8B,GAAAJ,OAAA,CAAAI,UAAA,GAAG,CAAC,YAAY,CAAU;AAE9D,MAAMC,KAAyB,GAAAL,OAAA,CAAAK,KAAA,GAAG,CAAC,UAAU,EAAE,SAAS,CAAU;AAElE,MAAMC,UAA8B,GAAAN,OAAA,CAAAM,UAAA,GAAG,IAAI;AAE3C,MAAMC,WAA+B,GAAAP,OAAA,CAAAO,WAAA,GAAG,CAC7C,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,CACb;AAEH,MAAMC,GAAuB,GAAAR,OAAA,CAAAQ,GAAA,GAAG,CAAC,qBAAqB,CAAC;AAEvD,MAAMC,IAAwB,GAAAT,OAAA,CAAAS,IAAA,GAAG,IAAI;AAErC,MAAMC,SAA6B,GAAAV,OAAA,CAAAU,SAAA,GAAG,IAAI;AAE1C,MAAMC,IAAwB,GAAAX,OAAA,CAAAW,IAAA,GAAG,IAAI;AAErC,MAAMC,IAAwB,GAAAZ,OAAA,CAAAY,IAAA,GAAG,CACtC,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,CACT;AAGH,MAAMC,YAAgC,GAAAb,OAAA,CAAAa,YAAA,GAAG,CAAC,aAAa,CAAU;AAEjE,MAAMC,cAAkC,GAAAd,OAAA,CAAAc,cAAA,GAAG,CAAC,aAAa,CAAU;AAEnE,MAAMC,oBAAwC,GAAAf,OAAA,CAAAe,oBAAA,GAAG,CACtD,sBAAsB,CACd;AAEH,MAAMC,4BAAgD,GAAAhB,OAAA,CAAAgB,4BAAA,GAAG,CAC9D,6BAA6B,CACrB;AAEH,MAAMC,iBAAqC,GAAAjB,OAAA,CAAAiB,iBAAA,GAAG,CACnD,gBAAgB,CACR","ignoreList":[]}
|
||||
Reference in New Issue
Block a user