@babel/traverse 7.19.0 → 7.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @babel/traverse might be problematic. Click here for more details.

@@ -1 +1 @@
1
- {"version":3,"names":["validate","debug","buildDebug","REMOVED","SHOULD_STOP","SHOULD_SKIP","NodePath","constructor","hub","parent","contexts","state","opts","_traverseFlags","skipKeys","parentPath","container","listKey","key","node","type","data","context","scope","get","Error","targetNode","paths","pathCache","Map","set","path","setup","getScope","isScope","Scope","setData","val","Object","create","getData","def","undefined","hasNode","buildCodeFrameError","msg","SyntaxError","buildError","traverse","visitor","getPathLocation","parts","inList","unshift","join","message","enabled","toString","generator","code","parentKey","shouldSkip","v","shouldStop","removed","assign","prototype","NodePath_ancestry","NodePath_inference","NodePath_replacement","NodePath_evaluation","NodePath_conversion","NodePath_introspection","NodePath_context","NodePath_removal","NodePath_modification","NodePath_family","NodePath_comments","_guessExecutionStatusRelativeToDifferentFunctions","_guessExecutionStatusRelativeTo","t","TYPES","typeKey","fn","TypeError","NodePath_virtual_types_validator","keys","virtualTypes","includes","push"],"sources":["../../src/path/index.ts"],"sourcesContent":["import type { HubInterface } from \"../hub\";\nimport type TraversalContext from \"../context\";\nimport * as virtualTypes from \"./lib/virtual-types\";\nimport buildDebug from \"debug\";\nimport traverse from \"../index\";\nimport type { Visitor } from \"../types\";\nimport Scope from \"../scope\";\nimport { validate } from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport { path as pathCache } from \"../cache\";\nimport generator from \"@babel/generator\";\n\n// NodePath is split across many files.\nimport * as NodePath_ancestry from \"./ancestry\";\nimport * as NodePath_inference from \"./inference\";\nimport * as NodePath_replacement from \"./replacement\";\nimport * as NodePath_evaluation from \"./evaluation\";\nimport * as NodePath_conversion from \"./conversion\";\nimport * as NodePath_introspection from \"./introspection\";\nimport * as NodePath_context from \"./context\";\nimport * as NodePath_removal from \"./removal\";\nimport * as NodePath_modification from \"./modification\";\nimport * as NodePath_family from \"./family\";\nimport * as NodePath_comments from \"./comments\";\nimport * as NodePath_virtual_types_validator from \"./lib/virtual-types-validator\";\nimport type { NodePathAssetions } from \"./generated/asserts\";\nimport type { NodePathValidators } from \"./generated/validators\";\n\nconst debug = buildDebug(\"babel\");\n\nexport const REMOVED = 1 << 0;\nexport const SHOULD_STOP = 1 << 1;\nexport const SHOULD_SKIP = 1 << 2;\n\nclass NodePath<T extends t.Node = t.Node> {\n constructor(hub: HubInterface, parent: t.ParentMaps[T[\"type\"]]) {\n this.parent = parent;\n this.hub = hub;\n this.data = null;\n\n this.context = null;\n this.scope = null;\n }\n\n declare parent: t.ParentMaps[T[\"type\"]];\n declare hub: HubInterface;\n declare data: Record<string | symbol, unknown>;\n // TraversalContext is configured by setContext\n declare context: TraversalContext;\n declare scope: Scope;\n\n contexts: Array<TraversalContext> = [];\n state: any = null;\n opts: any = null;\n // this.shouldSkip = false; this.shouldStop = false; this.removed = false;\n _traverseFlags: number = 0;\n skipKeys: any = null;\n parentPath: t.ParentMaps[T[\"type\"]] extends null\n ? null\n : NodePath<t.ParentMaps[T[\"type\"]]> | null = null;\n container: t.Node | Array<t.Node> | null = null;\n listKey: string | null = null;\n key: string | number | null = null;\n node: T = null;\n type: T[\"type\"] | null = null;\n\n static get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n }: {\n hub?: HubInterface;\n parentPath: NodePath | null;\n parent: t.Node;\n container: t.Node | t.Node[];\n listKey?: string;\n key: string | number;\n }): NodePath {\n if (!hub && parentPath) {\n hub = parentPath.hub;\n }\n\n if (!parent) {\n throw new Error(\"To get a node path the parent needs to exist\");\n }\n\n const targetNode =\n // @ts-expect-error key must present in container\n container[key];\n\n let paths = pathCache.get(parent);\n if (!paths) {\n paths = new Map();\n pathCache.set(parent, paths);\n }\n\n let path = paths.get(targetNode);\n if (!path) {\n path = new NodePath(hub, parent);\n if (targetNode) paths.set(targetNode, path);\n }\n\n path.setup(parentPath, container, listKey, key);\n\n return path;\n }\n\n getScope(scope: Scope): Scope {\n // TODO: Remove this when TS is fixed.\n // A regression was introduced in ts4.8 that would cause OOM.\n // Avoid it by manually casting the types.\n // https://github.com/babel/babel/pull/14880\n return this.isScope()\n ? new Scope(this as NodePath<t.Pattern | t.Scopable>)\n : scope;\n }\n\n setData(key: string | symbol, val: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n return (this.data[key] = val);\n }\n\n getData(key: string | symbol, def?: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n let val = this.data[key];\n if (val === undefined && def !== undefined) val = this.data[key] = def;\n return val;\n }\n\n hasNode(): this is NodePath<NonNullable<this[\"node\"]>> {\n return this.node != null;\n }\n\n buildCodeFrameError(\n msg: string,\n Error: new () => Error = SyntaxError,\n ): Error {\n return this.hub.buildError(this.node, msg, Error);\n }\n\n traverse<T>(visitor: Visitor<T>, state: T): void;\n traverse(visitor: Visitor): void;\n traverse(visitor: any, state?: any) {\n traverse(this.node, visitor, this.scope, state, this);\n }\n\n set(key: string, node: any) {\n validate(this.node, key, node);\n // @ts-expect-error key must present in this.node\n this.node[key] = node;\n }\n\n getPathLocation(): string {\n const parts = [];\n let path: NodePath = this;\n do {\n let key = path.key;\n if (path.inList) key = `${path.listKey}[${key}]`;\n parts.unshift(key);\n } while ((path = path.parentPath));\n return parts.join(\".\");\n }\n\n debug(message: string) {\n if (!debug.enabled) return;\n debug(`${this.getPathLocation()} ${this.type}: ${message}`);\n }\n\n toString() {\n return generator(this.node).code;\n }\n\n get inList() {\n return !!this.listKey;\n }\n\n set inList(inList) {\n if (!inList) {\n this.listKey = null;\n }\n // ignore inList = true as it should depend on `listKey`\n }\n\n get parentKey(): string {\n return (this.listKey || this.key) as string;\n }\n\n get shouldSkip() {\n return !!(this._traverseFlags & SHOULD_SKIP);\n }\n\n set shouldSkip(v) {\n if (v) {\n this._traverseFlags |= SHOULD_SKIP;\n } else {\n this._traverseFlags &= ~SHOULD_SKIP;\n }\n }\n\n get shouldStop() {\n return !!(this._traverseFlags & SHOULD_STOP);\n }\n\n set shouldStop(v) {\n if (v) {\n this._traverseFlags |= SHOULD_STOP;\n } else {\n this._traverseFlags &= ~SHOULD_STOP;\n }\n }\n\n get removed() {\n return !!(this._traverseFlags & REMOVED);\n }\n set removed(v) {\n if (v) {\n this._traverseFlags |= REMOVED;\n } else {\n this._traverseFlags &= ~REMOVED;\n }\n }\n}\n\nObject.assign(\n NodePath.prototype,\n NodePath_ancestry,\n NodePath_inference,\n NodePath_replacement,\n NodePath_evaluation,\n NodePath_conversion,\n NodePath_introspection,\n NodePath_context,\n NodePath_removal,\n NodePath_modification,\n NodePath_family,\n NodePath_comments,\n);\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in\n // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.\n NodePath.prototype._guessExecutionStatusRelativeToDifferentFunctions =\n NodePath_introspection._guessExecutionStatusRelativeTo;\n}\n\n// we can not use `import { TYPES } from \"@babel/types\"` here\n// because the transformNamedBabelTypesImportToDestructuring plugin in babel.config.js\n// does not offer live bindings for `TYPES`\n// we can change to `import { TYPES }` when we are publishing ES modules only\nfor (const type of t.TYPES) {\n const typeKey = `is${type}`;\n // @ts-expect-error typeKey must present in t\n const fn = t[typeKey];\n // @ts-expect-error augmenting NodePath prototype\n NodePath.prototype[typeKey] = function (opts: any) {\n return fn(this.node, opts);\n };\n\n // @ts-expect-error augmenting NodePath prototype\n NodePath.prototype[`assert${type}`] = function (opts: any) {\n if (!fn(this.node, opts)) {\n throw new TypeError(`Expected node path of type ${type}`);\n }\n };\n}\n\n// Register virtual types validators after base types validators\nObject.assign(NodePath.prototype, NodePath_virtual_types_validator);\n\nfor (const type of Object.keys(virtualTypes) as (keyof typeof virtualTypes)[]) {\n if (type[0] === \"_\") continue;\n if (!t.TYPES.includes(type)) t.TYPES.push(type);\n}\n\ntype NodePathMixins = typeof NodePath_ancestry &\n typeof NodePath_inference &\n typeof NodePath_replacement &\n typeof NodePath_evaluation &\n typeof NodePath_conversion &\n typeof NodePath_introspection &\n typeof NodePath_context &\n typeof NodePath_removal &\n typeof NodePath_modification &\n typeof NodePath_family &\n typeof NodePath_comments;\n\n// @ts-expect-error TS throws because ensureBlock returns the body node path\n// however, we don't use the return value and treat it as a transform and\n// assertion utilities. For better type inference we annotate it as an\n// assertion method\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface NodePath<T>\n extends NodePathAssetions,\n NodePathValidators,\n NodePathMixins {\n /**\n * @see ./conversion.ts for implementation\n */\n ensureBlock<\n T extends\n | t.Loop\n | t.WithStatement\n | t.Function\n | t.LabeledStatement\n | t.CatchClause,\n >(\n this: NodePath<T>,\n ): asserts this is NodePath<T & { body: t.BlockStatement }>;\n}\n\nexport default NodePath;\n"],"mappings":";;;;;;;AAEA;;AACA;;AACA;;AAEA;;AACA;;;;AAEA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;EAjBSA;;;AAqBT,MAAMC,KAAK,GAAGC,MAAU,CAAC,OAAD,CAAxB;;AAEO,MAAMC,OAAO,GAAG,KAAK,CAArB;;AACA,MAAMC,WAAW,GAAG,KAAK,CAAzB;;AACA,MAAMC,WAAW,GAAG,KAAK,CAAzB;;;AAEP,MAAMC,QAAN,CAA0C;EACxCC,WAAW,CAACC,GAAD,EAAoBC,MAApB,EAAqD;IAAA,KAgBhEC,QAhBgE,GAgB5B,EAhB4B;IAAA,KAiBhEC,KAjBgE,GAiBnD,IAjBmD;IAAA,KAkBhEC,IAlBgE,GAkBpD,IAlBoD;IAAA,KAoBhEC,cApBgE,GAoBvC,CApBuC;IAAA,KAqBhEC,QArBgE,GAqBhD,IArBgD;IAAA,KAsBhEC,UAtBgE,GAwBjB,IAxBiB;IAAA,KAyBhEC,SAzBgE,GAyBrB,IAzBqB;IAAA,KA0BhEC,OA1BgE,GA0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AAKhE,IAAN,EAAYP,IAAZ,CAAP,EAA0B;MACxB,MAAM,IAAIwE,SAAJ,CAAe,8BAA6BhE,IAAK,EAAjD,CAAN;IACD;EACF,CAJD;AAKD;;AAGDkB,MAAM,CAAC2B,MAAP,CAAc3D,QAAQ,CAAC4D,SAAvB,EAAkCmB,gCAAlC;;AAEA,KAAK,MAAMjE,IAAX,IAAmBkB,MAAM,CAACgD,IAAP,CAAYC,YAAZ,CAAnB,EAA+E;EAC7E,IAAInE,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAhB,EAAqB;EACrB,IAAI,CAAC4D,CAAC,CAACC,KAAF,CAAQO,QAAR,CAAiBpE,IAAjB,CAAL,EAA6B4D,CAAC,CAACC,KAAF,CAAQQ,IAAR,CAAarE,IAAb;AAC9B;;eAsCcd,Q"}
1
+ {"version":3,"names":["validate","debug","buildDebug","REMOVED","SHOULD_STOP","SHOULD_SKIP","NodePath","constructor","hub","parent","contexts","state","opts","_traverseFlags","skipKeys","parentPath","container","listKey","key","node","type","data","context","scope","get","Error","targetNode","paths","pathCache","Map","set","path","setup","getScope","isScope","Scope","setData","val","Object","create","getData","def","undefined","hasNode","buildCodeFrameError","msg","SyntaxError","buildError","traverse","visitor","getPathLocation","parts","inList","unshift","join","message","enabled","toString","generator","code","parentKey","shouldSkip","v","shouldStop","removed","assign","prototype","NodePath_ancestry","NodePath_inference","NodePath_replacement","NodePath_evaluation","NodePath_conversion","NodePath_introspection","NodePath_context","NodePath_removal","NodePath_modification","NodePath_family","NodePath_comments","_guessExecutionStatusRelativeToDifferentFunctions","_guessExecutionStatusRelativeTo","t","TYPES","typeKey","fn","TypeError","NodePath_virtual_types_validator","keys","virtualTypes","includes","push"],"sources":["../../src/path/index.ts"],"sourcesContent":["import type { HubInterface } from \"../hub\";\nimport type TraversalContext from \"../context\";\nimport * as virtualTypes from \"./lib/virtual-types\";\nimport buildDebug from \"debug\";\nimport traverse from \"../index\";\nimport type { Visitor } from \"../types\";\nimport Scope from \"../scope\";\nimport { validate } from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport { path as pathCache } from \"../cache\";\nimport generator from \"@babel/generator\";\n\n// NodePath is split across many files.\nimport * as NodePath_ancestry from \"./ancestry\";\nimport * as NodePath_inference from \"./inference\";\nimport * as NodePath_replacement from \"./replacement\";\nimport * as NodePath_evaluation from \"./evaluation\";\nimport * as NodePath_conversion from \"./conversion\";\nimport * as NodePath_introspection from \"./introspection\";\nimport * as NodePath_context from \"./context\";\nimport * as NodePath_removal from \"./removal\";\nimport * as NodePath_modification from \"./modification\";\nimport * as NodePath_family from \"./family\";\nimport * as NodePath_comments from \"./comments\";\nimport * as NodePath_virtual_types_validator from \"./lib/virtual-types-validator\";\nimport type { NodePathAssetions } from \"./generated/asserts\";\nimport type { NodePathValidators } from \"./generated/validators\";\n\nconst debug = buildDebug(\"babel\");\n\nexport const REMOVED = 1 << 0;\nexport const SHOULD_STOP = 1 << 1;\nexport const SHOULD_SKIP = 1 << 2;\n\nclass NodePath<T extends t.Node = t.Node> {\n constructor(hub: HubInterface, parent: t.ParentMaps[T[\"type\"]]) {\n this.parent = parent;\n this.hub = hub;\n this.data = null;\n\n this.context = null;\n this.scope = null;\n }\n\n declare parent: t.ParentMaps[T[\"type\"]];\n declare hub: HubInterface;\n declare data: Record<string | symbol, unknown>;\n // TraversalContext is configured by setContext\n declare context: TraversalContext;\n declare scope: Scope;\n\n contexts: Array<TraversalContext> = [];\n state: any = null;\n opts: any = null;\n // this.shouldSkip = false; this.shouldStop = false; this.removed = false;\n _traverseFlags: number = 0;\n skipKeys: any = null;\n parentPath: t.ParentMaps[T[\"type\"]] extends null\n ? null\n : NodePath<t.ParentMaps[T[\"type\"]]> | null = null;\n container: t.Node | Array<t.Node> | null = null;\n listKey: string | null = null;\n key: string | number | null = null;\n node: T = null;\n type: T[\"type\"] | null = null;\n\n static get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n }: {\n hub?: HubInterface;\n parentPath: NodePath | null;\n parent: t.Node;\n container: t.Node | t.Node[];\n listKey?: string;\n key: string | number;\n }): NodePath {\n if (!hub && parentPath) {\n hub = parentPath.hub;\n }\n\n if (!parent) {\n throw new Error(\"To get a node path the parent needs to exist\");\n }\n\n const targetNode =\n // @ts-expect-error key must present in container\n container[key];\n\n let paths = pathCache.get(parent);\n if (!paths) {\n paths = new Map();\n pathCache.set(parent, paths);\n }\n\n let path = paths.get(targetNode);\n if (!path) {\n path = new NodePath(hub, parent);\n if (targetNode) paths.set(targetNode, path);\n }\n\n path.setup(parentPath, container, listKey, key);\n\n return path;\n }\n\n getScope(scope: Scope): Scope {\n return this.isScope() ? new Scope(this) : scope;\n }\n\n setData(key: string | symbol, val: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n return (this.data[key] = val);\n }\n\n getData(key: string | symbol, def?: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n let val = this.data[key];\n if (val === undefined && def !== undefined) val = this.data[key] = def;\n return val;\n }\n\n hasNode(): this is NodePath<NonNullable<this[\"node\"]>> {\n return this.node != null;\n }\n\n buildCodeFrameError(\n msg: string,\n Error: new () => Error = SyntaxError,\n ): Error {\n return this.hub.buildError(this.node, msg, Error);\n }\n\n traverse<T>(visitor: Visitor<T>, state: T): void;\n traverse(visitor: Visitor): void;\n traverse(visitor: any, state?: any) {\n traverse(this.node, visitor, this.scope, state, this);\n }\n\n set(key: string, node: any) {\n validate(this.node, key, node);\n // @ts-expect-error key must present in this.node\n this.node[key] = node;\n }\n\n getPathLocation(): string {\n const parts = [];\n let path: NodePath = this;\n do {\n let key = path.key;\n if (path.inList) key = `${path.listKey}[${key}]`;\n parts.unshift(key);\n } while ((path = path.parentPath));\n return parts.join(\".\");\n }\n\n debug(message: string) {\n if (!debug.enabled) return;\n debug(`${this.getPathLocation()} ${this.type}: ${message}`);\n }\n\n toString() {\n return generator(this.node).code;\n }\n\n get inList() {\n return !!this.listKey;\n }\n\n set inList(inList) {\n if (!inList) {\n this.listKey = null;\n }\n // ignore inList = true as it should depend on `listKey`\n }\n\n get parentKey(): string {\n return (this.listKey || this.key) as string;\n }\n\n get shouldSkip() {\n return !!(this._traverseFlags & SHOULD_SKIP);\n }\n\n set shouldSkip(v) {\n if (v) {\n this._traverseFlags |= SHOULD_SKIP;\n } else {\n this._traverseFlags &= ~SHOULD_SKIP;\n }\n }\n\n get shouldStop() {\n return !!(this._traverseFlags & SHOULD_STOP);\n }\n\n set shouldStop(v) {\n if (v) {\n this._traverseFlags |= SHOULD_STOP;\n } else {\n this._traverseFlags &= ~SHOULD_STOP;\n }\n }\n\n get removed() {\n return !!(this._traverseFlags & REMOVED);\n }\n set removed(v) {\n if (v) {\n this._traverseFlags |= REMOVED;\n } else {\n this._traverseFlags &= ~REMOVED;\n }\n }\n}\n\nObject.assign(\n NodePath.prototype,\n NodePath_ancestry,\n NodePath_inference,\n NodePath_replacement,\n NodePath_evaluation,\n NodePath_conversion,\n NodePath_introspection,\n NodePath_context,\n NodePath_removal,\n NodePath_modification,\n NodePath_family,\n NodePath_comments,\n);\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in\n // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.\n NodePath.prototype._guessExecutionStatusRelativeToDifferentFunctions =\n NodePath_introspection._guessExecutionStatusRelativeTo;\n}\n\n// we can not use `import { TYPES } from \"@babel/types\"` here\n// because the transformNamedBabelTypesImportToDestructuring plugin in babel.config.js\n// does not offer live bindings for `TYPES`\n// we can change to `import { TYPES }` when we are publishing ES modules only\nfor (const type of t.TYPES) {\n const typeKey = `is${type}`;\n // @ts-expect-error typeKey must present in t\n const fn = t[typeKey];\n // @ts-expect-error augmenting NodePath prototype\n NodePath.prototype[typeKey] = function (opts: any) {\n return fn(this.node, opts);\n };\n\n // @ts-expect-error augmenting NodePath prototype\n NodePath.prototype[`assert${type}`] = function (opts: any) {\n if (!fn(this.node, opts)) {\n throw new TypeError(`Expected node path of type ${type}`);\n }\n };\n}\n\n// Register virtual types validators after base types validators\nObject.assign(NodePath.prototype, NodePath_virtual_types_validator);\n\nfor (const type of Object.keys(virtualTypes) as (keyof typeof virtualTypes)[]) {\n if (type[0] === \"_\") continue;\n if (!t.TYPES.includes(type)) t.TYPES.push(type);\n}\n\ntype NodePathMixins = typeof NodePath_ancestry &\n typeof NodePath_inference &\n typeof NodePath_replacement &\n typeof NodePath_evaluation &\n typeof NodePath_conversion &\n typeof NodePath_introspection &\n typeof NodePath_context &\n typeof NodePath_removal &\n typeof NodePath_modification &\n typeof NodePath_family &\n typeof NodePath_comments;\n\n// @ts-expect-error TS throws because ensureBlock returns the body node path\n// however, we don't use the return value and treat it as a transform and\n// assertion utilities. For better type inference we annotate it as an\n// assertion method\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface NodePath<T>\n extends NodePathAssetions,\n NodePathValidators,\n NodePathMixins {\n /**\n * @see ./conversion.ts for implementation\n */\n ensureBlock<\n T extends\n | t.Loop\n | t.WithStatement\n | t.Function\n | t.LabeledStatement\n | t.CatchClause,\n >(\n this: NodePath<T>,\n ): asserts this is NodePath<T & { body: t.BlockStatement }>;\n}\n\nexport default NodePath;\n"],"mappings":";;;;;;;AAEA;;AACA;;AACA;;AAEA;;AACA;;;;AAEA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;EAjBSA;;;AAqBT,MAAMC,KAAK,GAAGC,MAAU,CAAC,OAAD,CAAxB;;AAEO,MAAMC,OAAO,GAAG,KAAK,CAArB;;AACA,MAAMC,WAAW,GAAG,KAAK,CAAzB;;AACA,MAAMC,WAAW,GAAG,KAAK,CAAzB;;;AAEP,MAAMC,QAAN,CAA0C;EACxCC,WAAW,CAACC,GAAD,EAAoBC,MAApB,EAAqD;IAAA,KAgBhEC,QAhBgE,GAgB5B,EAhB4B;IAAA,KAiBhEC,KAjBgE,GAiBnD,IAjBmD;IAAA,KAkBh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AA8B,UAAUtE,IAAV,EAAqB;IACjD,OAAOuE,EAAE,CAAC,KAAKhE,IAAN,EAAYP,IAAZ,CAAT;EACD,CAFD;;EAKAN,QAAQ,CAAC4D,SAAT,CAAoB,SAAQ9C,IAAK,EAAjC,IAAsC,UAAUR,IAAV,EAAqB;IACzD,IAAI,CAACuE,EAAE,CAAC,KAAKhE,IAAN,EAAYP,IAAZ,CAAP,EAA0B;MACxB,MAAM,IAAIwE,SAAJ,CAAe,8BAA6BhE,IAAK,EAAjD,CAAN;IACD;EACF,CAJD;AAKD;;AAGDkB,MAAM,CAAC2B,MAAP,CAAc3D,QAAQ,CAAC4D,SAAvB,EAAkCmB,gCAAlC;;AAEA,KAAK,MAAMjE,IAAX,IAAmBkB,MAAM,CAACgD,IAAP,CAAYC,YAAZ,CAAnB,EAA+E;EAC7E,IAAInE,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAhB,EAAqB;EACrB,IAAI,CAAC4D,CAAC,CAACC,KAAF,CAAQO,QAAR,CAAiBpE,IAAjB,CAAL,EAA6B4D,CAAC,CAACC,KAAF,CAAQQ,IAAR,CAAarE,IAAb;AAC9B;;eAsCcd,Q"}
@@ -44,7 +44,8 @@ const {
44
44
  isStatement: nodeIsStatement,
45
45
  isVar: nodeIsVar,
46
46
  isVariableDeclaration,
47
- react
47
+ react,
48
+ isForOfStatement
48
49
  } = _t;
