@galadrim/galadmin 0.1.32 → 0.1.33
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.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/front/build/asset-manifest.json +3 -3
- package/src/front/build/index.html +1 -1
- package/src/front/build/static/js/main.4ce5340d.chunk.js +2 -0
- package/src/front/build/static/js/main.4ce5340d.chunk.js.map +1 -0
- package/src/front/node_modules/.cache/.eslintcache +1 -1
- package/src/front/node_modules/.cache/babel-loader/{a442b07ccfc975b334314fdb76b50b42.json → 04b67a528af96a9bceeadf265dfb56d2.json} +1 -1
- package/src/front/node_modules/.cache/babel-loader/cdf89c046963294c4cbf7482c8706cbc.json +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/c3/3e/f2b5b90044b7bdbb4cff67b2c09e24bb506274240d920de24bb4b678f3f00b80f7e9f0900cd1de883484031488d8603e97ea6b4e39a9c6ab5160353d3be9 +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/6c/19/fe86ba5d7c4062f185480ad22dd3b9fae9b30149827224339f9a633a9a94 +1 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/87/08/421190bfe6e50816e059da6c33526c9943732ef856ebd2752d0cbfb4a852 +1 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/{b3/58/c0bc4ec69302d38ceac243da47ee7549ca88af7e0c89962c82ad9b304bbb → c2/e5/5451dd89bb0fd48f988bf27c7ee614c66eb91f7085c5b5c8cb33048d0c32} +1 -1
- package/src/front/node_modules/.package-lock.json +50 -58
- package/src/front/node_modules/@babel/compat-data/README.md +1 -1
- package/src/front/node_modules/@babel/compat-data/data/corejs2-built-ins.json +146 -0
- package/src/front/node_modules/@babel/compat-data/data/native-modules.json +1 -1
- package/src/front/node_modules/@babel/compat-data/data/plugin-bugfixes.json +15 -0
- package/src/front/node_modules/@babel/compat-data/data/plugins.json +68 -9
- package/src/front/node_modules/@babel/compat-data/package.json +4 -4
- package/src/front/node_modules/@babel/core/README.md +1 -1
- package/src/front/node_modules/@babel/core/lib/config/config-chain.js +1 -3
- package/src/front/node_modules/@babel/core/lib/config/config-chain.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/files/module-types.js +5 -5
- package/src/front/node_modules/@babel/core/lib/config/files/module-types.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/full.js +2 -3
- package/src/front/node_modules/@babel/core/lib/config/full.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/helpers/config-api.js +4 -4
- package/src/front/node_modules/@babel/core/lib/config/helpers/config-api.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/validation/option-assertions.js +1 -3
- package/src/front/node_modules/@babel/core/lib/config/validation/option-assertions.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/validation/plugins.js +5 -2
- package/src/front/node_modules/@babel/core/lib/config/validation/plugins.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +2 -1
- package/src/front/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/index.js +1 -1
- package/src/front/node_modules/@babel/core/lib/transformation/file/file.js +5 -5
- package/src/front/node_modules/@babel/core/lib/transformation/file/file.js.map +1 -1
- package/src/front/node_modules/@babel/core/package.json +10 -10
- package/src/front/node_modules/@babel/generator/README.md +1 -1
- package/src/front/node_modules/@babel/generator/lib/buffer.js +6 -6
- package/src/front/node_modules/@babel/generator/lib/buffer.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/types.js +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/printer.js +4 -4
- package/src/front/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/src/front/node_modules/@babel/generator/package.json +4 -3
- package/src/front/node_modules/@babel/helper-compilation-targets/README.md +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/debug.js +2 -2
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/debug.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/filter-items.js +5 -9
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/filter-items.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/index.js +8 -4
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/options.js +2 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/options.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/pretty.js +2 -2
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/pretty.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/targets.js +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/targets.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/utils.js +3 -3
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/utils.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/package.json +6 -6
- package/src/front/node_modules/@babel/helper-split-export-declaration/README.md +1 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/lib/index.js +5 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/package.json +1 -1
- package/src/front/node_modules/@babel/helpers/README.md +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/dispose.js +9 -13
- package/src/front/node_modules/@babel/helpers/lib/helpers/dispose.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/using.js +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/using.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers-generated.js +2 -2
- package/src/front/node_modules/@babel/helpers/lib/helpers-generated.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/package.json +3 -3
- package/src/front/node_modules/@babel/parser/README.md +1 -1
- package/src/front/node_modules/@babel/parser/lib/index.js +1 -3
- package/src/front/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/statement.js +1 -3
- package/src/front/node_modules/@babel/parser/lib/parser/statement.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/flow/index.js.map +1 -1
- package/src/front/node_modules/@babel/parser/package.json +2 -2
- package/src/front/node_modules/@babel/traverse/README.md +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/scope/index.js +21 -9
- package/src/front/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/types.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/visitors.js +22 -15
- package/src/front/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/package.json +4 -4
- package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/README.md +13 -2
- package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/package.json +4 -4
- package/src/front/node_modules/{@babel/helper-compilation-targets/node_modules/semver → @nicolo-ribaudo/semver-v6}/semver.js +40 -27
- package/src/front/node_modules/typescript/lib/tsc.js +16 -19
- package/src/front/node_modules/typescript/lib/tsserver.js +22 -24
- package/src/front/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -1
- package/src/front/node_modules/typescript/lib/tsserverlibrary.js +22 -24
- package/src/front/node_modules/typescript/lib/typescript.d.ts +0 -1
- package/src/front/node_modules/typescript/lib/typescript.js +22 -24
- package/src/front/node_modules/typescript/lib/typingsInstaller.js +1 -1
- package/src/front/node_modules/typescript/package.json +1 -1
- package/src/front/package-lock.json +97 -112
- package/src/front/src/components/Input.js +6 -0
- package/src/front/src/components/Sidebar.js +2 -2
- package/src/front/build/static/js/main.405f6f90.chunk.js +0 -2
- package/src/front/build/static/js/main.405f6f90.chunk.js.map +0 -1
- package/src/front/node_modules/.cache/babel-loader/964c56108bc43622244156806407d3d8.json +0 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/00/35/f206f48274d030c7a1e2457996323f694ca72c9ec94bddb8ecc8f37aa4632918182acf152491e9b475b95f567493b47644434cdb77f795b23c0b8392aaf7 +0 -1
- package/src/front/node_modules/@babel/core/node_modules/semver/semver.js +0 -1596
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/CHANGELOG.md +0 -70
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/LICENSE +0 -15
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/README.md +0 -443
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/bin/semver.js +0 -174
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/package.json +0 -28
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/range.bnf +0 -16
- /package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/CHANGELOG.md +0 -0
- /package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/LICENSE +0 -0
- /package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/bin/semver.js +0 -0
- /package/src/front/node_modules/{@babel/core/node_modules/semver → @nicolo-ribaudo/semver-v6}/range.bnf +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["virtualTypes","require","_t","DEPRECATED_KEYS","DEPRECATED_ALIASES","FLIPPED_ALIAS_KEYS","TYPES","__internal__deprecationWarning","deprecationWarning","isVirtualType","type","isExplodedVisitor","visitor","_exploded","explode","nodeType","Object","keys","shouldIgnoreKey","parts","split","length","fns","part","verify","__esModule","ensureEntranceObjects","ensureCallbackArrays","wrapCheck","types","mergePair","aliases","deprecatedKey","deprecatedAlias","alias","existing","assign","_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 {\n DEPRECATED_KEYS,\n DEPRECATED_ALIASES,\n FLIPPED_ALIAS_KEYS,\n TYPES,\n __internal__deprecationWarning as deprecationWarning,\n} from \"@babel/types\";\nimport type { ExplodedVisitor, 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\nexport function isExplodedVisitor(\n visitor: Visitor,\n): visitor is ExplodedVisitor {\n // @ts-expect-error _exploded is not defined on non-exploded Visitor\n return visitor?._exploded;\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<S>(visitor: Visitor<S>): ExplodedVisitor<S> {\n if (isExplodedVisitor(visitor)) return visitor;\n // @ts-expect-error `visitor` will be cast to ExplodedVisitor by this function\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 normalised as VisitNodeObject\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 let aliases = FLIPPED_ALIAS_KEYS[nodeType];\n\n if (nodeType in DEPRECATED_KEYS) {\n const deprecatedKey = DEPRECATED_KEYS[nodeType];\n deprecationWarning(nodeType, deprecatedKey, \"Visitor \");\n aliases = [deprecatedKey];\n } else if (nodeType in DEPRECATED_ALIASES) {\n const deprecatedAlias =\n DEPRECATED_ALIASES[nodeType as keyof typeof DEPRECATED_ALIASES];\n deprecationWarning(nodeType, deprecatedAlias, \"Visitor \");\n aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];\n }\n\n if (!aliases) continue;\n\n const fns = visitor[nodeType];\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 // @ts-expect-error explosion has been performed\n return visitor as ExplodedVisitor;\n}\n\nexport function verify(visitor: Visitor) {\n // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\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 // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\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 fns = fns.map(function (fn) {\n let newFn = fn;\n\n if (state) {\n newFn = function (path: NodePath) {\n 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 if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];\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 (key === \"denylist\" || key === \"noScope\" || key === \"skipKeys\") {\n return true;\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"blacklist\") {\n return true;\n }\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,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAMsB;EALpBE,eAAe;EACfC,kBAAkB;EAClBC,kBAAkB;EAClBC,KAAK;EACLC,8BAA8B,EAAIC;AAAkB,IAAAN,EAAA;AAKtD,SAASO,aAAaA,CAACC,IAAY,EAAyB;EAC1D,OAAOA,IAAI,IAAIV,YAAY;AAC7B;AAEO,SAASW,iBAAiBA,CAC/BC,OAAgB,EACY;EAE5B,OAAOA,OAAO,oBAAPA,OAAO,CAAEC,SAAS;AAC3B;AAkBO,SAASC,OAAOA,CAAIF,OAAmB,EAAsB;EAClE,IAAID,iBAAiB,CAACC,OAAO,CAAC,EAAE,OAAOA,OAAO;EAE9CA,OAAO,CAACC,SAAS,G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;IAClCD,IAAI,CAACZ,GAAG,CAAC,GAAG,EAAE,CAACd,MAAM,CAAC0B,IAAI,CAACZ,GAAG,CAAC,IAAI,EAAE,EAAEa,GAAG,CAACb,GAAG,CAAC,CAAC;EAClD;AACF"}
|
|
1
|
+
{"version":3,"names":["virtualTypes","require","_t","DEPRECATED_KEYS","DEPRECATED_ALIASES","FLIPPED_ALIAS_KEYS","TYPES","__internal__deprecationWarning","deprecationWarning","isVirtualType","type","isExplodedVisitor","visitor","_exploded","explode","nodeType","Object","keys","shouldIgnoreKey","parts","split","length","fns","part","verify","__esModule","ensureEntranceObjects","ensureCallbackArrays","wrapCheck","types","mergePair","aliases","deprecatedKey","deprecatedAlias","alias","existing","assign","_verified","Error","validateVisitorMethods","indexOf","visitors","visitorKey","path","val","concat","fn","TypeError","merge","states","wrapper","mergedVisitor","i","state","topVisitor","wrapWithStateOrWrapper","key","typeVisitor","nodeVisitor","oldVisitor","newVisitor","phase","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 type { Node } from \"@babel/types\";\nimport {\n DEPRECATED_KEYS,\n DEPRECATED_ALIASES,\n FLIPPED_ALIAS_KEYS,\n TYPES,\n __internal__deprecationWarning as deprecationWarning,\n} from \"@babel/types\";\nimport type { ExplodedVisitor, NodePath, Visitor } from \"./index\";\nimport type { ExplVisitNode, VisitNodeFunction, VisitPhase } from \"./types\";\n\ntype VIRTUAL_TYPES = keyof typeof virtualTypes;\nfunction isVirtualType(type: string): type is VIRTUAL_TYPES {\n return type in virtualTypes;\n}\nexport type VisitWrapper<S = any> = (\n stateName: string | undefined,\n visitorType: VisitPhase,\n callback: VisitNodeFunction<S, Node>,\n) => VisitNodeFunction<S, Node>;\n\nexport function isExplodedVisitor(\n visitor: Visitor,\n): visitor is ExplodedVisitor {\n // @ts-expect-error _exploded is not defined on non-exploded Visitor\n return visitor?._exploded;\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 * 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<S>(visitor: Visitor<S>): ExplodedVisitor<S> {\n if (isExplodedVisitor(visitor)) return visitor;\n // @ts-expect-error `visitor` will be cast to ExplodedVisitor by this function\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 normalised as VisitNodeObject\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 let aliases = FLIPPED_ALIAS_KEYS[nodeType];\n\n if (nodeType in DEPRECATED_KEYS) {\n const deprecatedKey = DEPRECATED_KEYS[nodeType];\n deprecationWarning(nodeType, deprecatedKey, \"Visitor \");\n aliases = [deprecatedKey];\n } else if (nodeType in DEPRECATED_ALIASES) {\n const deprecatedAlias =\n DEPRECATED_ALIASES[nodeType as keyof typeof DEPRECATED_ALIASES];\n deprecationWarning(nodeType, deprecatedAlias, \"Visitor \");\n aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];\n }\n\n if (!aliases) continue;\n\n const fns = visitor[nodeType];\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 // @ts-expect-error explosion has been performed\n return visitor as ExplodedVisitor;\n}\n\nexport function verify(visitor: Visitor) {\n // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\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 // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\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>(\n visitors: Visitor<State>[],\n): ExplodedVisitor<State>;\nexport function merge(\n visitors: Visitor<unknown>[],\n states?: any[],\n wrapper?: Function | null,\n): ExplodedVisitor<unknown>;\nexport function merge(\n visitors: any[],\n states: any[] = [],\n wrapper?: VisitWrapper | null,\n): ExplodedVisitor {\n // @ts-expect-error don't bother with internal flags so it can work with earlier @babel/core validations\n const mergedVisitor: ExplodedVisitor = {};\n\n for (let i = 0; i < visitors.length; i++) {\n const visitor = explode(visitors[i]);\n const state = states[i];\n\n let topVisitor: ExplVisitNode<unknown, Node> = visitor;\n if (state || wrapper) {\n topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper);\n }\n mergePair(mergedVisitor, topVisitor);\n\n for (const key of Object.keys(visitor) as (keyof ExplodedVisitor)[]) {\n if (shouldIgnoreKey(key)) continue;\n\n let typeVisitor = visitor[key];\n\n // if we have state or wrapper then overload the callbacks to take it\n if (state || wrapper) {\n typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);\n }\n\n const nodeVisitor = (mergedVisitor[key] ||= {});\n mergePair(nodeVisitor, typeVisitor);\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return {\n ...mergedVisitor,\n _exploded: true,\n _verified: true,\n };\n }\n\n return mergedVisitor;\n}\n\nfunction wrapWithStateOrWrapper<State>(\n oldVisitor: ExplVisitNode<State, Node>,\n state: State | null,\n wrapper?: VisitWrapper<State> | null,\n): ExplVisitNode<State, Node> {\n const newVisitor: ExplVisitNode<State, Node> = {};\n\n for (const phase of [\"enter\", \"exit\"] as VisitPhase[]) {\n let fns = oldVisitor[phase];\n\n // not an enter/exit array of callbacks\n if (!Array.isArray(fns)) continue;\n\n fns = fns.map(function (fn) {\n let newFn = fn;\n\n if (state) {\n newFn = function (path: NodePath) {\n fn.call(state, path, state);\n };\n }\n\n if (wrapper) {\n // @ts-expect-error Fixme: actually PluginPass.key (aka pluginAlias)?\n newFn = wrapper(state?.key, phase, 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 newVisitor[phase] = 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 if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];\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 | `_${string}`\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 (key === \"denylist\" || key === \"noScope\" || key === \"skipKeys\") {\n return true;\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"blacklist\") {\n return true;\n }\n }\n\n return false;\n}\n\n/*\nfunction mergePair(\n dest: ExplVisitNode<unknown, Node>,\n src: ExplVisitNode<unknown, Node>,\n);\n*/\nfunction mergePair(dest: any, src: any) {\n for (const phase of [\"enter\", \"exit\"] as VisitPhase[]) {\n if (!src[phase]) continue;\n dest[phase] = [].concat(dest[phase] || [], src[phase]);\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,EAAA,GAAAD,OAAA;AAMsB;EALpBE,eAAe;EACfC,kBAAkB;EAClBC,kBAAkB;EAClBC,KAAK;EACLC,8BAA8B,EAAIC;AAAkB,IAAAN,EAAA;AAMtD,SAASO,aAAaA,CAACC,IAAY,EAAyB;EAC1D,OAAOA,IAAI,IAAIV,YAAY;AAC7B;AAOO,SAASW,iBAAiBA,CAC/BC,OAAgB,EACY;EAE5B,OAAOA,OAAO,oBAAPA,OAAO,CAAEC,SAAS;AAC3B;AAiBO,SAASC,OAAOA,CAAIF,OAAmB,EAAsB;EAClE,IAAID,iBAAiB,CAACC,OAAO,CAAC,EAAE,OAAOA,OAAO;EAE9CA,OAAO,CAACC,SAAS,GAAG,IAAI;EAGxB,KAAK,MAAME,QAAQ,IAAIC,MAAM,CAACC,IAAI,CAACL,OAAO,CAAC,EAAuB;IAChE,IAAIM,eAAe,CAACH,QAAQ,CAAC,EAAE;IAE/B,MAAMI,KAAoB,GAAGJ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AQ,EAAE;EACtC,KAAK,MAAMb,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAkB;IACrD,IAAI,CAACa,GAAG,CAACb,KAAK,CAAC,EAAE;IACjBY,IAAI,CAACZ,KAAK,CAAC,GAAG,EAAE,CAAChB,MAAM,CAAC4B,IAAI,CAACZ,KAAK,CAAC,IAAI,EAAE,EAAEa,GAAG,CAACb,KAAK,CAAC,CAAC;EACxD;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/traverse",
|
|
3
|
-
"version": "7.22.
|
|
3
|
+
"version": "7.22.8",
|
|
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",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"main": "./lib/index.js",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/code-frame": "^7.22.5",
|
|
20
|
-
"@babel/generator": "^7.22.
|
|
20
|
+
"@babel/generator": "^7.22.7",
|
|
21
21
|
"@babel/helper-environment-visitor": "^7.22.5",
|
|
22
22
|
"@babel/helper-function-name": "^7.22.5",
|
|
23
23
|
"@babel/helper-hoist-variables": "^7.22.5",
|
|
24
|
-
"@babel/helper-split-export-declaration": "^7.22.
|
|
25
|
-
"@babel/parser": "^7.22.
|
|
24
|
+
"@babel/helper-split-export-declaration": "^7.22.6",
|
|
25
|
+
"@babel/parser": "^7.22.7",
|
|
26
26
|
"@babel/types": "^7.22.5",
|
|
27
27
|
"debug": "^4.1.0",
|
|
28
28
|
"globals": "^11.1.0"
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
semver(1) -- The semantic versioner for npm
|
|
2
2
|
===========================================
|
|
3
3
|
|
|
4
|
+
> This repo is a fork to backport [717534ee353682f3bcf33e60a8af4292626d4441](https://github.com/npm/node-semver/commit/717534ee353682f3bcf33e60a8af4292626d4441) to version 6.
|
|
5
|
+
>
|
|
6
|
+
> Manually tested on:
|
|
7
|
+
> - Node.js 6.17.1 with tap 12 (running `npm run test 'test/*'`).
|
|
8
|
+
> 4 tests are failing because they use the `resolveMatchSnapshot` function,
|
|
9
|
+
> introduced in a newer tap version
|
|
10
|
+
> - Node.js 14.21.3 with tap 14
|
|
11
|
+
> - Node.js 20.3.1 with tap 16
|
|
12
|
+
> 3 tests in `test/cli.js` are failling with `child test left in queue:`,
|
|
13
|
+
> because the async tests API has changed in recent tap versions
|
|
14
|
+
|
|
4
15
|
## Install
|
|
5
16
|
|
|
6
17
|
```bash
|
|
7
|
-
npm install semver
|
|
18
|
+
npm install @nicolo-ribaudo/semver-v6
|
|
8
19
|
````
|
|
9
20
|
|
|
10
21
|
## Usage
|
|
@@ -12,7 +23,7 @@ npm install semver
|
|
|
12
23
|
As a node module:
|
|
13
24
|
|
|
14
25
|
```js
|
|
15
|
-
const semver = require('semver')
|
|
26
|
+
const semver = require('@nicolo-ribaudo/semver-v6')
|
|
16
27
|
|
|
17
28
|
semver.valid('1.2.3') // '1.2.3'
|
|
18
29
|
semver.valid('a.b.c') // null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "semver",
|
|
3
|
-
"version": "6.3.
|
|
4
|
-
"description": "
|
|
2
|
+
"name": "@nicolo-ribaudo/semver-v6",
|
|
3
|
+
"version": "6.3.3",
|
|
4
|
+
"description": "v6 of the \"semver\" package, with security fixes backported from v7.",
|
|
5
5
|
"main": "semver.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "tap",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"tap": "^14.3.1"
|
|
14
14
|
},
|
|
15
15
|
"license": "ISC",
|
|
16
|
-
"repository": "https://github.com/
|
|
16
|
+
"repository": "https://github.com/nicolo-ribaudo/semver-v6",
|
|
17
17
|
"bin": {
|
|
18
18
|
"semver": "./bin/semver.js"
|
|
19
19
|
},
|
|
@@ -28,6 +28,7 @@ var MAX_SAFE_COMPONENT_LENGTH = 16
|
|
|
28
28
|
|
|
29
29
|
// The actual regexps go on exports.re
|
|
30
30
|
var re = exports.re = []
|
|
31
|
+
var safeRe = exports.safeRe = []
|
|
31
32
|
var src = exports.src = []
|
|
32
33
|
var t = exports.tokens = {}
|
|
33
34
|
var R = 0
|
|
@@ -250,6 +251,19 @@ for (var i = 0; i < R; i++) {
|
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
253
|
|
|
254
|
+
for (var index = 0; index < re.length; index++) {
|
|
255
|
+
// Replace all greedy whitespace to prevent regex dos issues. These regex are
|
|
256
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
257
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
258
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
259
|
+
// future breaking change could export the safer regex only with a note that
|
|
260
|
+
// all input should have extra whitespace removed.
|
|
261
|
+
var safe = re[index].source
|
|
262
|
+
.split('\\s*').join('\\s{0,1}')
|
|
263
|
+
.split('\\s+').join('\\s')
|
|
264
|
+
safeRe[index] = new RegExp(safe, re[index].flags)
|
|
265
|
+
}
|
|
266
|
+
|
|
253
267
|
exports.parse = parse
|
|
254
268
|
function parse (version, options) {
|
|
255
269
|
if (!options || typeof options !== 'object') {
|
|
@@ -271,7 +285,7 @@ function parse (version, options) {
|
|
|
271
285
|
return null
|
|
272
286
|
}
|
|
273
287
|
|
|
274
|
-
var r = options.loose ?
|
|
288
|
+
var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
|
|
275
289
|
if (!r.test(version)) {
|
|
276
290
|
return null
|
|
277
291
|
}
|
|
@@ -326,7 +340,7 @@ function SemVer (version, options) {
|
|
|
326
340
|
this.options = options
|
|
327
341
|
this.loose = !!options.loose
|
|
328
342
|
|
|
329
|
-
var m = version.trim().match(options.loose ?
|
|
343
|
+
var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
|
|
330
344
|
|
|
331
345
|
if (!m) {
|
|
332
346
|
throw new TypeError('Invalid Version: ' + version)
|
|
@@ -771,6 +785,7 @@ function Comparator (comp, options) {
|
|
|
771
785
|
return new Comparator(comp, options)
|
|
772
786
|
}
|
|
773
787
|
|
|
788
|
+
comp = comp.trim().split(/\s+/).join(' ')
|
|
774
789
|
debug('comparator', comp, options)
|
|
775
790
|
this.options = options
|
|
776
791
|
this.loose = !!options.loose
|
|
@@ -787,7 +802,7 @@ function Comparator (comp, options) {
|
|
|
787
802
|
|
|
788
803
|
var ANY = {}
|
|
789
804
|
Comparator.prototype.parse = function (comp) {
|
|
790
|
-
var r = this.options.loose ?
|
|
805
|
+
var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
|
|
791
806
|
var m = comp.match(r)
|
|
792
807
|
|
|
793
808
|
if (!m) {
|
|
@@ -911,17 +926,19 @@ function Range (range, options) {
|
|
|
911
926
|
this.loose = !!options.loose
|
|
912
927
|
this.includePrerelease = !!options.includePrerelease
|
|
913
928
|
|
|
914
|
-
// First
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
929
|
+
// First reduce all whitespace as much as possible so we do not have to rely
|
|
930
|
+
// on potentially slow regexes like \s*. This is then stored and used for
|
|
931
|
+
// future error messages as well.
|
|
932
|
+
this.raw = range.trim().split(/\s+/).join(' ')
|
|
933
|
+
this.set = this.raw.split(/\s*\|\|\s*/).map(function (range) {
|
|
934
|
+
return this.parseRange(range)
|
|
918
935
|
}, this).filter(function (c) {
|
|
919
936
|
// throw out any that are not relevant for whatever reason
|
|
920
937
|
return c.length
|
|
921
938
|
})
|
|
922
939
|
|
|
923
940
|
if (!this.set.length) {
|
|
924
|
-
throw new TypeError('Invalid SemVer Range: ' +
|
|
941
|
+
throw new TypeError('Invalid SemVer Range: ' + this.raw)
|
|
925
942
|
}
|
|
926
943
|
|
|
927
944
|
this.format()
|
|
@@ -940,28 +957,24 @@ Range.prototype.toString = function () {
|
|
|
940
957
|
|
|
941
958
|
Range.prototype.parseRange = function (range) {
|
|
942
959
|
var loose = this.options.loose
|
|
943
|
-
range = range.trim()
|
|
944
960
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
945
|
-
var hr = loose ?
|
|
961
|
+
var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
|
|
946
962
|
range = range.replace(hr, hyphenReplace)
|
|
947
963
|
debug('hyphen replace', range)
|
|
948
964
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
949
|
-
range = range.replace(
|
|
950
|
-
debug('comparator trim', range,
|
|
965
|
+
range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
|
|
966
|
+
debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
|
|
951
967
|
|
|
952
968
|
// `~ 1.2.3` => `~1.2.3`
|
|
953
|
-
range = range.replace(
|
|
969
|
+
range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
|
|
954
970
|
|
|
955
971
|
// `^ 1.2.3` => `^1.2.3`
|
|
956
|
-
range = range.replace(
|
|
957
|
-
|
|
958
|
-
// normalize spaces
|
|
959
|
-
range = range.split(/\s+/).join(' ')
|
|
972
|
+
range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
|
|
960
973
|
|
|
961
974
|
// At this point, the range is completely trimmed and
|
|
962
975
|
// ready to be split into comparators.
|
|
963
976
|
|
|
964
|
-
var compRe = loose ?
|
|
977
|
+
var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
|
|
965
978
|
var set = range.split(' ').map(function (comp) {
|
|
966
979
|
return parseComparator(comp, this.options)
|
|
967
980
|
}, this).join(' ').split(/\s+/)
|
|
@@ -1061,7 +1074,7 @@ function replaceTildes (comp, options) {
|
|
|
1061
1074
|
}
|
|
1062
1075
|
|
|
1063
1076
|
function replaceTilde (comp, options) {
|
|
1064
|
-
var r = options.loose ?
|
|
1077
|
+
var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
|
|
1065
1078
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
1066
1079
|
debug('tilde', comp, _, M, m, p, pr)
|
|
1067
1080
|
var ret
|
|
@@ -1102,7 +1115,7 @@ function replaceCarets (comp, options) {
|
|
|
1102
1115
|
|
|
1103
1116
|
function replaceCaret (comp, options) {
|
|
1104
1117
|
debug('caret', comp, options)
|
|
1105
|
-
var r = options.loose ?
|
|
1118
|
+
var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
|
|
1106
1119
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
1107
1120
|
debug('caret', comp, _, M, m, p, pr)
|
|
1108
1121
|
var ret
|
|
@@ -1161,7 +1174,7 @@ function replaceXRanges (comp, options) {
|
|
|
1161
1174
|
|
|
1162
1175
|
function replaceXRange (comp, options) {
|
|
1163
1176
|
comp = comp.trim()
|
|
1164
|
-
var r = options.loose ?
|
|
1177
|
+
var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
|
|
1165
1178
|
return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
|
|
1166
1179
|
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
|
1167
1180
|
var xM = isX(M)
|
|
@@ -1236,10 +1249,10 @@ function replaceXRange (comp, options) {
|
|
|
1236
1249
|
function replaceStars (comp, options) {
|
|
1237
1250
|
debug('replaceStars', comp, options)
|
|
1238
1251
|
// Looseness is ignored here. star is always as loose as it gets!
|
|
1239
|
-
return comp.trim().replace(
|
|
1252
|
+
return comp.trim().replace(safeRe[t.STAR], '')
|
|
1240
1253
|
}
|
|
1241
1254
|
|
|
1242
|
-
// This function is passed to string.replace(
|
|
1255
|
+
// This function is passed to string.replace(safeRe[t.HYPHENRANGE])
|
|
1243
1256
|
// M, m, patch, prerelease, build
|
|
1244
1257
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
1245
1258
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
|
|
@@ -1562,7 +1575,7 @@ function coerce (version, options) {
|
|
|
1562
1575
|
|
|
1563
1576
|
var match = null
|
|
1564
1577
|
if (!options.rtl) {
|
|
1565
|
-
match = version.match(
|
|
1578
|
+
match = version.match(safeRe[t.COERCE])
|
|
1566
1579
|
} else {
|
|
1567
1580
|
// Find the right-most coercible string that does not share
|
|
1568
1581
|
// a terminus with a more left-ward coercible string.
|
|
@@ -1573,17 +1586,17 @@ function coerce (version, options) {
|
|
|
1573
1586
|
// Stop when we get a match that ends at the string end, since no
|
|
1574
1587
|
// coercible string can be more right-ward without the same terminus.
|
|
1575
1588
|
var next
|
|
1576
|
-
while ((next =
|
|
1589
|
+
while ((next = safeRe[t.COERCERTL].exec(version)) &&
|
|
1577
1590
|
(!match || match.index + match[0].length !== version.length)
|
|
1578
1591
|
) {
|
|
1579
1592
|
if (!match ||
|
|
1580
1593
|
next.index + next[0].length !== match.index + match[0].length) {
|
|
1581
1594
|
match = next
|
|
1582
1595
|
}
|
|
1583
|
-
|
|
1596
|
+
safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
|
1584
1597
|
}
|
|
1585
1598
|
// leave it in a clean state
|
|
1586
|
-
|
|
1599
|
+
safeRe[t.COERCERTL].lastIndex = -1
|
|
1587
1600
|
}
|
|
1588
1601
|
|
|
1589
1602
|
if (match === null) {
|
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.1";
|
|
21
|
-
var version = "5.1.
|
|
21
|
+
var version = "5.1.6";
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -52642,19 +52642,13 @@ function createTypeChecker(host) {
|
|
|
52642
52642
|
if (getObjectFlags(type) & 4 /* Reference */) {
|
|
52643
52643
|
const target = type.target;
|
|
52644
52644
|
const typeArguments = getTypeArguments(type);
|
|
52645
|
-
|
|
52646
|
-
const ref = createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType]));
|
|
52647
|
-
return needApparentType ? getApparentType(ref) : ref;
|
|
52648
|
-
}
|
|
52645
|
+
return length(target.typeParameters) === length(typeArguments) ? createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType])) : type;
|
|
52649
52646
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
52650
52647
|
const types = sameMap(type.types, (t) => getTypeWithThisArgument(t, thisArgument, needApparentType));
|
|
52651
52648
|
return types !== type.types ? getIntersectionType(types) : type;
|
|
52652
52649
|
}
|
|
52653
52650
|
return needApparentType ? getApparentType(type) : type;
|
|
52654
52651
|
}
|
|
52655
|
-
function getThisArgument(type) {
|
|
52656
|
-
return getObjectFlags(type) & 4 /* Reference */ && length(getTypeArguments(type)) > getTypeReferenceArity(type) ? last(getTypeArguments(type)) : type;
|
|
52657
|
-
}
|
|
52658
52652
|
function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) {
|
|
52659
52653
|
let mapper;
|
|
52660
52654
|
let members;
|
|
@@ -53720,7 +53714,7 @@ function createTypeChecker(host) {
|
|
|
53720
53714
|
return type.resolvedBaseConstraint;
|
|
53721
53715
|
}
|
|
53722
53716
|
const stack = [];
|
|
53723
|
-
return type.resolvedBaseConstraint =
|
|
53717
|
+
return type.resolvedBaseConstraint = getImmediateBaseConstraint(type);
|
|
53724
53718
|
function getImmediateBaseConstraint(t) {
|
|
53725
53719
|
if (!t.immediateBaseConstraint) {
|
|
53726
53720
|
if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) {
|
|
@@ -53812,18 +53806,18 @@ function createTypeChecker(host) {
|
|
|
53812
53806
|
}
|
|
53813
53807
|
if (isGenericTupleType(t)) {
|
|
53814
53808
|
const newElements = map(getElementTypes(t), (v, i) => {
|
|
53815
|
-
const constraint = t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v;
|
|
53816
|
-
return constraint && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
53809
|
+
const constraint = v.flags & 262144 /* TypeParameter */ && t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v;
|
|
53810
|
+
return constraint !== v && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
53817
53811
|
});
|
|
53818
53812
|
return createTupleType(newElements, t.target.elementFlags, t.target.readonly, t.target.labeledElementDeclarations);
|
|
53819
53813
|
}
|
|
53820
53814
|
return t;
|
|
53821
53815
|
}
|
|
53822
53816
|
}
|
|
53823
|
-
function getApparentTypeOfIntersectionType(type) {
|
|
53817
|
+
function getApparentTypeOfIntersectionType(type, thisArgument) {
|
|
53824
53818
|
return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(
|
|
53825
53819
|
type,
|
|
53826
|
-
|
|
53820
|
+
thisArgument,
|
|
53827
53821
|
/*needApparentType*/
|
|
53828
53822
|
true
|
|
53829
53823
|
));
|
|
@@ -53874,8 +53868,9 @@ function createTypeChecker(host) {
|
|
|
53874
53868
|
return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
53875
53869
|
}
|
|
53876
53870
|
function getApparentType(type) {
|
|
53877
|
-
const t =
|
|
53878
|
-
|
|
53871
|
+
const t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type;
|
|
53872
|
+
const objectFlags = getObjectFlags(t);
|
|
53873
|
+
return objectFlags & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : objectFlags & 4 /* Reference */ && t !== type ? getTypeWithThisArgument(t, type) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t, type) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t;
|
|
53879
53874
|
}
|
|
53880
53875
|
function getReducedApparentType(type) {
|
|
53881
53876
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
@@ -58055,7 +58050,10 @@ function createTypeChecker(host) {
|
|
|
58055
58050
|
const newMapper = createTypeMapper(typeParameters, typeArguments);
|
|
58056
58051
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
58057
58052
|
if (result.flags & 138117121 /* ObjectFlagsType */ && !(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58058
|
-
|
|
58053
|
+
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58054
|
+
if (!(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58055
|
+
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
58056
|
+
}
|
|
58059
58057
|
}
|
|
58060
58058
|
target.instantiations.set(id, result);
|
|
58061
58059
|
}
|
|
@@ -60581,7 +60579,6 @@ function createTypeChecker(host) {
|
|
|
60581
60579
|
} else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
60582
60580
|
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
60583
60581
|
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
|
|
60584
|
-
instantiateType(source2.objectType, reportUnreliableMapper);
|
|
60585
60582
|
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
|
|
60586
60583
|
}
|
|
60587
60584
|
if (result2) {
|
|
@@ -60661,7 +60658,7 @@ function createTypeChecker(host) {
|
|
|
60661
60658
|
return 3 /* Maybe */;
|
|
60662
60659
|
}
|
|
60663
60660
|
const c = target2;
|
|
60664
|
-
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
60661
|
+
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root) && !(source2.flags & 16777216 /* Conditional */ && source2.root === c.root)) {
|
|
60665
60662
|
const skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
60666
60663
|
const skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
60667
60664
|
if (result2 = skipTrue ? -1 /* True */ : isRelatedTo(
|
|
@@ -95306,7 +95303,7 @@ function transformJsx(context) {
|
|
|
95306
95303
|
continue;
|
|
95307
95304
|
}
|
|
95308
95305
|
finishObjectLiteralIfNeeded();
|
|
95309
|
-
expressions.push(attr.expression);
|
|
95306
|
+
expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression)));
|
|
95310
95307
|
continue;
|
|
95311
95308
|
}
|
|
95312
95309
|
properties.push(transformJsxAttributeToObjectLiteralElement(attr));
|
|
@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2304
2304
|
|
|
2305
2305
|
// src/compiler/corePublic.ts
|
|
2306
2306
|
var versionMajorMinor = "5.1";
|
|
2307
|
-
var version = "5.1.
|
|
2307
|
+
var version = "5.1.6";
|
|
2308
2308
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2309
2309
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2310
2310
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -57293,19 +57293,13 @@ function createTypeChecker(host) {
|
|
|
57293
57293
|
if (getObjectFlags(type) & 4 /* Reference */) {
|
|
57294
57294
|
const target = type.target;
|
|
57295
57295
|
const typeArguments = getTypeArguments(type);
|
|
57296
|
-
|
|
57297
|
-
const ref = createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType]));
|
|
57298
|
-
return needApparentType ? getApparentType(ref) : ref;
|
|
57299
|
-
}
|
|
57296
|
+
return length(target.typeParameters) === length(typeArguments) ? createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType])) : type;
|
|
57300
57297
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
57301
57298
|
const types = sameMap(type.types, (t) => getTypeWithThisArgument(t, thisArgument, needApparentType));
|
|
57302
57299
|
return types !== type.types ? getIntersectionType(types) : type;
|
|
57303
57300
|
}
|
|
57304
57301
|
return needApparentType ? getApparentType(type) : type;
|
|
57305
57302
|
}
|
|
57306
|
-
function getThisArgument(type) {
|
|
57307
|
-
return getObjectFlags(type) & 4 /* Reference */ && length(getTypeArguments(type)) > getTypeReferenceArity(type) ? last(getTypeArguments(type)) : type;
|
|
57308
|
-
}
|
|
57309
57303
|
function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) {
|
|
57310
57304
|
let mapper;
|
|
57311
57305
|
let members;
|
|
@@ -58371,7 +58365,7 @@ function createTypeChecker(host) {
|
|
|
58371
58365
|
return type.resolvedBaseConstraint;
|
|
58372
58366
|
}
|
|
58373
58367
|
const stack = [];
|
|
58374
|
-
return type.resolvedBaseConstraint =
|
|
58368
|
+
return type.resolvedBaseConstraint = getImmediateBaseConstraint(type);
|
|
58375
58369
|
function getImmediateBaseConstraint(t) {
|
|
58376
58370
|
if (!t.immediateBaseConstraint) {
|
|
58377
58371
|
if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) {
|
|
@@ -58463,18 +58457,18 @@ function createTypeChecker(host) {
|
|
|
58463
58457
|
}
|
|
58464
58458
|
if (isGenericTupleType(t)) {
|
|
58465
58459
|
const newElements = map(getElementTypes(t), (v, i) => {
|
|
58466
|
-
const constraint = t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v;
|
|
58467
|
-
return constraint && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
58460
|
+
const constraint = v.flags & 262144 /* TypeParameter */ && t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v;
|
|
58461
|
+
return constraint !== v && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
58468
58462
|
});
|
|
58469
58463
|
return createTupleType(newElements, t.target.elementFlags, t.target.readonly, t.target.labeledElementDeclarations);
|
|
58470
58464
|
}
|
|
58471
58465
|
return t;
|
|
58472
58466
|
}
|
|
58473
58467
|
}
|
|
58474
|
-
function getApparentTypeOfIntersectionType(type) {
|
|
58468
|
+
function getApparentTypeOfIntersectionType(type, thisArgument) {
|
|
58475
58469
|
return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(
|
|
58476
58470
|
type,
|
|
58477
|
-
|
|
58471
|
+
thisArgument,
|
|
58478
58472
|
/*needApparentType*/
|
|
58479
58473
|
true
|
|
58480
58474
|
));
|
|
@@ -58525,8 +58519,9 @@ function createTypeChecker(host) {
|
|
|
58525
58519
|
return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
58526
58520
|
}
|
|
58527
58521
|
function getApparentType(type) {
|
|
58528
|
-
const t =
|
|
58529
|
-
|
|
58522
|
+
const t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type;
|
|
58523
|
+
const objectFlags = getObjectFlags(t);
|
|
58524
|
+
return objectFlags & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : objectFlags & 4 /* Reference */ && t !== type ? getTypeWithThisArgument(t, type) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t, type) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t;
|
|
58530
58525
|
}
|
|
58531
58526
|
function getReducedApparentType(type) {
|
|
58532
58527
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
@@ -62706,7 +62701,10 @@ function createTypeChecker(host) {
|
|
|
62706
62701
|
const newMapper = createTypeMapper(typeParameters, typeArguments);
|
|
62707
62702
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
62708
62703
|
if (result.flags & 138117121 /* ObjectFlagsType */ && !(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
62709
|
-
|
|
62704
|
+
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
62705
|
+
if (!(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
62706
|
+
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
62707
|
+
}
|
|
62710
62708
|
}
|
|
62711
62709
|
target.instantiations.set(id, result);
|
|
62712
62710
|
}
|
|
@@ -65232,7 +65230,6 @@ function createTypeChecker(host) {
|
|
|
65232
65230
|
} else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
65233
65231
|
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
65234
65232
|
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
|
|
65235
|
-
instantiateType(source2.objectType, reportUnreliableMapper);
|
|
65236
65233
|
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
|
|
65237
65234
|
}
|
|
65238
65235
|
if (result2) {
|
|
@@ -65312,7 +65309,7 @@ function createTypeChecker(host) {
|
|
|
65312
65309
|
return 3 /* Maybe */;
|
|
65313
65310
|
}
|
|
65314
65311
|
const c = target2;
|
|
65315
|
-
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
65312
|
+
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root) && !(source2.flags & 16777216 /* Conditional */ && source2.root === c.root)) {
|
|
65316
65313
|
const skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
65317
65314
|
const skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
65318
65315
|
if (result2 = skipTrue ? -1 /* True */ : isRelatedTo(
|
|
@@ -100128,7 +100125,7 @@ function transformJsx(context) {
|
|
|
100128
100125
|
continue;
|
|
100129
100126
|
}
|
|
100130
100127
|
finishObjectLiteralIfNeeded();
|
|
100131
|
-
expressions.push(attr.expression);
|
|
100128
|
+
expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression)));
|
|
100132
100129
|
continue;
|
|
100133
100130
|
}
|
|
100134
100131
|
properties.push(transformJsxAttributeToObjectLiteralElement(attr));
|
|
@@ -156311,7 +156308,7 @@ function getSourceFromOrigin(origin) {
|
|
|
156311
156308
|
}
|
|
156312
156309
|
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) {
|
|
156313
156310
|
const start2 = timestamp();
|
|
156314
|
-
const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken);
|
|
156311
|
+
const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken, location);
|
|
156315
156312
|
const useSemicolons = probablyUsesSemicolons(sourceFile);
|
|
156316
156313
|
const typeChecker = program.getTypeChecker();
|
|
156317
156314
|
const uniques = /* @__PURE__ */ new Map();
|
|
@@ -158490,11 +158487,12 @@ function isModuleSpecifierMissingOrEmpty(specifier) {
|
|
|
158490
158487
|
return true;
|
|
158491
158488
|
return !((_a = tryCast(isExternalModuleReference(specifier) ? specifier.expression : specifier, isStringLiteralLike)) == null ? void 0 : _a.text);
|
|
158492
158489
|
}
|
|
158493
|
-
function getVariableOrParameterDeclaration(contextToken) {
|
|
158490
|
+
function getVariableOrParameterDeclaration(contextToken, location) {
|
|
158494
158491
|
if (!contextToken)
|
|
158495
158492
|
return;
|
|
158496
|
-
const
|
|
158497
|
-
|
|
158493
|
+
const possiblyParameterDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent));
|
|
158494
|
+
const possiblyVariableDeclaration = findAncestor(location, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node));
|
|
158495
|
+
return possiblyParameterDeclaration || possiblyVariableDeclaration;
|
|
158498
158496
|
}
|
|
158499
158497
|
function isArrowFunctionBody(node) {
|
|
158500
158498
|
return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/;
|
|
@@ -158736,7 +158734,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
158736
158734
|
case 290 /* JsxAttribute */:
|
|
158737
158735
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
158738
158736
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
158739
|
-
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
|
|
158737
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
|
|
158740
158738
|
}
|
|
158741
158739
|
case 271 /* ImportDeclaration */:
|
|
158742
158740
|
case 277 /* ExportDeclaration */:
|
|
@@ -5446,7 +5446,6 @@ declare namespace ts {
|
|
|
5446
5446
|
type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
|
|
5447
5447
|
interface JsxSpreadAttribute extends ObjectLiteralElement {
|
|
5448
5448
|
readonly kind: SyntaxKind.JsxSpreadAttribute;
|
|
5449
|
-
readonly name: PropertyName;
|
|
5450
5449
|
readonly parent: JsxAttributes;
|
|
5451
5450
|
readonly expression: Expression;
|
|
5452
5451
|
}
|