init 3
This commit is contained in:
125
node_modules/@babel/traverse/lib/context.js
generated
vendored
Normal file
125
node_modules/@babel/traverse/lib/context.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _index = require("./path/index.js");
|
||||
var _t = require("@babel/types");
|
||||
var _context = require("./path/context.js");
|
||||
var _hub = require("./hub.js");
|
||||
const {
|
||||
VISITOR_KEYS
|
||||
} = _t;
|
||||
class TraversalContext {
|
||||
constructor(scope, opts, state, parentPath) {
|
||||
this.queue = null;
|
||||
this.priorityQueue = null;
|
||||
this.parentPath = parentPath;
|
||||
this.scope = scope;
|
||||
this.state = state;
|
||||
this.opts = opts;
|
||||
}
|
||||
shouldVisit(node) {
|
||||
const opts = this.opts;
|
||||
if (opts.enter || opts.exit) return true;
|
||||
if (opts[node.type]) return true;
|
||||
const keys = VISITOR_KEYS[node.type];
|
||||
if (!(keys != null && keys.length)) return false;
|
||||
for (const key of keys) {
|
||||
if (node[key]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
create(node, container, key, listKey) {
|
||||
const {
|
||||
parentPath
|
||||
} = this;
|
||||
const hub = parentPath == null ? node.type === "Program" || node.type === "File" ? new _hub.default() : undefined : parentPath.hub;
|
||||
return _index.default.get({
|
||||
parentPath,
|
||||
parent: node,
|
||||
container,
|
||||
key: key,
|
||||
listKey,
|
||||
hub
|
||||
});
|
||||
}
|
||||
maybeQueue(path, notPriority) {
|
||||
if (this.queue) {
|
||||
if (notPriority) {
|
||||
this.queue.push(path);
|
||||
} else {
|
||||
this.priorityQueue.push(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
visitMultiple(container, parent, listKey) {
|
||||
if (container.length === 0) return false;
|
||||
const queue = [];
|
||||
for (let key = 0; key < container.length; key++) {
|
||||
const node = container[key];
|
||||
if (node && this.shouldVisit(node)) {
|
||||
queue.push(this.create(parent, container, key, listKey));
|
||||
}
|
||||
}
|
||||
return this.visitQueue(queue);
|
||||
}
|
||||
visitSingle(node, key) {
|
||||
if (this.shouldVisit(node[key])) {
|
||||
return this.visitQueue([this.create(node, node, key)]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
visitQueue(queue) {
|
||||
this.queue = queue;
|
||||
this.priorityQueue = [];
|
||||
const visited = new WeakSet();
|
||||
let stop = false;
|
||||
let visitIndex = 0;
|
||||
for (; visitIndex < queue.length;) {
|
||||
const path = queue[visitIndex];
|
||||
visitIndex++;
|
||||
_context.resync.call(path);
|
||||
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
|
||||
_context.pushContext.call(path, this);
|
||||
}
|
||||
if (path.key === null) continue;
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
if (visited.has(node)) continue;
|
||||
if (node) visited.add(node);
|
||||
if (path.visit()) {
|
||||
stop = true;
|
||||
break;
|
||||
}
|
||||
if (this.priorityQueue.length) {
|
||||
stop = this.visitQueue(this.priorityQueue);
|
||||
this.priorityQueue = [];
|
||||
this.queue = queue;
|
||||
if (stop) break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < visitIndex; i++) {
|
||||
_context.popContext.call(queue[i]);
|
||||
}
|
||||
this.queue = null;
|
||||
return stop;
|
||||
}
|
||||
visit(node, key) {
|
||||
const nodes = node[key];
|
||||
if (!nodes) return false;
|
||||
if (Array.isArray(nodes)) {
|
||||
return this.visitMultiple(nodes, node, key);
|
||||
} else {
|
||||
return this.visitSingle(node, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.default = TraversalContext;
|
||||
|
||||
//# sourceMappingURL=context.js.map
|
||||
1
node_modules/@babel/traverse/lib/context.js.map
generated
vendored
Normal file
1
node_modules/@babel/traverse/lib/context.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
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
|
||||
162
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
generated
vendored
Normal file
162
node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
"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
|
||||
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