@weavelogic/knowledge-graph-agent 0.3.0 → 0.6.0
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/README.md +374 -427
- package/dist/_virtual/ExpiringCache.js +5 -0
- package/dist/_virtual/ExpiringCache.js.map +1 -0
- package/dist/_virtual/___vite-browser-external.js +7 -0
- package/dist/_virtual/___vite-browser-external.js.map +1 -0
- package/dist/_virtual/__vite-browser-external.js +5 -0
- package/dist/_virtual/__vite-browser-external.js.map +1 -0
- package/dist/_virtual/_commonjs-dynamic-modules.js +7 -0
- package/dist/_virtual/_commonjs-dynamic-modules.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +27 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/assert-valid-pattern.js +5 -0
- package/dist/_virtual/assert-valid-pattern.js.map +1 -0
- package/dist/_virtual/ast-converter.js +5 -0
- package/dist/_virtual/ast-converter.js.map +1 -0
- package/dist/_virtual/ast-spec.js +5 -0
- package/dist/_virtual/ast-spec.js.map +1 -0
- package/dist/_virtual/ast.js +5 -0
- package/dist/_virtual/ast.js.map +1 -0
- package/dist/_virtual/brace-expressions.js +5 -0
- package/dist/_virtual/brace-expressions.js.map +1 -0
- package/dist/_virtual/browser.js +6 -0
- package/dist/_virtual/browser.js.map +1 -0
- package/dist/_virtual/browser2.js +5 -0
- package/dist/_virtual/browser2.js.map +1 -0
- package/dist/_virtual/candidateTSConfigRootDirs.js +5 -0
- package/dist/_virtual/candidateTSConfigRootDirs.js.map +1 -0
- package/dist/_virtual/check-modifiers.js +5 -0
- package/dist/_virtual/check-modifiers.js.map +1 -0
- package/dist/_virtual/clear-caches.js +5 -0
- package/dist/_virtual/clear-caches.js.map +1 -0
- package/dist/_virtual/compilerOptions.js +5 -0
- package/dist/_virtual/compilerOptions.js.map +1 -0
- package/dist/_virtual/convert-comments.js +5 -0
- package/dist/_virtual/convert-comments.js.map +1 -0
- package/dist/_virtual/convert.js +5 -0
- package/dist/_virtual/convert.js.map +1 -0
- package/dist/_virtual/createIsolatedProgram.js +5 -0
- package/dist/_virtual/createIsolatedProgram.js.map +1 -0
- package/dist/_virtual/createParseSettings.js +5 -0
- package/dist/_virtual/createParseSettings.js.map +1 -0
- package/dist/_virtual/createParserServices.js +5 -0
- package/dist/_virtual/createParserServices.js.map +1 -0
- package/dist/_virtual/createProjectProgram.js +5 -0
- package/dist/_virtual/createProjectProgram.js.map +1 -0
- package/dist/_virtual/createProjectProgramError.js +5 -0
- package/dist/_virtual/createProjectProgramError.js.map +1 -0
- package/dist/_virtual/createProjectService.js +5 -0
- package/dist/_virtual/createProjectService.js.map +1 -0
- package/dist/_virtual/createSourceFile.js +5 -0
- package/dist/_virtual/createSourceFile.js.map +1 -0
- package/dist/_virtual/describeFilePath.js +5 -0
- package/dist/_virtual/describeFilePath.js.map +1 -0
- package/dist/_virtual/escape.js +5 -0
- package/dist/_virtual/escape.js.map +1 -0
- package/dist/_virtual/eslint-visitor-keys.js +5 -0
- package/dist/_virtual/eslint-visitor-keys.js.map +1 -0
- package/dist/_virtual/estree-to-ts-node-types.js +5 -0
- package/dist/_virtual/estree-to-ts-node-types.js.map +1 -0
- package/dist/_virtual/get-keys.js +5 -0
- package/dist/_virtual/get-keys.js.map +1 -0
- package/dist/_virtual/getModifiers.js +5 -0
- package/dist/_virtual/getModifiers.js.map +1 -0
- package/dist/_virtual/getParsedConfigFile.js +5 -0
- package/dist/_virtual/getParsedConfigFile.js.map +1 -0
- package/dist/_virtual/getParsedConfigFileFromTSServer.js +5 -0
- package/dist/_virtual/getParsedConfigFileFromTSServer.js.map +1 -0
- package/dist/_virtual/getProjectConfigFiles.js +5 -0
- package/dist/_virtual/getProjectConfigFiles.js.map +1 -0
- package/dist/_virtual/getScriptKind.js +5 -0
- package/dist/_virtual/getScriptKind.js.map +1 -0
- package/dist/_virtual/getWatchProgramsForProjects.js +5 -0
- package/dist/_virtual/getWatchProgramsForProjects.js.map +1 -0
- package/dist/_virtual/global-ponyfill.js +9 -0
- package/dist/_virtual/global-ponyfill.js.map +1 -0
- package/dist/_virtual/global-ponyfill2.js +5 -0
- package/dist/_virtual/global-ponyfill2.js.map +1 -0
- package/dist/_virtual/index.js +2 -4
- package/dist/_virtual/index.js.map +1 -1
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/_virtual/inferSingleRun.js +5 -0
- package/dist/_virtual/inferSingleRun.js.map +1 -0
- package/dist/_virtual/lib.js +5 -0
- package/dist/_virtual/lib.js.map +1 -0
- package/dist/_virtual/node-utils.js +5 -0
- package/dist/_virtual/node-utils.js.map +1 -0
- package/dist/_virtual/parser-options.js +5 -0
- package/dist/_virtual/parser-options.js.map +1 -0
- package/dist/_virtual/parser.js +5 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/re.js +5 -0
- package/dist/_virtual/re.js.map +1 -0
- package/dist/_virtual/resolveProjectList.js +5 -0
- package/dist/_virtual/resolveProjectList.js.map +1 -0
- package/dist/_virtual/semantic-or-syntactic-errors.js +5 -0
- package/dist/_virtual/semantic-or-syntactic-errors.js.map +1 -0
- package/dist/_virtual/shared.js +5 -0
- package/dist/_virtual/shared.js.map +1 -0
- package/dist/_virtual/simple-traverse.js +5 -0
- package/dist/_virtual/simple-traverse.js.map +1 -0
- package/dist/_virtual/source-files.js +5 -0
- package/dist/_virtual/source-files.js.map +1 -0
- package/dist/_virtual/ts-estree.js +5 -0
- package/dist/_virtual/ts-estree.js.map +1 -0
- package/dist/_virtual/ts-nodes.js +5 -0
- package/dist/_virtual/ts-nodes.js.map +1 -0
- package/dist/_virtual/tsserverlibrary.js +5 -0
- package/dist/_virtual/tsserverlibrary.js.map +1 -0
- package/dist/_virtual/typescript.js +5 -0
- package/dist/_virtual/typescript.js.map +1 -0
- package/dist/_virtual/unescape.js +5 -0
- package/dist/_virtual/unescape.js.map +1 -0
- package/dist/_virtual/useProgramFromProjectService.js +5 -0
- package/dist/_virtual/useProgramFromProjectService.js.map +1 -0
- package/dist/_virtual/useProvidedPrograms.js +5 -0
- package/dist/_virtual/useProvidedPrograms.js.map +1 -0
- package/dist/_virtual/utils.js +5 -0
- package/dist/_virtual/utils.js.map +1 -0
- package/dist/_virtual/validateDefaultProjectForFilesGlob.js +5 -0
- package/dist/_virtual/validateDefaultProjectForFilesGlob.js.map +1 -0
- package/dist/_virtual/version-check.js +5 -0
- package/dist/_virtual/version-check.js.map +1 -0
- package/dist/_virtual/version.js +5 -0
- package/dist/_virtual/version.js.map +1 -0
- package/dist/_virtual/visitor-keys.js +5 -0
- package/dist/_virtual/visitor-keys.js.map +1 -0
- package/dist/_virtual/warnAboutTSVersion.js +5 -0
- package/dist/_virtual/warnAboutTSVersion.js.map +1 -0
- package/dist/_virtual/withoutProjectParserOptions.js +5 -0
- package/dist/_virtual/withoutProjectParserOptions.js.map +1 -0
- package/dist/_virtual/xhtml-entities.js +5 -0
- package/dist/_virtual/xhtml-entities.js.map +1 -0
- package/dist/audit/config.d.ts +150 -0
- package/dist/audit/config.d.ts.map +1 -0
- package/dist/audit/config.js +111 -0
- package/dist/audit/config.js.map +1 -0
- package/dist/audit/index.d.ts +38 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.d.ts +276 -0
- package/dist/audit/services/audit-chain.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.js +502 -0
- package/dist/audit/services/audit-chain.js.map +1 -0
- package/dist/audit/services/index.d.ts +11 -0
- package/dist/audit/services/index.d.ts.map +1 -0
- package/dist/audit/services/syndication.d.ts +334 -0
- package/dist/audit/services/syndication.d.ts.map +1 -0
- package/dist/audit/services/syndication.js +589 -0
- package/dist/audit/services/syndication.js.map +1 -0
- package/dist/audit/types.d.ts +453 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/cli/commands/audit.d.ts +21 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +621 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +14 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +271 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/plugin.d.ts +14 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +784 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +15 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +252 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/vector.d.ts +14 -0
- package/dist/cli/commands/vector.d.ts.map +1 -0
- package/dist/cli/commands/vector.js +429 -0
- package/dist/cli/commands/vector.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +12 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +471 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +54 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/manager.js +325 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/dashboard-server/index.d.ts +31 -0
- package/dist/dashboard-server/index.d.ts.map +1 -0
- package/dist/dashboard-server/server.d.ts +205 -0
- package/dist/dashboard-server/server.d.ts.map +1 -0
- package/dist/dashboard-server/server.js +651 -0
- package/dist/dashboard-server/server.js.map +1 -0
- package/dist/database/schemas/index.d.ts +85 -0
- package/dist/database/schemas/index.d.ts.map +1 -0
- package/dist/graphql/context.d.ts +154 -0
- package/dist/graphql/context.d.ts.map +1 -0
- package/dist/graphql/context.js +168 -0
- package/dist/graphql/context.js.map +1 -0
- package/dist/graphql/index.d.ts +12 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/pubsub.d.ts +282 -0
- package/dist/graphql/pubsub.d.ts.map +1 -0
- package/dist/graphql/resolvers/index.d.ts +519 -0
- package/dist/graphql/resolvers/index.d.ts.map +1 -0
- package/dist/graphql/resolvers/mutations.d.ts +255 -0
- package/dist/graphql/resolvers/mutations.d.ts.map +1 -0
- package/dist/graphql/resolvers/queries.d.ts +451 -0
- package/dist/graphql/resolvers/queries.d.ts.map +1 -0
- package/dist/graphql/resolvers/subscriptions.d.ts +399 -0
- package/dist/graphql/resolvers/subscriptions.d.ts.map +1 -0
- package/dist/graphql/scalars.d.ts +89 -0
- package/dist/graphql/scalars.d.ts.map +1 -0
- package/dist/graphql/scalars.js +242 -0
- package/dist/graphql/scalars.js.map +1 -0
- package/dist/graphql/server.d.ts +122 -0
- package/dist/graphql/server.d.ts.map +1 -0
- package/dist/graphql/server.js +368 -0
- package/dist/graphql/server.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/handlers/index.js +1 -1
- package/dist/mcp-server/server.js +2 -2
- package/dist/mcp-server/tools/audit/checkpoint.d.ts +58 -0
- package/dist/mcp-server/tools/audit/checkpoint.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/checkpoint.js +73 -0
- package/dist/mcp-server/tools/audit/checkpoint.js.map +1 -0
- package/dist/mcp-server/tools/audit/index.d.ts +53 -0
- package/dist/mcp-server/tools/audit/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/index.js +12 -0
- package/dist/mcp-server/tools/audit/index.js.map +1 -0
- package/dist/mcp-server/tools/audit/query.d.ts +58 -0
- package/dist/mcp-server/tools/audit/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/query.js +125 -0
- package/dist/mcp-server/tools/audit/query.js.map +1 -0
- package/dist/mcp-server/tools/audit/sync.d.ts +58 -0
- package/dist/mcp-server/tools/audit/sync.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/sync.js +126 -0
- package/dist/mcp-server/tools/audit/sync.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +3 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/registry.js +90 -0
- package/dist/mcp-server/tools/registry.js.map +1 -1
- package/dist/mcp-server/tools/vector/index.d.ts +12 -0
- package/dist/mcp-server/tools/vector/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/index.js +12 -0
- package/dist/mcp-server/tools/vector/index.js.map +1 -0
- package/dist/mcp-server/tools/vector/search.d.ts +41 -0
- package/dist/mcp-server/tools/vector/search.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/search.js +224 -0
- package/dist/mcp-server/tools/vector/search.js.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts +39 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.js +170 -0
- package/dist/mcp-server/tools/vector/trajectory.js.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts +44 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.js +175 -0
- package/dist/mcp-server/tools/vector/upsert.js.map +1 -0
- package/dist/mcp-server/tools/workflow/index.d.ts +29 -0
- package/dist/mcp-server/tools/workflow/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/index.js +12 -0
- package/dist/mcp-server/tools/workflow/index.js.map +1 -0
- package/dist/mcp-server/tools/workflow/list.d.ts +41 -0
- package/dist/mcp-server/tools/workflow/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/list.js +195 -0
- package/dist/mcp-server/tools/workflow/list.js.map +1 -0
- package/dist/mcp-server/tools/workflow/start.d.ts +40 -0
- package/dist/mcp-server/tools/workflow/start.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/start.js +165 -0
- package/dist/mcp-server/tools/workflow/start.js.map +1 -0
- package/dist/mcp-server/tools/workflow/status.d.ts +38 -0
- package/dist/mcp-server/tools/workflow/status.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/status.js +97 -0
- package/dist/mcp-server/tools/workflow/status.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/create.js +31 -0
- package/dist/node_modules/@envelop/core/esm/create.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/document-string-map.js +5 -0
- package/dist/node_modules/@envelop/core/esm/document-string-map.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/orchestrator.js +407 -0
- package/dist/node_modules/@envelop/core/esm/orchestrator.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-engine.js +29 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-engine.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-extend-context.js +10 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-extend-context.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-masked-errors.js +86 -0
- package/dist/node_modules/@envelop/core/esm/plugins/use-masked-errors.js.map +1 -0
- package/dist/node_modules/@envelop/core/esm/utils.js +129 -0
- package/dist/node_modules/@envelop/core/esm/utils.js.map +1 -0
- package/dist/node_modules/@envelop/instrumentation/esm/instrumentation.js +51 -0
- package/dist/node_modules/@envelop/instrumentation/esm/instrumentation.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/coerceError.js +26 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/coerceError.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/execute.js +1101 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/execute.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/flattenAsyncIterable.js +72 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/flattenAsyncIterable.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/invariant.js +9 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/invariant.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/normalizedExecutor.js +22 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/normalizedExecutor.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/promiseForObject.js +26 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/promiseForObject.js.map +1 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/values.js +73 -0
- package/dist/node_modules/@graphql-tools/executor/esm/execution/values.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/extensions.js +46 -0
- package/dist/node_modules/@graphql-tools/merge/esm/extensions.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/links.js +142 -0
- package/dist/node_modules/@graphql-tools/merge/esm/links.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/merge-resolvers.js +27 -0
- package/dist/node_modules/@graphql-tools/merge/esm/merge-resolvers.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js +23 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js +113 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js +39 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js +23 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js +74 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js +27 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js +29 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js +15 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js +81 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js +142 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js +21 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js +36 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js +29 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js +24 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js.map +1 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js +67 -0
- package/dist/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js.map +1 -0
- package/dist/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js +287 -0
- package/dist/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js.map +1 -0
- package/dist/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js +42 -0
- package/dist/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js.map +1 -0
- package/dist/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js +22 -0
- package/dist/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js.map +1 -0
- package/dist/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js +34 -0
- package/dist/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js.map +1 -0
- package/dist/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js +50 -0
- package/dist/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js +17 -0
- package/dist/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/Interfaces.js +32 -0
- package/dist/node_modules/@graphql-tools/utils/esm/Interfaces.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/Path.js +21 -0
- package/dist/node_modules/@graphql-tools/utils/esm/Path.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromType.js +31 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromType.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromValue.js +70 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromValue.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js +56 -0
- package/dist/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/collectFields.js +137 -0
- package/dist/node_modules/@graphql-tools/utils/esm/collectFields.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/comments.js +337 -0
- package/dist/node_modules/@graphql-tools/utils/esm/comments.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js +20 -0
- package/dist/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/directives.js +46 -0
- package/dist/node_modules/@graphql-tools/utils/esm/directives.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/errors.js +52 -0
- package/dist/node_modules/@graphql-tools/utils/esm/errors.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js +28 -0
- package/dist/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/forEachField.js +18 -0
- package/dist/node_modules/@graphql-tools/utils/esm/forEachField.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/get-directives.js +12 -0
- package/dist/node_modules/@graphql-tools/utils/esm/get-directives.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getArgumentValues.js +61 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getArgumentValues.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js +76 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js +13 -0
- package/dist/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/heal.js +120 -0
- package/dist/node_modules/@graphql-tools/utils/esm/heal.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/helpers.js +42 -0
- package/dist/node_modules/@graphql-tools/utils/esm/helpers.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js +7 -0
- package/dist/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/isDocumentNode.js +8 -0
- package/dist/node_modules/@graphql-tools/utils/esm/isDocumentNode.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/jsutils.js +26 -0
- package/dist/node_modules/@graphql-tools/utils/esm/jsutils.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/mapSchema.js +439 -0
- package/dist/node_modules/@graphql-tools/utils/esm/mapSchema.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/memoize.js +104 -0
- package/dist/node_modules/@graphql-tools/utils/esm/memoize.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/mergeDeep.js +86 -0
- package/dist/node_modules/@graphql-tools/utils/esm/mergeDeep.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js +370 -0
- package/dist/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/rewire.js +155 -0
- package/dist/node_modules/@graphql-tools/utils/esm/rewire.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/rootTypes.js +33 -0
- package/dist/node_modules/@graphql-tools/utils/esm/rootTypes.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/stub.js +32 -0
- package/dist/node_modules/@graphql-tools/utils/esm/stub.js.map +1 -0
- package/dist/node_modules/@graphql-tools/utils/esm/transformInputValue.js +47 -0
- package/dist/node_modules/@graphql-tools/utils/esm/transformInputValue.js.map +1 -0
- package/dist/node_modules/@graphql-yoga/logger/esm/index.js +42 -0
- package/dist/node_modules/@graphql-yoga/logger/esm/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/createProjectService.js +126 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/createProjectService.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.js +25 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/index.js +32 -0
- package/dist/node_modules/@typescript-eslint/project-service/dist/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.js +20 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.js +87 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/index.js +34 -0
- package/dist/node_modules/@typescript-eslint/tsconfig-utils/dist/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js +201 -0
- package/dist/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/types/dist/index.js +45 -0
- package/dist/node_modules/@typescript-eslint/types/dist/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/types/dist/lib.js +12 -0
- package/dist/node_modules/@typescript-eslint/types/dist/lib.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/types/dist/parser-options.js +12 -0
- package/dist/node_modules/@typescript-eslint/types/dist/parser-options.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/types/dist/ts-estree.js +52 -0
- package/dist/node_modules/@typescript-eslint/types/dist/ts-estree.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js +54 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.js +207 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js +34 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js +81 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +2438 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js +117 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js +33 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js +82 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js +84 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js +31 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js +90 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js +292 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js +134 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js +91 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js +35 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js +39 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js +88 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/index.js +90 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js +268 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js +533 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js +50 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.js +38 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js +216 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js +87 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js +53 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js +89 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +92 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parser.js +132 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js +124 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js +64 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js +63 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js +12 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js +46 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js +12 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js +205 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js +75 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/version.js +15 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/version.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js +17 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +23 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js +495 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js +121 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js +17 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js +763 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js +17 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/package.json.js +9 -0
- package/dist/node_modules/@typescript-eslint/typescript-estree/package.json.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js +16 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/index.js +25 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/index.js.map +1 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +187 -0
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/AsyncDisposableStack.js +72 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/AsyncDisposableStack.js.map +1 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/SupressedError.js +16 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/SupressedError.js.map +1 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/index.js +6 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/index.js.map +1 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/symbols.js +12 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/symbols.js.map +1 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/utils.js +12 -0
- package/dist/node_modules/@whatwg-node/disposablestack/esm/utils.js.map +1 -0
- package/dist/node_modules/@whatwg-node/fetch/dist/global-ponyfill.js +33 -0
- package/dist/node_modules/@whatwg-node/fetch/dist/global-ponyfill.js.map +1 -0
- package/dist/node_modules/@whatwg-node/promise-helpers/esm/index.js +241 -0
- package/dist/node_modules/@whatwg-node/promise-helpers/esm/index.js.map +1 -0
- package/dist/node_modules/@whatwg-node/server/esm/createServerAdapter.js +333 -0
- package/dist/node_modules/@whatwg-node/server/esm/createServerAdapter.js.map +1 -0
- package/dist/node_modules/@whatwg-node/server/esm/plugins/useCors.js +106 -0
- package/dist/node_modules/@whatwg-node/server/esm/plugins/useCors.js.map +1 -0
- package/dist/node_modules/@whatwg-node/server/esm/utils.js +476 -0
- package/dist/node_modules/@whatwg-node/server/esm/utils.js.map +1 -0
- package/dist/node_modules/@whatwg-node/server/esm/uwebsockets.js +232 -0
- package/dist/node_modules/@whatwg-node/server/esm/uwebsockets.js.map +1 -0
- package/dist/node_modules/balanced-match/index.js +62 -0
- package/dist/node_modules/balanced-match/index.js.map +1 -0
- package/dist/node_modules/brace-expansion/index.js +156 -0
- package/dist/node_modules/brace-expansion/index.js.map +1 -0
- package/dist/node_modules/cross-inspect/esm/index.js +89 -0
- package/dist/node_modules/cross-inspect/esm/index.js.map +1 -0
- package/dist/node_modules/debug/src/browser.js +178 -0
- package/dist/node_modules/debug/src/browser.js.map +1 -0
- package/dist/node_modules/debug/src/common.js +183 -0
- package/dist/node_modules/debug/src/common.js.map +1 -0
- package/dist/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.js +353 -0
- package/dist/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.js.map +1 -0
- package/dist/node_modules/fdir/dist/index.js +540 -0
- package/dist/node_modules/fdir/dist/index.js.map +1 -0
- package/dist/node_modules/graphql/error/GraphQLError.js +154 -0
- package/dist/node_modules/graphql/error/GraphQLError.js.map +1 -0
- package/dist/node_modules/graphql/error/locatedError.js +23 -0
- package/dist/node_modules/graphql/error/locatedError.js.map +1 -0
- package/dist/node_modules/graphql/error/syntaxError.js +11 -0
- package/dist/node_modules/graphql/error/syntaxError.js.map +1 -0
- package/dist/node_modules/graphql/execution/collectFields.js +128 -0
- package/dist/node_modules/graphql/execution/collectFields.js.map +1 -0
- package/dist/node_modules/graphql/execution/execute.js +606 -0
- package/dist/node_modules/graphql/execution/execute.js.map +1 -0
- package/dist/node_modules/graphql/execution/mapAsyncIterator.js +46 -0
- package/dist/node_modules/graphql/execution/mapAsyncIterator.js.map +1 -0
- package/dist/node_modules/graphql/execution/subscribe.js +121 -0
- package/dist/node_modules/graphql/execution/subscribe.js.map +1 -0
- package/dist/node_modules/graphql/execution/values.js +184 -0
- package/dist/node_modules/graphql/execution/values.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/Path.js +21 -0
- package/dist/node_modules/graphql/jsutils/Path.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/devAssert.js +10 -0
- package/dist/node_modules/graphql/jsutils/devAssert.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/didYouMean.js +24 -0
- package/dist/node_modules/graphql/jsutils/didYouMean.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/groupBy.js +17 -0
- package/dist/node_modules/graphql/jsutils/groupBy.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/identityFunc.js +7 -0
- package/dist/node_modules/graphql/jsutils/identityFunc.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/inspect.js +85 -0
- package/dist/node_modules/graphql/jsutils/inspect.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/instanceOf.js +42 -0
- package/dist/node_modules/graphql/jsutils/instanceOf.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/invariant.js +12 -0
- package/dist/node_modules/graphql/jsutils/invariant.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/isAsyncIterable.js +7 -0
- package/dist/node_modules/graphql/jsutils/isAsyncIterable.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/isIterableObject.js +7 -0
- package/dist/node_modules/graphql/jsutils/isIterableObject.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/isObjectLike.js +7 -0
- package/dist/node_modules/graphql/jsutils/isObjectLike.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/isPromise.js +7 -0
- package/dist/node_modules/graphql/jsutils/isPromise.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/keyMap.js +11 -0
- package/dist/node_modules/graphql/jsutils/keyMap.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/keyValMap.js +11 -0
- package/dist/node_modules/graphql/jsutils/keyValMap.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/mapValue.js +11 -0
- package/dist/node_modules/graphql/jsutils/mapValue.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/memoize3.js +28 -0
- package/dist/node_modules/graphql/jsutils/memoize3.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/naturalCompare.js +47 -0
- package/dist/node_modules/graphql/jsutils/naturalCompare.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/printPathArray.js +9 -0
- package/dist/node_modules/graphql/jsutils/printPathArray.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/promiseForObject.js +13 -0
- package/dist/node_modules/graphql/jsutils/promiseForObject.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/promiseReduce.js +12 -0
- package/dist/node_modules/graphql/jsutils/promiseReduce.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/suggestionList.js +94 -0
- package/dist/node_modules/graphql/jsutils/suggestionList.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/toError.js +15 -0
- package/dist/node_modules/graphql/jsutils/toError.js.map +1 -0
- package/dist/node_modules/graphql/jsutils/toObjMap.js +17 -0
- package/dist/node_modules/graphql/jsutils/toObjMap.js.map +1 -0
- package/dist/node_modules/graphql/language/ast.js +189 -0
- package/dist/node_modules/graphql/language/ast.js.map +1 -0
- package/dist/node_modules/graphql/language/blockString.js +60 -0
- package/dist/node_modules/graphql/language/blockString.js.map +1 -0
- package/dist/node_modules/graphql/language/characterClasses.js +24 -0
- package/dist/node_modules/graphql/language/characterClasses.js.map +1 -0
- package/dist/node_modules/graphql/language/directiveLocation.js +26 -0
- package/dist/node_modules/graphql/language/directiveLocation.js.map +1 -0
- package/dist/node_modules/graphql/language/kinds.js +55 -0
- package/dist/node_modules/graphql/language/kinds.js.map +1 -0
- package/dist/node_modules/graphql/language/lexer.js +543 -0
- package/dist/node_modules/graphql/language/lexer.js.map +1 -0
- package/dist/node_modules/graphql/language/location.js +22 -0
- package/dist/node_modules/graphql/language/location.js.map +1 -0
- package/dist/node_modules/graphql/language/parser.js +1343 -0
- package/dist/node_modules/graphql/language/parser.js.map +1 -0
- package/dist/node_modules/graphql/language/predicates.js +28 -0
- package/dist/node_modules/graphql/language/predicates.js.map +1 -0
- package/dist/node_modules/graphql/language/printLocation.js +51 -0
- package/dist/node_modules/graphql/language/printLocation.js.map +1 -0
- package/dist/node_modules/graphql/language/printString.js +178 -0
- package/dist/node_modules/graphql/language/printString.js.map +1 -0
- package/dist/node_modules/graphql/language/printer.js +269 -0
- package/dist/node_modules/graphql/language/printer.js.map +1 -0
- package/dist/node_modules/graphql/language/source.js +33 -0
- package/dist/node_modules/graphql/language/source.js.map +1 -0
- package/dist/node_modules/graphql/language/tokenKind.js +30 -0
- package/dist/node_modules/graphql/language/tokenKind.js.map +1 -0
- package/dist/node_modules/graphql/language/visitor.js +192 -0
- package/dist/node_modules/graphql/language/visitor.js.map +1 -0
- package/dist/node_modules/graphql/type/assertName.js +34 -0
- package/dist/node_modules/graphql/type/assertName.js.map +1 -0
- package/dist/node_modules/graphql/type/definition.js +648 -0
- package/dist/node_modules/graphql/type/definition.js.map +1 -0
- package/dist/node_modules/graphql/type/directives.js +137 -0
- package/dist/node_modules/graphql/type/directives.js.map +1 -0
- package/dist/node_modules/graphql/type/introspection.js +506 -0
- package/dist/node_modules/graphql/type/introspection.js.map +1 -0
- package/dist/node_modules/graphql/type/scalars.js +248 -0
- package/dist/node_modules/graphql/type/scalars.js.map +1 -0
- package/dist/node_modules/graphql/type/schema.js +223 -0
- package/dist/node_modules/graphql/type/schema.js.map +1 -0
- package/dist/node_modules/graphql/type/validate.js +461 -0
- package/dist/node_modules/graphql/type/validate.js.map +1 -0
- package/dist/node_modules/graphql/utilities/TypeInfo.js +257 -0
- package/dist/node_modules/graphql/utilities/TypeInfo.js.map +1 -0
- package/dist/node_modules/graphql/utilities/astFromValue.js +111 -0
- package/dist/node_modules/graphql/utilities/astFromValue.js.map +1 -0
- package/dist/node_modules/graphql/utilities/buildASTSchema.js +65 -0
- package/dist/node_modules/graphql/utilities/buildASTSchema.js.map +1 -0
- package/dist/node_modules/graphql/utilities/coerceInputValue.js +154 -0
- package/dist/node_modules/graphql/utilities/coerceInputValue.js.map +1 -0
- package/dist/node_modules/graphql/utilities/extendSchema.js +456 -0
- package/dist/node_modules/graphql/utilities/extendSchema.js.map +1 -0
- package/dist/node_modules/graphql/utilities/getOperationAST.js +22 -0
- package/dist/node_modules/graphql/utilities/getOperationAST.js.map +1 -0
- package/dist/node_modules/graphql/utilities/sortValueNode.js +30 -0
- package/dist/node_modules/graphql/utilities/sortValueNode.js.map +1 -0
- package/dist/node_modules/graphql/utilities/typeComparators.js +58 -0
- package/dist/node_modules/graphql/utilities/typeComparators.js.map +1 -0
- package/dist/node_modules/graphql/utilities/typeFromAST.js +20 -0
- package/dist/node_modules/graphql/utilities/typeFromAST.js.map +1 -0
- package/dist/node_modules/graphql/utilities/valueFromAST.js +109 -0
- package/dist/node_modules/graphql/utilities/valueFromAST.js.map +1 -0
- package/dist/node_modules/graphql/utilities/valueFromASTUntyped.js +32 -0
- package/dist/node_modules/graphql/utilities/valueFromASTUntyped.js.map +1 -0
- package/dist/node_modules/graphql/validation/ValidationContext.js +171 -0
- package/dist/node_modules/graphql/validation/ValidationContext.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +24 -0
- package/dist/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +80 -0
- package/dist/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +43 -0
- package/dist/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +73 -0
- package/dist/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownDirectivesRule.js +112 -0
- package/dist/node_modules/graphql/validation/rules/KnownDirectivesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +20 -0
- package/dist/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +55 -0
- package/dist/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +28 -0
- package/dist/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js +34 -0
- package/dist/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +56 -0
- package/dist/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +53 -0
- package/dist/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +34 -0
- package/dist/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +41 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +38 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +519 -0
- package/dist/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +55 -0
- package/dist/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js +113 -0
- package/dist/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +99 -0
- package/dist/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/ScalarLeafsRule.js +53 -0
- package/dist/node_modules/graphql/validation/rules/ScalarLeafsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +62 -0
- package/dist/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js +47 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +29 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js +38 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +63 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js +50 -0
- package/dist/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js +59 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +27 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +38 -0
- package/dist/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +32 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js +48 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js +41 -0
- package/dist/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +30 -0
- package/dist/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +170 -0
- package/dist/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +27 -0
- package/dist/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +74 -0
- package/dist/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.map +1 -0
- package/dist/node_modules/graphql/validation/specifiedRules.js +88 -0
- package/dist/node_modules/graphql/validation/specifiedRules.js.map +1 -0
- package/dist/node_modules/graphql/validation/validate.js +65 -0
- package/dist/node_modules/graphql/validation/validate.js.map +1 -0
- package/dist/node_modules/graphql/version.js +10 -0
- package/dist/node_modules/graphql/version.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/common.js +127 -0
- package/dist/node_modules/graphql-ws/lib/common.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/server.js +257 -0
- package/dist/node_modules/graphql-ws/lib/server.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/use/ws.js +83 -0
- package/dist/node_modules/graphql-ws/lib/use/ws.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/utils.js +35 -0
- package/dist/node_modules/graphql-ws/lib/utils.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/error.js +127 -0
- package/dist/node_modules/graphql-yoga/esm/error.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/graphiql-html.js +5 -0
- package/dist/node_modules/graphql-yoga/esm/graphiql-html.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/landing-page-html.js +21 -0
- package/dist/node_modules/graphql-yoga/esm/landing-page-html.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/allowed-headers.js +26 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/allowed-headers.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/get.js +15 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/get.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-form-url-encoded.js +12 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-form-url-encoded.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-graphql-string.js +12 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-graphql-string.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-json.js +58 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-json.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-multipart.js +78 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/post-multipart.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/utils.js +28 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-parser/utils.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-check-graphql-query-params.js +131 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-check-graphql-query-params.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-check-method-for-graphql.js +28 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-check-method-for-graphql.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-http-validation-error.js +21 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-http-validation-error.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-limit-batching.js +37 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-limit-batching.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-prevent-mutation-via-get.js +61 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/request-validation/use-prevent-mutation-via-get.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/accept.js +28 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/accept.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/multipart.js +68 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/multipart.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js +29 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/sse.js +83 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/sse.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/stringify.js +47 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/result-processor/stringify.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-graphiql.js +55 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-graphiql.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-health-check.js +20 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-health-check.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-parser-and-validation-cache.js +63 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-parser-and-validation-cache.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-request-parser.js +15 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-request-parser.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-result-processor.js +58 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-result-processor.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-schema.js +76 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-schema.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-unhandled-route.js +52 -0
- package/dist/node_modules/graphql-yoga/esm/plugins/use-unhandled-route.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/process-request.js +56 -0
- package/dist/node_modules/graphql-yoga/esm/process-request.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/server.js +374 -0
- package/dist/node_modules/graphql-yoga/esm/server.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/utils/create-lru-cache.js +10 -0
- package/dist/node_modules/graphql-yoga/esm/utils/create-lru-cache.js.map +1 -0
- package/dist/node_modules/graphql-yoga/esm/utils/mask-error.js +47 -0
- package/dist/node_modules/graphql-yoga/esm/utils/mask-error.js.map +1 -0
- package/dist/node_modules/graphql-yoga/node_modules/lru-cache/dist/esm/index.js +1370 -0
- package/dist/node_modules/graphql-yoga/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/dist/node_modules/ms/index.js +121 -0
- package/dist/node_modules/ms/index.js.map +1 -0
- package/dist/node_modules/picomatch/index.js +23 -0
- package/dist/node_modules/picomatch/index.js.map +1 -0
- package/dist/node_modules/picomatch/lib/constants.js +203 -0
- package/dist/node_modules/picomatch/lib/constants.js.map +1 -0
- package/dist/node_modules/picomatch/lib/parse.js +774 -0
- package/dist/node_modules/picomatch/lib/parse.js.map +1 -0
- package/dist/node_modules/picomatch/lib/picomatch.js +148 -0
- package/dist/node_modules/picomatch/lib/picomatch.js.map +1 -0
- package/dist/node_modules/picomatch/lib/scan.js +336 -0
- package/dist/node_modules/picomatch/lib/scan.js.map +1 -0
- package/dist/node_modules/picomatch/lib/utils.js +71 -0
- package/dist/node_modules/picomatch/lib/utils.js.map +1 -0
- package/dist/node_modules/semver/classes/comparator.js +123 -0
- package/dist/node_modules/semver/classes/comparator.js.map +1 -0
- package/dist/node_modules/semver/classes/range.js +388 -0
- package/dist/node_modules/semver/classes/range.js.map +1 -0
- package/dist/node_modules/semver/classes/semver.js +288 -0
- package/dist/node_modules/semver/classes/semver.js.map +1 -0
- package/dist/node_modules/semver/functions/clean.js +18 -0
- package/dist/node_modules/semver/functions/clean.js.map +1 -0
- package/dist/node_modules/semver/functions/cmp.js +60 -0
- package/dist/node_modules/semver/functions/cmp.js.map +1 -0
- package/dist/node_modules/semver/functions/coerce.js +53 -0
- package/dist/node_modules/semver/functions/coerce.js.map +1 -0
- package/dist/node_modules/semver/functions/compare-build.js +19 -0
- package/dist/node_modules/semver/functions/compare-build.js.map +1 -0
- package/dist/node_modules/semver/functions/compare-loose.js +15 -0
- package/dist/node_modules/semver/functions/compare-loose.js.map +1 -0
- package/dist/node_modules/semver/functions/compare.js +15 -0
- package/dist/node_modules/semver/functions/compare.js.map +1 -0
- package/dist/node_modules/semver/functions/diff.js +49 -0
- package/dist/node_modules/semver/functions/diff.js.map +1 -0
- package/dist/node_modules/semver/functions/eq.js +15 -0
- package/dist/node_modules/semver/functions/eq.js.map +1 -0
- package/dist/node_modules/semver/functions/gt.js +15 -0
- package/dist/node_modules/semver/functions/gt.js.map +1 -0
- package/dist/node_modules/semver/functions/gte.js +15 -0
- package/dist/node_modules/semver/functions/gte.js.map +1 -0
- package/dist/node_modules/semver/functions/inc.js +29 -0
- package/dist/node_modules/semver/functions/inc.js.map +1 -0
- package/dist/node_modules/semver/functions/lt.js +15 -0
- package/dist/node_modules/semver/functions/lt.js.map +1 -0
- package/dist/node_modules/semver/functions/lte.js +15 -0
- package/dist/node_modules/semver/functions/lte.js.map +1 -0
- package/dist/node_modules/semver/functions/major.js +15 -0
- package/dist/node_modules/semver/functions/major.js.map +1 -0
- package/dist/node_modules/semver/functions/minor.js +15 -0
- package/dist/node_modules/semver/functions/minor.js.map +1 -0
- package/dist/node_modules/semver/functions/neq.js +15 -0
- package/dist/node_modules/semver/functions/neq.js.map +1 -0
- package/dist/node_modules/semver/functions/parse.js +27 -0
- package/dist/node_modules/semver/functions/parse.js.map +1 -0
- package/dist/node_modules/semver/functions/patch.js +15 -0
- package/dist/node_modules/semver/functions/patch.js.map +1 -0
- package/dist/node_modules/semver/functions/prerelease.js +18 -0
- package/dist/node_modules/semver/functions/prerelease.js.map +1 -0
- package/dist/node_modules/semver/functions/rcompare.js +15 -0
- package/dist/node_modules/semver/functions/rcompare.js.map +1 -0
- package/dist/node_modules/semver/functions/rsort.js +15 -0
- package/dist/node_modules/semver/functions/rsort.js.map +1 -0
- package/dist/node_modules/semver/functions/satisfies.js +22 -0
- package/dist/node_modules/semver/functions/satisfies.js.map +1 -0
- package/dist/node_modules/semver/functions/sort.js +15 -0
- package/dist/node_modules/semver/functions/sort.js.map +1 -0
- package/dist/node_modules/semver/functions/valid.js +18 -0
- package/dist/node_modules/semver/functions/valid.js.map +1 -0
- package/dist/node_modules/semver/index.js +140 -0
- package/dist/node_modules/semver/index.js.map +1 -0
- package/dist/node_modules/semver/internal/constants.js +36 -0
- package/dist/node_modules/semver/internal/constants.js.map +1 -0
- package/dist/node_modules/semver/internal/debug.js +14 -0
- package/dist/node_modules/semver/internal/debug.js.map +1 -0
- package/dist/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/semver/internal/identifiers.js.map +1 -0
- package/dist/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/semver/internal/lrucache.js.map +1 -0
- package/dist/node_modules/semver/internal/parse-options.js +23 -0
- package/dist/node_modules/semver/internal/parse-options.js.map +1 -0
- package/dist/node_modules/semver/internal/re.js +96 -0
- package/dist/node_modules/semver/internal/re.js.map +1 -0
- package/dist/node_modules/semver/ranges/gtr.js +15 -0
- package/dist/node_modules/semver/ranges/gtr.js.map +1 -0
- package/dist/node_modules/semver/ranges/intersects.js +19 -0
- package/dist/node_modules/semver/ranges/intersects.js.map +1 -0
- package/dist/node_modules/semver/ranges/ltr.js +15 -0
- package/dist/node_modules/semver/ranges/ltr.js.map +1 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +35 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js.map +1 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +35 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js.map +1 -0
- package/dist/node_modules/semver/ranges/min-version.js +66 -0
- package/dist/node_modules/semver/ranges/min-version.js.map +1 -0
- package/dist/node_modules/semver/ranges/outside.js +81 -0
- package/dist/node_modules/semver/ranges/outside.js.map +1 -0
- package/dist/node_modules/semver/ranges/simplify.js +56 -0
- package/dist/node_modules/semver/ranges/simplify.js.map +1 -0
- package/dist/node_modules/semver/ranges/subset.js +170 -0
- package/dist/node_modules/semver/ranges/subset.js.map +1 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +15 -0
- package/dist/node_modules/semver/ranges/to-comparators.js.map +1 -0
- package/dist/node_modules/semver/ranges/valid.js +21 -0
- package/dist/node_modules/semver/ranges/valid.js.map +1 -0
- package/dist/node_modules/tinyglobby/dist/index.js +332 -0
- package/dist/node_modules/tinyglobby/dist/index.js.map +1 -0
- package/dist/node_modules/ts-api-utils/lib/index.js +2361 -0
- package/dist/node_modules/ts-api-utils/lib/index.js.map +1 -0
- package/dist/node_modules/typescript/lib/tsserverlibrary.js +33 -0
- package/dist/node_modules/typescript/lib/tsserverlibrary.js.map +1 -0
- package/dist/node_modules/typescript/lib/typescript.js +210602 -0
- package/dist/node_modules/typescript/lib/typescript.js.map +1 -0
- package/dist/node_modules/ws/browser.js +16 -0
- package/dist/node_modules/ws/browser.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/analyzer.d.ts +105 -0
- package/dist/plugins/analyzers/code-complexity/analyzer.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/analyzer.js +507 -0
- package/dist/plugins/analyzers/code-complexity/analyzer.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/graph-generator.d.ts +70 -0
- package/dist/plugins/analyzers/code-complexity/graph-generator.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/graph-generator.js +405 -0
- package/dist/plugins/analyzers/code-complexity/graph-generator.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/index.d.ts +191 -0
- package/dist/plugins/analyzers/code-complexity/index.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/index.js +276 -0
- package/dist/plugins/analyzers/code-complexity/index.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/metrics.d.ts +77 -0
- package/dist/plugins/analyzers/code-complexity/metrics.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/metrics.js +514 -0
- package/dist/plugins/analyzers/code-complexity/metrics.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/plugin.d.ts +161 -0
- package/dist/plugins/analyzers/code-complexity/plugin.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/plugin.js +661 -0
- package/dist/plugins/analyzers/code-complexity/plugin.js.map +1 -0
- package/dist/plugins/analyzers/code-complexity/types.d.ts +360 -0
- package/dist/plugins/analyzers/code-complexity/types.d.ts.map +1 -0
- package/dist/plugins/analyzers/code-complexity/types.js +27 -0
- package/dist/plugins/analyzers/code-complexity/types.js.map +1 -0
- package/dist/plugins/analyzers/dependency-health/analyzer.d.ts +56 -0
- package/dist/plugins/analyzers/dependency-health/analyzer.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/analyzer.js +387 -0
- package/dist/plugins/analyzers/dependency-health/analyzer.js.map +1 -0
- package/dist/plugins/analyzers/dependency-health/graph-generator.d.ts +60 -0
- package/dist/plugins/analyzers/dependency-health/graph-generator.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/graph-generator.js +295 -0
- package/dist/plugins/analyzers/dependency-health/graph-generator.js.map +1 -0
- package/dist/plugins/analyzers/dependency-health/index.d.ts +201 -0
- package/dist/plugins/analyzers/dependency-health/index.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/index.js +857 -0
- package/dist/plugins/analyzers/dependency-health/index.js.map +1 -0
- package/dist/plugins/analyzers/dependency-health/npm-client.d.ts +68 -0
- package/dist/plugins/analyzers/dependency-health/npm-client.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/npm-client.js +226 -0
- package/dist/plugins/analyzers/dependency-health/npm-client.js.map +1 -0
- package/dist/plugins/analyzers/dependency-health/types.d.ts +462 -0
- package/dist/plugins/analyzers/dependency-health/types.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/vulnerability.d.ts +80 -0
- package/dist/plugins/analyzers/dependency-health/vulnerability.d.ts.map +1 -0
- package/dist/plugins/analyzers/dependency-health/vulnerability.js +215 -0
- package/dist/plugins/analyzers/dependency-health/vulnerability.js.map +1 -0
- package/dist/plugins/analyzers/index.d.ts +12 -0
- package/dist/plugins/analyzers/index.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +13 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/loader.d.ts +158 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +554 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manager.d.ts +183 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +876 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/registry.d.ts +163 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +448 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/types.d.ts +930 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +43 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/server/container.d.ts +263 -0
- package/dist/server/container.d.ts.map +1 -0
- package/dist/server/container.js +605 -0
- package/dist/server/container.js.map +1 -0
- package/dist/server/event-bus.d.ts +418 -0
- package/dist/server/event-bus.d.ts.map +1 -0
- package/dist/server/event-bus.js +442 -0
- package/dist/server/event-bus.js.map +1 -0
- package/dist/server/index.d.ts +37 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/manager.d.ts +123 -0
- package/dist/server/manager.d.ts.map +1 -0
- package/dist/server/manager.js +742 -0
- package/dist/server/manager.js.map +1 -0
- package/dist/server/shared-services.d.ts +130 -0
- package/dist/server/shared-services.d.ts.map +1 -0
- package/dist/server/shared-services.js +476 -0
- package/dist/server/shared-services.js.map +1 -0
- package/dist/server/types.d.ts +320 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +13 -0
- package/dist/server/types.js.map +1 -0
- package/dist/services/manager.js +328 -0
- package/dist/services/manager.js.map +1 -0
- package/dist/vector/config.d.ts +300 -0
- package/dist/vector/config.d.ts.map +1 -0
- package/dist/vector/config.js +124 -0
- package/dist/vector/config.js.map +1 -0
- package/dist/vector/index.d.ts +50 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/services/index.d.ts +13 -0
- package/dist/vector/services/index.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.d.ts +405 -0
- package/dist/vector/services/trajectory-tracker.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.js +445 -0
- package/dist/vector/services/trajectory-tracker.js.map +1 -0
- package/dist/vector/services/vector-store.d.ts +339 -0
- package/dist/vector/services/vector-store.d.ts.map +1 -0
- package/dist/vector/services/vector-store.js +748 -0
- package/dist/vector/services/vector-store.js.map +1 -0
- package/dist/vector/types.d.ts +677 -0
- package/dist/vector/types.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.d.ts +196 -0
- package/dist/workflow/adapters/goap-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.js +706 -0
- package/dist/workflow/adapters/goap-adapter.js.map +1 -0
- package/dist/workflow/adapters/index.d.ts +10 -0
- package/dist/workflow/adapters/index.d.ts.map +1 -0
- package/dist/workflow/config.d.ts +135 -0
- package/dist/workflow/config.d.ts.map +1 -0
- package/dist/workflow/config.js +92 -0
- package/dist/workflow/config.js.map +1 -0
- package/dist/workflow/handlers/index.d.ts +9 -0
- package/dist/workflow/handlers/index.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts +397 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.js +454 -0
- package/dist/workflow/handlers/webhook-handlers.js.map +1 -0
- package/dist/workflow/index.d.ts +42 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/services/index.d.ts +9 -0
- package/dist/workflow/services/index.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.d.ts +318 -0
- package/dist/workflow/services/workflow-service.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.js +577 -0
- package/dist/workflow/services/workflow-service.js.map +1 -0
- package/dist/workflow/types.d.ts +470 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/workflows/realtime-collab.d.ts +245 -0
- package/dist/workflow/workflows/realtime-collab.d.ts.map +1 -0
- package/package.json +29 -3
- package/dist/_virtual/additionalItems.js +0 -5
- package/dist/_virtual/additionalItems.js.map +0 -1
- package/dist/_virtual/additionalProperties.js +0 -5
- package/dist/_virtual/additionalProperties.js.map +0 -1
- package/dist/_virtual/ajv.js +0 -6
- package/dist/_virtual/ajv.js.map +0 -1
- package/dist/_virtual/ajv2.js +0 -5
- package/dist/_virtual/ajv2.js.map +0 -1
- package/dist/_virtual/allOf.js +0 -5
- package/dist/_virtual/allOf.js.map +0 -1
- package/dist/_virtual/anyOf.js +0 -5
- package/dist/_virtual/anyOf.js.map +0 -1
- package/dist/_virtual/applicability.js +0 -5
- package/dist/_virtual/applicability.js.map +0 -1
- package/dist/_virtual/boolSchema.js +0 -5
- package/dist/_virtual/boolSchema.js.map +0 -1
- package/dist/_virtual/code.js +0 -5
- package/dist/_virtual/code.js.map +0 -1
- package/dist/_virtual/code2.js +0 -5
- package/dist/_virtual/code2.js.map +0 -1
- package/dist/_virtual/const.js +0 -5
- package/dist/_virtual/const.js.map +0 -1
- package/dist/_virtual/contains.js +0 -5
- package/dist/_virtual/contains.js.map +0 -1
- package/dist/_virtual/core.js +0 -5
- package/dist/_virtual/core.js.map +0 -1
- package/dist/_virtual/dataType.js +0 -5
- package/dist/_virtual/dataType.js.map +0 -1
- package/dist/_virtual/defaults.js +0 -5
- package/dist/_virtual/defaults.js.map +0 -1
- package/dist/_virtual/dependencies.js +0 -5
- package/dist/_virtual/dependencies.js.map +0 -1
- package/dist/_virtual/draft7.js +0 -5
- package/dist/_virtual/draft7.js.map +0 -1
- package/dist/_virtual/enum.js +0 -5
- package/dist/_virtual/enum.js.map +0 -1
- package/dist/_virtual/equal.js +0 -5
- package/dist/_virtual/equal.js.map +0 -1
- package/dist/_virtual/errors.js +0 -5
- package/dist/_virtual/errors.js.map +0 -1
- package/dist/_virtual/format.js +0 -5
- package/dist/_virtual/format.js.map +0 -1
- package/dist/_virtual/formats.js +0 -5
- package/dist/_virtual/formats.js.map +0 -1
- package/dist/_virtual/id.js +0 -5
- package/dist/_virtual/id.js.map +0 -1
- package/dist/_virtual/if.js +0 -5
- package/dist/_virtual/if.js.map +0 -1
- package/dist/_virtual/index12.js +0 -5
- package/dist/_virtual/index12.js.map +0 -1
- package/dist/_virtual/items.js +0 -5
- package/dist/_virtual/items.js.map +0 -1
- package/dist/_virtual/items2020.js +0 -5
- package/dist/_virtual/items2020.js.map +0 -1
- package/dist/_virtual/keyword.js +0 -5
- package/dist/_virtual/keyword.js.map +0 -1
- package/dist/_virtual/limit.js +0 -5
- package/dist/_virtual/limit.js.map +0 -1
- package/dist/_virtual/limitItems.js +0 -5
- package/dist/_virtual/limitItems.js.map +0 -1
- package/dist/_virtual/limitLength.js +0 -5
- package/dist/_virtual/limitLength.js.map +0 -1
- package/dist/_virtual/limitNumber.js +0 -5
- package/dist/_virtual/limitNumber.js.map +0 -1
- package/dist/_virtual/limitProperties.js +0 -5
- package/dist/_virtual/limitProperties.js.map +0 -1
- package/dist/_virtual/metadata.js +0 -5
- package/dist/_virtual/metadata.js.map +0 -1
- package/dist/_virtual/multipleOf.js +0 -5
- package/dist/_virtual/multipleOf.js.map +0 -1
- package/dist/_virtual/names.js +0 -5
- package/dist/_virtual/names.js.map +0 -1
- package/dist/_virtual/not.js +0 -5
- package/dist/_virtual/not.js.map +0 -1
- package/dist/_virtual/oneOf.js +0 -5
- package/dist/_virtual/oneOf.js.map +0 -1
- package/dist/_virtual/pattern.js +0 -5
- package/dist/_virtual/pattern.js.map +0 -1
- package/dist/_virtual/patternProperties.js +0 -5
- package/dist/_virtual/patternProperties.js.map +0 -1
- package/dist/_virtual/prefixItems.js +0 -5
- package/dist/_virtual/prefixItems.js.map +0 -1
- package/dist/_virtual/properties.js +0 -5
- package/dist/_virtual/properties.js.map +0 -1
- package/dist/_virtual/propertyNames.js +0 -5
- package/dist/_virtual/propertyNames.js.map +0 -1
- package/dist/_virtual/ref.js +0 -5
- package/dist/_virtual/ref.js.map +0 -1
- package/dist/_virtual/ref_error.js +0 -5
- package/dist/_virtual/ref_error.js.map +0 -1
- package/dist/_virtual/required.js +0 -5
- package/dist/_virtual/required.js.map +0 -1
- package/dist/_virtual/resolve.js +0 -5
- package/dist/_virtual/resolve.js.map +0 -1
- package/dist/_virtual/rules.js +0 -5
- package/dist/_virtual/rules.js.map +0 -1
- package/dist/_virtual/scope.js +0 -5
- package/dist/_virtual/scope.js.map +0 -1
- package/dist/_virtual/subschema.js +0 -5
- package/dist/_virtual/subschema.js.map +0 -1
- package/dist/_virtual/thenElse.js +0 -5
- package/dist/_virtual/thenElse.js.map +0 -1
- package/dist/_virtual/types.js +0 -5
- package/dist/_virtual/types.js.map +0 -1
- package/dist/_virtual/ucs2length.js +0 -5
- package/dist/_virtual/ucs2length.js.map +0 -1
- package/dist/_virtual/uniqueItems.js +0 -5
- package/dist/_virtual/uniqueItems.js.map +0 -1
- package/dist/_virtual/uri.js +0 -5
- package/dist/_virtual/uri.js.map +0 -1
- package/dist/_virtual/util.js +0 -5
- package/dist/_virtual/util.js.map +0 -1
- package/dist/_virtual/validation_error.js +0 -5
- package/dist/_virtual/validation_error.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +0 -296
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +0 -71
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +0 -26
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +0 -407
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +0 -1332
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +0 -71
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +0 -1
- package/dist/node_modules/ajv/dist/ajv.js +0 -84
- package/dist/node_modules/ajv/dist/ajv.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -160
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -728
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -152
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/errors.js +0 -131
- package/dist/node_modules/ajv/dist/compile/errors.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/index.js +0 -234
- package/dist/node_modules/ajv/dist/compile/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/names.js +0 -44
- package/dist/node_modules/ajv/dist/compile/names.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -22
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/resolve.js +0 -163
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/rules.js +0 -35
- package/dist/node_modules/ajv/dist/compile/rules.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/util.js +0 -173
- package/dist/node_modules/ajv/dist/compile/util.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -27
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -58
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -193
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -43
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -522
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -126
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -89
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +0 -1
- package/dist/node_modules/ajv/dist/core.js +0 -628
- package/dist/node_modules/ajv/dist/core.js.map +0 -1
- package/dist/node_modules/ajv/dist/refs/data.json.js +0 -24
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +0 -1
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +0 -25
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/equal.js +0 -16
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -30
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/uri.js +0 -16
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -20
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -59
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -114
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -32
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -22
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -100
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -103
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -75
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -68
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -64
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -43
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -36
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -64
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -81
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -22
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -66
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -49
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -23
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -140
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -19
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -27
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -132
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -114
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -18
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -31
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -95
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -16
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -27
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -36
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -56
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -52
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -34
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -39
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -37
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -34
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -33
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -34
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -89
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -75
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/formats.js +0 -209
- package/dist/node_modules/ajv-formats/dist/formats.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/index.js +0 -51
- package/dist/node_modules/ajv-formats/dist/index.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/limit.js +0 -80
- package/dist/node_modules/ajv-formats/dist/limit.js.map +0 -1
- package/dist/node_modules/fast-deep-equal/index.js +0 -39
- package/dist/node_modules/fast-deep-equal/index.js.map +0 -1
- package/dist/node_modules/fast-uri/index.js +0 -261
- package/dist/node_modules/fast-uri/index.js.map +0 -1
- package/dist/node_modules/fast-uri/lib/schemes.js +0 -215
- package/dist/node_modules/fast-uri/lib/schemes.js.map +0 -1
- package/dist/node_modules/fast-uri/lib/utils.js +0 -261
- package/dist/node_modules/fast-uri/lib/utils.js.map +0 -1
- package/dist/node_modules/json-schema-traverse/index.js +0 -92
- package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -37
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -43
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -13
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -688
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -492
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -405
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -58
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -82
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -60
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -87
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1283
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -341
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -2
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
|
@@ -0,0 +1,2438 @@
|
|
|
1
|
+
import { __exports as convert } from "../../../../_virtual/convert.js";
|
|
2
|
+
import { __require as requireTypescript } from "../../../typescript/lib/typescript.js";
|
|
3
|
+
import { __require as requireCheckModifiers } from "./check-modifiers.js";
|
|
4
|
+
import { __require as requireGetModifiers } from "./getModifiers.js";
|
|
5
|
+
import { __require as requireNodeUtils } from "./node-utils.js";
|
|
6
|
+
import { __require as requireTsEstree } from "./ts-estree/index.js";
|
|
7
|
+
var hasRequiredConvert;
|
|
8
|
+
function requireConvert() {
|
|
9
|
+
if (hasRequiredConvert) return convert;
|
|
10
|
+
hasRequiredConvert = 1;
|
|
11
|
+
var __createBinding = convert && convert.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === void 0) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() {
|
|
16
|
+
return m[k];
|
|
17
|
+
} };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === void 0) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = convert && convert.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = convert && convert.__importStar || /* @__PURE__ */ (function() {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function(mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) {
|
|
42
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
}
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(convert, "__esModule", { value: true });
|
|
49
|
+
convert.Converter = void 0;
|
|
50
|
+
convert.convertError = convertError;
|
|
51
|
+
const ts = __importStar(requireTypescript());
|
|
52
|
+
const check_modifiers_1 = requireCheckModifiers();
|
|
53
|
+
const getModifiers_1 = requireGetModifiers();
|
|
54
|
+
const node_utils_1 = requireNodeUtils();
|
|
55
|
+
const ts_estree_1 = requireTsEstree();
|
|
56
|
+
const SyntaxKind = ts.SyntaxKind;
|
|
57
|
+
function convertError(error) {
|
|
58
|
+
return (0, node_utils_1.createError)(error.start, "message" in error && error.message || error.messageText, error.file);
|
|
59
|
+
}
|
|
60
|
+
function isPropertyAccessEntityNameExpression(node) {
|
|
61
|
+
return ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && isEntityNameExpression(node.expression);
|
|
62
|
+
}
|
|
63
|
+
function isEntityNameExpression(node) {
|
|
64
|
+
return node.kind === SyntaxKind.Identifier || isPropertyAccessEntityNameExpression(node);
|
|
65
|
+
}
|
|
66
|
+
class Converter {
|
|
67
|
+
allowPattern = false;
|
|
68
|
+
ast;
|
|
69
|
+
esTreeNodeToTSNodeMap = /* @__PURE__ */ new WeakMap();
|
|
70
|
+
options;
|
|
71
|
+
tsNodeToESTreeNodeMap = /* @__PURE__ */ new WeakMap();
|
|
72
|
+
/**
|
|
73
|
+
* Converts a TypeScript node into an ESTree node
|
|
74
|
+
* @param ast the full TypeScript AST
|
|
75
|
+
* @param options additional options for the conversion
|
|
76
|
+
* @returns the converted ESTreeNode
|
|
77
|
+
*/
|
|
78
|
+
constructor(ast, options) {
|
|
79
|
+
this.ast = ast;
|
|
80
|
+
this.options = { ...options };
|
|
81
|
+
}
|
|
82
|
+
#checkForStatementDeclaration(initializer, kind) {
|
|
83
|
+
const loop = kind === ts.SyntaxKind.ForInStatement ? "for...in" : "for...of";
|
|
84
|
+
if (ts.isVariableDeclarationList(initializer)) {
|
|
85
|
+
if (initializer.declarations.length !== 1) {
|
|
86
|
+
this.#throwError(initializer, `Only a single variable declaration is allowed in a '${loop}' statement.`);
|
|
87
|
+
}
|
|
88
|
+
const declaration = initializer.declarations[0];
|
|
89
|
+
if (declaration.initializer) {
|
|
90
|
+
this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have an initializer.`);
|
|
91
|
+
} else if (declaration.type) {
|
|
92
|
+
this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`);
|
|
93
|
+
}
|
|
94
|
+
if (kind === ts.SyntaxKind.ForInStatement && initializer.flags & ts.NodeFlags.Using) {
|
|
95
|
+
this.#throwError(initializer, "The left-hand side of a 'for...in' statement cannot be a 'using' declaration.");
|
|
96
|
+
}
|
|
97
|
+
} else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) && initializer.kind !== ts.SyntaxKind.ObjectLiteralExpression && initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
|
|
98
|
+
this.#throwError(initializer, `The left-hand side of a '${loop}' statement must be a variable or a property access.`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
#checkModifiers(node) {
|
|
102
|
+
if (this.options.allowInvalidAST) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
(0, check_modifiers_1.checkModifiers)(node);
|
|
106
|
+
}
|
|
107
|
+
#throwError(node, message) {
|
|
108
|
+
if (this.options.allowInvalidAST) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
throw (0, node_utils_1.createError)(node, message, this.ast);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a getter for a property under aliasKey that returns the value under
|
|
115
|
+
* valueKey. If suppressDeprecatedPropertyWarnings is not enabled, the
|
|
116
|
+
* getter also console warns about the deprecation.
|
|
117
|
+
*
|
|
118
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/issues/6469
|
|
119
|
+
*/
|
|
120
|
+
#withDeprecatedAliasGetter(node, aliasKey, valueKey, suppressWarnings = false) {
|
|
121
|
+
let warned = suppressWarnings;
|
|
122
|
+
Object.defineProperty(node, aliasKey, {
|
|
123
|
+
configurable: true,
|
|
124
|
+
get: this.options.suppressDeprecatedPropertyWarnings ? () => node[valueKey] : () => {
|
|
125
|
+
if (!warned) {
|
|
126
|
+
process.emitWarning(`The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, "DeprecationWarning");
|
|
127
|
+
warned = true;
|
|
128
|
+
}
|
|
129
|
+
return node[valueKey];
|
|
130
|
+
},
|
|
131
|
+
set(value) {
|
|
132
|
+
Object.defineProperty(node, aliasKey, {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
value,
|
|
135
|
+
writable: true
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return node;
|
|
140
|
+
}
|
|
141
|
+
#withDeprecatedGetter(node, deprecatedKey, preferredKey, value) {
|
|
142
|
+
let warned = false;
|
|
143
|
+
Object.defineProperty(node, deprecatedKey, {
|
|
144
|
+
configurable: true,
|
|
145
|
+
get: this.options.suppressDeprecatedPropertyWarnings ? () => value : () => {
|
|
146
|
+
if (!warned) {
|
|
147
|
+
let message = `The '${deprecatedKey}' property is deprecated on ${node.type} nodes.`;
|
|
148
|
+
if (preferredKey) {
|
|
149
|
+
message += ` Use ${preferredKey} instead.`;
|
|
150
|
+
}
|
|
151
|
+
message += " See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.";
|
|
152
|
+
process.emitWarning(message, "DeprecationWarning");
|
|
153
|
+
warned = true;
|
|
154
|
+
}
|
|
155
|
+
return value;
|
|
156
|
+
},
|
|
157
|
+
set(value2) {
|
|
158
|
+
Object.defineProperty(node, deprecatedKey, {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
value: value2,
|
|
161
|
+
writable: true
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return node;
|
|
166
|
+
}
|
|
167
|
+
assertModuleSpecifier(node, allowNull) {
|
|
168
|
+
if (!allowNull && node.moduleSpecifier == null) {
|
|
169
|
+
this.#throwError(node, "Module specifier must be a string literal.");
|
|
170
|
+
}
|
|
171
|
+
if (node.moduleSpecifier && node.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) {
|
|
172
|
+
this.#throwError(node.moduleSpecifier, "Module specifier must be a string literal.");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
convertBindingNameWithTypeAnnotation(name, tsType, parent) {
|
|
176
|
+
const id = this.convertPattern(name);
|
|
177
|
+
if (tsType) {
|
|
178
|
+
id.typeAnnotation = this.convertTypeAnnotation(tsType, parent);
|
|
179
|
+
this.fixParentLocation(id, id.typeAnnotation.range);
|
|
180
|
+
}
|
|
181
|
+
return id;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Coverts body Nodes and add a directive field to StringLiterals
|
|
185
|
+
* @param nodes of ts.Node
|
|
186
|
+
* @param parent parentNode
|
|
187
|
+
* @returns Array of body statements
|
|
188
|
+
*/
|
|
189
|
+
convertBodyExpressions(nodes, parent) {
|
|
190
|
+
let allowDirectives = (0, node_utils_1.canContainDirective)(parent);
|
|
191
|
+
return nodes.map((statement) => {
|
|
192
|
+
const child = this.convertChild(statement);
|
|
193
|
+
if (allowDirectives) {
|
|
194
|
+
if (child?.expression && ts.isExpressionStatement(statement) && ts.isStringLiteral(statement.expression)) {
|
|
195
|
+
const raw = child.expression.raw;
|
|
196
|
+
child.directive = raw.slice(1, -1);
|
|
197
|
+
return child;
|
|
198
|
+
}
|
|
199
|
+
allowDirectives = false;
|
|
200
|
+
}
|
|
201
|
+
return child;
|
|
202
|
+
}).filter((statement) => statement);
|
|
203
|
+
}
|
|
204
|
+
convertChainExpression(node, tsNode) {
|
|
205
|
+
const { child, isOptional } = (() => {
|
|
206
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) {
|
|
207
|
+
return { child: node.object, isOptional: node.optional };
|
|
208
|
+
}
|
|
209
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) {
|
|
210
|
+
return { child: node.callee, isOptional: node.optional };
|
|
211
|
+
}
|
|
212
|
+
return { child: node.expression, isOptional: false };
|
|
213
|
+
})();
|
|
214
|
+
const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child);
|
|
215
|
+
if (!isChildUnwrappable && !isOptional) {
|
|
216
|
+
return node;
|
|
217
|
+
}
|
|
218
|
+
if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) {
|
|
219
|
+
const newChild = child.expression;
|
|
220
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) {
|
|
221
|
+
node.object = newChild;
|
|
222
|
+
} else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) {
|
|
223
|
+
node.callee = newChild;
|
|
224
|
+
} else {
|
|
225
|
+
node.expression = newChild;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return this.createNode(tsNode, {
|
|
229
|
+
type: ts_estree_1.AST_NODE_TYPES.ChainExpression,
|
|
230
|
+
expression: node
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Converts a TypeScript node into an ESTree node.
|
|
235
|
+
* @param child the child ts.Node
|
|
236
|
+
* @param parent parentNode
|
|
237
|
+
* @returns the converted ESTree node
|
|
238
|
+
*/
|
|
239
|
+
convertChild(child, parent) {
|
|
240
|
+
return this.converter(child, parent, false);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Converts TypeScript node array into an ESTree node list.
|
|
244
|
+
* @param children the child `ts.NodeArray` or `ts.Node[]`
|
|
245
|
+
* @param parent parentNode
|
|
246
|
+
* @returns the converted ESTree node list
|
|
247
|
+
*/
|
|
248
|
+
convertChildren(children, parent) {
|
|
249
|
+
return children.map((child) => this.converter(child, parent, false));
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Converts a TypeScript node into an ESTree node.
|
|
253
|
+
* @param child the child ts.Node
|
|
254
|
+
* @param parent parentNode
|
|
255
|
+
* @returns the converted ESTree node
|
|
256
|
+
*/
|
|
257
|
+
convertPattern(child, parent) {
|
|
258
|
+
return this.converter(child, parent, true);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Converts a child into a type annotation. This creates an intermediary
|
|
262
|
+
* TypeAnnotation node to match what Flow does.
|
|
263
|
+
* @param child The TypeScript AST node to convert.
|
|
264
|
+
* @param parent parentNode
|
|
265
|
+
* @returns The type annotation node.
|
|
266
|
+
*/
|
|
267
|
+
convertTypeAnnotation(child, parent) {
|
|
268
|
+
const offset = parent?.kind === SyntaxKind.FunctionType || parent?.kind === SyntaxKind.ConstructorType ? 2 : 1;
|
|
269
|
+
const annotationStartCol = child.getFullStart() - offset;
|
|
270
|
+
const range = [annotationStartCol, child.end];
|
|
271
|
+
const loc = (0, node_utils_1.getLocFor)(range, this.ast);
|
|
272
|
+
return {
|
|
273
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation,
|
|
274
|
+
loc,
|
|
275
|
+
range,
|
|
276
|
+
typeAnnotation: this.convertChild(child)
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node
|
|
281
|
+
* @param typeArguments ts.NodeArray typeArguments
|
|
282
|
+
* @param node parent used to create this node
|
|
283
|
+
* @returns TypeParameterInstantiation node
|
|
284
|
+
*/
|
|
285
|
+
convertTypeArgumentsToTypeParameterInstantiation(typeArguments, node) {
|
|
286
|
+
const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast);
|
|
287
|
+
const range = [typeArguments.pos - 1, greaterThanToken.end];
|
|
288
|
+
if (typeArguments.length === 0) {
|
|
289
|
+
this.#throwError(range, "Type argument list cannot be empty.");
|
|
290
|
+
}
|
|
291
|
+
return this.createNode(node, {
|
|
292
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation,
|
|
293
|
+
range,
|
|
294
|
+
params: this.convertChildren(typeArguments)
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node
|
|
299
|
+
* @param typeParameters ts.Node typeParameters
|
|
300
|
+
* @returns TypeParameterDeclaration node
|
|
301
|
+
*/
|
|
302
|
+
convertTSTypeParametersToTypeParametersDeclaration(typeParameters) {
|
|
303
|
+
const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast);
|
|
304
|
+
const range = [
|
|
305
|
+
typeParameters.pos - 1,
|
|
306
|
+
greaterThanToken.end
|
|
307
|
+
];
|
|
308
|
+
if (typeParameters.length === 0) {
|
|
309
|
+
this.#throwError(range, "Type parameter list cannot be empty.");
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration,
|
|
313
|
+
loc: (0, node_utils_1.getLocFor)(range, this.ast),
|
|
314
|
+
range,
|
|
315
|
+
params: this.convertChildren(typeParameters)
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Converts an array of ts.Node parameters into an array of ESTreeNode params
|
|
320
|
+
* @param parameters An array of ts.Node params to be converted
|
|
321
|
+
* @returns an array of converted ESTreeNode params
|
|
322
|
+
*/
|
|
323
|
+
convertParameters(parameters) {
|
|
324
|
+
if (!parameters?.length) {
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
return parameters.map((param) => {
|
|
328
|
+
const convertedParam = this.convertChild(param);
|
|
329
|
+
convertedParam.decorators = this.convertChildren((0, getModifiers_1.getDecorators)(param) ?? []);
|
|
330
|
+
return convertedParam;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Converts a TypeScript node into an ESTree node.
|
|
335
|
+
* @param node the child ts.Node
|
|
336
|
+
* @param parent parentNode
|
|
337
|
+
* @param allowPattern flag to determine if patterns are allowed
|
|
338
|
+
* @returns the converted ESTree node
|
|
339
|
+
*/
|
|
340
|
+
converter(node, parent, allowPattern) {
|
|
341
|
+
if (!node) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
this.#checkModifiers(node);
|
|
345
|
+
const pattern = this.allowPattern;
|
|
346
|
+
if (allowPattern != null) {
|
|
347
|
+
this.allowPattern = allowPattern;
|
|
348
|
+
}
|
|
349
|
+
const result = this.convertNode(node, parent ?? node.parent);
|
|
350
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
351
|
+
this.allowPattern = pattern;
|
|
352
|
+
return result;
|
|
353
|
+
}
|
|
354
|
+
convertImportAttributes(node) {
|
|
355
|
+
const attributes = node.attributes ?? node.assertClause;
|
|
356
|
+
return this.convertChildren(attributes?.elements ?? []);
|
|
357
|
+
}
|
|
358
|
+
convertJSXIdentifier(node) {
|
|
359
|
+
const result = this.createNode(node, {
|
|
360
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
361
|
+
name: node.getText()
|
|
362
|
+
});
|
|
363
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
364
|
+
return result;
|
|
365
|
+
}
|
|
366
|
+
convertJSXNamespaceOrIdentifier(node) {
|
|
367
|
+
if (node.kind === ts.SyntaxKind.JsxNamespacedName) {
|
|
368
|
+
const result = this.createNode(node, {
|
|
369
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName,
|
|
370
|
+
name: this.createNode(node.name, {
|
|
371
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
372
|
+
name: node.name.text
|
|
373
|
+
}),
|
|
374
|
+
namespace: this.createNode(node.namespace, {
|
|
375
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
376
|
+
name: node.namespace.text
|
|
377
|
+
})
|
|
378
|
+
});
|
|
379
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
const text = node.getText();
|
|
383
|
+
const colonIndex = text.indexOf(":");
|
|
384
|
+
if (colonIndex > 0) {
|
|
385
|
+
const range = (0, node_utils_1.getRange)(node, this.ast);
|
|
386
|
+
const result = this.createNode(node, {
|
|
387
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName,
|
|
388
|
+
range,
|
|
389
|
+
name: this.createNode(node, {
|
|
390
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
391
|
+
range: [range[0] + colonIndex + 1, range[1]],
|
|
392
|
+
name: text.slice(colonIndex + 1)
|
|
393
|
+
}),
|
|
394
|
+
namespace: this.createNode(node, {
|
|
395
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
396
|
+
range: [range[0], range[0] + colonIndex],
|
|
397
|
+
name: text.slice(0, colonIndex)
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
return this.convertJSXIdentifier(node);
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Converts a TypeScript JSX node.tagName into an ESTree node.name
|
|
407
|
+
* @param node the tagName object from a JSX ts.Node
|
|
408
|
+
* @returns the converted ESTree name object
|
|
409
|
+
*/
|
|
410
|
+
convertJSXTagName(node, parent) {
|
|
411
|
+
let result;
|
|
412
|
+
switch (node.kind) {
|
|
413
|
+
case SyntaxKind.PropertyAccessExpression:
|
|
414
|
+
if (node.name.kind === SyntaxKind.PrivateIdentifier) {
|
|
415
|
+
this.#throwError(node.name, "Non-private identifier expected.");
|
|
416
|
+
}
|
|
417
|
+
result = this.createNode(node, {
|
|
418
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression,
|
|
419
|
+
object: this.convertJSXTagName(node.expression, parent),
|
|
420
|
+
property: this.convertJSXIdentifier(node.name)
|
|
421
|
+
});
|
|
422
|
+
break;
|
|
423
|
+
case SyntaxKind.ThisKeyword:
|
|
424
|
+
case SyntaxKind.Identifier:
|
|
425
|
+
default:
|
|
426
|
+
return this.convertJSXNamespaceOrIdentifier(node);
|
|
427
|
+
}
|
|
428
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
431
|
+
convertMethodSignature(node) {
|
|
432
|
+
return this.createNode(node, {
|
|
433
|
+
type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
|
|
434
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
435
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
436
|
+
key: this.convertChild(node.name),
|
|
437
|
+
kind: (() => {
|
|
438
|
+
switch (node.kind) {
|
|
439
|
+
case SyntaxKind.GetAccessor:
|
|
440
|
+
return "get";
|
|
441
|
+
case SyntaxKind.SetAccessor:
|
|
442
|
+
return "set";
|
|
443
|
+
case SyntaxKind.MethodSignature:
|
|
444
|
+
return "method";
|
|
445
|
+
}
|
|
446
|
+
})(),
|
|
447
|
+
optional: (0, node_utils_1.isOptional)(node),
|
|
448
|
+
params: this.convertParameters(node.parameters),
|
|
449
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
|
|
450
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
451
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
452
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Uses the provided range location to adjust the location data of the given Node
|
|
457
|
+
* @param result The node that will have its location data mutated
|
|
458
|
+
* @param childRange The child node range used to expand location
|
|
459
|
+
*/
|
|
460
|
+
fixParentLocation(result, childRange) {
|
|
461
|
+
if (childRange[0] < result.range[0]) {
|
|
462
|
+
result.range[0] = childRange[0];
|
|
463
|
+
result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast);
|
|
464
|
+
}
|
|
465
|
+
if (childRange[1] > result.range[1]) {
|
|
466
|
+
result.range[1] = childRange[1];
|
|
467
|
+
result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Converts a TypeScript node into an ESTree node.
|
|
472
|
+
* The core of the conversion logic:
|
|
473
|
+
* Identify and convert each relevant TypeScript SyntaxKind
|
|
474
|
+
* @returns the converted ESTree node
|
|
475
|
+
*/
|
|
476
|
+
convertNode(node, parent) {
|
|
477
|
+
switch (node.kind) {
|
|
478
|
+
case SyntaxKind.SourceFile: {
|
|
479
|
+
return this.createNode(node, {
|
|
480
|
+
type: ts_estree_1.AST_NODE_TYPES.Program,
|
|
481
|
+
range: [node.getStart(this.ast), node.endOfFileToken.end],
|
|
482
|
+
body: this.convertBodyExpressions(node.statements, node),
|
|
483
|
+
comments: void 0,
|
|
484
|
+
sourceType: node.externalModuleIndicator ? "module" : "script",
|
|
485
|
+
tokens: void 0
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
case SyntaxKind.Block: {
|
|
489
|
+
return this.createNode(node, {
|
|
490
|
+
type: ts_estree_1.AST_NODE_TYPES.BlockStatement,
|
|
491
|
+
body: this.convertBodyExpressions(node.statements, node)
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
case SyntaxKind.Identifier: {
|
|
495
|
+
if ((0, node_utils_1.isThisInTypeQuery)(node)) {
|
|
496
|
+
return this.createNode(node, {
|
|
497
|
+
type: ts_estree_1.AST_NODE_TYPES.ThisExpression
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return this.createNode(node, {
|
|
501
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
502
|
+
decorators: [],
|
|
503
|
+
name: node.text,
|
|
504
|
+
optional: false,
|
|
505
|
+
typeAnnotation: void 0
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
case SyntaxKind.PrivateIdentifier: {
|
|
509
|
+
return this.createNode(node, {
|
|
510
|
+
type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier,
|
|
511
|
+
// typescript includes the `#` in the text
|
|
512
|
+
name: node.text.slice(1)
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
case SyntaxKind.WithStatement:
|
|
516
|
+
return this.createNode(node, {
|
|
517
|
+
type: ts_estree_1.AST_NODE_TYPES.WithStatement,
|
|
518
|
+
body: this.convertChild(node.statement),
|
|
519
|
+
object: this.convertChild(node.expression)
|
|
520
|
+
});
|
|
521
|
+
// Control Flow
|
|
522
|
+
case SyntaxKind.ReturnStatement:
|
|
523
|
+
return this.createNode(node, {
|
|
524
|
+
type: ts_estree_1.AST_NODE_TYPES.ReturnStatement,
|
|
525
|
+
argument: this.convertChild(node.expression)
|
|
526
|
+
});
|
|
527
|
+
case SyntaxKind.LabeledStatement:
|
|
528
|
+
return this.createNode(node, {
|
|
529
|
+
type: ts_estree_1.AST_NODE_TYPES.LabeledStatement,
|
|
530
|
+
body: this.convertChild(node.statement),
|
|
531
|
+
label: this.convertChild(node.label)
|
|
532
|
+
});
|
|
533
|
+
case SyntaxKind.ContinueStatement:
|
|
534
|
+
return this.createNode(node, {
|
|
535
|
+
type: ts_estree_1.AST_NODE_TYPES.ContinueStatement,
|
|
536
|
+
label: this.convertChild(node.label)
|
|
537
|
+
});
|
|
538
|
+
case SyntaxKind.BreakStatement:
|
|
539
|
+
return this.createNode(node, {
|
|
540
|
+
type: ts_estree_1.AST_NODE_TYPES.BreakStatement,
|
|
541
|
+
label: this.convertChild(node.label)
|
|
542
|
+
});
|
|
543
|
+
// Choice
|
|
544
|
+
case SyntaxKind.IfStatement:
|
|
545
|
+
return this.createNode(node, {
|
|
546
|
+
type: ts_estree_1.AST_NODE_TYPES.IfStatement,
|
|
547
|
+
alternate: this.convertChild(node.elseStatement),
|
|
548
|
+
consequent: this.convertChild(node.thenStatement),
|
|
549
|
+
test: this.convertChild(node.expression)
|
|
550
|
+
});
|
|
551
|
+
case SyntaxKind.SwitchStatement:
|
|
552
|
+
if (node.caseBlock.clauses.filter((switchCase) => switchCase.kind === SyntaxKind.DefaultClause).length > 1) {
|
|
553
|
+
this.#throwError(node, "A 'default' clause cannot appear more than once in a 'switch' statement.");
|
|
554
|
+
}
|
|
555
|
+
return this.createNode(node, {
|
|
556
|
+
type: ts_estree_1.AST_NODE_TYPES.SwitchStatement,
|
|
557
|
+
cases: this.convertChildren(node.caseBlock.clauses),
|
|
558
|
+
discriminant: this.convertChild(node.expression)
|
|
559
|
+
});
|
|
560
|
+
case SyntaxKind.CaseClause:
|
|
561
|
+
case SyntaxKind.DefaultClause:
|
|
562
|
+
return this.createNode(node, {
|
|
563
|
+
type: ts_estree_1.AST_NODE_TYPES.SwitchCase,
|
|
564
|
+
// expression is present in case only
|
|
565
|
+
consequent: this.convertChildren(node.statements),
|
|
566
|
+
test: node.kind === SyntaxKind.CaseClause ? this.convertChild(node.expression) : null
|
|
567
|
+
});
|
|
568
|
+
// Exceptions
|
|
569
|
+
case SyntaxKind.ThrowStatement:
|
|
570
|
+
if (node.expression.end === node.expression.pos) {
|
|
571
|
+
this.#throwError(node, "A throw statement must throw an expression.");
|
|
572
|
+
}
|
|
573
|
+
return this.createNode(node, {
|
|
574
|
+
type: ts_estree_1.AST_NODE_TYPES.ThrowStatement,
|
|
575
|
+
argument: this.convertChild(node.expression)
|
|
576
|
+
});
|
|
577
|
+
case SyntaxKind.TryStatement:
|
|
578
|
+
return this.createNode(node, {
|
|
579
|
+
type: ts_estree_1.AST_NODE_TYPES.TryStatement,
|
|
580
|
+
block: this.convertChild(node.tryBlock),
|
|
581
|
+
finalizer: this.convertChild(node.finallyBlock),
|
|
582
|
+
handler: this.convertChild(node.catchClause)
|
|
583
|
+
});
|
|
584
|
+
case SyntaxKind.CatchClause:
|
|
585
|
+
if (node.variableDeclaration?.initializer) {
|
|
586
|
+
this.#throwError(node.variableDeclaration.initializer, "Catch clause variable cannot have an initializer.");
|
|
587
|
+
}
|
|
588
|
+
return this.createNode(node, {
|
|
589
|
+
type: ts_estree_1.AST_NODE_TYPES.CatchClause,
|
|
590
|
+
body: this.convertChild(node.block),
|
|
591
|
+
param: node.variableDeclaration ? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type) : null
|
|
592
|
+
});
|
|
593
|
+
// Loops
|
|
594
|
+
case SyntaxKind.WhileStatement:
|
|
595
|
+
return this.createNode(node, {
|
|
596
|
+
type: ts_estree_1.AST_NODE_TYPES.WhileStatement,
|
|
597
|
+
body: this.convertChild(node.statement),
|
|
598
|
+
test: this.convertChild(node.expression)
|
|
599
|
+
});
|
|
600
|
+
/**
|
|
601
|
+
* Unlike other parsers, TypeScript calls a "DoWhileStatement"
|
|
602
|
+
* a "DoStatement"
|
|
603
|
+
*/
|
|
604
|
+
case SyntaxKind.DoStatement:
|
|
605
|
+
return this.createNode(node, {
|
|
606
|
+
type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement,
|
|
607
|
+
body: this.convertChild(node.statement),
|
|
608
|
+
test: this.convertChild(node.expression)
|
|
609
|
+
});
|
|
610
|
+
case SyntaxKind.ForStatement:
|
|
611
|
+
return this.createNode(node, {
|
|
612
|
+
type: ts_estree_1.AST_NODE_TYPES.ForStatement,
|
|
613
|
+
body: this.convertChild(node.statement),
|
|
614
|
+
init: this.convertChild(node.initializer),
|
|
615
|
+
test: this.convertChild(node.condition),
|
|
616
|
+
update: this.convertChild(node.incrementor)
|
|
617
|
+
});
|
|
618
|
+
case SyntaxKind.ForInStatement:
|
|
619
|
+
this.#checkForStatementDeclaration(node.initializer, node.kind);
|
|
620
|
+
return this.createNode(node, {
|
|
621
|
+
type: ts_estree_1.AST_NODE_TYPES.ForInStatement,
|
|
622
|
+
body: this.convertChild(node.statement),
|
|
623
|
+
left: this.convertPattern(node.initializer),
|
|
624
|
+
right: this.convertChild(node.expression)
|
|
625
|
+
});
|
|
626
|
+
case SyntaxKind.ForOfStatement: {
|
|
627
|
+
this.#checkForStatementDeclaration(node.initializer, node.kind);
|
|
628
|
+
return this.createNode(node, {
|
|
629
|
+
type: ts_estree_1.AST_NODE_TYPES.ForOfStatement,
|
|
630
|
+
await: node.awaitModifier?.kind === SyntaxKind.AwaitKeyword,
|
|
631
|
+
body: this.convertChild(node.statement),
|
|
632
|
+
left: this.convertPattern(node.initializer),
|
|
633
|
+
right: this.convertChild(node.expression)
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
// Declarations
|
|
637
|
+
case SyntaxKind.FunctionDeclaration: {
|
|
638
|
+
const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
|
|
639
|
+
const isAsync = (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node);
|
|
640
|
+
const isGenerator = !!node.asteriskToken;
|
|
641
|
+
if (isDeclare) {
|
|
642
|
+
if (node.body) {
|
|
643
|
+
this.#throwError(node, "An implementation cannot be declared in ambient contexts.");
|
|
644
|
+
} else if (isAsync) {
|
|
645
|
+
this.#throwError(node, "'async' modifier cannot be used in an ambient context.");
|
|
646
|
+
} else if (isGenerator) {
|
|
647
|
+
this.#throwError(node, "Generators are not allowed in an ambient context.");
|
|
648
|
+
}
|
|
649
|
+
} else if (!node.body && isGenerator) {
|
|
650
|
+
this.#throwError(node, "A function signature cannot be declared as a generator.");
|
|
651
|
+
}
|
|
652
|
+
const result = this.createNode(node, {
|
|
653
|
+
// declare implies no body due to the invariant above
|
|
654
|
+
type: !node.body ? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction : ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
|
|
655
|
+
async: isAsync,
|
|
656
|
+
body: this.convertChild(node.body) || void 0,
|
|
657
|
+
declare: isDeclare,
|
|
658
|
+
expression: false,
|
|
659
|
+
generator: isGenerator,
|
|
660
|
+
id: this.convertChild(node.name),
|
|
661
|
+
params: this.convertParameters(node.parameters),
|
|
662
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
663
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
664
|
+
});
|
|
665
|
+
return this.fixExports(node, result);
|
|
666
|
+
}
|
|
667
|
+
case SyntaxKind.VariableDeclaration: {
|
|
668
|
+
const hasExclamationToken = !!node.exclamationToken;
|
|
669
|
+
if (hasExclamationToken) {
|
|
670
|
+
if (node.initializer) {
|
|
671
|
+
this.#throwError(node, "Declarations with initializers cannot also have definite assignment assertions.");
|
|
672
|
+
} else if (node.name.kind !== SyntaxKind.Identifier || !node.type) {
|
|
673
|
+
this.#throwError(node, "Declarations with definite assignment assertions must also have type annotations.");
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
if (node.parent.kind === SyntaxKind.VariableDeclarationList) {
|
|
677
|
+
const variableDeclarationList = node.parent;
|
|
678
|
+
const kind = (0, node_utils_1.getDeclarationKind)(variableDeclarationList);
|
|
679
|
+
if ((variableDeclarationList.parent.kind === SyntaxKind.ForInStatement || variableDeclarationList.parent.kind === SyntaxKind.ForStatement) && (kind === "using" || kind === "await using")) {
|
|
680
|
+
if (!node.initializer) {
|
|
681
|
+
this.#throwError(node, `'${kind}' declarations may not be initialized in for statement.`);
|
|
682
|
+
}
|
|
683
|
+
if (node.name.kind !== SyntaxKind.Identifier) {
|
|
684
|
+
this.#throwError(node.name, `'${kind}' declarations may not have binding patterns.`);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
|
|
688
|
+
const variableStatement = variableDeclarationList.parent;
|
|
689
|
+
if (kind === "using" || kind === "await using") {
|
|
690
|
+
if (!node.initializer) {
|
|
691
|
+
this.#throwError(node, `'${kind}' declarations must be initialized.`);
|
|
692
|
+
}
|
|
693
|
+
if (node.name.kind !== SyntaxKind.Identifier) {
|
|
694
|
+
this.#throwError(node.name, `'${kind}' declarations may not have binding patterns.`);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
const hasDeclareKeyword = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, variableStatement);
|
|
698
|
+
if ((hasDeclareKeyword || ["await using", "const", "using"].includes(kind)) && hasExclamationToken) {
|
|
699
|
+
this.#throwError(node, `A definite assignment assertion '!' is not permitted in this context.`);
|
|
700
|
+
}
|
|
701
|
+
if (hasDeclareKeyword && node.initializer && (["let", "var"].includes(kind) || node.type)) {
|
|
702
|
+
this.#throwError(node, `Initializers are not permitted in ambient contexts.`);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
const init = this.convertChild(node.initializer);
|
|
707
|
+
const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node);
|
|
708
|
+
return this.createNode(node, {
|
|
709
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator,
|
|
710
|
+
definite: hasExclamationToken,
|
|
711
|
+
id,
|
|
712
|
+
init
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
case SyntaxKind.VariableStatement: {
|
|
716
|
+
const declarations = node.declarationList.declarations;
|
|
717
|
+
if (!declarations.length) {
|
|
718
|
+
this.#throwError(node, "A variable declaration list must have at least one variable declarator.");
|
|
719
|
+
}
|
|
720
|
+
const result = this.createNode(node, {
|
|
721
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
722
|
+
declarations: this.convertChildren(declarations),
|
|
723
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
724
|
+
kind: (0, node_utils_1.getDeclarationKind)(node.declarationList)
|
|
725
|
+
});
|
|
726
|
+
return this.fixExports(node, result);
|
|
727
|
+
}
|
|
728
|
+
// mostly for for-of, for-in
|
|
729
|
+
case SyntaxKind.VariableDeclarationList: {
|
|
730
|
+
return this.createNode(node, {
|
|
731
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
732
|
+
declarations: this.convertChildren(node.declarations),
|
|
733
|
+
declare: false,
|
|
734
|
+
kind: (0, node_utils_1.getDeclarationKind)(node)
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
// Expressions
|
|
738
|
+
case SyntaxKind.ExpressionStatement:
|
|
739
|
+
return this.createNode(node, {
|
|
740
|
+
type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement,
|
|
741
|
+
directive: void 0,
|
|
742
|
+
expression: this.convertChild(node.expression)
|
|
743
|
+
});
|
|
744
|
+
case SyntaxKind.ThisKeyword:
|
|
745
|
+
return this.createNode(node, {
|
|
746
|
+
type: ts_estree_1.AST_NODE_TYPES.ThisExpression
|
|
747
|
+
});
|
|
748
|
+
case SyntaxKind.ArrayLiteralExpression: {
|
|
749
|
+
if (this.allowPattern) {
|
|
750
|
+
return this.createNode(node, {
|
|
751
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayPattern,
|
|
752
|
+
decorators: [],
|
|
753
|
+
elements: node.elements.map((el) => this.convertPattern(el)),
|
|
754
|
+
optional: false,
|
|
755
|
+
typeAnnotation: void 0
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
return this.createNode(node, {
|
|
759
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayExpression,
|
|
760
|
+
elements: this.convertChildren(node.elements)
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
case SyntaxKind.ObjectLiteralExpression: {
|
|
764
|
+
if (this.allowPattern) {
|
|
765
|
+
return this.createNode(node, {
|
|
766
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectPattern,
|
|
767
|
+
decorators: [],
|
|
768
|
+
optional: false,
|
|
769
|
+
properties: node.properties.map((el) => this.convertPattern(el)),
|
|
770
|
+
typeAnnotation: void 0
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
const properties = [];
|
|
774
|
+
for (const property of node.properties) {
|
|
775
|
+
if ((property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor || property.kind === SyntaxKind.MethodDeclaration) && !property.body) {
|
|
776
|
+
this.#throwError(property.end - 1, "'{' expected.");
|
|
777
|
+
}
|
|
778
|
+
properties.push(this.convertChild(property));
|
|
779
|
+
}
|
|
780
|
+
return this.createNode(node, {
|
|
781
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectExpression,
|
|
782
|
+
properties
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
case SyntaxKind.PropertyAssignment: {
|
|
786
|
+
const { exclamationToken, questionToken } = node;
|
|
787
|
+
if (questionToken) {
|
|
788
|
+
this.#throwError(questionToken, "A property assignment cannot have a question token.");
|
|
789
|
+
}
|
|
790
|
+
if (exclamationToken) {
|
|
791
|
+
this.#throwError(exclamationToken, "A property assignment cannot have an exclamation token.");
|
|
792
|
+
}
|
|
793
|
+
return this.createNode(node, {
|
|
794
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
795
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
796
|
+
key: this.convertChild(node.name),
|
|
797
|
+
kind: "init",
|
|
798
|
+
method: false,
|
|
799
|
+
optional: false,
|
|
800
|
+
shorthand: false,
|
|
801
|
+
value: this.converter(node.initializer, node, this.allowPattern)
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
case SyntaxKind.ShorthandPropertyAssignment: {
|
|
805
|
+
const { exclamationToken, modifiers, questionToken } = node;
|
|
806
|
+
if (modifiers) {
|
|
807
|
+
this.#throwError(modifiers[0], "A shorthand property assignment cannot have modifiers.");
|
|
808
|
+
}
|
|
809
|
+
if (questionToken) {
|
|
810
|
+
this.#throwError(questionToken, "A shorthand property assignment cannot have a question token.");
|
|
811
|
+
}
|
|
812
|
+
if (exclamationToken) {
|
|
813
|
+
this.#throwError(exclamationToken, "A shorthand property assignment cannot have an exclamation token.");
|
|
814
|
+
}
|
|
815
|
+
if (node.objectAssignmentInitializer) {
|
|
816
|
+
return this.createNode(node, {
|
|
817
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
818
|
+
computed: false,
|
|
819
|
+
key: this.convertChild(node.name),
|
|
820
|
+
kind: "init",
|
|
821
|
+
method: false,
|
|
822
|
+
optional: false,
|
|
823
|
+
shorthand: true,
|
|
824
|
+
value: this.createNode(node, {
|
|
825
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
826
|
+
decorators: [],
|
|
827
|
+
left: this.convertPattern(node.name),
|
|
828
|
+
optional: false,
|
|
829
|
+
right: this.convertChild(node.objectAssignmentInitializer),
|
|
830
|
+
typeAnnotation: void 0
|
|
831
|
+
})
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
return this.createNode(node, {
|
|
835
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
836
|
+
computed: false,
|
|
837
|
+
key: this.convertChild(node.name),
|
|
838
|
+
kind: "init",
|
|
839
|
+
method: false,
|
|
840
|
+
optional: false,
|
|
841
|
+
shorthand: true,
|
|
842
|
+
value: this.convertChild(node.name)
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
case SyntaxKind.ComputedPropertyName:
|
|
846
|
+
return this.convertChild(node.expression);
|
|
847
|
+
case SyntaxKind.PropertyDeclaration: {
|
|
848
|
+
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
|
|
849
|
+
if (isAbstract && node.initializer) {
|
|
850
|
+
this.#throwError(node.initializer, `Abstract property cannot have an initializer.`);
|
|
851
|
+
}
|
|
852
|
+
if (node.name.kind === SyntaxKind.StringLiteral && node.name.text === "constructor") {
|
|
853
|
+
this.#throwError(node.name, "Classes may not have a field named 'constructor'.");
|
|
854
|
+
}
|
|
855
|
+
const isAccessor = (0, node_utils_1.hasModifier)(SyntaxKind.AccessorKeyword, node);
|
|
856
|
+
const type = (() => {
|
|
857
|
+
if (isAccessor) {
|
|
858
|
+
if (isAbstract) {
|
|
859
|
+
return ts_estree_1.AST_NODE_TYPES.TSAbstractAccessorProperty;
|
|
860
|
+
}
|
|
861
|
+
return ts_estree_1.AST_NODE_TYPES.AccessorProperty;
|
|
862
|
+
}
|
|
863
|
+
if (isAbstract) {
|
|
864
|
+
return ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition;
|
|
865
|
+
}
|
|
866
|
+
return ts_estree_1.AST_NODE_TYPES.PropertyDefinition;
|
|
867
|
+
})();
|
|
868
|
+
const key = this.convertChild(node.name);
|
|
869
|
+
return this.createNode(node, {
|
|
870
|
+
type,
|
|
871
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
872
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
873
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
874
|
+
decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
|
|
875
|
+
definite: !!node.exclamationToken,
|
|
876
|
+
key,
|
|
877
|
+
optional: (key.type === ts_estree_1.AST_NODE_TYPES.Literal || node.name.kind === SyntaxKind.Identifier || node.name.kind === SyntaxKind.ComputedPropertyName || node.name.kind === SyntaxKind.PrivateIdentifier) && !!node.questionToken,
|
|
878
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
|
|
879
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
|
|
880
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
881
|
+
typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node),
|
|
882
|
+
value: isAbstract ? null : this.convertChild(node.initializer)
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
case SyntaxKind.GetAccessor:
|
|
886
|
+
case SyntaxKind.SetAccessor: {
|
|
887
|
+
if (node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral) {
|
|
888
|
+
return this.convertMethodSignature(node);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
// otherwise, it is a non-type accessor - intentional fallthrough
|
|
892
|
+
case SyntaxKind.MethodDeclaration: {
|
|
893
|
+
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
|
|
894
|
+
if (isAbstract && node.body) {
|
|
895
|
+
this.#throwError(node.name, node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor ? "An abstract accessor cannot have an implementation." : `Method '${(0, node_utils_1.declarationNameToString)(node.name, this.ast)}' cannot have an implementation because it is marked abstract.`);
|
|
896
|
+
}
|
|
897
|
+
const method = this.createNode(node, {
|
|
898
|
+
type: !node.body ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression : ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
899
|
+
range: [node.parameters.pos - 1, node.end],
|
|
900
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
901
|
+
body: this.convertChild(node.body),
|
|
902
|
+
declare: false,
|
|
903
|
+
expression: false,
|
|
904
|
+
// ESTreeNode as ESTreeNode here
|
|
905
|
+
generator: !!node.asteriskToken,
|
|
906
|
+
id: null,
|
|
907
|
+
params: [],
|
|
908
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
909
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
910
|
+
});
|
|
911
|
+
if (method.typeParameters) {
|
|
912
|
+
this.fixParentLocation(method, method.typeParameters.range);
|
|
913
|
+
}
|
|
914
|
+
let result;
|
|
915
|
+
if (parent.kind === SyntaxKind.ObjectLiteralExpression) {
|
|
916
|
+
method.params = this.convertChildren(node.parameters);
|
|
917
|
+
result = this.createNode(node, {
|
|
918
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
919
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
920
|
+
key: this.convertChild(node.name),
|
|
921
|
+
kind: "init",
|
|
922
|
+
method: node.kind === SyntaxKind.MethodDeclaration,
|
|
923
|
+
optional: !!node.questionToken,
|
|
924
|
+
shorthand: false,
|
|
925
|
+
value: method
|
|
926
|
+
});
|
|
927
|
+
} else {
|
|
928
|
+
method.params = this.convertParameters(node.parameters);
|
|
929
|
+
const methodDefinitionType = isAbstract ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition : ts_estree_1.AST_NODE_TYPES.MethodDefinition;
|
|
930
|
+
result = this.createNode(node, {
|
|
931
|
+
type: methodDefinitionType,
|
|
932
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
933
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
934
|
+
decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
|
|
935
|
+
key: this.convertChild(node.name),
|
|
936
|
+
kind: "method",
|
|
937
|
+
optional: !!node.questionToken,
|
|
938
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
|
|
939
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
940
|
+
value: method
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
if (node.kind === SyntaxKind.GetAccessor) {
|
|
944
|
+
result.kind = "get";
|
|
945
|
+
} else if (node.kind === SyntaxKind.SetAccessor) {
|
|
946
|
+
result.kind = "set";
|
|
947
|
+
} else if (!result.static && node.name.kind === SyntaxKind.StringLiteral && node.name.text === "constructor" && result.type !== ts_estree_1.AST_NODE_TYPES.Property) {
|
|
948
|
+
result.kind = "constructor";
|
|
949
|
+
}
|
|
950
|
+
return result;
|
|
951
|
+
}
|
|
952
|
+
// TypeScript uses this even for static methods named "constructor"
|
|
953
|
+
case SyntaxKind.Constructor: {
|
|
954
|
+
const lastModifier = (0, node_utils_1.getLastModifier)(node);
|
|
955
|
+
const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ?? node.getFirstToken();
|
|
956
|
+
const constructor = this.createNode(node, {
|
|
957
|
+
type: !node.body ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression : ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
958
|
+
range: [node.parameters.pos - 1, node.end],
|
|
959
|
+
async: false,
|
|
960
|
+
body: this.convertChild(node.body),
|
|
961
|
+
declare: false,
|
|
962
|
+
expression: false,
|
|
963
|
+
// is not present in ESTreeNode
|
|
964
|
+
generator: false,
|
|
965
|
+
id: null,
|
|
966
|
+
params: this.convertParameters(node.parameters),
|
|
967
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
968
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
969
|
+
});
|
|
970
|
+
if (constructor.typeParameters) {
|
|
971
|
+
this.fixParentLocation(constructor, constructor.typeParameters.range);
|
|
972
|
+
}
|
|
973
|
+
const constructorKey = constructorToken.kind === SyntaxKind.StringLiteral ? this.createNode(constructorToken, {
|
|
974
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
975
|
+
raw: constructorToken.getText(),
|
|
976
|
+
value: "constructor"
|
|
977
|
+
}) : this.createNode(node, {
|
|
978
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
979
|
+
range: [
|
|
980
|
+
constructorToken.getStart(this.ast),
|
|
981
|
+
constructorToken.end
|
|
982
|
+
],
|
|
983
|
+
decorators: [],
|
|
984
|
+
name: "constructor",
|
|
985
|
+
optional: false,
|
|
986
|
+
typeAnnotation: void 0
|
|
987
|
+
});
|
|
988
|
+
const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node);
|
|
989
|
+
return this.createNode(node, {
|
|
990
|
+
type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition : ts_estree_1.AST_NODE_TYPES.MethodDefinition,
|
|
991
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
992
|
+
computed: false,
|
|
993
|
+
decorators: [],
|
|
994
|
+
key: constructorKey,
|
|
995
|
+
kind: isStatic ? "method" : "constructor",
|
|
996
|
+
optional: false,
|
|
997
|
+
override: false,
|
|
998
|
+
static: isStatic,
|
|
999
|
+
value: constructor
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
case SyntaxKind.FunctionExpression: {
|
|
1003
|
+
return this.createNode(node, {
|
|
1004
|
+
type: ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
1005
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
1006
|
+
body: this.convertChild(node.body),
|
|
1007
|
+
declare: false,
|
|
1008
|
+
expression: false,
|
|
1009
|
+
generator: !!node.asteriskToken,
|
|
1010
|
+
id: this.convertChild(node.name),
|
|
1011
|
+
params: this.convertParameters(node.parameters),
|
|
1012
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
1013
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
case SyntaxKind.SuperKeyword:
|
|
1017
|
+
return this.createNode(node, {
|
|
1018
|
+
type: ts_estree_1.AST_NODE_TYPES.Super
|
|
1019
|
+
});
|
|
1020
|
+
case SyntaxKind.ArrayBindingPattern:
|
|
1021
|
+
return this.createNode(node, {
|
|
1022
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayPattern,
|
|
1023
|
+
decorators: [],
|
|
1024
|
+
elements: node.elements.map((el) => this.convertPattern(el)),
|
|
1025
|
+
optional: false,
|
|
1026
|
+
typeAnnotation: void 0
|
|
1027
|
+
});
|
|
1028
|
+
// occurs with missing array elements like [,]
|
|
1029
|
+
case SyntaxKind.OmittedExpression:
|
|
1030
|
+
return null;
|
|
1031
|
+
case SyntaxKind.ObjectBindingPattern:
|
|
1032
|
+
return this.createNode(node, {
|
|
1033
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectPattern,
|
|
1034
|
+
decorators: [],
|
|
1035
|
+
optional: false,
|
|
1036
|
+
properties: node.elements.map((el) => this.convertPattern(el)),
|
|
1037
|
+
typeAnnotation: void 0
|
|
1038
|
+
});
|
|
1039
|
+
case SyntaxKind.BindingElement: {
|
|
1040
|
+
if (parent.kind === SyntaxKind.ArrayBindingPattern) {
|
|
1041
|
+
const arrayItem = this.convertChild(node.name, parent);
|
|
1042
|
+
if (node.initializer) {
|
|
1043
|
+
return this.createNode(node, {
|
|
1044
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1045
|
+
decorators: [],
|
|
1046
|
+
left: arrayItem,
|
|
1047
|
+
optional: false,
|
|
1048
|
+
right: this.convertChild(node.initializer),
|
|
1049
|
+
typeAnnotation: void 0
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
if (node.dotDotDotToken) {
|
|
1053
|
+
return this.createNode(node, {
|
|
1054
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1055
|
+
argument: arrayItem,
|
|
1056
|
+
decorators: [],
|
|
1057
|
+
optional: false,
|
|
1058
|
+
typeAnnotation: void 0,
|
|
1059
|
+
value: void 0
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
return arrayItem;
|
|
1063
|
+
}
|
|
1064
|
+
let result;
|
|
1065
|
+
if (node.dotDotDotToken) {
|
|
1066
|
+
result = this.createNode(node, {
|
|
1067
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1068
|
+
argument: this.convertChild(node.propertyName ?? node.name),
|
|
1069
|
+
decorators: [],
|
|
1070
|
+
optional: false,
|
|
1071
|
+
typeAnnotation: void 0,
|
|
1072
|
+
value: void 0
|
|
1073
|
+
});
|
|
1074
|
+
} else {
|
|
1075
|
+
result = this.createNode(node, {
|
|
1076
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
1077
|
+
computed: node.propertyName?.kind === SyntaxKind.ComputedPropertyName,
|
|
1078
|
+
key: this.convertChild(node.propertyName ?? node.name),
|
|
1079
|
+
kind: "init",
|
|
1080
|
+
method: false,
|
|
1081
|
+
optional: false,
|
|
1082
|
+
shorthand: !node.propertyName,
|
|
1083
|
+
value: this.convertChild(node.name)
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
if (node.initializer) {
|
|
1087
|
+
result.value = this.createNode(node, {
|
|
1088
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1089
|
+
range: [node.name.getStart(this.ast), node.initializer.end],
|
|
1090
|
+
decorators: [],
|
|
1091
|
+
left: this.convertChild(node.name),
|
|
1092
|
+
optional: false,
|
|
1093
|
+
right: this.convertChild(node.initializer),
|
|
1094
|
+
typeAnnotation: void 0
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
return result;
|
|
1098
|
+
}
|
|
1099
|
+
case SyntaxKind.ArrowFunction: {
|
|
1100
|
+
return this.createNode(node, {
|
|
1101
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
1102
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
1103
|
+
body: this.convertChild(node.body),
|
|
1104
|
+
expression: node.body.kind !== SyntaxKind.Block,
|
|
1105
|
+
generator: false,
|
|
1106
|
+
id: null,
|
|
1107
|
+
params: this.convertParameters(node.parameters),
|
|
1108
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
1109
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
case SyntaxKind.YieldExpression:
|
|
1113
|
+
return this.createNode(node, {
|
|
1114
|
+
type: ts_estree_1.AST_NODE_TYPES.YieldExpression,
|
|
1115
|
+
argument: this.convertChild(node.expression),
|
|
1116
|
+
delegate: !!node.asteriskToken
|
|
1117
|
+
});
|
|
1118
|
+
case SyntaxKind.AwaitExpression:
|
|
1119
|
+
return this.createNode(node, {
|
|
1120
|
+
type: ts_estree_1.AST_NODE_TYPES.AwaitExpression,
|
|
1121
|
+
argument: this.convertChild(node.expression)
|
|
1122
|
+
});
|
|
1123
|
+
// Template Literals
|
|
1124
|
+
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
|
1125
|
+
return this.createNode(node, {
|
|
1126
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral,
|
|
1127
|
+
expressions: [],
|
|
1128
|
+
quasis: [
|
|
1129
|
+
this.createNode(node, {
|
|
1130
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateElement,
|
|
1131
|
+
tail: true,
|
|
1132
|
+
value: {
|
|
1133
|
+
cooked: node.text,
|
|
1134
|
+
raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1)
|
|
1135
|
+
}
|
|
1136
|
+
})
|
|
1137
|
+
]
|
|
1138
|
+
});
|
|
1139
|
+
case SyntaxKind.TemplateExpression: {
|
|
1140
|
+
const result = this.createNode(node, {
|
|
1141
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral,
|
|
1142
|
+
expressions: [],
|
|
1143
|
+
quasis: [this.convertChild(node.head)]
|
|
1144
|
+
});
|
|
1145
|
+
node.templateSpans.forEach((templateSpan) => {
|
|
1146
|
+
result.expressions.push(this.convertChild(templateSpan.expression));
|
|
1147
|
+
result.quasis.push(this.convertChild(templateSpan.literal));
|
|
1148
|
+
});
|
|
1149
|
+
return result;
|
|
1150
|
+
}
|
|
1151
|
+
case SyntaxKind.TaggedTemplateExpression: {
|
|
1152
|
+
if (node.tag.flags & ts.NodeFlags.OptionalChain) {
|
|
1153
|
+
this.#throwError(node, "Tagged template expressions are not permitted in an optional chain.");
|
|
1154
|
+
}
|
|
1155
|
+
return this.createNode(node, {
|
|
1156
|
+
type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression,
|
|
1157
|
+
quasi: this.convertChild(node.template),
|
|
1158
|
+
tag: this.convertChild(node.tag),
|
|
1159
|
+
typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
case SyntaxKind.TemplateHead:
|
|
1163
|
+
case SyntaxKind.TemplateMiddle:
|
|
1164
|
+
case SyntaxKind.TemplateTail: {
|
|
1165
|
+
const tail = node.kind === SyntaxKind.TemplateTail;
|
|
1166
|
+
return this.createNode(node, {
|
|
1167
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateElement,
|
|
1168
|
+
tail,
|
|
1169
|
+
value: {
|
|
1170
|
+
cooked: node.text,
|
|
1171
|
+
raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2))
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
// Patterns
|
|
1176
|
+
case SyntaxKind.SpreadAssignment:
|
|
1177
|
+
case SyntaxKind.SpreadElement: {
|
|
1178
|
+
if (this.allowPattern) {
|
|
1179
|
+
return this.createNode(node, {
|
|
1180
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1181
|
+
argument: this.convertPattern(node.expression),
|
|
1182
|
+
decorators: [],
|
|
1183
|
+
optional: false,
|
|
1184
|
+
typeAnnotation: void 0,
|
|
1185
|
+
value: void 0
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
return this.createNode(node, {
|
|
1189
|
+
type: ts_estree_1.AST_NODE_TYPES.SpreadElement,
|
|
1190
|
+
argument: this.convertChild(node.expression)
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
case SyntaxKind.Parameter: {
|
|
1194
|
+
let parameter;
|
|
1195
|
+
let result;
|
|
1196
|
+
if (node.dotDotDotToken) {
|
|
1197
|
+
parameter = result = this.createNode(node, {
|
|
1198
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1199
|
+
argument: this.convertChild(node.name),
|
|
1200
|
+
decorators: [],
|
|
1201
|
+
optional: false,
|
|
1202
|
+
typeAnnotation: void 0,
|
|
1203
|
+
value: void 0
|
|
1204
|
+
});
|
|
1205
|
+
} else if (node.initializer) {
|
|
1206
|
+
parameter = this.convertChild(node.name);
|
|
1207
|
+
result = this.createNode(node, {
|
|
1208
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1209
|
+
range: [node.name.getStart(this.ast), node.initializer.end],
|
|
1210
|
+
decorators: [],
|
|
1211
|
+
left: parameter,
|
|
1212
|
+
optional: false,
|
|
1213
|
+
right: this.convertChild(node.initializer),
|
|
1214
|
+
typeAnnotation: void 0
|
|
1215
|
+
});
|
|
1216
|
+
const modifiers2 = (0, getModifiers_1.getModifiers)(node);
|
|
1217
|
+
if (modifiers2) {
|
|
1218
|
+
result.range[0] = parameter.range[0];
|
|
1219
|
+
result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast);
|
|
1220
|
+
}
|
|
1221
|
+
} else {
|
|
1222
|
+
parameter = result = this.convertChild(node.name, parent);
|
|
1223
|
+
}
|
|
1224
|
+
if (node.type) {
|
|
1225
|
+
parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
1226
|
+
this.fixParentLocation(parameter, parameter.typeAnnotation.range);
|
|
1227
|
+
}
|
|
1228
|
+
if (node.questionToken) {
|
|
1229
|
+
if (node.questionToken.end > parameter.range[1]) {
|
|
1230
|
+
parameter.range[1] = node.questionToken.end;
|
|
1231
|
+
parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast);
|
|
1232
|
+
}
|
|
1233
|
+
parameter.optional = true;
|
|
1234
|
+
}
|
|
1235
|
+
const modifiers = (0, getModifiers_1.getModifiers)(node);
|
|
1236
|
+
if (modifiers) {
|
|
1237
|
+
return this.createNode(node, {
|
|
1238
|
+
type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty,
|
|
1239
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
1240
|
+
decorators: [],
|
|
1241
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
|
|
1242
|
+
parameter: result,
|
|
1243
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
|
|
1244
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node)
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
return result;
|
|
1248
|
+
}
|
|
1249
|
+
// Classes
|
|
1250
|
+
case SyntaxKind.ClassDeclaration:
|
|
1251
|
+
if (!node.name && (!(0, node_utils_1.hasModifier)(ts.SyntaxKind.ExportKeyword, node) || !(0, node_utils_1.hasModifier)(ts.SyntaxKind.DefaultKeyword, node))) {
|
|
1252
|
+
this.#throwError(node, "A class declaration without the 'default' modifier must have a name.");
|
|
1253
|
+
}
|
|
1254
|
+
/* intentional fallthrough */
|
|
1255
|
+
case SyntaxKind.ClassExpression: {
|
|
1256
|
+
const heritageClauses = node.heritageClauses ?? [];
|
|
1257
|
+
const classNodeType = node.kind === SyntaxKind.ClassDeclaration ? ts_estree_1.AST_NODE_TYPES.ClassDeclaration : ts_estree_1.AST_NODE_TYPES.ClassExpression;
|
|
1258
|
+
let extendsClause;
|
|
1259
|
+
let implementsClause;
|
|
1260
|
+
for (const heritageClause of heritageClauses) {
|
|
1261
|
+
const { token, types } = heritageClause;
|
|
1262
|
+
if (types.length === 0) {
|
|
1263
|
+
this.#throwError(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`);
|
|
1264
|
+
}
|
|
1265
|
+
if (token === SyntaxKind.ExtendsKeyword) {
|
|
1266
|
+
if (extendsClause) {
|
|
1267
|
+
this.#throwError(heritageClause, "'extends' clause already seen.");
|
|
1268
|
+
}
|
|
1269
|
+
if (implementsClause) {
|
|
1270
|
+
this.#throwError(heritageClause, "'extends' clause must precede 'implements' clause.");
|
|
1271
|
+
}
|
|
1272
|
+
if (types.length > 1) {
|
|
1273
|
+
this.#throwError(types[1], "Classes can only extend a single class.");
|
|
1274
|
+
}
|
|
1275
|
+
extendsClause ??= heritageClause;
|
|
1276
|
+
} else if (token === SyntaxKind.ImplementsKeyword) {
|
|
1277
|
+
if (implementsClause) {
|
|
1278
|
+
this.#throwError(heritageClause, "'implements' clause already seen.");
|
|
1279
|
+
}
|
|
1280
|
+
implementsClause ??= heritageClause;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
const result = this.createNode(node, {
|
|
1284
|
+
type: classNodeType,
|
|
1285
|
+
abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node),
|
|
1286
|
+
body: this.createNode(node, {
|
|
1287
|
+
type: ts_estree_1.AST_NODE_TYPES.ClassBody,
|
|
1288
|
+
range: [node.members.pos - 1, node.end],
|
|
1289
|
+
body: this.convertChildren(node.members.filter(node_utils_1.isESTreeClassMember))
|
|
1290
|
+
}),
|
|
1291
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
1292
|
+
decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
|
|
1293
|
+
id: this.convertChild(node.name),
|
|
1294
|
+
implements: this.convertChildren(implementsClause?.types ?? []),
|
|
1295
|
+
superClass: extendsClause?.types[0] ? this.convertChild(extendsClause.types[0].expression) : null,
|
|
1296
|
+
superTypeArguments: void 0,
|
|
1297
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1298
|
+
});
|
|
1299
|
+
if (extendsClause?.types[0]?.typeArguments) {
|
|
1300
|
+
result.superTypeArguments = this.convertTypeArgumentsToTypeParameterInstantiation(extendsClause.types[0].typeArguments, extendsClause.types[0]);
|
|
1301
|
+
}
|
|
1302
|
+
return this.fixExports(node, result);
|
|
1303
|
+
}
|
|
1304
|
+
// Modules
|
|
1305
|
+
case SyntaxKind.ModuleBlock:
|
|
1306
|
+
return this.createNode(node, {
|
|
1307
|
+
type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock,
|
|
1308
|
+
body: this.convertBodyExpressions(node.statements, node)
|
|
1309
|
+
});
|
|
1310
|
+
case SyntaxKind.ImportDeclaration: {
|
|
1311
|
+
this.assertModuleSpecifier(node, false);
|
|
1312
|
+
const result = this.createNode(node, this.#withDeprecatedAliasGetter({
|
|
1313
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration,
|
|
1314
|
+
attributes: this.convertImportAttributes(node),
|
|
1315
|
+
importKind: "value",
|
|
1316
|
+
source: this.convertChild(node.moduleSpecifier),
|
|
1317
|
+
specifiers: []
|
|
1318
|
+
}, "assertions", "attributes", true));
|
|
1319
|
+
if (node.importClause) {
|
|
1320
|
+
if (node.importClause.isTypeOnly) {
|
|
1321
|
+
result.importKind = "type";
|
|
1322
|
+
}
|
|
1323
|
+
if (node.importClause.name) {
|
|
1324
|
+
result.specifiers.push(this.convertChild(node.importClause));
|
|
1325
|
+
}
|
|
1326
|
+
if (node.importClause.namedBindings) {
|
|
1327
|
+
switch (node.importClause.namedBindings.kind) {
|
|
1328
|
+
case SyntaxKind.NamespaceImport:
|
|
1329
|
+
result.specifiers.push(this.convertChild(node.importClause.namedBindings));
|
|
1330
|
+
break;
|
|
1331
|
+
case SyntaxKind.NamedImports:
|
|
1332
|
+
result.specifiers.push(...this.convertChildren(node.importClause.namedBindings.elements));
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
return result;
|
|
1338
|
+
}
|
|
1339
|
+
case SyntaxKind.NamespaceImport:
|
|
1340
|
+
return this.createNode(node, {
|
|
1341
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier,
|
|
1342
|
+
local: this.convertChild(node.name)
|
|
1343
|
+
});
|
|
1344
|
+
case SyntaxKind.ImportSpecifier:
|
|
1345
|
+
return this.createNode(node, {
|
|
1346
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier,
|
|
1347
|
+
imported: this.convertChild(node.propertyName ?? node.name),
|
|
1348
|
+
importKind: node.isTypeOnly ? "type" : "value",
|
|
1349
|
+
local: this.convertChild(node.name)
|
|
1350
|
+
});
|
|
1351
|
+
case SyntaxKind.ImportClause: {
|
|
1352
|
+
const local = this.convertChild(node.name);
|
|
1353
|
+
return this.createNode(node, {
|
|
1354
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier,
|
|
1355
|
+
range: local.range,
|
|
1356
|
+
local
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
case SyntaxKind.ExportDeclaration: {
|
|
1360
|
+
if (node.exportClause?.kind === SyntaxKind.NamedExports) {
|
|
1361
|
+
this.assertModuleSpecifier(node, true);
|
|
1362
|
+
return this.createNode(node, this.#withDeprecatedAliasGetter({
|
|
1363
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
|
|
1364
|
+
attributes: this.convertImportAttributes(node),
|
|
1365
|
+
declaration: null,
|
|
1366
|
+
exportKind: node.isTypeOnly ? "type" : "value",
|
|
1367
|
+
source: this.convertChild(node.moduleSpecifier),
|
|
1368
|
+
specifiers: this.convertChildren(node.exportClause.elements, node)
|
|
1369
|
+
}, "assertions", "attributes", true));
|
|
1370
|
+
}
|
|
1371
|
+
this.assertModuleSpecifier(node, false);
|
|
1372
|
+
return this.createNode(node, this.#withDeprecatedAliasGetter({
|
|
1373
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration,
|
|
1374
|
+
attributes: this.convertImportAttributes(node),
|
|
1375
|
+
exported: node.exportClause?.kind === SyntaxKind.NamespaceExport ? this.convertChild(node.exportClause.name) : null,
|
|
1376
|
+
exportKind: node.isTypeOnly ? "type" : "value",
|
|
1377
|
+
source: this.convertChild(node.moduleSpecifier)
|
|
1378
|
+
}, "assertions", "attributes", true));
|
|
1379
|
+
}
|
|
1380
|
+
case SyntaxKind.ExportSpecifier: {
|
|
1381
|
+
const local = node.propertyName ?? node.name;
|
|
1382
|
+
if (local.kind === SyntaxKind.StringLiteral && parent.kind === SyntaxKind.ExportDeclaration && parent.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) {
|
|
1383
|
+
this.#throwError(local, "A string literal cannot be used as a local exported binding without `from`.");
|
|
1384
|
+
}
|
|
1385
|
+
return this.createNode(node, {
|
|
1386
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier,
|
|
1387
|
+
exported: this.convertChild(node.name),
|
|
1388
|
+
exportKind: node.isTypeOnly ? "type" : "value",
|
|
1389
|
+
local: this.convertChild(local)
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
case SyntaxKind.ExportAssignment:
|
|
1393
|
+
if (node.isExportEquals) {
|
|
1394
|
+
return this.createNode(node, {
|
|
1395
|
+
type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment,
|
|
1396
|
+
expression: this.convertChild(node.expression)
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
return this.createNode(node, {
|
|
1400
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration,
|
|
1401
|
+
declaration: this.convertChild(node.expression),
|
|
1402
|
+
exportKind: "value"
|
|
1403
|
+
});
|
|
1404
|
+
// Unary Operations
|
|
1405
|
+
case SyntaxKind.PrefixUnaryExpression:
|
|
1406
|
+
case SyntaxKind.PostfixUnaryExpression: {
|
|
1407
|
+
const operator = (0, node_utils_1.getTextForTokenKind)(node.operator);
|
|
1408
|
+
if (operator === "++" || operator === "--") {
|
|
1409
|
+
if (!(0, node_utils_1.isValidAssignmentTarget)(node.operand)) {
|
|
1410
|
+
this.#throwError(node.operand, "Invalid left-hand side expression in unary operation");
|
|
1411
|
+
}
|
|
1412
|
+
return this.createNode(node, {
|
|
1413
|
+
type: ts_estree_1.AST_NODE_TYPES.UpdateExpression,
|
|
1414
|
+
argument: this.convertChild(node.operand),
|
|
1415
|
+
operator,
|
|
1416
|
+
prefix: node.kind === SyntaxKind.PrefixUnaryExpression
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
return this.createNode(node, {
|
|
1420
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1421
|
+
argument: this.convertChild(node.operand),
|
|
1422
|
+
operator,
|
|
1423
|
+
prefix: node.kind === SyntaxKind.PrefixUnaryExpression
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
case SyntaxKind.DeleteExpression:
|
|
1427
|
+
return this.createNode(node, {
|
|
1428
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1429
|
+
argument: this.convertChild(node.expression),
|
|
1430
|
+
operator: "delete",
|
|
1431
|
+
prefix: true
|
|
1432
|
+
});
|
|
1433
|
+
case SyntaxKind.VoidExpression:
|
|
1434
|
+
return this.createNode(node, {
|
|
1435
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1436
|
+
argument: this.convertChild(node.expression),
|
|
1437
|
+
operator: "void",
|
|
1438
|
+
prefix: true
|
|
1439
|
+
});
|
|
1440
|
+
case SyntaxKind.TypeOfExpression:
|
|
1441
|
+
return this.createNode(node, {
|
|
1442
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1443
|
+
argument: this.convertChild(node.expression),
|
|
1444
|
+
operator: "typeof",
|
|
1445
|
+
prefix: true
|
|
1446
|
+
});
|
|
1447
|
+
case SyntaxKind.TypeOperator:
|
|
1448
|
+
return this.createNode(node, {
|
|
1449
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator,
|
|
1450
|
+
operator: (0, node_utils_1.getTextForTokenKind)(node.operator),
|
|
1451
|
+
typeAnnotation: this.convertChild(node.type)
|
|
1452
|
+
});
|
|
1453
|
+
// Binary Operations
|
|
1454
|
+
case SyntaxKind.BinaryExpression: {
|
|
1455
|
+
if (node.operatorToken.kind !== SyntaxKind.InKeyword && node.left.kind === SyntaxKind.PrivateIdentifier) {
|
|
1456
|
+
this.#throwError(node.left, "Private identifiers cannot appear on the right-hand-side of an 'in' expression.");
|
|
1457
|
+
} else if (node.right.kind === SyntaxKind.PrivateIdentifier) {
|
|
1458
|
+
this.#throwError(node.right, "Private identifiers are only allowed on the left-hand-side of an 'in' expression.");
|
|
1459
|
+
}
|
|
1460
|
+
if ((0, node_utils_1.isComma)(node.operatorToken)) {
|
|
1461
|
+
const result = this.createNode(node, {
|
|
1462
|
+
type: ts_estree_1.AST_NODE_TYPES.SequenceExpression,
|
|
1463
|
+
expressions: []
|
|
1464
|
+
});
|
|
1465
|
+
const left = this.convertChild(node.left);
|
|
1466
|
+
if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression && node.left.kind !== SyntaxKind.ParenthesizedExpression) {
|
|
1467
|
+
result.expressions.push(...left.expressions);
|
|
1468
|
+
} else {
|
|
1469
|
+
result.expressions.push(left);
|
|
1470
|
+
}
|
|
1471
|
+
result.expressions.push(this.convertChild(node.right));
|
|
1472
|
+
return result;
|
|
1473
|
+
}
|
|
1474
|
+
const expressionType = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken);
|
|
1475
|
+
if (this.allowPattern && expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) {
|
|
1476
|
+
return this.createNode(node, {
|
|
1477
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1478
|
+
decorators: [],
|
|
1479
|
+
left: this.convertPattern(node.left, node),
|
|
1480
|
+
optional: false,
|
|
1481
|
+
right: this.convertChild(node.right),
|
|
1482
|
+
typeAnnotation: void 0
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
return this.createNode(node, {
|
|
1486
|
+
...expressionType,
|
|
1487
|
+
left: this.converter(node.left, node, expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression),
|
|
1488
|
+
right: this.convertChild(node.right)
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
case SyntaxKind.PropertyAccessExpression: {
|
|
1492
|
+
const object = this.convertChild(node.expression);
|
|
1493
|
+
const property = this.convertChild(node.name);
|
|
1494
|
+
const computed = false;
|
|
1495
|
+
const result = this.createNode(node, {
|
|
1496
|
+
type: ts_estree_1.AST_NODE_TYPES.MemberExpression,
|
|
1497
|
+
computed,
|
|
1498
|
+
object,
|
|
1499
|
+
optional: node.questionDotToken != null,
|
|
1500
|
+
property
|
|
1501
|
+
});
|
|
1502
|
+
return this.convertChainExpression(result, node);
|
|
1503
|
+
}
|
|
1504
|
+
case SyntaxKind.ElementAccessExpression: {
|
|
1505
|
+
const object = this.convertChild(node.expression);
|
|
1506
|
+
const property = this.convertChild(node.argumentExpression);
|
|
1507
|
+
const computed = true;
|
|
1508
|
+
const result = this.createNode(node, {
|
|
1509
|
+
type: ts_estree_1.AST_NODE_TYPES.MemberExpression,
|
|
1510
|
+
computed,
|
|
1511
|
+
object,
|
|
1512
|
+
optional: node.questionDotToken != null,
|
|
1513
|
+
property
|
|
1514
|
+
});
|
|
1515
|
+
return this.convertChainExpression(result, node);
|
|
1516
|
+
}
|
|
1517
|
+
case SyntaxKind.CallExpression: {
|
|
1518
|
+
if (node.expression.kind === SyntaxKind.ImportKeyword) {
|
|
1519
|
+
if (node.arguments.length !== 1 && node.arguments.length !== 2) {
|
|
1520
|
+
this.#throwError(node.arguments[2] ?? node, "Dynamic import requires exactly one or two arguments.");
|
|
1521
|
+
}
|
|
1522
|
+
return this.createNode(node, this.#withDeprecatedAliasGetter({
|
|
1523
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportExpression,
|
|
1524
|
+
options: node.arguments[1] ? this.convertChild(node.arguments[1]) : null,
|
|
1525
|
+
source: this.convertChild(node.arguments[0])
|
|
1526
|
+
}, "attributes", "options", true));
|
|
1527
|
+
}
|
|
1528
|
+
const callee = this.convertChild(node.expression);
|
|
1529
|
+
const args = this.convertChildren(node.arguments);
|
|
1530
|
+
const typeArguments = node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1531
|
+
const result = this.createNode(node, {
|
|
1532
|
+
type: ts_estree_1.AST_NODE_TYPES.CallExpression,
|
|
1533
|
+
arguments: args,
|
|
1534
|
+
callee,
|
|
1535
|
+
optional: node.questionDotToken != null,
|
|
1536
|
+
typeArguments
|
|
1537
|
+
});
|
|
1538
|
+
return this.convertChainExpression(result, node);
|
|
1539
|
+
}
|
|
1540
|
+
case SyntaxKind.NewExpression: {
|
|
1541
|
+
const typeArguments = node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1542
|
+
return this.createNode(node, {
|
|
1543
|
+
type: ts_estree_1.AST_NODE_TYPES.NewExpression,
|
|
1544
|
+
arguments: this.convertChildren(node.arguments ?? []),
|
|
1545
|
+
callee: this.convertChild(node.expression),
|
|
1546
|
+
typeArguments
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
case SyntaxKind.ConditionalExpression:
|
|
1550
|
+
return this.createNode(node, {
|
|
1551
|
+
type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression,
|
|
1552
|
+
alternate: this.convertChild(node.whenFalse),
|
|
1553
|
+
consequent: this.convertChild(node.whenTrue),
|
|
1554
|
+
test: this.convertChild(node.condition)
|
|
1555
|
+
});
|
|
1556
|
+
case SyntaxKind.MetaProperty: {
|
|
1557
|
+
return this.createNode(node, {
|
|
1558
|
+
type: ts_estree_1.AST_NODE_TYPES.MetaProperty,
|
|
1559
|
+
meta: this.createNode(
|
|
1560
|
+
// TODO: do we really want to convert it to Token?
|
|
1561
|
+
node.getFirstToken(),
|
|
1562
|
+
{
|
|
1563
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
1564
|
+
decorators: [],
|
|
1565
|
+
name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken),
|
|
1566
|
+
optional: false,
|
|
1567
|
+
typeAnnotation: void 0
|
|
1568
|
+
}
|
|
1569
|
+
),
|
|
1570
|
+
property: this.convertChild(node.name)
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
case SyntaxKind.Decorator: {
|
|
1574
|
+
return this.createNode(node, {
|
|
1575
|
+
type: ts_estree_1.AST_NODE_TYPES.Decorator,
|
|
1576
|
+
expression: this.convertChild(node.expression)
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
// Literals
|
|
1580
|
+
case SyntaxKind.StringLiteral: {
|
|
1581
|
+
return this.createNode(node, {
|
|
1582
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1583
|
+
raw: node.getText(),
|
|
1584
|
+
value: parent.kind === SyntaxKind.JsxAttribute ? (0, node_utils_1.unescapeStringLiteralText)(node.text) : node.text
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
case SyntaxKind.NumericLiteral: {
|
|
1588
|
+
return this.createNode(node, {
|
|
1589
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1590
|
+
raw: node.getText(),
|
|
1591
|
+
value: Number(node.text)
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
case SyntaxKind.BigIntLiteral: {
|
|
1595
|
+
const range = (0, node_utils_1.getRange)(node, this.ast);
|
|
1596
|
+
const rawValue = this.ast.text.slice(range[0], range[1]);
|
|
1597
|
+
const bigint = rawValue.slice(0, -1).replaceAll("_", "");
|
|
1598
|
+
const value = typeof BigInt !== "undefined" ? BigInt(bigint) : null;
|
|
1599
|
+
return this.createNode(node, {
|
|
1600
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1601
|
+
range,
|
|
1602
|
+
bigint: value == null ? bigint : String(value),
|
|
1603
|
+
raw: rawValue,
|
|
1604
|
+
value
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
case SyntaxKind.RegularExpressionLiteral: {
|
|
1608
|
+
const pattern = node.text.slice(1, node.text.lastIndexOf("/"));
|
|
1609
|
+
const flags = node.text.slice(node.text.lastIndexOf("/") + 1);
|
|
1610
|
+
let regex = null;
|
|
1611
|
+
try {
|
|
1612
|
+
regex = new RegExp(pattern, flags);
|
|
1613
|
+
} catch {
|
|
1614
|
+
}
|
|
1615
|
+
return this.createNode(node, {
|
|
1616
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1617
|
+
raw: node.text,
|
|
1618
|
+
regex: {
|
|
1619
|
+
flags,
|
|
1620
|
+
pattern
|
|
1621
|
+
},
|
|
1622
|
+
value: regex
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
case SyntaxKind.TrueKeyword:
|
|
1626
|
+
return this.createNode(node, {
|
|
1627
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1628
|
+
raw: "true",
|
|
1629
|
+
value: true
|
|
1630
|
+
});
|
|
1631
|
+
case SyntaxKind.FalseKeyword:
|
|
1632
|
+
return this.createNode(node, {
|
|
1633
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1634
|
+
raw: "false",
|
|
1635
|
+
value: false
|
|
1636
|
+
});
|
|
1637
|
+
case SyntaxKind.NullKeyword: {
|
|
1638
|
+
return this.createNode(node, {
|
|
1639
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1640
|
+
raw: "null",
|
|
1641
|
+
value: null
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
case SyntaxKind.EmptyStatement:
|
|
1645
|
+
return this.createNode(node, {
|
|
1646
|
+
type: ts_estree_1.AST_NODE_TYPES.EmptyStatement
|
|
1647
|
+
});
|
|
1648
|
+
case SyntaxKind.DebuggerStatement:
|
|
1649
|
+
return this.createNode(node, {
|
|
1650
|
+
type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement
|
|
1651
|
+
});
|
|
1652
|
+
// JSX
|
|
1653
|
+
case SyntaxKind.JsxElement:
|
|
1654
|
+
return this.createNode(node, {
|
|
1655
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXElement,
|
|
1656
|
+
children: this.convertChildren(node.children),
|
|
1657
|
+
closingElement: this.convertChild(node.closingElement),
|
|
1658
|
+
openingElement: this.convertChild(node.openingElement)
|
|
1659
|
+
});
|
|
1660
|
+
case SyntaxKind.JsxFragment:
|
|
1661
|
+
return this.createNode(node, {
|
|
1662
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXFragment,
|
|
1663
|
+
children: this.convertChildren(node.children),
|
|
1664
|
+
closingFragment: this.convertChild(node.closingFragment),
|
|
1665
|
+
openingFragment: this.convertChild(node.openingFragment)
|
|
1666
|
+
});
|
|
1667
|
+
case SyntaxKind.JsxSelfClosingElement: {
|
|
1668
|
+
return this.createNode(node, {
|
|
1669
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXElement,
|
|
1670
|
+
/**
|
|
1671
|
+
* Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement,
|
|
1672
|
+
* TypeScript does not seem to have the idea of openingElement when tag is self-closing
|
|
1673
|
+
*/
|
|
1674
|
+
children: [],
|
|
1675
|
+
closingElement: null,
|
|
1676
|
+
openingElement: this.createNode(node, {
|
|
1677
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1678
|
+
range: (0, node_utils_1.getRange)(node, this.ast),
|
|
1679
|
+
attributes: this.convertChildren(node.attributes.properties),
|
|
1680
|
+
name: this.convertJSXTagName(node.tagName, node),
|
|
1681
|
+
selfClosing: true,
|
|
1682
|
+
typeArguments: node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) : void 0
|
|
1683
|
+
})
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
case SyntaxKind.JsxOpeningElement: {
|
|
1687
|
+
return this.createNode(node, {
|
|
1688
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1689
|
+
attributes: this.convertChildren(node.attributes.properties),
|
|
1690
|
+
name: this.convertJSXTagName(node.tagName, node),
|
|
1691
|
+
selfClosing: false,
|
|
1692
|
+
typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
case SyntaxKind.JsxClosingElement:
|
|
1696
|
+
return this.createNode(node, {
|
|
1697
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement,
|
|
1698
|
+
name: this.convertJSXTagName(node.tagName, node)
|
|
1699
|
+
});
|
|
1700
|
+
case SyntaxKind.JsxOpeningFragment:
|
|
1701
|
+
return this.createNode(node, {
|
|
1702
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment
|
|
1703
|
+
});
|
|
1704
|
+
case SyntaxKind.JsxClosingFragment:
|
|
1705
|
+
return this.createNode(node, {
|
|
1706
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment
|
|
1707
|
+
});
|
|
1708
|
+
case SyntaxKind.JsxExpression: {
|
|
1709
|
+
const expression = node.expression ? this.convertChild(node.expression) : this.createNode(node, {
|
|
1710
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression,
|
|
1711
|
+
range: [node.getStart(this.ast) + 1, node.getEnd() - 1]
|
|
1712
|
+
});
|
|
1713
|
+
if (node.dotDotDotToken) {
|
|
1714
|
+
return this.createNode(node, {
|
|
1715
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild,
|
|
1716
|
+
expression
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
return this.createNode(node, {
|
|
1720
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer,
|
|
1721
|
+
expression
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
case SyntaxKind.JsxAttribute: {
|
|
1725
|
+
return this.createNode(node, {
|
|
1726
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXAttribute,
|
|
1727
|
+
name: this.convertJSXNamespaceOrIdentifier(node.name),
|
|
1728
|
+
value: this.convertChild(node.initializer)
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
case SyntaxKind.JsxText: {
|
|
1732
|
+
const start = node.getFullStart();
|
|
1733
|
+
const end = node.getEnd();
|
|
1734
|
+
const text = this.ast.text.slice(start, end);
|
|
1735
|
+
return this.createNode(node, {
|
|
1736
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXText,
|
|
1737
|
+
range: [start, end],
|
|
1738
|
+
raw: text,
|
|
1739
|
+
value: (0, node_utils_1.unescapeStringLiteralText)(text)
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
case SyntaxKind.JsxSpreadAttribute:
|
|
1743
|
+
return this.createNode(node, {
|
|
1744
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute,
|
|
1745
|
+
argument: this.convertChild(node.expression)
|
|
1746
|
+
});
|
|
1747
|
+
case SyntaxKind.QualifiedName: {
|
|
1748
|
+
return this.createNode(node, {
|
|
1749
|
+
type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName,
|
|
1750
|
+
left: this.convertChild(node.left),
|
|
1751
|
+
right: this.convertChild(node.right)
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
// TypeScript specific
|
|
1755
|
+
case SyntaxKind.TypeReference:
|
|
1756
|
+
return this.createNode(node, {
|
|
1757
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeReference,
|
|
1758
|
+
typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
1759
|
+
typeName: this.convertChild(node.typeName)
|
|
1760
|
+
});
|
|
1761
|
+
case SyntaxKind.TypeParameter: {
|
|
1762
|
+
return this.createNode(node, {
|
|
1763
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter,
|
|
1764
|
+
const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node),
|
|
1765
|
+
constraint: node.constraint && this.convertChild(node.constraint),
|
|
1766
|
+
default: node.default ? this.convertChild(node.default) : void 0,
|
|
1767
|
+
in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node),
|
|
1768
|
+
name: this.convertChild(node.name),
|
|
1769
|
+
out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node)
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
case SyntaxKind.ThisType:
|
|
1773
|
+
return this.createNode(node, {
|
|
1774
|
+
type: ts_estree_1.AST_NODE_TYPES.TSThisType
|
|
1775
|
+
});
|
|
1776
|
+
case SyntaxKind.AnyKeyword:
|
|
1777
|
+
case SyntaxKind.BigIntKeyword:
|
|
1778
|
+
case SyntaxKind.BooleanKeyword:
|
|
1779
|
+
case SyntaxKind.NeverKeyword:
|
|
1780
|
+
case SyntaxKind.NumberKeyword:
|
|
1781
|
+
case SyntaxKind.ObjectKeyword:
|
|
1782
|
+
case SyntaxKind.StringKeyword:
|
|
1783
|
+
case SyntaxKind.SymbolKeyword:
|
|
1784
|
+
case SyntaxKind.UnknownKeyword:
|
|
1785
|
+
case SyntaxKind.VoidKeyword:
|
|
1786
|
+
case SyntaxKind.UndefinedKeyword:
|
|
1787
|
+
case SyntaxKind.IntrinsicKeyword: {
|
|
1788
|
+
return this.createNode(node, {
|
|
1789
|
+
type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`]
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
case SyntaxKind.NonNullExpression: {
|
|
1793
|
+
const nnExpr = this.createNode(node, {
|
|
1794
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression,
|
|
1795
|
+
expression: this.convertChild(node.expression)
|
|
1796
|
+
});
|
|
1797
|
+
return this.convertChainExpression(nnExpr, node);
|
|
1798
|
+
}
|
|
1799
|
+
case SyntaxKind.TypeLiteral: {
|
|
1800
|
+
return this.createNode(node, {
|
|
1801
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral,
|
|
1802
|
+
members: this.convertChildren(node.members)
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
case SyntaxKind.ArrayType: {
|
|
1806
|
+
return this.createNode(node, {
|
|
1807
|
+
type: ts_estree_1.AST_NODE_TYPES.TSArrayType,
|
|
1808
|
+
elementType: this.convertChild(node.elementType)
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
case SyntaxKind.IndexedAccessType: {
|
|
1812
|
+
return this.createNode(node, {
|
|
1813
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType,
|
|
1814
|
+
indexType: this.convertChild(node.indexType),
|
|
1815
|
+
objectType: this.convertChild(node.objectType)
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
case SyntaxKind.ConditionalType: {
|
|
1819
|
+
return this.createNode(node, {
|
|
1820
|
+
type: ts_estree_1.AST_NODE_TYPES.TSConditionalType,
|
|
1821
|
+
checkType: this.convertChild(node.checkType),
|
|
1822
|
+
extendsType: this.convertChild(node.extendsType),
|
|
1823
|
+
falseType: this.convertChild(node.falseType),
|
|
1824
|
+
trueType: this.convertChild(node.trueType)
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
case SyntaxKind.TypeQuery:
|
|
1828
|
+
return this.createNode(node, {
|
|
1829
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery,
|
|
1830
|
+
exprName: this.convertChild(node.exprName),
|
|
1831
|
+
typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1832
|
+
});
|
|
1833
|
+
case SyntaxKind.MappedType: {
|
|
1834
|
+
if (node.members && node.members.length > 0) {
|
|
1835
|
+
this.#throwError(node.members[0], "A mapped type may not declare properties or methods.");
|
|
1836
|
+
}
|
|
1837
|
+
return this.createNode(node, this.#withDeprecatedGetter({
|
|
1838
|
+
type: ts_estree_1.AST_NODE_TYPES.TSMappedType,
|
|
1839
|
+
constraint: this.convertChild(node.typeParameter.constraint),
|
|
1840
|
+
key: this.convertChild(node.typeParameter.name),
|
|
1841
|
+
nameType: this.convertChild(node.nameType) ?? null,
|
|
1842
|
+
optional: node.questionToken ? node.questionToken.kind === SyntaxKind.QuestionToken || (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind) : false,
|
|
1843
|
+
readonly: node.readonlyToken ? node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword || (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind) : void 0,
|
|
1844
|
+
typeAnnotation: node.type && this.convertChild(node.type)
|
|
1845
|
+
}, "typeParameter", "'constraint' and 'key'", this.convertChild(node.typeParameter)));
|
|
1846
|
+
}
|
|
1847
|
+
case SyntaxKind.ParenthesizedExpression:
|
|
1848
|
+
return this.convertChild(node.expression, parent);
|
|
1849
|
+
case SyntaxKind.TypeAliasDeclaration: {
|
|
1850
|
+
const result = this.createNode(node, {
|
|
1851
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
|
|
1852
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
1853
|
+
id: this.convertChild(node.name),
|
|
1854
|
+
typeAnnotation: this.convertChild(node.type),
|
|
1855
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1856
|
+
});
|
|
1857
|
+
return this.fixExports(node, result);
|
|
1858
|
+
}
|
|
1859
|
+
case SyntaxKind.MethodSignature: {
|
|
1860
|
+
return this.convertMethodSignature(node);
|
|
1861
|
+
}
|
|
1862
|
+
case SyntaxKind.PropertySignature: {
|
|
1863
|
+
const { initializer } = node;
|
|
1864
|
+
if (initializer) {
|
|
1865
|
+
this.#throwError(initializer, "A property signature cannot have an initializer.");
|
|
1866
|
+
}
|
|
1867
|
+
return this.createNode(node, {
|
|
1868
|
+
type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
|
|
1869
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
1870
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
1871
|
+
key: this.convertChild(node.name),
|
|
1872
|
+
optional: (0, node_utils_1.isOptional)(node),
|
|
1873
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
|
|
1874
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
1875
|
+
typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node)
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
case SyntaxKind.IndexSignature: {
|
|
1879
|
+
return this.createNode(node, {
|
|
1880
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
|
|
1881
|
+
accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
|
|
1882
|
+
parameters: this.convertChildren(node.parameters),
|
|
1883
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
|
|
1884
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
1885
|
+
typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node)
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
case SyntaxKind.ConstructorType: {
|
|
1889
|
+
return this.createNode(node, {
|
|
1890
|
+
type: ts_estree_1.AST_NODE_TYPES.TSConstructorType,
|
|
1891
|
+
abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node),
|
|
1892
|
+
params: this.convertParameters(node.parameters),
|
|
1893
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
1894
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
case SyntaxKind.FunctionType: {
|
|
1898
|
+
const { modifiers } = node;
|
|
1899
|
+
if (modifiers) {
|
|
1900
|
+
this.#throwError(modifiers[0], "A function type cannot have modifiers.");
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
// intentional fallthrough
|
|
1904
|
+
case SyntaxKind.ConstructSignature:
|
|
1905
|
+
case SyntaxKind.CallSignature: {
|
|
1906
|
+
const type = node.kind === SyntaxKind.ConstructSignature ? ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration : node.kind === SyntaxKind.CallSignature ? ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration : ts_estree_1.AST_NODE_TYPES.TSFunctionType;
|
|
1907
|
+
return this.createNode(node, {
|
|
1908
|
+
type,
|
|
1909
|
+
params: this.convertParameters(node.parameters),
|
|
1910
|
+
returnType: node.type && this.convertTypeAnnotation(node.type, node),
|
|
1911
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
case SyntaxKind.ExpressionWithTypeArguments: {
|
|
1915
|
+
const parentKind = parent.kind;
|
|
1916
|
+
const type = parentKind === SyntaxKind.InterfaceDeclaration ? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage : parentKind === SyntaxKind.HeritageClause ? ts_estree_1.AST_NODE_TYPES.TSClassImplements : ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression;
|
|
1917
|
+
return this.createNode(node, {
|
|
1918
|
+
type,
|
|
1919
|
+
expression: this.convertChild(node.expression),
|
|
1920
|
+
typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
case SyntaxKind.InterfaceDeclaration: {
|
|
1924
|
+
const interfaceHeritageClauses = node.heritageClauses ?? [];
|
|
1925
|
+
const interfaceExtends = [];
|
|
1926
|
+
let seenExtendsClause = false;
|
|
1927
|
+
for (const heritageClause of interfaceHeritageClauses) {
|
|
1928
|
+
if (heritageClause.token !== SyntaxKind.ExtendsKeyword) {
|
|
1929
|
+
this.#throwError(heritageClause, heritageClause.token === SyntaxKind.ImplementsKeyword ? "Interface declaration cannot have 'implements' clause." : "Unexpected token.");
|
|
1930
|
+
}
|
|
1931
|
+
if (seenExtendsClause) {
|
|
1932
|
+
this.#throwError(heritageClause, "'extends' clause already seen.");
|
|
1933
|
+
}
|
|
1934
|
+
seenExtendsClause = true;
|
|
1935
|
+
for (const heritageType of heritageClause.types) {
|
|
1936
|
+
if (!isEntityNameExpression(heritageType.expression) || ts.isOptionalChain(heritageType.expression)) {
|
|
1937
|
+
this.#throwError(heritageType, "Interface declaration can only extend an identifier/qualified name with optional type arguments.");
|
|
1938
|
+
}
|
|
1939
|
+
interfaceExtends.push(this.convertChild(heritageType, node));
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
const result = this.createNode(node, {
|
|
1943
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration,
|
|
1944
|
+
body: this.createNode(node, {
|
|
1945
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody,
|
|
1946
|
+
range: [node.members.pos - 1, node.end],
|
|
1947
|
+
body: this.convertChildren(node.members)
|
|
1948
|
+
}),
|
|
1949
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
1950
|
+
extends: interfaceExtends,
|
|
1951
|
+
id: this.convertChild(node.name),
|
|
1952
|
+
typeParameters: node.typeParameters && this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
1953
|
+
});
|
|
1954
|
+
return this.fixExports(node, result);
|
|
1955
|
+
}
|
|
1956
|
+
case SyntaxKind.TypePredicate: {
|
|
1957
|
+
const result = this.createNode(node, {
|
|
1958
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate,
|
|
1959
|
+
asserts: node.assertsModifier != null,
|
|
1960
|
+
parameterName: this.convertChild(node.parameterName),
|
|
1961
|
+
typeAnnotation: null
|
|
1962
|
+
});
|
|
1963
|
+
if (node.type) {
|
|
1964
|
+
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
1965
|
+
result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc;
|
|
1966
|
+
result.typeAnnotation.range = result.typeAnnotation.typeAnnotation.range;
|
|
1967
|
+
}
|
|
1968
|
+
return result;
|
|
1969
|
+
}
|
|
1970
|
+
case SyntaxKind.ImportType: {
|
|
1971
|
+
const range = (0, node_utils_1.getRange)(node, this.ast);
|
|
1972
|
+
if (node.isTypeOf) {
|
|
1973
|
+
const token = (0, node_utils_1.findNextToken)(node.getFirstToken(), node, this.ast);
|
|
1974
|
+
range[0] = token.getStart(this.ast);
|
|
1975
|
+
}
|
|
1976
|
+
let options = null;
|
|
1977
|
+
if (node.attributes) {
|
|
1978
|
+
const value = this.createNode(node.attributes, {
|
|
1979
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectExpression,
|
|
1980
|
+
properties: node.attributes.elements.map((importAttribute) => this.createNode(importAttribute, {
|
|
1981
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
1982
|
+
computed: false,
|
|
1983
|
+
key: this.convertChild(importAttribute.name),
|
|
1984
|
+
kind: "init",
|
|
1985
|
+
method: false,
|
|
1986
|
+
optional: false,
|
|
1987
|
+
shorthand: false,
|
|
1988
|
+
value: this.convertChild(importAttribute.value)
|
|
1989
|
+
}))
|
|
1990
|
+
});
|
|
1991
|
+
const commaToken = (0, node_utils_1.findNextToken)(node.argument, node, this.ast);
|
|
1992
|
+
const openBraceToken = (0, node_utils_1.findNextToken)(commaToken, node, this.ast);
|
|
1993
|
+
const tokenAfterAttributes = (0, node_utils_1.findNextToken)(node.attributes, node, this.ast);
|
|
1994
|
+
const closeBraceToken = tokenAfterAttributes.kind === ts.SyntaxKind.CommaToken ? (0, node_utils_1.findNextToken)(tokenAfterAttributes, node, this.ast) : tokenAfterAttributes;
|
|
1995
|
+
const withOrAssertToken = (0, node_utils_1.findNextToken)(openBraceToken, node, this.ast);
|
|
1996
|
+
const withOrAssertTokenRange = (0, node_utils_1.getRange)(withOrAssertToken, this.ast);
|
|
1997
|
+
const withOrAssertName = withOrAssertToken.kind === ts.SyntaxKind.AssertKeyword ? "assert" : "with";
|
|
1998
|
+
options = this.createNode(node, {
|
|
1999
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectExpression,
|
|
2000
|
+
range: [openBraceToken.getStart(this.ast), closeBraceToken.end],
|
|
2001
|
+
properties: [
|
|
2002
|
+
this.createNode(node, {
|
|
2003
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
2004
|
+
range: [withOrAssertTokenRange[0], node.attributes.end],
|
|
2005
|
+
computed: false,
|
|
2006
|
+
key: this.createNode(node, {
|
|
2007
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
2008
|
+
range: withOrAssertTokenRange,
|
|
2009
|
+
decorators: [],
|
|
2010
|
+
name: withOrAssertName,
|
|
2011
|
+
optional: false,
|
|
2012
|
+
typeAnnotation: void 0
|
|
2013
|
+
}),
|
|
2014
|
+
kind: "init",
|
|
2015
|
+
method: false,
|
|
2016
|
+
optional: false,
|
|
2017
|
+
shorthand: false,
|
|
2018
|
+
value
|
|
2019
|
+
})
|
|
2020
|
+
]
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
const argument = this.convertChild(node.argument);
|
|
2024
|
+
const source = argument.literal;
|
|
2025
|
+
const result = this.createNode(node, this.#withDeprecatedGetter({
|
|
2026
|
+
type: ts_estree_1.AST_NODE_TYPES.TSImportType,
|
|
2027
|
+
range,
|
|
2028
|
+
options,
|
|
2029
|
+
qualifier: this.convertChild(node.qualifier),
|
|
2030
|
+
source,
|
|
2031
|
+
typeArguments: node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) : null
|
|
2032
|
+
}, "argument", "source", argument));
|
|
2033
|
+
if (node.isTypeOf) {
|
|
2034
|
+
return this.createNode(node, {
|
|
2035
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery,
|
|
2036
|
+
exprName: result,
|
|
2037
|
+
typeArguments: void 0
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2040
|
+
return result;
|
|
2041
|
+
}
|
|
2042
|
+
case SyntaxKind.EnumDeclaration: {
|
|
2043
|
+
const members = this.convertChildren(node.members);
|
|
2044
|
+
const result = this.createNode(node, this.#withDeprecatedGetter({
|
|
2045
|
+
type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration,
|
|
2046
|
+
body: this.createNode(node, {
|
|
2047
|
+
type: ts_estree_1.AST_NODE_TYPES.TSEnumBody,
|
|
2048
|
+
range: [node.members.pos - 1, node.end],
|
|
2049
|
+
members
|
|
2050
|
+
}),
|
|
2051
|
+
const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node),
|
|
2052
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
2053
|
+
id: this.convertChild(node.name)
|
|
2054
|
+
}, "members", `'body.members'`, this.convertChildren(node.members)));
|
|
2055
|
+
return this.fixExports(node, result);
|
|
2056
|
+
}
|
|
2057
|
+
case SyntaxKind.EnumMember: {
|
|
2058
|
+
const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName;
|
|
2059
|
+
if (computed) {
|
|
2060
|
+
this.#throwError(node.name, "Computed property names are not allowed in enums.");
|
|
2061
|
+
}
|
|
2062
|
+
if (node.name.kind === SyntaxKind.NumericLiteral || node.name.kind === SyntaxKind.BigIntLiteral) {
|
|
2063
|
+
this.#throwError(node.name, "An enum member cannot have a numeric name.");
|
|
2064
|
+
}
|
|
2065
|
+
return this.createNode(node, this.#withDeprecatedGetter({
|
|
2066
|
+
type: ts_estree_1.AST_NODE_TYPES.TSEnumMember,
|
|
2067
|
+
id: this.convertChild(node.name),
|
|
2068
|
+
initializer: node.initializer && this.convertChild(node.initializer)
|
|
2069
|
+
}, "computed", void 0, computed));
|
|
2070
|
+
}
|
|
2071
|
+
case SyntaxKind.ModuleDeclaration: {
|
|
2072
|
+
let isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
|
|
2073
|
+
const result = this.createNode(node, {
|
|
2074
|
+
type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration,
|
|
2075
|
+
...(() => {
|
|
2076
|
+
if (node.flags & ts.NodeFlags.GlobalAugmentation) {
|
|
2077
|
+
const id = this.convertChild(node.name);
|
|
2078
|
+
const body = this.convertChild(node.body);
|
|
2079
|
+
if (body == null || body.type === ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration) {
|
|
2080
|
+
this.#throwError(node.body ?? node, "Expected a valid module body");
|
|
2081
|
+
}
|
|
2082
|
+
if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) {
|
|
2083
|
+
this.#throwError(node.name, "global module augmentation must have an Identifier id");
|
|
2084
|
+
}
|
|
2085
|
+
return {
|
|
2086
|
+
body,
|
|
2087
|
+
declare: false,
|
|
2088
|
+
global: false,
|
|
2089
|
+
id,
|
|
2090
|
+
kind: "global"
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
if (ts.isStringLiteral(node.name)) {
|
|
2094
|
+
const body = this.convertChild(node.body);
|
|
2095
|
+
return {
|
|
2096
|
+
kind: "module",
|
|
2097
|
+
...body != null ? { body } : {},
|
|
2098
|
+
declare: false,
|
|
2099
|
+
global: false,
|
|
2100
|
+
id: this.convertChild(node.name)
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
if (node.body == null) {
|
|
2104
|
+
this.#throwError(node, "Expected a module body");
|
|
2105
|
+
}
|
|
2106
|
+
if (node.name.kind !== ts.SyntaxKind.Identifier) {
|
|
2107
|
+
this.#throwError(node.name, "`namespace`s must have an Identifier id");
|
|
2108
|
+
}
|
|
2109
|
+
let name = this.createNode(node.name, {
|
|
2110
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
2111
|
+
range: [node.name.getStart(this.ast), node.name.getEnd()],
|
|
2112
|
+
decorators: [],
|
|
2113
|
+
name: node.name.text,
|
|
2114
|
+
optional: false,
|
|
2115
|
+
typeAnnotation: void 0
|
|
2116
|
+
});
|
|
2117
|
+
while (node.body && ts.isModuleDeclaration(node.body) && node.body.name) {
|
|
2118
|
+
node = node.body;
|
|
2119
|
+
isDeclare ||= (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
|
|
2120
|
+
const nextName = node.name;
|
|
2121
|
+
const right = this.createNode(nextName, {
|
|
2122
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
2123
|
+
range: [nextName.getStart(this.ast), nextName.getEnd()],
|
|
2124
|
+
decorators: [],
|
|
2125
|
+
name: nextName.text,
|
|
2126
|
+
optional: false,
|
|
2127
|
+
typeAnnotation: void 0
|
|
2128
|
+
});
|
|
2129
|
+
name = this.createNode(nextName, {
|
|
2130
|
+
type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName,
|
|
2131
|
+
range: [name.range[0], right.range[1]],
|
|
2132
|
+
left: name,
|
|
2133
|
+
right
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
return {
|
|
2137
|
+
body: this.convertChild(node.body),
|
|
2138
|
+
declare: false,
|
|
2139
|
+
global: false,
|
|
2140
|
+
id: name,
|
|
2141
|
+
kind: node.flags & ts.NodeFlags.Namespace ? "namespace" : "module"
|
|
2142
|
+
};
|
|
2143
|
+
})()
|
|
2144
|
+
});
|
|
2145
|
+
result.declare = isDeclare;
|
|
2146
|
+
if (node.flags & ts.NodeFlags.GlobalAugmentation) {
|
|
2147
|
+
result.global = true;
|
|
2148
|
+
}
|
|
2149
|
+
return this.fixExports(node, result);
|
|
2150
|
+
}
|
|
2151
|
+
// TypeScript specific types
|
|
2152
|
+
case SyntaxKind.ParenthesizedType: {
|
|
2153
|
+
return this.convertChild(node.type);
|
|
2154
|
+
}
|
|
2155
|
+
case SyntaxKind.UnionType: {
|
|
2156
|
+
return this.createNode(node, {
|
|
2157
|
+
type: ts_estree_1.AST_NODE_TYPES.TSUnionType,
|
|
2158
|
+
types: this.convertChildren(node.types)
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
case SyntaxKind.IntersectionType: {
|
|
2162
|
+
return this.createNode(node, {
|
|
2163
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType,
|
|
2164
|
+
types: this.convertChildren(node.types)
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
case SyntaxKind.AsExpression: {
|
|
2168
|
+
return this.createNode(node, {
|
|
2169
|
+
type: ts_estree_1.AST_NODE_TYPES.TSAsExpression,
|
|
2170
|
+
expression: this.convertChild(node.expression),
|
|
2171
|
+
typeAnnotation: this.convertChild(node.type)
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
case SyntaxKind.InferType: {
|
|
2175
|
+
return this.createNode(node, {
|
|
2176
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInferType,
|
|
2177
|
+
typeParameter: this.convertChild(node.typeParameter)
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
case SyntaxKind.LiteralType: {
|
|
2181
|
+
if (node.literal.kind === SyntaxKind.NullKeyword) {
|
|
2182
|
+
return this.createNode(node.literal, {
|
|
2183
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
return this.createNode(node, {
|
|
2187
|
+
type: ts_estree_1.AST_NODE_TYPES.TSLiteralType,
|
|
2188
|
+
literal: this.convertChild(node.literal)
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
case SyntaxKind.TypeAssertionExpression: {
|
|
2192
|
+
return this.createNode(node, {
|
|
2193
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion,
|
|
2194
|
+
expression: this.convertChild(node.expression),
|
|
2195
|
+
typeAnnotation: this.convertChild(node.type)
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
case SyntaxKind.ImportEqualsDeclaration: {
|
|
2199
|
+
return this.fixExports(node, this.createNode(node, {
|
|
2200
|
+
type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration,
|
|
2201
|
+
id: this.convertChild(node.name),
|
|
2202
|
+
importKind: node.isTypeOnly ? "type" : "value",
|
|
2203
|
+
moduleReference: this.convertChild(node.moduleReference)
|
|
2204
|
+
}));
|
|
2205
|
+
}
|
|
2206
|
+
case SyntaxKind.ExternalModuleReference: {
|
|
2207
|
+
if (node.expression.kind !== SyntaxKind.StringLiteral) {
|
|
2208
|
+
this.#throwError(node.expression, "String literal expected.");
|
|
2209
|
+
}
|
|
2210
|
+
return this.createNode(node, {
|
|
2211
|
+
type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference,
|
|
2212
|
+
expression: this.convertChild(node.expression)
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
case SyntaxKind.NamespaceExportDeclaration: {
|
|
2216
|
+
return this.createNode(node, {
|
|
2217
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration,
|
|
2218
|
+
id: this.convertChild(node.name)
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
case SyntaxKind.AbstractKeyword: {
|
|
2222
|
+
return this.createNode(node, {
|
|
2223
|
+
type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
// Tuple
|
|
2227
|
+
case SyntaxKind.TupleType: {
|
|
2228
|
+
const elementTypes = this.convertChildren(node.elements);
|
|
2229
|
+
return this.createNode(node, {
|
|
2230
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTupleType,
|
|
2231
|
+
elementTypes
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
case SyntaxKind.NamedTupleMember: {
|
|
2235
|
+
const member = this.createNode(node, {
|
|
2236
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember,
|
|
2237
|
+
elementType: this.convertChild(node.type, node),
|
|
2238
|
+
label: this.convertChild(node.name, node),
|
|
2239
|
+
optional: node.questionToken != null
|
|
2240
|
+
});
|
|
2241
|
+
if (node.dotDotDotToken) {
|
|
2242
|
+
member.range[0] = member.label.range[0];
|
|
2243
|
+
member.loc.start = member.label.loc.start;
|
|
2244
|
+
return this.createNode(node, {
|
|
2245
|
+
type: ts_estree_1.AST_NODE_TYPES.TSRestType,
|
|
2246
|
+
typeAnnotation: member
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
return member;
|
|
2250
|
+
}
|
|
2251
|
+
case SyntaxKind.OptionalType: {
|
|
2252
|
+
return this.createNode(node, {
|
|
2253
|
+
type: ts_estree_1.AST_NODE_TYPES.TSOptionalType,
|
|
2254
|
+
typeAnnotation: this.convertChild(node.type)
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
case SyntaxKind.RestType: {
|
|
2258
|
+
return this.createNode(node, {
|
|
2259
|
+
type: ts_estree_1.AST_NODE_TYPES.TSRestType,
|
|
2260
|
+
typeAnnotation: this.convertChild(node.type)
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
// Template Literal Types
|
|
2264
|
+
case SyntaxKind.TemplateLiteralType: {
|
|
2265
|
+
const result = this.createNode(node, {
|
|
2266
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTemplateLiteralType,
|
|
2267
|
+
quasis: [this.convertChild(node.head)],
|
|
2268
|
+
types: []
|
|
2269
|
+
});
|
|
2270
|
+
node.templateSpans.forEach((templateSpan) => {
|
|
2271
|
+
result.types.push(this.convertChild(templateSpan.type));
|
|
2272
|
+
result.quasis.push(this.convertChild(templateSpan.literal));
|
|
2273
|
+
});
|
|
2274
|
+
return result;
|
|
2275
|
+
}
|
|
2276
|
+
case SyntaxKind.ClassStaticBlockDeclaration: {
|
|
2277
|
+
return this.createNode(node, {
|
|
2278
|
+
type: ts_estree_1.AST_NODE_TYPES.StaticBlock,
|
|
2279
|
+
body: this.convertBodyExpressions(node.body.statements, node)
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2283
|
+
case SyntaxKind.AssertEntry:
|
|
2284
|
+
case SyntaxKind.ImportAttribute: {
|
|
2285
|
+
return this.createNode(node, {
|
|
2286
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportAttribute,
|
|
2287
|
+
key: this.convertChild(node.name),
|
|
2288
|
+
value: this.convertChild(node.value)
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
case SyntaxKind.SatisfiesExpression: {
|
|
2292
|
+
return this.createNode(node, {
|
|
2293
|
+
type: ts_estree_1.AST_NODE_TYPES.TSSatisfiesExpression,
|
|
2294
|
+
expression: this.convertChild(node.expression),
|
|
2295
|
+
typeAnnotation: this.convertChild(node.type)
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
default:
|
|
2299
|
+
return this.deeplyCopy(node);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
createNode(node, data) {
|
|
2303
|
+
const result = data;
|
|
2304
|
+
result.range ??= (0, node_utils_1.getRange)(node, this.ast);
|
|
2305
|
+
result.loc ??= (0, node_utils_1.getLocFor)(result.range, this.ast);
|
|
2306
|
+
if (result && this.options.shouldPreserveNodeMaps) {
|
|
2307
|
+
this.esTreeNodeToTSNodeMap.set(result, node);
|
|
2308
|
+
}
|
|
2309
|
+
return result;
|
|
2310
|
+
}
|
|
2311
|
+
convertProgram() {
|
|
2312
|
+
return this.converter(this.ast);
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* For nodes that are copied directly from the TypeScript AST into
|
|
2316
|
+
* ESTree mostly as-is. The only difference is the addition of a type
|
|
2317
|
+
* property instead of a kind property. Recursively copies all children.
|
|
2318
|
+
*/
|
|
2319
|
+
deeplyCopy(node) {
|
|
2320
|
+
if (node.kind === ts.SyntaxKind.JSDocFunctionType) {
|
|
2321
|
+
this.#throwError(node, "JSDoc types can only be used inside documentation comments.");
|
|
2322
|
+
}
|
|
2323
|
+
const customType = `TS${SyntaxKind[node.kind]}`;
|
|
2324
|
+
if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) {
|
|
2325
|
+
throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`);
|
|
2326
|
+
}
|
|
2327
|
+
const result = this.createNode(node, {
|
|
2328
|
+
type: customType
|
|
2329
|
+
});
|
|
2330
|
+
if ("type" in node) {
|
|
2331
|
+
result.typeAnnotation = node.type && "kind" in node.type && ts.isTypeNode(node.type) ? this.convertTypeAnnotation(node.type, node) : null;
|
|
2332
|
+
}
|
|
2333
|
+
if ("typeArguments" in node) {
|
|
2334
|
+
result.typeArguments = node.typeArguments && "pos" in node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) : null;
|
|
2335
|
+
}
|
|
2336
|
+
if ("typeParameters" in node) {
|
|
2337
|
+
result.typeParameters = node.typeParameters && "pos" in node.typeParameters ? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) : null;
|
|
2338
|
+
}
|
|
2339
|
+
const decorators = (0, getModifiers_1.getDecorators)(node);
|
|
2340
|
+
if (decorators?.length) {
|
|
2341
|
+
result.decorators = this.convertChildren(decorators);
|
|
2342
|
+
}
|
|
2343
|
+
const KEYS_TO_NOT_COPY = /* @__PURE__ */ new Set([
|
|
2344
|
+
"_children",
|
|
2345
|
+
"decorators",
|
|
2346
|
+
"end",
|
|
2347
|
+
"flags",
|
|
2348
|
+
"heritageClauses",
|
|
2349
|
+
"illegalDecorators",
|
|
2350
|
+
"jsDoc",
|
|
2351
|
+
"kind",
|
|
2352
|
+
"locals",
|
|
2353
|
+
"localSymbol",
|
|
2354
|
+
"modifierFlagsCache",
|
|
2355
|
+
"modifiers",
|
|
2356
|
+
"nextContainer",
|
|
2357
|
+
"parent",
|
|
2358
|
+
"pos",
|
|
2359
|
+
"symbol",
|
|
2360
|
+
"transformFlags",
|
|
2361
|
+
"type",
|
|
2362
|
+
"typeArguments",
|
|
2363
|
+
"typeParameters"
|
|
2364
|
+
]);
|
|
2365
|
+
Object.entries(node).filter(([key]) => !KEYS_TO_NOT_COPY.has(key)).forEach(([key, value]) => {
|
|
2366
|
+
if (Array.isArray(value)) {
|
|
2367
|
+
result[key] = this.convertChildren(value);
|
|
2368
|
+
} else if (value && typeof value === "object" && value.kind) {
|
|
2369
|
+
result[key] = this.convertChild(value);
|
|
2370
|
+
} else {
|
|
2371
|
+
result[key] = value;
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
return result;
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Fixes the exports of the given ts.Node
|
|
2378
|
+
* @returns the ESTreeNode with fixed exports
|
|
2379
|
+
*/
|
|
2380
|
+
fixExports(node, result) {
|
|
2381
|
+
const isNamespaceNode = ts.isModuleDeclaration(node) && !ts.isStringLiteral(node.name);
|
|
2382
|
+
const modifiers = isNamespaceNode ? (0, node_utils_1.getNamespaceModifiers)(node) : (0, getModifiers_1.getModifiers)(node);
|
|
2383
|
+
if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) {
|
|
2384
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
2385
|
+
const exportKeyword = modifiers[0];
|
|
2386
|
+
const nextModifier = modifiers[1];
|
|
2387
|
+
const declarationIsDefault = nextModifier?.kind === SyntaxKind.DefaultKeyword;
|
|
2388
|
+
const varToken = declarationIsDefault ? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast) : (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast);
|
|
2389
|
+
result.range[0] = varToken.getStart(this.ast);
|
|
2390
|
+
result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast);
|
|
2391
|
+
if (declarationIsDefault) {
|
|
2392
|
+
return this.createNode(node, {
|
|
2393
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration,
|
|
2394
|
+
range: [exportKeyword.getStart(this.ast), result.range[1]],
|
|
2395
|
+
declaration: result,
|
|
2396
|
+
exportKind: "value"
|
|
2397
|
+
});
|
|
2398
|
+
}
|
|
2399
|
+
const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration || result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration;
|
|
2400
|
+
const isDeclare = "declare" in result && result.declare;
|
|
2401
|
+
return this.createNode(
|
|
2402
|
+
node,
|
|
2403
|
+
// @ts-expect-error - TODO, narrow the types here
|
|
2404
|
+
this.#withDeprecatedAliasGetter({
|
|
2405
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
|
|
2406
|
+
range: [exportKeyword.getStart(this.ast), result.range[1]],
|
|
2407
|
+
attributes: [],
|
|
2408
|
+
declaration: result,
|
|
2409
|
+
exportKind: isType || isDeclare ? "type" : "value",
|
|
2410
|
+
source: null,
|
|
2411
|
+
specifiers: []
|
|
2412
|
+
}, "assertions", "attributes", true)
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
return result;
|
|
2416
|
+
}
|
|
2417
|
+
getASTMaps() {
|
|
2418
|
+
return {
|
|
2419
|
+
esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap,
|
|
2420
|
+
tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap
|
|
2421
|
+
};
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* Register specific TypeScript node into map with first ESTree node provided
|
|
2425
|
+
*/
|
|
2426
|
+
registerTSNodeInNodeMap(node, result) {
|
|
2427
|
+
if (result && this.options.shouldPreserveNodeMaps && !this.tsNodeToESTreeNodeMap.has(node)) {
|
|
2428
|
+
this.tsNodeToESTreeNodeMap.set(node, result);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
convert.Converter = Converter;
|
|
2433
|
+
return convert;
|
|
2434
|
+
}
|
|
2435
|
+
export {
|
|
2436
|
+
requireConvert as __require
|
|
2437
|
+
};
|
|
2438
|
+
//# sourceMappingURL=convert.js.map
|