49
50
  const {
50
51
  isCompatTag
@@ -169,7 +170,7 @@ function isSpreadProperty() {
169
170
  }
170
171
 
171
172
  function isForAwaitStatement() {
172
- return isForStatement(this.node, {
173
+ return isForOfStatement(this.node, {
173
174
  await: true
174
175
  });
175
176
  }
@@ -1 +1 @@
1
- {"version":3,"names":["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","isCompatTag","isReferencedIdentifier","opts","node","parent","name","parentPath","isReferencedMemberExpression","isBindingIdentifier","grandparent","left","init","isUser","loc","isGenerated","isPure","constantsOnly","scope","importKind","exportKind","isRestProperty","isObjectPattern","isSpreadProperty","isObjectExpression","isForAwaitStatement","await","isExistentialTypeParam","Error","isNumericLiteralTypeAnnotation"],"sources":["../../../src/path/lib/virtual-types-validator.ts"],"sourcesContent":["import type NodePath from \"../index\";\nimport {\n isBinding,\n isBlockScoped as nodeIsBlockScoped,\n isExportDeclaration,\n isExpression as nodeIsExpression,\n isFlow as nodeIsFlow,\n isForStatement,\n isForXStatement,\n isIdentifier,\n isImportDeclaration,\n isImportSpecifier,\n isJSXIdentifier,\n isJSXMemberExpression,\n isMemberExpression,\n isRestElement as nodeIsRestElement,\n isReferenced as nodeIsReferenced,\n isScope as nodeIsScope,\n isStatement as nodeIsStatement,\n isVar as nodeIsVar,\n isVariableDeclaration,\n react,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nconst { isCompatTag } = react;\nimport type { VirtualTypeAliases } from \"./virtual-types\";\n\nexport interface VirtualTypeNodePathValidators {\n isBindingIdentifier<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"BindingIdentifier\"]>;\n isBlockScoped(opts?: object): boolean;\n /**\n * @deprecated\n */\n isExistentialTypeParam<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ExistentialTypeParam\"]>;\n isExpression<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Expression>;\n isFlow<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Flow>;\n isForAwaitStatement<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ForAwaitStatement\"]>;\n isGenerated(opts?: object): boolean;\n /**\n * @deprecated\n */\n isNumericLiteralTypeAnnotation(opts?: object): void;\n isPure(opts?: object): boolean;\n isReferenced(opts?: object): boolean;\n isReferencedIdentifier<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ReferencedIdentifier\"]>;\n isReferencedMemberExpression<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ReferencedMemberExpression\"]>;\n isRestProperty<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.RestProperty>;\n isScope<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"Scope\"]>;\n isSpreadProperty<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.SpreadProperty>;\n isStatement<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Statement>;\n isUser(opts?: object): boolean;\n isVar<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"Var\"]>;\n}\n\nexport function isReferencedIdentifier(this: NodePath, opts?: any): boolean {\n const { node, parent } = this;\n if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {\n if (isJSXIdentifier(node, opts)) {\n if (isCompatTag(node.name)) return false;\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n }\n\n // check if node is referenced\n return nodeIsReferenced(node, parent, this.parentPath.parent);\n}\n\nexport function isReferencedMemberExpression(this: NodePath): boolean {\n const { node, parent } = this;\n return isMemberExpression(node) && nodeIsReferenced(node, parent);\n}\n\nexport function isBindingIdentifier(this: NodePath): boolean {\n const { node, parent } = this;\n const grandparent = this.parentPath.parent;\n return isIdentifier(node) && isBinding(node, parent, grandparent);\n}\n\nexport function isStatement(this: NodePath): boolean {\n const { node, parent } = this;\n if (nodeIsStatement(node)) {\n if (isVariableDeclaration(node)) {\n if (isForXStatement(parent, { left: node })) return false;\n if (isForStatement(parent, { init: node })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nexport function isExpression(this: NodePath): boolean {\n if (this.isIdentifier()) {\n return this.isReferencedIdentifier();\n } else {\n return nodeIsExpression(this.node);\n }\n}\n\nexport function isScope(this: NodePath): boolean {\n return nodeIsScope(this.node, this.parent);\n}\n\nexport function isReferenced(this: NodePath): boolean {\n return nodeIsReferenced(this.node, this.parent);\n}\n\nexport function isBlockScoped(this: NodePath): boolean {\n return nodeIsBlockScoped(this.node);\n}\n\nexport function isVar(this: NodePath): boolean {\n return nodeIsVar(this.node);\n}\n\nexport function isUser(this: NodePath): boolean {\n return this.node && !!this.node.loc;\n}\n\nexport function isGenerated(this: NodePath): boolean {\n return !this.isUser();\n}\n\nexport function isPure(this: NodePath, constantsOnly?: boolean): boolean {\n return this.scope.isPure(this.node, constantsOnly);\n}\n\nexport function isFlow(this: NodePath): boolean {\n const { node } = this;\n if (nodeIsFlow(node)) {\n return true;\n } else if (isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n}\n\n// TODO: 7.0 Backwards Compat\nexport function isRestProperty(this: NodePath): boolean {\n return (\n nodeIsRestElement(this.node) &&\n this.parentPath &&\n this.parentPath.isObjectPattern()\n );\n}\n\nexport function isSpreadProperty(this: NodePath): boolean {\n return (\n nodeIsRestElement(this.node) &&\n this.parentPath &&\n this.parentPath.isObjectExpression()\n );\n}\n\nexport function isForAwaitStatement(this: NodePath): boolean {\n return isForStatement(this.node, { await: true });\n}\n\nexport function isExistentialTypeParam(this: NodePath): void {\n throw new Error(\n \"`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.\",\n );\n}\n\nexport function isNumericLiteralTypeAnnotation(this: NodePath): void {\n throw new Error(\n \"`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.\",\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;;;EACEA,S;EACAC,a,EAAiBC,iB;EACjBC,mB;EACAC,Y,EAAgBC,gB;EAChBC,M,EAAUC,U;EACVC,c;EACAC,e;EACAC,Y;EACAC,mB;EACAC,iB;EACAC,e;EACAC,qB;EACAC,kB;EACAC,a,EAAiBC,iB;EACjBC,Y,EAAgBC,gB;EAChBC,O,EAAWC,W;EACXC,W,EAAeC,e;EACfC,K,EAASC,S;EACTC,qB;EACAC;;AAGF,MAAM;EAAEC;AAAF,IAAkBD,KAAxB;;AAkEO,SAASE,sBAAT,CAAgDC,IAAhD,EAAqE;EAC1E,MAAM;IAAEC,IAAF;IAAQC;EAAR,IAAmB,IAAzB;;EACA,IAAI,CAACtB,YAAY,CAACqB,IAAD,EAAOD,IAAP,CAAb,IAA6B,CAAChB,qBAAqB,CAACkB,MAAD,EAASF,IAAT,CAAvD,EAAuE;IACrE,IAAIjB,eAAe,CAACkB,IAAD,EAAOD,IAAP,CAAnB,EAAiC;MAC/B,IAAIF,WAAW,CAACG,IAAI,CAACE,IAAN,CAAf,EAA4B,OAAO,KAAP;IAC7B,CAFD,MAEO;MAEL,OAAO,KAAP;IACD;EACF;;EAGD,OAAOd,gBAAgB,CAACY,IAAD,EAAOC,MAAP,EAAe,KAAKE,UAAL,CAAgBF,MAA/B,CAAvB;AACD;;AAEM,SAASG,4BAAT,GAA+D;EACpE,MAAM;IAAEJ,IAAF;IAAQC;EAAR,IAAmB,IAAzB;EACA,OAAOjB,kBAAkB,CAACgB,IAAD,CAAlB,IAA4BZ,gBAAgB,CAACY,IAAD,EAAOC,MAAP,CAAnD;AACD;;AAEM,SAASI,mBAAT,GAAsD;EAC3D,MAAM;IAAEL,IAAF;IAAQC;EAAR,IAAmB,IAAzB;EACA,MAAMK,WA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J,+FADI,CAAN;AAGD;;AAEM,SAASC,8BAAT,GAA8D;EACnE,MAAM,IAAID,KAAJ,CACJ,gHADI,CAAN;AAGD"}
1
+ {"version":3,"names":["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","isCompatTag","isReferencedIdentifier","opts","node","parent","name","parentPath","isReferencedMemberExpression","isBindingIdentifier","grandparent","left","init","isUser","loc","isGenerated","isPure","constantsOnly","scope","importKind","exportKind","isRestProperty","isObjectPattern","isSpreadProperty","isObjectExpression","isForAwaitStatement","await","isExistentialTypeParam","Error","isNumericLiteralTypeAnnotation"],"sources":["../../../src/path/lib/virtual-types-validator.ts"],"sourcesContent":["import type NodePath from \"../index\";\nimport {\n isBinding,\n isBlockScoped as nodeIsBlockScoped,\n isExportDeclaration,\n isExpression as nodeIsExpression,\n isFlow as nodeIsFlow,\n isForStatement,\n isForXStatement,\n isIdentifier,\n isImportDeclaration,\n isImportSpecifier,\n isJSXIdentifier,\n isJSXMemberExpression,\n isMemberExpression,\n isRestElement as nodeIsRestElement,\n isReferenced as nodeIsReferenced,\n isScope as nodeIsScope,\n isStatement as nodeIsStatement,\n isVar as nodeIsVar,\n isVariableDeclaration,\n react,\n isForOfStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nconst { isCompatTag } = react;\nimport type { VirtualTypeAliases } from \"./virtual-types\";\n\nexport interface VirtualTypeNodePathValidators {\n isBindingIdentifier<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"BindingIdentifier\"]>;\n isBlockScoped(opts?: object): boolean;\n /**\n * @deprecated\n */\n isExistentialTypeParam<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ExistentialTypeParam\"]>;\n isExpression<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Expression>;\n isFlow<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Flow>;\n isForAwaitStatement<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ForAwaitStatement\"]>;\n isGenerated(opts?: object): boolean;\n /**\n * @deprecated\n */\n isNumericLiteralTypeAnnotation(opts?: object): void;\n isPure(opts?: object): boolean;\n isReferenced(opts?: object): boolean;\n isReferencedIdentifier<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ReferencedIdentifier\"]>;\n isReferencedMemberExpression<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"ReferencedMemberExpression\"]>;\n isRestProperty<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.RestProperty>;\n isScope<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"Scope\"]>;\n isSpreadProperty<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.SpreadProperty>;\n isStatement<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & t.Statement>;\n isUser(opts?: object): boolean;\n isVar<T extends t.Node>(\n this: NodePath<T>,\n opts?: object,\n ): this is NodePath<T & VirtualTypeAliases[\"Var\"]>;\n}\n\nexport function isReferencedIdentifier(this: NodePath, opts?: any): boolean {\n const { node, parent } = this;\n if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {\n if (isJSXIdentifier(node, opts)) {\n if (isCompatTag(node.name)) return false;\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n }\n\n // check if node is referenced\n return nodeIsReferenced(node, parent, this.parentPath.parent);\n}\n\nexport function isReferencedMemberExpression(this: NodePath): boolean {\n const { node, parent } = this;\n return isMemberExpression(node) && nodeIsReferenced(node, parent);\n}\n\nexport function isBindingIdentifier(this: NodePath): boolean {\n const { node, parent } = this;\n const grandparent = this.parentPath.parent;\n return isIdentifier(node) && isBinding(node, parent, grandparent);\n}\n\nexport function isStatement(this: NodePath): boolean {\n const { node, parent } = this;\n if (nodeIsStatement(node)) {\n if (isVariableDeclaration(node)) {\n if (isForXStatement(parent, { left: node })) return false;\n if (isForStatement(parent, { init: node })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nexport function isExpression(this: NodePath): boolean {\n if (this.isIdentifier()) {\n return this.isReferencedIdentifier();\n } else {\n return nodeIsExpression(this.node);\n }\n}\n\nexport function isScope(this: NodePath): boolean {\n return nodeIsScope(this.node, this.parent);\n}\n\nexport function isReferenced(this: NodePath): boolean {\n return nodeIsReferenced(this.node, this.parent);\n}\n\nexport function isBlockScoped(this: NodePath): boolean {\n return nodeIsBlockScoped(this.node);\n}\n\nexport function isVar(this: NodePath): boolean {\n return nodeIsVar(this.node);\n}\n\nexport function isUser(this: NodePath): boolean {\n return this.node && !!this.node.loc;\n}\n\nexport function isGenerated(this: NodePath): boolean {\n return !this.isUser();\n}\n\nexport function isPure(this: NodePath, constantsOnly?: boolean): boolean {\n return this.scope.isPure(this.node, constantsOnly);\n}\n\nexport function isFlow(this: NodePath): boolean {\n const { node } = this;\n if (nodeIsFlow(node)) {\n return true;\n } else if (isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n}\n\n// TODO: 7.0 Backwards Compat\nexport function isRestProperty(this: NodePath): boolean {\n return (\n nodeIsRestElement(this.node) &&\n this.parentPath &&\n this.parentPath.isObjectPattern()\n );\n}\n\nexport function isSpreadProperty(this: NodePath): boolean {\n return (\n nodeIsRestElement(this.node) &&\n this.parentPath &&\n this.parentPath.isObjectExpression()\n );\n}\n\nexport function isForAwaitStatement(this: NodePath): boolean {\n return isForOfStatement(this.node, { await: true });\n}\n\nexport function isExistentialTypeParam(this: NodePath): void {\n throw new Error(\n \"`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.\",\n );\n}\n\nexport function isNumericLiteralTypeAnnotation(this: NodePath): void {\n throw new Error(\n \"`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.\",\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;;;EACEA,S;EACAC,a,EAAiBC,iB;EACjBC,mB;EACAC,Y,EAAgBC,gB;EAChBC,M,EAAUC,U;EACVC,c;EACAC,e;EACAC,Y;EACAC,mB;EACAC,iB;EACAC,e;EACAC,qB;EACAC,kB;EACAC,a,EAAiBC,iB;EACjBC,Y,EAAgBC,gB;EAChBC,O,EAAWC,W;EACXC,W,EAAeC,e;EACfC,K,EAASC,S;EACTC,qB;EACAC,K;EACAC;;AAGF,MAAM;EAAEC;AAAF,IAAkBF,KAAxB;;AAkEO,SAASG,sBAAT,CAAgDC,IAAhD,EAAqE;EAC1E,MAAM;IAAEC,IAAF;IAAQC;EAAR,IAAmB,IAAzB;;EACA,IAAI,CAACvB,YAAY,CAACsB,IAAD,EAAOD,IAAP,CAAb,IAA6B,CAACjB,qBAAqB,CAACmB,MAAD,EAASF,IAAT,CAAvD,EAAuE;IACrE,IAAIlB,eAAe,CAACmB,IAAD,EAAOD,IAAP,CAAnB,EAAiC;MAC/B,IAAIF,WAAW,CAACG,IAAI,CAACE,IAAN,CAAf,EAA4B,OAAO,KAAP;IAC7B,CAFD,MAEO;MAEL,OAAO,KAAP;IACD;EACF;;EAGD,OAAOf,gBAAgB,CAACa,IAAD,EA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hB,EAHF;AAKD;;AAEM,SAASC,gBAAT,GAAmD;EACxD,OACElC,iBAAiB,CAAC,KAAKe,IAAN,CAAjB,IACA,KAAKG,UADL,IAEA,KAAKA,UAAL,CAAgBiB,kBAAhB,EAHF;AAKD;;AAEM,SAASC,mBAAT,GAAsD;EAC3D,OAAOzB,gBAAgB,CAAC,KAAKI,IAAN,EAAY;IAAEsB,KAAK,EAAE;EAAT,CAAZ,CAAvB;AACD;;AAEM,SAASC,sBAAT,GAAsD;EAC3D,MAAM,IAAIC,KAAJ,CACJ,+FADI,CAAN;AAGD;;AAEM,SAASC,8BAAT,GAA8D;EACnE,MAAM,IAAID,KAAJ,CACJ,gHADI,CAAN;AAGD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/traverse",
3
- "version": "7.19.0",
3
+ "version": "7.19.1",
4
4
  "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
5
5
  "author": "The Babel Team (https://babel.dev/team)",
6
6
  "homepage": "https://babel.dev/docs/en/next/babel-traverse",
@@ -22,7 +22,7 @@
22
22
  "@babel/helper-function-name": "^7.19.0",
23
23
  "@babel/helper-hoist-variables": "^7.18.6",
24
24
  "@babel/helper-split-export-declaration": "^7.18.6",
25
- "@babel/parser": "^7.19.0",
25
+ "@babel/parser": "^7.19.1",
26
26
  "@babel/types": "^7.19.0",
27
27
  "debug": "^4.1.0",
28
28
  "globals": "^11.1.0"