challenge-algorithms-v2.0-u.../node_modules/@babel/traverse/lib/visitors.js.map

1 line
17 KiB
Plaintext

{"version":3,"names":["DEPRECATED_KEYS","FLIPPED_ALIAS_KEYS","TYPES","isVirtualType","type","virtualTypes","explode","visitor","_exploded","nodeType","Object","keys","shouldIgnoreKey","parts","split","length","fns","part","verify","__esModule","ensureEntranceObjects","ensureCallbackArrays","wrapCheck","types","mergePair","aliases","deprecatedKey","console","trace","alias","existing","_verified","Error","validateVisitorMethods","indexOf","visitors","visitorKey","path","val","concat","fn","TypeError","merge","states","wrapper","rootVisitor","i","state","visitorType","wrapWithStateOrWrapper","nodeVisitor","oldVisitor","newVisitor","key","Array","isArray","map","newFn","call","toString","obj","enter","exit","apply","arguments","dest","src"],"sources":["../src/visitors.ts"],"sourcesContent":["import * as virtualTypes from \"./path/lib/virtual-types\";\nimport { DEPRECATED_KEYS, FLIPPED_ALIAS_KEYS, TYPES } from \"@babel/types\";\nimport type { NodePath, Visitor } from \"./index\";\n\ntype VIRTUAL_TYPES = keyof typeof virtualTypes;\nfunction isVirtualType(type: string): type is VIRTUAL_TYPES {\n return type in virtualTypes;\n}\n\n/**\n * explode() will take a visitor object with all of the various shorthands\n * that we support, and validates & normalizes it into a common format, ready\n * to be used in traversal\n *\n * The various shorthands are:\n * * `Identifier() { ... }` -> `Identifier: { enter() { ... } }`\n * * `\"Identifier|NumericLiteral\": { ... }` -> `Identifier: { ... }, NumericLiteral: { ... }`\n * * Aliases in `@babel/types`: e.g. `Property: { ... }` -> `ObjectProperty: { ... }, ClassProperty: { ... }`\n *\n * Other normalizations are:\n * * Visitors of virtual types are wrapped, so that they are only visited when\n * their dynamic check passes\n * * `enter` and `exit` functions are wrapped in arrays, to ease merging of\n * visitors\n */\nexport function explode(visitor: Visitor) {\n if (visitor._exploded) return visitor;\n visitor._exploded = true;\n\n // normalise pipes\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n const parts: Array<string> = nodeType.split(\"|\");\n if (parts.length === 1) continue;\n\n const fns = visitor[nodeType];\n delete visitor[nodeType];\n\n for (const part of parts) {\n // @ts-expect-error part will be verified by `verify` later\n visitor[part] = fns;\n }\n }\n\n // verify data structure\n verify(visitor);\n\n // make sure there's no __esModule type since this is because we're using loose mode\n // and it sets __esModule to be enumerable on all modules :(\n // @ts-expect-error ESModule interop\n delete visitor.__esModule;\n\n // ensure visitors are objects\n ensureEntranceObjects(visitor);\n\n // ensure enter/exit callbacks are arrays\n ensureCallbackArrays(visitor);\n\n // add type wrappers\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n if (!isVirtualType(nodeType)) continue;\n\n // wrap all the functions\n const fns = visitor[nodeType];\n for (const type of Object.keys(fns)) {\n // @ts-expect-error manipulating visitors\n fns[type] = wrapCheck(nodeType, fns[type]);\n }\n\n // clear it from the visitor\n delete visitor[nodeType];\n\n const types = virtualTypes[nodeType];\n if (types !== null) {\n for (const type of types) {\n // merge the visitor if necessary or just put it back in\n if (visitor[type]) {\n mergePair(visitor[type], fns);\n } else {\n // @ts-expect-error Expression produces too complex union\n visitor[type] = fns;\n }\n }\n } else {\n mergePair(visitor, fns);\n }\n }\n\n // add aliases\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n const fns = visitor[nodeType];\n\n let aliases = FLIPPED_ALIAS_KEYS[nodeType];\n\n const deprecatedKey = DEPRECATED_KEYS[nodeType];\n if (deprecatedKey) {\n console.trace(\n `Visitor defined for ${nodeType} but it has been renamed to ${deprecatedKey}`,\n );\n aliases = [deprecatedKey];\n }\n\n if (!aliases) continue;\n\n // clear it from the visitor\n delete visitor[nodeType];\n\n for (const alias of aliases) {\n const existing = visitor[alias];\n if (existing) {\n mergePair(existing, fns);\n } else {\n // @ts-expect-error Expression produces a union type that is too complex to represent.\n visitor[alias] = { ...fns };\n }\n }\n }\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n ensureCallbackArrays(\n // @ts-expect-error nodeType must present in visitor after previous validations\n visitor[nodeType],\n );\n }\n\n return visitor;\n}\n\nexport function verify(visitor: Visitor) {\n if (visitor._verified) return;\n\n if (typeof visitor === \"function\") {\n throw new Error(\n \"You passed `traverse()` a function when it expected a visitor object, \" +\n \"are you sure you didn't mean `{ enter: Function }`?\",\n );\n }\n\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (nodeType === \"enter\" || nodeType === \"exit\") {\n validateVisitorMethods(nodeType, visitor[nodeType]);\n }\n\n if (shouldIgnoreKey(nodeType)) continue;\n\n if (TYPES.indexOf(nodeType) < 0) {\n throw new Error(\n `You gave us a visitor for the node type ${nodeType} but it's not a valid type`,\n );\n }\n\n const visitors = visitor[nodeType];\n if (typeof visitors === \"object\") {\n for (const visitorKey of Object.keys(visitors)) {\n if (visitorKey === \"enter\" || visitorKey === \"exit\") {\n // verify that it just contains functions\n validateVisitorMethods(\n `${nodeType}.${visitorKey}`,\n visitors[visitorKey],\n );\n } else {\n throw new Error(\n \"You passed `traverse()` a visitor object with the property \" +\n `${nodeType} that has the invalid property ${visitorKey}`,\n );\n }\n }\n }\n }\n\n visitor._verified = true;\n}\n\nfunction validateVisitorMethods(\n path: string,\n val: any,\n): asserts val is Function | Function[] {\n const fns = [].concat(val);\n for (const fn of fns) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\n `Non-function found defined in ${path} with type ${typeof fn}`,\n );\n }\n }\n}\n\nexport function merge<State>(visitors: Visitor<State>[]): Visitor<State>;\nexport function merge(\n visitors: Visitor<unknown>[],\n states?: any[],\n wrapper?: Function | null,\n): Visitor<unknown>;\nexport function merge(\n visitors: any[],\n states: any[] = [],\n wrapper?: Function | null,\n) {\n const rootVisitor: Visitor = {};\n\n for (let i = 0; i < visitors.length; i++) {\n const visitor = visitors[i];\n const state = states[i];\n\n explode(visitor);\n\n for (const type of Object.keys(visitor) as (keyof Visitor)[]) {\n let visitorType = visitor[type];\n\n // if we have state or wrapper then overload the callbacks to take it\n if (state || wrapper) {\n visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);\n }\n\n // @ts-expect-error: Expression produces a union type that is too complex to represent.\n const nodeVisitor = (rootVisitor[type] ||= {});\n mergePair(nodeVisitor, visitorType);\n }\n }\n\n return rootVisitor;\n}\n\nfunction wrapWithStateOrWrapper<State>(\n oldVisitor: Visitor<State>,\n state: State,\n wrapper?: Function | null,\n) {\n const newVisitor: Visitor = {};\n\n for (const key of Object.keys(oldVisitor) as (keyof Visitor<State>)[]) {\n let fns = oldVisitor[key];\n\n // not an enter/exit array of callbacks\n if (!Array.isArray(fns)) continue;\n\n // @ts-expect-error manipulating visitors\n fns = fns.map(function (fn) {\n let newFn = fn;\n\n if (state) {\n newFn = function (path: NodePath) {\n return fn.call(state, path, state);\n };\n }\n\n if (wrapper) {\n // @ts-expect-error Fixme: document state.key\n newFn = wrapper(state.key, key, newFn);\n }\n\n // Override toString in case this function is printed, we want to print the wrapped function, same as we do in `wrapCheck`\n if (newFn !== fn) {\n newFn.toString = () => fn.toString();\n }\n\n return newFn;\n });\n\n // @ts-expect-error: Expression produces a union type that is too complex to represent.\n newVisitor[key] = fns;\n }\n\n return newVisitor;\n}\n\nfunction ensureEntranceObjects(obj: Visitor) {\n for (const key of Object.keys(obj) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(key)) continue;\n\n const fns = obj[key];\n if (typeof fns === \"function\") {\n // @ts-expect-error: Expression produces a union type that is too complex to represent.\n obj[key] = { enter: fns };\n }\n }\n}\n\nfunction ensureCallbackArrays(obj: Visitor) {\n // @ts-expect-error normalizing enter property\n if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];\n // @ts-expect-error normalizing exit property\n if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];\n}\n\nfunction wrapCheck(nodeType: VIRTUAL_TYPES, fn: Function) {\n const newFn = function (this: unknown, path: NodePath) {\n if (path[`is${nodeType}`]()) {\n return fn.apply(this, arguments);\n }\n };\n newFn.toString = () => fn.toString();\n return newFn;\n}\n\nfunction shouldIgnoreKey(\n key: string,\n): key is\n | \"enter\"\n | \"exit\"\n | \"shouldSkip\"\n | \"denylist\"\n | \"noScope\"\n | \"skipKeys\"\n | \"blacklist\" {\n // internal/hidden key\n if (key[0] === \"_\") return true;\n\n // ignore function keys\n if (key === \"enter\" || key === \"exit\" || key === \"shouldSkip\") return true;\n\n // ignore other options\n if (\n key === \"denylist\" ||\n key === \"noScope\" ||\n key === \"skipKeys\" ||\n // TODO: Remove in Babel 8\n key === \"blacklist\"\n ) {\n return true;\n }\n\n return false;\n}\n\nfunction mergePair(dest: any, src: any) {\n for (const key of Object.keys(src)) {\n dest[key] = [].concat(dest[key] || [], src[key]);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;;AACA;;;EAASA,e;EAAiBC,kB;EAAoBC;;;AAI9C,SAASC,aAAT,CAAuBC,IAAvB,EAA4D;EAC1D,OAAOA,IAAI,IAAIC,YAAf;AACD;;AAkBM,SAASC,OAAT,CAAiBC,OAAjB,EAAmC;EACxC,IAAIA,OAAO,CAACC,SAAZ,EAAuB,OAAOD,OAAP;EACvBA,OAAO,CAACC,SAAR,GAAoB,IAApB;;EAGA,KAAK,MAAMC,QAAX,IAAuBC,MAAM,CAACC,IAAP,CAAYJ,OAAZ,CAAvB,EAAkE;IAChE,IAAIK,eAAe,CAACH,QAAD,CAAnB,EAA+B;IAE/B,MAAMI,KAAoB,GAAGJ,QAAQ,CAACK,KAAT,CAAe,GAAf,CAA7B;IACA,IAAID,KAAK,CAACE,MAAN,KAAiB,CAArB,EAAwB;IAExB,MAAMC,GAAG,GAAGT,OAAO,CAACE,QAAD,CAAnB;IACA,OAAOF,OAAO,CAACE,QAAD,CAAd;;IAEA,KAAK,MAAMQ,IAAX,IAAmBJ,KAAnB,EAA0B;MAExBN,OAAO,CAACU,IAAD,CAAP,GAAgBD,GAAhB;IACD;EACF;;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