完成世界书、骰子、apiconfig页面处理
This commit is contained in:
22
frontend/node_modules/@babel/traverse/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@babel/traverse/LICENSE
generated
vendored
Normal 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
frontend/node_modules/@babel/traverse/lib/hub.js
generated
vendored
Normal file
19
frontend/node_modules/@babel/traverse/lib/hub.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
class Hub {
|
||||
getCode() {}
|
||||
getScope() {}
|
||||
addHelper() {
|
||||
throw new Error("Helpers are not supported by the default hub.");
|
||||
}
|
||||
buildError(node, msg, Error = TypeError) {
|
||||
return new Error(msg);
|
||||
}
|
||||
}
|
||||
exports.default = Hub;
|
||||
|
||||
//# sourceMappingURL=hub.js.map
|
||||
1
frontend/node_modules/@babel/traverse/lib/hub.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/hub.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["Hub","getCode","getScope","addHelper","Error","buildError","node","msg","TypeError","exports","default"],"sources":["../src/hub.ts"],"sourcesContent":["import type Scope from \"./scope/index.ts\";\nimport type { Node } from \"@babel/types\";\n\nexport interface HubInterface {\n getCode(): string | void;\n getScope(): Scope | void;\n addHelper(name: string): any;\n buildError(node: Node, msg: string, Error: new (msg: string) => Error): Error;\n}\n\nexport default class Hub implements HubInterface {\n getCode() {}\n\n getScope() {}\n\n addHelper() {\n throw new Error(\"Helpers are not supported by the default hub.\");\n }\n\n buildError(\n node: Node,\n msg: string,\n Error: new (msg: string) => Error = TypeError,\n ): Error {\n return new Error(msg);\n }\n}\n"],"mappings":";;;;;;AAUe,MAAMA,GAAG,CAAyB;EAC/CC,OAAOA,CAAA,EAAG,CAAC;EAEXC,QAAQA,CAAA,EAAG,CAAC;EAEZC,SAASA,CAAA,EAAG;IACV,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EAClE;EAEAC,UAAUA,CACRC,IAAU,EACVC,GAAW,EACXH,KAAiC,GAAGI,SAAS,EACtC;IACP,OAAO,IAAIJ,KAAK,CAACG,GAAG,CAAC;EACvB;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAV,GAAA","ignoreList":[]}
|
||||
52
frontend/node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
Normal file
52
frontend/node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.addComment = addComment;
|
||||
exports.addComments = addComments;
|
||||
exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
addComment: _addComment,
|
||||
addComments: _addComments
|
||||
} = _t;
|
||||
function shareCommentsWithSiblings() {
|
||||
if (typeof this.key === "string") return;
|
||||
const node = this.node;
|
||||
if (!node) return;
|
||||
const trailing = node.trailingComments;
|
||||
const leading = node.leadingComments;
|
||||
if (!trailing && !leading) return;
|
||||
const prev = this.getSibling(this.key - 1);
|
||||
const next = this.getSibling(this.key + 1);
|
||||
const hasPrev = Boolean(prev.node);
|
||||
const hasNext = Boolean(next.node);
|
||||
if (hasPrev) {
|
||||
if (leading) {
|
||||
prev.addComments("trailing", removeIfExisting(leading, prev.node.trailingComments));
|
||||
}
|
||||
if (trailing && !hasNext) prev.addComments("trailing", trailing);
|
||||
}
|
||||
if (hasNext) {
|
||||
if (trailing) {
|
||||
next.addComments("leading", removeIfExisting(trailing, next.node.leadingComments));
|
||||
}
|
||||
if (leading && !hasPrev) next.addComments("leading", leading);
|
||||
}
|
||||
}
|
||||
function removeIfExisting(list, toRemove) {
|
||||
if (!(toRemove != null && toRemove.length)) return list;
|
||||
const set = new Set(toRemove);
|
||||
return list.filter(el => {
|
||||
return !set.has(el);
|
||||
});
|
||||
}
|
||||
function addComment(type, content, line) {
|
||||
_addComment(this.node, type, content, line);
|
||||
}
|
||||
function addComments(type, comments) {
|
||||
_addComments(this.node, type, comments);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=comments.js.map
|
||||
1
frontend/node_modules/@babel/traverse/lib/path/comments.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/path/comments.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_t","require","addComment","_addComment","addComments","_addComments","shareCommentsWithSiblings","key","node","trailing","trailingComments","leading","leadingComments","prev","getSibling","next","hasPrev","Boolean","hasNext","removeIfExisting","list","toRemove","length","set","Set","filter","el","has","type","content","line","comments"],"sources":["../../src/path/comments.ts"],"sourcesContent":["// This file contains methods responsible for dealing with comments.\nimport type * as t from \"@babel/types\";\nimport type NodePath from \"./index.ts\";\nimport {\n addComment as _addComment,\n addComments as _addComments,\n} from \"@babel/types\";\n\n/**\n * Share comments amongst siblings.\n */\n\nexport function shareCommentsWithSiblings(this: NodePath) {\n // NOTE: this assumes numbered keys\n if (typeof this.key === \"string\") return;\n\n const node = this.node;\n if (!node) return;\n\n const trailing = node.trailingComments;\n const leading = node.leadingComments;\n if (!trailing && !leading) return;\n\n const prev = this.getSibling(this.key! - 1);\n const next = this.getSibling(this.key! + 1);\n const hasPrev = Boolean(prev.node);\n const hasNext = Boolean(next.node);\n\n if (hasPrev) {\n if (leading) {\n prev.addComments(\n \"trailing\",\n removeIfExisting(leading, prev.node.trailingComments),\n );\n }\n if (trailing && !hasNext) prev.addComments(\"trailing\", trailing);\n }\n if (hasNext) {\n if (trailing) {\n next.addComments(\n \"leading\",\n removeIfExisting(trailing, next.node.leadingComments),\n );\n }\n if (leading && !hasPrev) next.addComments(\"leading\", leading);\n }\n}\n\nfunction removeIfExisting<T>(list: T[], toRemove?: T[] | null): T[] {\n if (!toRemove?.length) return list;\n const set = new Set(toRemove);\n return list.filter(el => {\n return !set.has(el);\n });\n}\n\nexport function addComment(\n this: NodePath,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n) {\n _addComment(this.node, type, content, line);\n}\n\n/**\n * Give node `comments` of the specified `type`.\n */\n\nexport function addComments(\n this: NodePath,\n type: t.CommentTypeShorthand,\n comments: t.Comment[],\n) {\n _addComments(this.node, type, comments);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,EAAA,GAAAC,OAAA;AAGsB;EAFpBC,UAAU,EAAIC,WAAW;EACzBC,WAAW,EAAIC;AAAY,IAAAL,EAAA;AAOtB,SAASM,yBAAyBA,CAAA,EAAiB;EAExD,IAAI,OAAO,IAAI,CAACC,GAAG,KAAK,QAAQ,EAAE;EAElC,MAAMC,IAAI,GAAG,IAAI,CAACA,IAA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ACC,EAAE,IAAI;IACvB,OAAO,CAACH,GAAG,CAACI,GAAG,CAACD,EAAE,CAAC;EACrB,CAAC,CAAC;AACJ;AAEO,SAASxB,UAAUA,CAExB0B,IAA4B,EAC5BC,OAAe,EACfC,IAAc,EACd;EACA3B,WAAW,CAAC,IAAI,CAACK,IAAI,EAAEoB,IAAI,EAAEC,OAAO,EAAEC,IAAI,CAAC;AAC7C;AAMO,SAAS1B,WAAWA,CAEzBwB,IAA4B,EAC5BG,QAAqB,EACrB;EACA1B,YAAY,CAAC,IAAI,CAACG,IAAI,EAAEoB,IAAI,EAAEG,QAAQ,CAAC;AACzC","ignoreList":[]}
|
||||
149
frontend/node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
Normal file
149
frontend/node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports._getTypeAnnotation = _getTypeAnnotation;
|
||||
exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
|
||||
exports.couldBeBaseType = couldBeBaseType;
|
||||
exports.getTypeAnnotation = getTypeAnnotation;
|
||||
exports.isBaseType = isBaseType;
|
||||
exports.isGenericType = isGenericType;
|
||||
var inferers = require("./inferers.js");
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
anyTypeAnnotation,
|
||||
isAnyTypeAnnotation,
|
||||
isArrayTypeAnnotation,
|
||||
isBooleanTypeAnnotation,
|
||||
isEmptyTypeAnnotation,
|
||||
isFlowBaseAnnotation,
|
||||
isGenericTypeAnnotation,
|
||||
isIdentifier,
|
||||
isMixedTypeAnnotation,
|
||||
isNumberTypeAnnotation,
|
||||
isStringTypeAnnotation,
|
||||
isTSArrayType,
|
||||
isTSTypeAnnotation,
|
||||
isTSTypeReference,
|
||||
isTupleTypeAnnotation,
|
||||
isTypeAnnotation,
|
||||
isUnionTypeAnnotation,
|
||||
isVoidTypeAnnotation,
|
||||
stringTypeAnnotation,
|
||||
voidTypeAnnotation
|
||||
} = _t;
|
||||
function getTypeAnnotation() {
|
||||
let type = this.getData("typeAnnotation");
|
||||
if (type != null) {
|
||||
return type;
|
||||
}
|
||||
type = _getTypeAnnotation.call(this) || anyTypeAnnotation();
|
||||
if (isTypeAnnotation(type) || isTSTypeAnnotation(type)) {
|
||||
type = type.typeAnnotation;
|
||||
}
|
||||
this.setData("typeAnnotation", type);
|
||||
return type;
|
||||
}
|
||||
const typeAnnotationInferringNodes = new WeakSet();
|
||||
function _getTypeAnnotation() {
|
||||
const node = this.node;
|
||||
if (!node) {
|
||||
if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
|
||||
const declar = this.parentPath.parentPath;
|
||||
const declarParent = declar.parentPath;
|
||||
if (declar.key === "left" && declarParent.isForInStatement()) {
|
||||
return stringTypeAnnotation();
|
||||
}
|
||||
if (declar.key === "left" && declarParent.isForOfStatement()) {
|
||||
return anyTypeAnnotation();
|
||||
}
|
||||
return voidTypeAnnotation();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (node.typeAnnotation) {
|
||||
return node.typeAnnotation;
|
||||
}
|
||||
if (typeAnnotationInferringNodes.has(node)) {
|
||||
return;
|
||||
}
|
||||
typeAnnotationInferringNodes.add(node);
|
||||
try {
|
||||
var _inferer;
|
||||
let inferer = inferers[node.type];
|
||||
if (inferer) {
|
||||
return inferer.call(this, node);
|
||||
}
|
||||
inferer = inferers[this.parentPath.type];
|
||||
if ((_inferer = inferer) != null && _inferer.validParent) {
|
||||
return this.parentPath.getTypeAnnotation();
|
||||
}
|
||||
} finally {
|
||||
typeAnnotationInferringNodes.delete(node);
|
||||
}
|
||||
}
|
||||
function isBaseType(baseName, soft) {
|
||||
return _isBaseType(baseName, this.getTypeAnnotation(), soft);
|
||||
}
|
||||
function _isBaseType(baseName, type, soft) {
|
||||
if (baseName === "string") {
|
||||
return isStringTypeAnnotation(type);
|
||||
} else if (baseName === "number") {
|
||||
return isNumberTypeAnnotation(type);
|
||||
} else if (baseName === "boolean") {
|
||||
return isBooleanTypeAnnotation(type);
|
||||
} else if (baseName === "any") {
|
||||
return isAnyTypeAnnotation(type);
|
||||
} else if (baseName === "mixed") {
|
||||
return isMixedTypeAnnotation(type);
|
||||
} else if (baseName === "empty") {
|
||||
return isEmptyTypeAnnotation(type);
|
||||
} else if (baseName === "void") {
|
||||
return isVoidTypeAnnotation(type);
|
||||
} else {
|
||||
if (soft) {
|
||||
return false;
|
||||
} else {
|
||||
throw new Error(`Unknown base type ${baseName}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
function couldBeBaseType(name) {
|
||||
const type = this.getTypeAnnotation();
|
||||
if (isAnyTypeAnnotation(type)) return true;
|
||||
if (isUnionTypeAnnotation(type)) {
|
||||
for (const type2 of type.types) {
|
||||
if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return _isBaseType(name, type, true);
|
||||
}
|
||||
}
|
||||
function baseTypeStrictlyMatches(rightArg) {
|
||||
const left = this.getTypeAnnotation();
|
||||
const right = rightArg.getTypeAnnotation();
|
||||
if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {
|
||||
return right.type === left.type;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isGenericType(genericName) {
|
||||
const type = this.getTypeAnnotation();
|
||||
if (genericName === "Array") {
|
||||
if (isTSArrayType(type) || isArrayTypeAnnotation(type) || isTupleTypeAnnotation(type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return isGenericTypeAnnotation(type) && isIdentifier(type.id, {
|
||||
name: genericName
|
||||
}) || isTSTypeReference(type) && isIdentifier(type.typeName, {
|
||||
name: genericName
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/node_modules/@babel/traverse/lib/path/inference/index.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/path/inference/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
frontend/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
frontend/node_modules/@babel/traverse/lib/path/inference/inferers.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/path/inference/inferers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
38
frontend/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
Normal file
38
frontend/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
frontend/node_modules/@babel/traverse/lib/scope/binding.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/scope/binding.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
66
frontend/node_modules/@babel/traverse/lib/scope/traverseForScope.js
generated
vendored
Normal file
66
frontend/node_modules/@babel/traverse/lib/scope/traverseForScope.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = traverseForScope;
|
||||
var _t = require("@babel/types");
|
||||
var _index = require("../index.js");
|
||||
var _visitors = require("../visitors.js");
|
||||
var _context = require("../path/context.js");
|
||||
const {
|
||||
VISITOR_KEYS
|
||||
} = _t;
|
||||
function traverseForScope(path, visitors, state) {
|
||||
const exploded = (0, _visitors.explode)(visitors);
|
||||
if (exploded.enter || exploded.exit) {
|
||||
throw new Error("Should not be used with enter/exit visitors.");
|
||||
}
|
||||
_traverse(path.parentPath, path.parent, path.node, path.container, path.key, path.listKey, path.hub, path);
|
||||
function _traverse(parentPath, parent, node, container, key, listKey, hub, inPath) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
const path = inPath || _index.NodePath.get({
|
||||
hub,
|
||||
parentPath,
|
||||
parent,
|
||||
container,
|
||||
listKey,
|
||||
key
|
||||
});
|
||||
_context._forceSetScope.call(path);
|
||||
const visitor = exploded[node.type];
|
||||
if (visitor != null && visitor.enter) {
|
||||
for (const visit of visitor.enter) {
|
||||
visit.call(state, path, state);
|
||||
}
|
||||
}
|
||||
if (path.shouldSkip) {
|
||||
return;
|
||||
}
|
||||
const keys = VISITOR_KEYS[node.type];
|
||||
if (!(keys != null && keys.length)) {
|
||||
return;
|
||||
}
|
||||
for (const key of keys) {
|
||||
const prop = node[key];
|
||||
if (!prop) continue;
|
||||
if (Array.isArray(prop)) {
|
||||
for (let i = 0; i < prop.length; i++) {
|
||||
const value = prop[i];
|
||||
_traverse(path, node, value, prop, i, key);
|
||||
}
|
||||
} else {
|
||||
_traverse(path, node, prop, node, key, null);
|
||||
}
|
||||
}
|
||||
if (visitor != null && visitor.exit) {
|
||||
for (const visit of visitor.exit) {
|
||||
visit.call(state, path, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=traverseForScope.js.map
|
||||
1
frontend/node_modules/@babel/traverse/lib/scope/traverseForScope.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/scope/traverseForScope.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_t","require","_index","_visitors","_context","VISITOR_KEYS","traverseForScope","path","visitors","state","exploded","explode","enter","exit","Error","_traverse","parentPath","parent","node","container","key","listKey","hub","inPath","NodePath","get","_forceSetScope","call","visitor","type","visit","shouldSkip","keys","length","prop","Array","isArray","i","value"],"sources":["../../src/scope/traverseForScope.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { HubInterface, Visitor } from \"../index.ts\";\nimport { NodePath } from \"../index.ts\";\nimport { explode } from \"../visitors.ts\";\nimport { _forceSetScope } from \"../path/context.ts\";\n\nexport default function traverseForScope(\n path: NodePath,\n visitors: Visitor,\n state: any,\n) {\n const exploded = explode(visitors);\n\n if (exploded.enter || exploded.exit) {\n throw new Error(\"Should not be used with enter/exit visitors.\");\n }\n\n _traverse(\n path.parentPath,\n path.parent,\n path.node,\n path.container!,\n path.key!,\n path.listKey,\n path.hub,\n path,\n );\n\n function _traverse(\n parentPath: NodePath,\n parent: t.Node,\n node: t.Node,\n container: t.Node | t.Node[],\n key: string | number,\n listKey: string | null | undefined,\n hub?: HubInterface,\n inPath?: NodePath,\n ) {\n if (!node) {\n return;\n }\n\n const path =\n inPath ||\n NodePath.get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n });\n\n _forceSetScope.call(path);\n\n const visitor = exploded[node.type];\n if (visitor?.enter) {\n for (const visit of visitor.enter) {\n visit.call(state, path, state);\n }\n }\n\n if (path.shouldSkip) {\n return;\n }\n\n const keys = VISITOR_KEYS[node.type];\n if (!keys?.length) {\n return;\n }\n\n for (const key of keys) {\n // @ts-expect-error key must present in node\n const prop = node[key];\n if (!prop) continue;\n if (Array.isArray(prop)) {\n for (let i = 0; i < prop.length; i++) {\n const value = prop[i];\n _traverse(path, node, value, prop, i, key);\n }\n } else {\n _traverse(path, node, prop, node, key, null);\n }\n }\n\n if (visitor?.exit) {\n for (const visit of visitor.exit) {\n visit.call(state, path, state);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAoD;EAL3CI;AAAY,IAAAL,EAAA;AAON,SAASM,gBAAgBA,CACtCC,IAAc,EACdC,QAAiB,EACjBC,KAAU,EACV;EACA,MAAMC,QAAQ,GAAG,IAAAC,iBAAO,EAACH,QAAQ,CAAC;EAElC,IAAIE,QAAQ,CAACE,KAAK,IAAIF,QAAQ,CAACG,IAAI,EAAE;IACnC,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EAEAC,SAAS,CACPR,IAAI,CAACS,UAAU,EACfT,IAAI,CAACU,MAAM,EACXV,IAAI,CAACW,IAAI,EACTX,IAAI,CAACY,SAAS,EACdZ,IAAI,CAACa,GAAG,EACRb,IAAI,CAACc,OAAO,EACZd,IAAI,CAACe,GAAG,EACRf,IACF,CAAC;EAED,SAASQ,SAASA,CAChBC,UAAoB,EACpBC,MAAc,EACdC,IAAY,EACZC,SAA4B,EAC5BC,GAAoB,EACpBC,OAAkC,EAClCC,GAAkB,EAClBC,MAAiB,EACjB;IACA,IAAI,CAAC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A,IAAIQ,OAAO,YAAPA,OAAO,CAAEf,IAAI,EAAE;MACjB,KAAK,MAAMiB,KAAK,IAAIF,OAAO,CAACf,IAAI,EAAE;QAChCiB,KAAK,CAACH,IAAI,CAAClB,KAAK,EAAEF,IAAI,EAAEE,KAAK,CAAC;MAChC;IACF;EACF;AACF","ignoreList":[]}
|
||||
1
frontend/node_modules/@babel/traverse/lib/visitors.js.map
generated
vendored
Normal file
1
frontend/node_modules/@babel/traverse/lib/visitors.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user