From cca3e3bcedc18285d4810348ee8aa967a9b45e02 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:55:10 +0000 Subject: [PATCH 1/5] Initial plan From 1eb0ef1ff05de0aefdb9e8b09aa223710d73c767 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:02:04 +0000 Subject: [PATCH 2/5] Update dependencies and add SaveSystem and AchievementSystem Co-authored-by: MiChaelinzo <68110223+MiChaelinzo@users.noreply.github.com> --- framework/systems/AchievementSystem.js | 446 + framework/systems/AudioSystem.js | 230 + framework/utils/SaveSystem.js | 317 + node_modules/.bin/acorn | 16 - node_modules/.bin/baseline-browser-mapping | 17 +- node_modules/.bin/browserslist | 17 +- node_modules/.bin/create-jest | 16 - node_modules/.bin/escodegen | 16 - node_modules/.bin/esgenerate | 16 - node_modules/.bin/glob | 1 + node_modules/.bin/jest | 17 +- node_modules/.bin/napi-postinstall | 1 + node_modules/.bin/resolve | 16 - node_modules/.bin/tldts | 1 + node_modules/.bin/update-browserslist-db | 17 +- node_modules/.package-lock.json | 2796 +++-- node_modules/@asamuzakjp/css-color/LICENSE | 21 + node_modules/@asamuzakjp/css-color/README.md | 316 + .../css-color/dist/browser/css-color.min.js | 220 + .../dist/browser/css-color.min.js.map | 1 + .../@asamuzakjp/css-color/dist/cjs/index.cjs | 5484 +++++++++ .../css-color/dist/cjs/index.cjs.map | 1 + .../css-color/dist/cjs/index.d.cts | 109 + .../@asamuzakjp/css-color/dist/esm/index.d.ts | 18 + .../@asamuzakjp/css-color/dist/esm/index.js | 30 + .../css-color/dist/esm/index.js.map | 1 + .../css-color/dist/esm/js/cache.d.ts | 44 + .../css-color/dist/esm/js/cache.js | 82 + .../css-color/dist/esm/js/cache.js.map | 1 + .../css-color/dist/esm/js/color.d.ts | 537 + .../css-color/dist/esm/js/color.js | 2792 +++++ .../css-color/dist/esm/js/color.js.map | 1 + .../css-color/dist/esm/js/common.d.ts | 21 + .../css-color/dist/esm/js/common.js | 7 + .../css-color/dist/esm/js/common.js.map | 1 + .../css-color/dist/esm/js/constant.d.ts | 41 + .../css-color/dist/esm/js/constant.js | 97 + .../css-color/dist/esm/js/constant.js.map | 1 + .../css-color/dist/esm/js/convert.d.ts | 99 + .../css-color/dist/esm/js/convert.js | 361 + .../css-color/dist/esm/js/convert.js.map | 1 + .../css-color/dist/esm/js/css-calc.d.ts | 89 + .../css-color/dist/esm/js/css-calc.js | 860 ++ .../css-color/dist/esm/js/css-calc.js.map | 1 + .../css-color/dist/esm/js/css-gradient.d.ts | 54 + .../css-color/dist/esm/js/css-gradient.js | 195 + .../css-color/dist/esm/js/css-gradient.js.map | 1 + .../css-color/dist/esm/js/css-var.d.ts | 31 + .../css-color/dist/esm/js/css-var.js | 195 + .../css-color/dist/esm/js/css-var.js.map | 1 + .../css-color/dist/esm/js/relative-color.d.ts | 29 + .../css-color/dist/esm/js/relative-color.js | 487 + .../dist/esm/js/relative-color.js.map | 1 + .../css-color/dist/esm/js/resolve.d.ts | 52 + .../css-color/dist/esm/js/resolve.js | 288 + .../css-color/dist/esm/js/resolve.js.map | 1 + .../css-color/dist/esm/js/typedef.d.ts | 79 + .../css-color/dist/esm/js/util.d.ts | 45 + .../@asamuzakjp/css-color/dist/esm/js/util.js | 279 + .../css-color/dist/esm/js/util.js.map | 1 + .../css-color/node_modules/lru-cache/LICENSE | 15 + .../node_modules/lru-cache/README.md | 331 + .../lru-cache/dist/commonjs/index.d.ts | 1277 ++ .../lru-cache/dist/commonjs/index.d.ts.map | 1 + .../lru-cache/dist/commonjs/index.js | 1546 +++ .../lru-cache/dist/commonjs/index.js.map | 1 + .../lru-cache/dist/commonjs/index.min.js | 2 + .../lru-cache/dist/commonjs/index.min.js.map | 7 + .../lru-cache/dist/commonjs/package.json | 3 + .../lru-cache/dist/esm/index.d.ts | 1277 ++ .../lru-cache/dist/esm/index.d.ts.map | 1 + .../node_modules/lru-cache/dist/esm/index.js | 1542 +++ .../lru-cache/dist/esm/index.js.map | 1 + .../lru-cache/dist/esm/index.min.js | 2 + .../lru-cache/dist/esm/index.min.js.map | 7 + .../lru-cache/dist}/esm/package.json | 0 .../node_modules/lru-cache/package.json | 116 + .../@asamuzakjp/css-color/package.json | 81 + .../@asamuzakjp/css-color/src/index.ts | 27 + .../@asamuzakjp/css-color/src/js/cache.ts | 114 + .../@asamuzakjp/css-color/src/js/color.ts | 3459 ++++++ .../@asamuzakjp/css-color/src/js/common.ts | 31 + .../@asamuzakjp/css-color/src/js/constant.ts | 66 + .../@asamuzakjp/css-color/src/js/convert.ts | 469 + .../@asamuzakjp/css-color/src/js/css-calc.ts | 965 ++ .../css-color/src/js/css-gradient.ts | 289 + .../@asamuzakjp/css-color/src/js/css-var.ts | 250 + .../css-color/src/js/relative-color.ts | 580 + .../@asamuzakjp/css-color/src/js/resolve.ts | 379 + .../@asamuzakjp/css-color/src/js/typedef.ts | 87 + .../@asamuzakjp/css-color/src/js/util.ts | 336 + .../@csstools/color-helpers/CHANGELOG.md | 10 + .../@csstools/color-helpers/LICENSE.md | 18 + .../@csstools/color-helpers/README.md | 32 + .../@csstools/color-helpers/dist/index.cjs | 263 + .../@csstools/color-helpers/dist/index.d.ts | 429 + .../@csstools/color-helpers/dist/index.mjs | 263 + .../@csstools/color-helpers/package.json | 62 + node_modules/@csstools/css-calc/CHANGELOG.md | 10 + node_modules/@csstools/css-calc/LICENSE.md | 20 + node_modules/@csstools/css-calc/README.md | 132 + .../@csstools/css-calc/dist/index.cjs | 1 + .../@csstools/css-calc/dist/index.d.ts | 71 + .../@csstools/css-calc/dist/index.mjs | 1 + node_modules/@csstools/css-calc/package.json | 66 + .../@csstools/css-color-parser/CHANGELOG.md | 13 + .../@csstools/css-color-parser/LICENSE.md | 20 + .../@csstools/css-color-parser/README.md | 37 + .../@csstools/css-color-parser/dist/index.cjs | 1 + .../css-color-parser/dist/index.d.ts | 168 + .../@csstools/css-color-parser/dist/index.mjs | 1 + .../@csstools/css-color-parser/package.json | 71 + .../css-parser-algorithms/CHANGELOG.md | 9 + .../css-parser-algorithms/LICENSE.md | 20 + .../@csstools/css-parser-algorithms/README.md | 119 + .../css-parser-algorithms/dist/index.cjs | 1 + .../css-parser-algorithms/dist/index.d.ts | 604 + .../css-parser-algorithms/dist/index.mjs | 1 + .../css-parser-algorithms/package.json | 65 + .../@csstools/css-tokenizer/CHANGELOG.md | 9 + .../@csstools/css-tokenizer/LICENSE.md | 20 + .../@csstools/css-tokenizer/README.md | 111 + .../@csstools/css-tokenizer/dist/index.cjs | 1 + .../@csstools/css-tokenizer/dist/index.d.ts | 593 + .../@csstools/css-tokenizer/dist/index.mjs | 1 + .../@csstools/css-tokenizer/package.json | 62 + node_modules/@isaacs/cliui/LICENSE.txt | 14 + node_modules/@isaacs/cliui/README.md | 143 + node_modules/@isaacs/cliui/build/index.cjs | 317 + node_modules/@isaacs/cliui/build/index.d.cts | 43 + node_modules/@isaacs/cliui/build/lib/index.js | 302 + node_modules/@isaacs/cliui/index.mjs | 14 + node_modules/@isaacs/cliui/package.json | 86 + node_modules/@jest/console/LICENSE | 1 + .../@jest/console/build/BufferedConsole.js | 197 - .../@jest/console/build/CustomConsole.js | 182 - .../@jest/console/build/NullConsole.js | 35 - .../@jest/console/build/getConsoleOutput.js | 70 - node_modules/@jest/console/build/index.d.mts | 105 + node_modules/@jest/console/build/index.d.ts | 10 +- node_modules/@jest/console/build/index.js | 521 +- node_modules/@jest/console/build/index.mjs | 6 + node_modules/@jest/console/build/types.js | 1 - node_modules/@jest/console/package.json | 18 +- node_modules/@jest/core/LICENSE | 1 + .../@jest/core/build/FailedTestsCache.js | 46 - .../core/build/FailedTestsInteractiveMode.js | 195 - .../@jest/core/build/ReporterDispatcher.js | 87 - node_modules/@jest/core/build/SearchSource.js | 408 - .../core/build/SnapshotInteractiveMode.js | 238 - .../@jest/core/build/TestNamePatternPrompt.js | 39 - .../@jest/core/build/TestPathPatternPrompt.js | 39 - .../@jest/core/build/TestScheduler.js | 463 - node_modules/@jest/core/build/cli/index.js | 417 - .../@jest/core/build/collectHandles.js | 266 - .../core/build/getChangedFilesPromise.js | 65 - .../core/build/getConfigsOfProjectsToRun.js | 40 - .../@jest/core/build/getNoTestFound.js | 80 - .../@jest/core/build/getNoTestFoundFailed.js | 43 - .../build/getNoTestFoundPassWithNoTests.js | 26 - .../getNoTestFoundRelatedToChangedFiles.js | 48 - .../@jest/core/build/getNoTestFoundVerbose.js | 91 - .../core/build/getNoTestsFoundMessage.js | 64 - .../@jest/core/build/getProjectDisplayName.js | 16 - .../build/getProjectNamesMissingWarning.js | 49 - .../core/build/getSelectProjectsMessage.js | 71 - node_modules/@jest/core/build/index.d.mts | 82 + node_modules/@jest/core/build/index.d.ts | 32 +- node_modules/@jest/core/build/index.js | 4142 ++++++- node_modules/@jest/core/build/index.mjs | 6 + .../core/build/lib/activeFiltersMessage.js | 52 - .../@jest/core/build/lib/createContext.js | 31 - .../build/lib/handleDeprecationWarnings.js | 65 - .../@jest/core/build/lib/isValidPath.js | 26 - .../@jest/core/build/lib/logDebugMessages.js | 24 - .../core/build/lib/updateGlobalConfig.js | 95 - .../core/build/lib/watchPluginsHelpers.js | 56 - .../build/plugins/FailedTestsInteractive.js | 96 - node_modules/@jest/core/build/plugins/Quit.js | 42 - .../core/build/plugins/TestNamePattern.js | 70 - .../core/build/plugins/TestPathPattern.js | 70 - .../core/build/plugins/UpdateSnapshots.js | 51 - .../plugins/UpdateSnapshotsInteractive.js | 99 - .../@jest/core/build/runGlobalHook.js | 133 - node_modules/@jest/core/build/runJest.js | 391 - .../@jest/core/build/testSchedulerHelper.js | 57 - node_modules/@jest/core/build/types.js | 1 - node_modules/@jest/core/build/version.js | 18 - node_modules/@jest/core/build/watch.js | 666 - node_modules/@jest/core/package.json | 71 +- node_modules/@jest/diff-sequences/LICENSE | 22 + node_modules/@jest/diff-sequences/README.md | 404 + .../@jest/diff-sequences/build/index.d.ts | 39 + .../@jest/diff-sequences/build/index.js | 637 + .../@jest/diff-sequences/build/index.mjs | 3 + .../@jest/diff-sequences/package.json | 41 + .../@jest/environment-jsdom-abstract/LICENSE | 22 + .../build/index.d.mts | 31 + .../build/index.d.ts | 47 + .../environment-jsdom-abstract/build/index.js | 203 + .../build/index.mjs | 3 + .../environment-jsdom-abstract/package.json | 50 + node_modules/@jest/environment/LICENSE | 1 + .../@jest/environment/build/index.d.mts | 397 + .../@jest/environment/build/index.d.ts | 60 +- node_modules/@jest/environment/build/index.js | 16 +- .../environment/build/index.mjs} | 0 node_modules/@jest/environment/package.json | 12 +- node_modules/@jest/expect-utils/LICENSE | 1 + .../expect-utils/build/immutableUtils.js | 66 - .../@jest/expect-utils/build/index.d.mts | 35 + .../@jest/expect-utils/build/index.d.ts | 5 +- .../@jest/expect-utils/build/index.js | 693 +- .../@jest/expect-utils/build/index.mjs | 17 + .../@jest/expect-utils/build/jasmineUtils.js | 218 - .../@jest/expect-utils/build/types.js | 1 - .../@jest/expect-utils/build/utils.js | 462 - node_modules/@jest/expect-utils/package.json | 16 +- node_modules/@jest/expect/LICENSE | 1 + node_modules/@jest/expect/build/index.d.mts | 43 + node_modules/@jest/expect/build/index.d.ts | 34 +- node_modules/@jest/expect/build/index.js | 35 +- node_modules/@jest/expect/build/index.mjs | 3 + node_modules/@jest/expect/build/types.js | 1 - node_modules/@jest/expect/package.json | 16 +- node_modules/@jest/fake-timers/LICENSE | 1 + .../@jest/fake-timers/build/index.d.mts | 107 + .../@jest/fake-timers/build/index.d.ts | 9 +- node_modules/@jest/fake-timers/build/index.js | 728 +- .../@jest/fake-timers/build/index.mjs | 4 + .../fake-timers/build/legacyFakeTimers.js | 545 - .../fake-timers/build/modernFakeTimers.js | 191 - node_modules/@jest/fake-timers/package.json | 22 +- node_modules/@jest/get-type/LICENSE | 22 + node_modules/@jest/get-type/build/index.d.mts | 12 + node_modules/@jest/get-type/build/index.d.ts | 30 + node_modules/@jest/get-type/build/index.js | 70 + node_modules/@jest/get-type/build/index.mjs | 4 + node_modules/@jest/get-type/package.json | 29 + node_modules/@jest/globals/LICENSE | 1 + node_modules/@jest/globals/build/index.js | 20 +- node_modules/@jest/globals/package.json | 14 +- node_modules/@jest/pattern/LICENSE | 22 + node_modules/@jest/pattern/README.md | 3 + node_modules/@jest/pattern/api-extractor.json | 5 + node_modules/@jest/pattern/build/index.d.ts | 65 + node_modules/@jest/pattern/build/index.js | 214 + node_modules/@jest/pattern/build/index.mjs | 4 + node_modules/@jest/pattern/package.json | 32 + .../@jest/pattern/src/TestPathPatterns.ts | 132 + .../src/__tests__/TestPathPatterns.test.ts | 259 + .../TestPathPatterns.test.ts.snap | 5 + node_modules/@jest/pattern/src/index.ts | 12 + node_modules/@jest/pattern/tsconfig.json | 10 + node_modules/@jest/reporters/LICENSE | 1 + .../@jest/reporters/build/BaseReporter.js | 48 - .../@jest/reporters/build/CoverageReporter.js | 561 - .../reporters/build/CoverageWorker.d.mts | 43 + .../@jest/reporters/build/CoverageWorker.js | 233 +- .../@jest/reporters/build/CoverageWorker.mjs | 67 + .../@jest/reporters/build/DefaultReporter.js | 229 - .../reporters/build/GitHubActionsReporter.js | 381 - .../@jest/reporters/build/NotifyReporter.js | 218 - node_modules/@jest/reporters/build/Status.js | 214 - .../@jest/reporters/build/SummaryReporter.js | 239 - .../@jest/reporters/build/VerboseReporter.js | 175 - .../@jest/reporters/build/formatTestPath.js | 84 - .../reporters/build/generateEmptyCoverage.js | 151 - .../@jest/reporters/build/getResultHeader.js | 65 - .../reporters/build/getSnapshotStatus.js | 92 - .../reporters/build/getSnapshotSummary.js | 169 - .../@jest/reporters/build/getSummary.js | 206 - .../@jest/reporters/build/getWatermarks.js | 38 - .../@jest/reporters/build/index.d.mts | 209 + node_modules/@jest/reporters/build/index.d.ts | 35 +- node_modules/@jest/reporters/build/index.js | 2522 +++- node_modules/@jest/reporters/build/index.mjs | 10 + .../@jest/reporters/build/printDisplayName.js | 35 - .../@jest/reporters/build/relativePath.js | 72 - .../reporters/build/trimAndFormatPath.js | 118 - node_modules/@jest/reporters/build/types.js | 1 - .../@jest/reporters/build/wrapAnsiString.js | 69 - node_modules/@jest/reporters/package.json | 66 +- node_modules/@jest/schemas/LICENSE | 1 + node_modules/@jest/schemas/build/index.d.mts | 202 + node_modules/@jest/schemas/build/index.d.ts | 413 +- node_modules/@jest/schemas/build/index.js | 360 +- node_modules/@jest/schemas/build/index.mjs | 5 + node_modules/@jest/schemas/package.json | 10 +- node_modules/@jest/snapshot-utils/LICENSE | 22 + .../@jest/snapshot-utils/api-extractor.json | 5 + .../@jest/snapshot-utils/build/index.d.mts | 29 + .../@jest/snapshot-utils/build/index.d.ts | 42 + .../@jest/snapshot-utils/build/index.js | 227 + .../@jest/snapshot-utils/build/index.mjs | 12 + .../@jest/snapshot-utils/package.json | 38 + .../src/__tests__/utils.test.ts | 239 + .../@jest/snapshot-utils/src/index.ts | 9 + .../@jest/snapshot-utils/src/types.ts | 8 + .../@jest/snapshot-utils/src/utils.ts | 200 + .../@jest/snapshot-utils/tsconfig.json | 10 + node_modules/@jest/source-map/LICENSE | 1 + .../@jest/source-map/build/getCallsite.js | 85 - .../@jest/source-map/build/index.d.ts | 3 +- node_modules/@jest/source-map/build/index.js | 148 +- node_modules/@jest/source-map/build/index.mjs | 3 + node_modules/@jest/source-map/build/types.js | 1 - node_modules/@jest/source-map/package.json | 16 +- node_modules/@jest/test-result/LICENSE | 1 + .../test-result/build/formatTestResults.js | 69 - .../@jest/test-result/build/helpers.js | 175 - .../@jest/test-result/build/index.d.mts | 189 + .../@jest/test-result/build/index.d.ts | 45 +- node_modules/@jest/test-result/build/index.js | 324 +- .../@jest/test-result/build/index.mjs | 7 + node_modules/@jest/test-result/build/types.js | 1 - node_modules/@jest/test-result/package.json | 20 +- node_modules/@jest/test-sequencer/LICENSE | 1 + .../@jest/test-sequencer/build/index.d.mts | 81 + .../@jest/test-sequencer/build/index.d.ts | 12 +- .../@jest/test-sequencer/build/index.js | 176 +- .../@jest/test-sequencer/build/index.mjs | 3 + .../@jest/test-sequencer/package.json | 18 +- node_modules/@jest/transform/LICENSE | 1 + .../transform/build/ScriptTransformer.js | 1000 -- .../build/enhanceUnexpectedTokenMessage.js | 76 - .../@jest/transform/build/index.d.mts | 139 + node_modules/@jest/transform/build/index.d.ts | 6 +- node_modules/@jest/transform/build/index.js | 1095 +- node_modules/@jest/transform/build/index.mjs | 6 + .../build/runtimeErrorsAndWarnings.js | 94 - .../@jest/transform/build/shouldInstrument.js | 177 - node_modules/@jest/transform/build/types.js | 1 - node_modules/@jest/transform/package.json | 46 +- node_modules/@jest/types/LICENSE | 1 + node_modules/@jest/types/README.md | 2 +- node_modules/@jest/types/build/Circus.js | 1 - node_modules/@jest/types/build/Config.js | 1 - node_modules/@jest/types/build/Global.js | 1 - node_modules/@jest/types/build/TestResult.js | 1 - node_modules/@jest/types/build/Transform.js | 1 - node_modules/@jest/types/build/index.d.mts | 812 ++ node_modules/@jest/types/build/index.d.ts | 252 +- node_modules/@jest/types/build/index.js | 16 +- .../main.js => @jest/types/build/index.mjs} | 0 node_modules/@jest/types/package.json | 21 +- node_modules/@pkgjs/parseargs/.editorconfig | 14 + node_modules/@pkgjs/parseargs/CHANGELOG.md | 147 + node_modules/@pkgjs/parseargs/LICENSE | 201 + node_modules/@pkgjs/parseargs/README.md | 413 + .../parseargs/examples/is-default-value.js | 25 + .../parseargs/examples/limit-long-syntax.js | 35 + .../@pkgjs/parseargs/examples/negate.js | 43 + .../parseargs/examples/no-repeated-options.js | 31 + .../parseargs/examples/ordered-options.mjs | 41 + .../parseargs/examples/simple-hard-coded.js | 26 + node_modules/@pkgjs/parseargs/index.js | 396 + .../@pkgjs/parseargs/internal/errors.js | 47 + .../@pkgjs/parseargs/internal/primordials.js | 393 + .../@pkgjs/parseargs/internal/util.js | 14 + .../@pkgjs/parseargs/internal/validators.js | 89 + node_modules/@pkgjs/parseargs/package.json | 36 + node_modules/@pkgjs/parseargs/utils.js | 198 + node_modules/@pkgr/core/index.d.cts | 3 + node_modules/@pkgr/core/lib/constants.d.ts | 8 + node_modules/@pkgr/core/lib/constants.js | 9 + node_modules/@pkgr/core/lib/constants.js.map | 1 + node_modules/@pkgr/core/lib/helpers.d.ts | 5 + node_modules/@pkgr/core/lib/helpers.js | 45 + node_modules/@pkgr/core/lib/helpers.js.map | 1 + node_modules/@pkgr/core/lib/index.cjs | 65 + node_modules/@pkgr/core/lib/index.d.ts | 2 + node_modules/@pkgr/core/lib/index.js | 3 + node_modules/@pkgr/core/lib/index.js.map | 1 + node_modules/@pkgr/core/package.json | 38 + .../typebox/build/cjs/compiler/compiler.d.ts | 55 + .../typebox/build/cjs/compiler/compiler.js | 669 ++ .../typebox/build/cjs/compiler/index.d.ts | 2 + .../typebox/build/cjs/compiler/index.js | 22 + .../typebox/build/cjs/errors/errors.d.ts | 91 + .../typebox/build/cjs/errors/errors.js | 599 + .../typebox/build/cjs/errors/function.d.ts | 21 + .../typebox/build/cjs/errors/function.js | 153 + .../typebox/build/cjs/errors/index.d.ts | 2 + .../typebox/build/cjs/errors/index.js | 19 + .../@sinclair/typebox/build/cjs/index.d.ts | 71 + .../@sinclair/typebox/build/cjs/index.js | 97 + .../typebox/build/cjs/parser/index.d.ts | 2 + .../typebox/build/cjs/parser/index.js | 39 + .../build/cjs/parser/runtime/guard.d.ts | 23 + .../typebox/build/cjs/parser/runtime/guard.js | 86 + .../build/cjs/parser/runtime/index.d.ts | 5 + .../typebox/build/cjs/parser/runtime/index.js | 45 + .../build/cjs/parser/runtime/module.d.ts | 9 + .../build/cjs/parser/runtime/module.js | 22 + .../build/cjs/parser/runtime/parse.d.ts | 9 + .../typebox/build/cjs/parser/runtime/parse.js | 160 + .../build/cjs/parser/runtime/token.d.ts | 8 + .../typebox/build/cjs/parser/runtime/token.js | 230 + .../build/cjs/parser/runtime/types.d.ts | 98 + .../typebox/build/cjs/parser/runtime/types.js | 71 + .../build/cjs/parser/static/index.d.ts | 3 + .../typebox/build/cjs/parser/static/index.js | 43 + .../build/cjs/parser/static/parse.d.ts | 20 + .../typebox/build/cjs/parser/static/parse.js | 3 + .../build/cjs/parser/static/token.d.ts | 108 + .../typebox/build/cjs/parser/static/token.js | 3 + .../build/cjs/parser/static/types.d.ts | 69 + .../typebox/build/cjs/parser/static/types.js | 3 + .../typebox/build/cjs/syntax/index.d.ts | 1 + .../typebox/build/cjs/syntax/index.js | 18 + .../typebox/build/cjs/syntax/mapping.d.ts | 167 + .../typebox/build/cjs/syntax/mapping.js | 491 + .../typebox/build/cjs/syntax/parser.d.ts | 162 + .../typebox/build/cjs/syntax/parser.js | 191 + .../typebox/build/cjs/syntax/syntax.d.ts | 12 + .../typebox/build/cjs/syntax/syntax.js | 54 + .../typebox/build/cjs/system/index.d.ts | 2 + .../typebox/build/cjs/system/index.js | 19 + .../typebox/build/cjs/system/policy.d.ts | 29 + .../typebox/build/cjs/system/policy.js | 58 + .../typebox/build/cjs/system/system.d.ts | 16 + .../typebox/build/cjs/system/system.js | 43 + .../typebox/build/cjs/type/any/any.d.ts | 8 + .../typebox/build/cjs/type/any/any.js | 10 + .../typebox/build/cjs/type/any/index.d.ts | 1 + .../typebox/build/cjs/type/any/index.js | 18 + .../build/cjs/type/argument/argument.d.ts | 9 + .../build/cjs/type/argument/argument.js | 10 + .../build/cjs/type/argument/index.d.ts | 1 + .../typebox/build/cjs/type/argument/index.js | 18 + .../typebox/build/cjs/type/array/array.d.ts | 28 + .../typebox/build/cjs/type/array/array.js | 10 + .../typebox/build/cjs/type/array/index.d.ts | 1 + .../typebox/build/cjs/type/array/index.js | 18 + .../type/async-iterator/async-iterator.d.ts | 11 + .../cjs/type/async-iterator/async-iterator.js | 10 + .../build/cjs/type/async-iterator/index.d.ts | 1 + .../build/cjs/type/async-iterator/index.js | 18 + .../build/cjs/type/awaited/awaited.d.ts | 14 + .../typebox/build/cjs/type/awaited/awaited.js | 41 + .../typebox/build/cjs/type/awaited/index.d.ts | 1 + .../typebox/build/cjs/type/awaited/index.js | 18 + .../typebox/build/cjs/type/bigint/bigint.d.ts | 16 + .../typebox/build/cjs/type/bigint/bigint.js | 10 + .../typebox/build/cjs/type/bigint/index.d.ts | 1 + .../typebox/build/cjs/type/bigint/index.js | 18 + .../build/cjs/type/boolean/boolean.d.ts | 9 + .../typebox/build/cjs/type/boolean/boolean.js | 10 + .../typebox/build/cjs/type/boolean/index.d.ts | 1 + .../typebox/build/cjs/type/boolean/index.js | 18 + .../typebox/build/cjs/type/clone/index.d.ts | 2 + .../typebox/build/cjs/type/clone/index.js | 19 + .../typebox/build/cjs/type/clone/type.d.ts | 5 + .../typebox/build/cjs/type/clone/type.js | 14 + .../typebox/build/cjs/type/clone/value.d.ts | 2 + .../typebox/build/cjs/type/clone/value.js | 73 + .../build/cjs/type/composite/composite.d.ts | 18 + .../build/cjs/type/composite/composite.js | 46 + .../build/cjs/type/composite/index.d.ts | 1 + .../typebox/build/cjs/type/composite/index.js | 18 + .../build/cjs/type/computed/computed.d.ts | 9 + .../build/cjs/type/computed/computed.js | 10 + .../build/cjs/type/computed/index.d.ts | 1 + .../typebox/build/cjs/type/computed/index.js | 18 + .../typebox/build/cjs/type/const/const.d.ts | 27 + .../typebox/build/cjs/type/const/const.js | 58 + .../typebox/build/cjs/type/const/index.d.ts | 1 + .../typebox/build/cjs/type/const/index.js | 18 + .../constructor-parameters.d.ts | 7 + .../constructor-parameters.js | 44 + .../type/constructor-parameters/index.d.ts | 1 + .../cjs/type/constructor-parameters/index.js | 18 + .../cjs/type/constructor/constructor.d.ts | 23 + .../build/cjs/type/constructor/constructor.js | 10 + .../build/cjs/type/constructor/index.d.ts | 1 + .../build/cjs/type/constructor/index.js | 18 + .../build/cjs/type/create/immutable.d.ts | 2 + .../build/cjs/type/create/immutable.js | 70 + .../typebox/build/cjs/type/create/index.d.ts | 1 + .../typebox/build/cjs/type/create/index.js | 18 + .../typebox/build/cjs/type/create/type.d.ts | 3 + .../typebox/build/cjs/type/create/type.js | 19 + .../typebox/build/cjs/type/date/date.d.ts | 21 + .../typebox/build/cjs/type/date/date.js | 10 + .../typebox/build/cjs/type/date/index.d.ts | 1 + .../typebox/build/cjs/type/date/index.js | 18 + .../build/cjs/type/discard/discard.d.ts | 2 + .../typebox/build/cjs/type/discard/discard.js | 12 + .../typebox/build/cjs/type/discard/index.d.ts | 1 + .../typebox/build/cjs/type/discard/index.js | 18 + .../typebox/build/cjs/type/enum/enum.d.ts | 14 + .../typebox/build/cjs/type/enum/enum.js | 22 + .../typebox/build/cjs/type/enum/index.d.ts | 1 + .../typebox/build/cjs/type/enum/index.js | 18 + .../typebox/build/cjs/type/error/error.d.ts | 4 + .../typebox/build/cjs/type/error/error.js | 11 + .../typebox/build/cjs/type/error/index.d.ts | 1 + .../typebox/build/cjs/type/error/index.js | 18 + .../exclude/exclude-from-mapped-result.d.ts | 11 + .../exclude/exclude-from-mapped-result.js | 22 + .../exclude-from-template-literal.d.ts | 5 + .../exclude/exclude-from-template-literal.js | 9 + .../build/cjs/type/exclude/exclude.d.ts | 21 + .../typebox/build/cjs/type/exclude/exclude.js | 29 + .../typebox/build/cjs/type/exclude/index.d.ts | 3 + .../typebox/build/cjs/type/exclude/index.js | 20 + .../build/cjs/type/extends/extends-check.d.ts | 10 + .../build/cjs/type/extends/extends-check.js | 641 + .../type/extends/extends-from-mapped-key.d.ts | 14 + .../type/extends/extends-from-mapped-key.js | 29 + .../extends/extends-from-mapped-result.d.ts | 11 + .../extends/extends-from-mapped-result.js | 23 + .../cjs/type/extends/extends-undefined.d.ts | 3 + .../cjs/type/extends/extends-undefined.js | 24 + .../build/cjs/type/extends/extends.d.ts | 16 + .../typebox/build/cjs/type/extends/extends.js | 27 + .../typebox/build/cjs/type/extends/index.d.ts | 5 + .../typebox/build/cjs/type/extends/index.js | 22 + .../extract/extract-from-mapped-result.d.ts | 11 + .../extract/extract-from-mapped-result.js | 22 + .../extract-from-template-literal.d.ts | 5 + .../extract/extract-from-template-literal.js | 9 + .../build/cjs/type/extract/extract.d.ts | 21 + .../typebox/build/cjs/type/extract/extract.js | 29 + .../typebox/build/cjs/type/extract/index.d.ts | 3 + .../typebox/build/cjs/type/extract/index.js | 20 + .../build/cjs/type/function/function.d.ts | 23 + .../build/cjs/type/function/function.js | 10 + .../build/cjs/type/function/index.d.ts | 1 + .../typebox/build/cjs/type/function/index.js | 18 + .../typebox/build/cjs/type/guard/index.d.ts | 3 + .../typebox/build/cjs/type/guard/index.js | 40 + .../typebox/build/cjs/type/guard/kind.d.ts | 147 + .../typebox/build/cjs/type/guard/kind.js | 320 + .../typebox/build/cjs/type/guard/type.d.ts | 152 + .../typebox/build/cjs/type/guard/type.js | 597 + .../typebox/build/cjs/type/guard/value.d.ts | 34 + .../typebox/build/cjs/type/guard/value.js | 89 + .../build/cjs/type/helpers/helpers.d.ts | 42 + .../typebox/build/cjs/type/helpers/helpers.js | 8 + .../typebox/build/cjs/type/helpers/index.d.ts | 1 + .../typebox/build/cjs/type/helpers/index.js | 18 + .../typebox/build/cjs/type/index.d.ts | 71 + .../@sinclair/typebox/build/cjs/type/index.js | 88 + .../typebox/build/cjs/type/indexed/index.d.ts | 4 + .../typebox/build/cjs/type/indexed/index.js | 21 + .../type/indexed/indexed-from-mapped-key.d.ts | 13 + .../type/indexed/indexed-from-mapped-key.js | 26 + .../indexed/indexed-from-mapped-result.d.ts | 12 + .../indexed/indexed-from-mapped-result.js | 24 + .../type/indexed/indexed-property-keys.d.ts | 14 + .../cjs/type/indexed/indexed-property-keys.js | 36 + .../build/cjs/type/indexed/indexed.d.ts | 52 + .../typebox/build/cjs/type/indexed/indexed.js | 98 + .../build/cjs/type/instance-type/index.d.ts | 1 + .../build/cjs/type/instance-type/index.js | 18 + .../cjs/type/instance-type/instance-type.d.ts | 6 + .../cjs/type/instance-type/instance-type.js | 44 + .../build/cjs/type/instantiate/index.d.ts | 1 + .../build/cjs/type/instantiate/index.js | 18 + .../cjs/type/instantiate/instantiate.d.ts | 50 + .../build/cjs/type/instantiate/instantiate.js | 153 + .../typebox/build/cjs/type/integer/index.d.ts | 1 + .../typebox/build/cjs/type/integer/index.js | 18 + .../build/cjs/type/integer/integer.d.ts | 16 + .../typebox/build/cjs/type/integer/integer.js | 10 + .../build/cjs/type/intersect/index.d.ts | 3 + .../typebox/build/cjs/type/intersect/index.js | 20 + .../cjs/type/intersect/intersect-create.d.ts | 3 + .../cjs/type/intersect/intersect-create.js | 23 + .../type/intersect/intersect-evaluated.d.ts | 13 + .../cjs/type/intersect/intersect-evaluated.js | 42 + .../cjs/type/intersect/intersect-type.d.ts | 15 + .../cjs/type/intersect/intersect-type.js | 4 + .../build/cjs/type/intersect/intersect.d.ts | 6 + .../build/cjs/type/intersect/intersect.js | 21 + .../build/cjs/type/intrinsic/capitalize.d.ts | 5 + .../build/cjs/type/intrinsic/capitalize.js | 9 + .../build/cjs/type/intrinsic/index.d.ts | 6 + .../typebox/build/cjs/type/intrinsic/index.js | 23 + .../intrinsic/intrinsic-from-mapped-key.d.ts | 14 + .../intrinsic/intrinsic-from-mapped-key.js | 30 + .../build/cjs/type/intrinsic/intrinsic.d.ts | 16 + .../build/cjs/type/intrinsic/intrinsic.js | 68 + .../build/cjs/type/intrinsic/lowercase.d.ts | 5 + .../build/cjs/type/intrinsic/lowercase.js | 9 + .../cjs/type/intrinsic/uncapitalize.d.ts | 5 + .../build/cjs/type/intrinsic/uncapitalize.js | 9 + .../build/cjs/type/intrinsic/uppercase.d.ts | 5 + .../build/cjs/type/intrinsic/uppercase.js | 9 + .../build/cjs/type/iterator/index.d.ts | 1 + .../typebox/build/cjs/type/iterator/index.js | 18 + .../build/cjs/type/iterator/iterator.d.ts | 11 + .../build/cjs/type/iterator/iterator.js | 10 + .../typebox/build/cjs/type/keyof/index.d.ts | 4 + .../typebox/build/cjs/type/keyof/index.js | 21 + .../type/keyof/keyof-from-mapped-result.d.ts | 12 + .../type/keyof/keyof-from-mapped-result.js | 23 + .../type/keyof/keyof-property-entries.d.ts | 7 + .../cjs/type/keyof/keyof-property-entries.js | 16 + .../cjs/type/keyof/keyof-property-keys.d.ts | 24 + .../cjs/type/keyof/keyof-property-keys.js | 78 + .../typebox/build/cjs/type/keyof/keyof.d.ts | 21 + .../typebox/build/cjs/type/keyof/keyof.js | 40 + .../typebox/build/cjs/type/literal/index.d.ts | 1 + .../typebox/build/cjs/type/literal/index.js | 18 + .../build/cjs/type/literal/literal.d.ts | 10 + .../typebox/build/cjs/type/literal/literal.js | 14 + .../typebox/build/cjs/type/mapped/index.d.ts | 3 + .../typebox/build/cjs/type/mapped/index.js | 20 + .../build/cjs/type/mapped/mapped-key.d.ts | 8 + .../build/cjs/type/mapped/mapped-key.js | 13 + .../build/cjs/type/mapped/mapped-result.d.ts | 9 + .../build/cjs/type/mapped/mapped-result.js | 13 + .../typebox/build/cjs/type/mapped/mapped.d.ts | 47 + .../typebox/build/cjs/type/mapped/mapped.js | 107 + .../build/cjs/type/module/compute.d.ts | 59 + .../typebox/build/cjs/type/module/compute.js | 205 + .../typebox/build/cjs/type/module/index.d.ts | 1 + .../typebox/build/cjs/type/module/index.js | 18 + .../typebox/build/cjs/type/module/infer.d.ts | 49 + .../typebox/build/cjs/type/module/infer.js | 3 + .../typebox/build/cjs/type/module/module.d.ts | 27 + .../typebox/build/cjs/type/module/module.js | 38 + .../typebox/build/cjs/type/never/index.d.ts | 1 + .../typebox/build/cjs/type/never/index.js | 18 + .../typebox/build/cjs/type/never/never.d.ts | 9 + .../typebox/build/cjs/type/never/never.js | 10 + .../typebox/build/cjs/type/not/index.d.ts | 1 + .../typebox/build/cjs/type/not/index.js | 18 + .../typebox/build/cjs/type/not/not.d.ts | 10 + .../typebox/build/cjs/type/not/not.js | 10 + .../typebox/build/cjs/type/null/index.d.ts | 1 + .../typebox/build/cjs/type/null/index.js | 18 + .../typebox/build/cjs/type/null/null.d.ts | 9 + .../typebox/build/cjs/type/null/null.js | 10 + .../typebox/build/cjs/type/number/index.d.ts | 1 + .../typebox/build/cjs/type/number/index.js | 18 + .../typebox/build/cjs/type/number/number.d.ts | 16 + .../typebox/build/cjs/type/number/number.js | 10 + .../typebox/build/cjs/type/object/index.d.ts | 1 + .../typebox/build/cjs/type/object/index.js | 18 + .../typebox/build/cjs/type/object/object.d.ts | 48 + .../typebox/build/cjs/type/object/object.js | 22 + .../typebox/build/cjs/type/omit/index.d.ts | 3 + .../typebox/build/cjs/type/omit/index.js | 20 + .../cjs/type/omit/omit-from-mapped-key.d.ts | 12 + .../cjs/type/omit/omit-from-mapped-key.js | 26 + .../type/omit/omit-from-mapped-result.d.ts | 12 + .../cjs/type/omit/omit-from-mapped-result.js | 23 + .../typebox/build/cjs/type/omit/omit.d.ts | 36 + .../typebox/build/cjs/type/omit/omit.js | 75 + .../build/cjs/type/optional/index.d.ts | 2 + .../typebox/build/cjs/type/optional/index.js | 19 + .../optional/optional-from-mapped-result.d.ts | 10 + .../optional/optional-from-mapped-result.js | 22 + .../build/cjs/type/optional/optional.d.ts | 20 + .../build/cjs/type/optional/optional.js | 26 + .../build/cjs/type/parameters/index.d.ts | 1 + .../build/cjs/type/parameters/index.js | 18 + .../build/cjs/type/parameters/parameters.d.ts | 7 + .../build/cjs/type/parameters/parameters.js | 44 + .../typebox/build/cjs/type/partial/index.d.ts | 2 + .../typebox/build/cjs/type/partial/index.js | 19 + .../partial/partial-from-mapped-result.d.ts | 12 + .../partial/partial-from-mapped-result.js | 23 + .../build/cjs/type/partial/partial.d.ts | 35 + .../typebox/build/cjs/type/partial/partial.js | 111 + .../build/cjs/type/patterns/index.d.ts | 1 + .../typebox/build/cjs/type/patterns/index.js | 18 + .../build/cjs/type/patterns/patterns.d.ts | 8 + .../build/cjs/type/patterns/patterns.js | 12 + .../typebox/build/cjs/type/pick/index.d.ts | 3 + .../typebox/build/cjs/type/pick/index.js | 20 + .../cjs/type/pick/pick-from-mapped-key.d.ts | 12 + .../cjs/type/pick/pick-from-mapped-key.js | 28 + .../type/pick/pick-from-mapped-result.d.ts | 12 + .../cjs/type/pick/pick-from-mapped-result.js | 23 + .../typebox/build/cjs/type/pick/pick.d.ts | 36 + .../typebox/build/cjs/type/pick/pick.js | 70 + .../typebox/build/cjs/type/promise/index.d.ts | 1 + .../typebox/build/cjs/type/promise/index.js | 18 + .../build/cjs/type/promise/promise.d.ts | 11 + .../typebox/build/cjs/type/promise/promise.js | 10 + .../cjs/type/readonly-optional/index.d.ts | 1 + .../build/cjs/type/readonly-optional/index.js | 18 + .../readonly-optional/readonly-optional.d.ts | 6 + .../readonly-optional/readonly-optional.js | 10 + .../build/cjs/type/readonly/index.d.ts | 2 + .../typebox/build/cjs/type/readonly/index.js | 19 + .../readonly/readonly-from-mapped-result.d.ts | 10 + .../readonly/readonly-from-mapped-result.js | 22 + .../build/cjs/type/readonly/readonly.d.ts | 20 + .../build/cjs/type/readonly/readonly.js | 26 + .../typebox/build/cjs/type/record/index.d.ts | 1 + .../typebox/build/cjs/type/record/index.js | 18 + .../typebox/build/cjs/type/record/record.d.ts | 71 + .../typebox/build/cjs/type/record/record.js | 123 + .../build/cjs/type/recursive/index.d.ts | 1 + .../typebox/build/cjs/type/recursive/index.js | 18 + .../build/cjs/type/recursive/recursive.d.ts | 16 + .../build/cjs/type/recursive/recursive.js | 19 + .../typebox/build/cjs/type/ref/index.d.ts | 1 + .../typebox/build/cjs/type/ref/index.js | 18 + .../typebox/build/cjs/type/ref/ref.d.ts | 41 + .../typebox/build/cjs/type/ref/ref.js | 14 + .../typebox/build/cjs/type/regexp/index.d.ts | 1 + .../typebox/build/cjs/type/regexp/index.js | 18 + .../typebox/build/cjs/type/regexp/regexp.d.ts | 20 + .../typebox/build/cjs/type/regexp/regexp.js | 12 + .../build/cjs/type/registry/format.d.ts | 13 + .../typebox/build/cjs/type/registry/format.js | 35 + .../build/cjs/type/registry/index.d.ts | 2 + .../typebox/build/cjs/type/registry/index.js | 39 + .../typebox/build/cjs/type/registry/type.d.ts | 13 + .../typebox/build/cjs/type/registry/type.js | 35 + .../build/cjs/type/required/index.d.ts | 2 + .../typebox/build/cjs/type/required/index.js | 19 + .../required/required-from-mapped-result.d.ts | 12 + .../required/required-from-mapped-result.js | 22 + .../build/cjs/type/required/required.d.ts | 35 + .../build/cjs/type/required/required.js | 110 + .../typebox/build/cjs/type/rest/index.d.ts | 1 + .../typebox/build/cjs/type/rest/index.js | 18 + .../typebox/build/cjs/type/rest/rest.d.ts | 10 + .../typebox/build/cjs/type/rest/rest.js | 19 + .../build/cjs/type/return-type/index.d.ts | 1 + .../build/cjs/type/return-type/index.js | 18 + .../cjs/type/return-type/return-type.d.ts | 6 + .../build/cjs/type/return-type/return-type.js | 44 + .../build/cjs/type/schema/anyschema.d.ts | 33 + .../build/cjs/type/schema/anyschema.js | 3 + .../typebox/build/cjs/type/schema/index.d.ts | 2 + .../typebox/build/cjs/type/schema/index.js | 19 + .../typebox/build/cjs/type/schema/schema.d.ts | 29 + .../typebox/build/cjs/type/schema/schema.js | 4 + .../typebox/build/cjs/type/sets/index.d.ts | 1 + .../typebox/build/cjs/type/sets/index.js | 18 + .../typebox/build/cjs/type/sets/set.d.ts | 28 + .../typebox/build/cjs/type/sets/set.js | 59 + .../typebox/build/cjs/type/static/index.d.ts | 1 + .../typebox/build/cjs/type/static/index.js | 18 + .../typebox/build/cjs/type/static/static.d.ts | 39 + .../typebox/build/cjs/type/static/static.js | 3 + .../typebox/build/cjs/type/string/index.d.ts | 1 + .../typebox/build/cjs/type/string/index.js | 18 + .../typebox/build/cjs/type/string/string.d.ts | 25 + .../typebox/build/cjs/type/string/string.js | 10 + .../typebox/build/cjs/type/symbol/index.d.ts | 1 + .../typebox/build/cjs/type/symbol/index.js | 18 + .../typebox/build/cjs/type/symbol/symbol.d.ts | 10 + .../typebox/build/cjs/type/symbol/symbol.js | 10 + .../typebox/build/cjs/type/symbols/index.d.ts | 1 + .../typebox/build/cjs/type/symbols/index.js | 18 + .../build/cjs/type/symbols/symbols.d.ts | 10 + .../typebox/build/cjs/type/symbols/symbols.js | 14 + .../cjs/type/template-literal/finite.d.ts | 19 + .../build/cjs/type/template-literal/finite.js | 56 + .../cjs/type/template-literal/generate.d.ts | 21 + .../cjs/type/template-literal/generate.js | 60 + .../cjs/type/template-literal/index.d.ts | 7 + .../build/cjs/type/template-literal/index.js | 24 + .../cjs/type/template-literal/parse.d.ts | 20 + .../build/cjs/type/template-literal/parse.js | 174 + .../cjs/type/template-literal/pattern.d.ts | 5 + .../cjs/type/template-literal/pattern.js | 39 + .../cjs/type/template-literal/syntax.d.ts | 20 + .../build/cjs/type/template-literal/syntax.js | 59 + .../template-literal/template-literal.d.ts | 30 + .../type/template-literal/template-literal.js | 17 + .../cjs/type/template-literal/union.d.ts | 9 + .../build/cjs/type/template-literal/union.js | 13 + .../build/cjs/type/transform/index.d.ts | 1 + .../typebox/build/cjs/type/transform/index.js | 18 + .../build/cjs/type/transform/transform.d.ts | 30 + .../build/cjs/type/transform/transform.js | 47 + .../typebox/build/cjs/type/tuple/index.d.ts | 1 + .../typebox/build/cjs/type/tuple/index.js | 18 + .../typebox/build/cjs/type/tuple/tuple.d.ts | 16 + .../typebox/build/cjs/type/tuple/tuple.js | 13 + .../typebox/build/cjs/type/type/index.d.ts | 6 + .../typebox/build/cjs/type/type/index.js | 51 + .../build/cjs/type/type/javascript.d.ts | 64 + .../typebox/build/cjs/type/type/javascript.js | 104 + .../typebox/build/cjs/type/type/json.d.ts | 208 + .../typebox/build/cjs/type/type/json.js | 226 + .../typebox/build/cjs/type/type/type.d.ts | 59 + .../typebox/build/cjs/type/type/type.js | 129 + .../build/cjs/type/uint8array/index.d.ts | 1 + .../build/cjs/type/uint8array/index.js | 18 + .../build/cjs/type/uint8array/uint8array.d.ts | 13 + .../build/cjs/type/uint8array/uint8array.js | 10 + .../build/cjs/type/undefined/index.d.ts | 1 + .../typebox/build/cjs/type/undefined/index.js | 18 + .../build/cjs/type/undefined/undefined.d.ts | 9 + .../build/cjs/type/undefined/undefined.js | 10 + .../typebox/build/cjs/type/union/index.d.ts | 3 + .../typebox/build/cjs/type/union/index.js | 20 + .../build/cjs/type/union/union-create.d.ts | 3 + .../build/cjs/type/union/union-create.js | 9 + .../build/cjs/type/union/union-evaluated.d.ts | 13 + .../build/cjs/type/union/union-evaluated.js | 40 + .../build/cjs/type/union/union-type.d.ts | 12 + .../build/cjs/type/union/union-type.js | 4 + .../typebox/build/cjs/type/union/union.d.ts | 6 + .../typebox/build/cjs/type/union/union.js | 14 + .../typebox/build/cjs/type/unknown/index.d.ts | 1 + .../typebox/build/cjs/type/unknown/index.js | 18 + .../build/cjs/type/unknown/unknown.d.ts | 8 + .../typebox/build/cjs/type/unknown/unknown.js | 10 + .../typebox/build/cjs/type/unsafe/index.d.ts | 1 + .../typebox/build/cjs/type/unsafe/index.js | 18 + .../typebox/build/cjs/type/unsafe/unsafe.d.ts | 11 + .../typebox/build/cjs/type/unsafe/unsafe.js | 10 + .../typebox/build/cjs/type/void/index.d.ts | 1 + .../typebox/build/cjs/type/void/index.js | 18 + .../typebox/build/cjs/type/void/void.d.ts | 9 + .../typebox/build/cjs/type/void/void.js | 10 + .../build/cjs/value/assert/assert.d.ts | 15 + .../typebox/build/cjs/value/assert/assert.js | 55 + .../typebox/build/cjs/value/assert/index.d.ts | 1 + .../typebox/build/cjs/value/assert/index.js | 18 + .../typebox/build/cjs/value/cast/cast.d.ts | 11 + .../typebox/build/cjs/value/cast/cast.js | 241 + .../typebox/build/cjs/value/cast/index.d.ts | 1 + .../typebox/build/cjs/value/cast/index.js | 18 + .../typebox/build/cjs/value/check/check.d.ts | 11 + .../typebox/build/cjs/value/check/check.js | 475 + .../typebox/build/cjs/value/check/index.d.ts | 1 + .../typebox/build/cjs/value/check/index.js | 18 + .../typebox/build/cjs/value/clean/clean.d.ts | 5 + .../typebox/build/cjs/value/clean/clean.js | 149 + .../typebox/build/cjs/value/clean/index.d.ts | 1 + .../typebox/build/cjs/value/clean/index.js | 18 + .../typebox/build/cjs/value/clone/clone.d.ts | 2 + .../typebox/build/cjs/value/clone/clone.js | 60 + .../typebox/build/cjs/value/clone/index.d.ts | 1 + .../typebox/build/cjs/value/clone/index.js | 18 + .../build/cjs/value/convert/convert.d.ts | 5 + .../build/cjs/value/convert/convert.js | 264 + .../build/cjs/value/convert/index.d.ts | 1 + .../typebox/build/cjs/value/convert/index.js | 18 + .../build/cjs/value/create/create.d.ts | 11 + .../typebox/build/cjs/value/create/create.js | 474 + .../typebox/build/cjs/value/create/index.d.ts | 1 + .../typebox/build/cjs/value/create/index.js | 18 + .../build/cjs/value/decode/decode.d.ts | 6 + .../typebox/build/cjs/value/decode/decode.js | 14 + .../typebox/build/cjs/value/decode/index.d.ts | 1 + .../typebox/build/cjs/value/decode/index.js | 18 + .../build/cjs/value/default/default.d.ts | 5 + .../build/cjs/value/default/default.js | 176 + .../build/cjs/value/default/index.d.ts | 1 + .../typebox/build/cjs/value/default/index.js | 18 + .../typebox/build/cjs/value/delta/delta.d.ts | 32 + .../typebox/build/cjs/value/delta/delta.js | 178 + .../typebox/build/cjs/value/delta/index.d.ts | 1 + .../typebox/build/cjs/value/delta/index.js | 18 + .../typebox/build/cjs/value/deref/deref.d.ts | 12 + .../typebox/build/cjs/value/deref/deref.js | 36 + .../typebox/build/cjs/value/deref/index.d.ts | 1 + .../typebox/build/cjs/value/deref/index.js | 18 + .../build/cjs/value/encode/encode.d.ts | 6 + .../typebox/build/cjs/value/encode/encode.js | 15 + .../typebox/build/cjs/value/encode/index.d.ts | 1 + .../typebox/build/cjs/value/encode/index.js | 18 + .../typebox/build/cjs/value/equal/equal.d.ts | 2 + .../typebox/build/cjs/value/equal/equal.js | 50 + .../typebox/build/cjs/value/equal/index.d.ts | 1 + .../typebox/build/cjs/value/equal/index.js | 18 + .../typebox/build/cjs/value/guard/guard.d.ts | 74 + .../typebox/build/cjs/value/guard/guard.js | 195 + .../typebox/build/cjs/value/guard/index.d.ts | 1 + .../typebox/build/cjs/value/guard/index.js | 18 + .../typebox/build/cjs/value/hash/hash.d.ts | 7 + .../typebox/build/cjs/value/hash/hash.js | 152 + .../typebox/build/cjs/value/hash/index.d.ts | 1 + .../typebox/build/cjs/value/hash/index.js | 18 + .../typebox/build/cjs/value/index.d.ts | 20 + .../typebox/build/cjs/value/index.js | 53 + .../typebox/build/cjs/value/mutate/index.d.ts | 1 + .../typebox/build/cjs/value/mutate/index.js | 18 + .../build/cjs/value/mutate/mutate.d.ts | 9 + .../typebox/build/cjs/value/mutate/mutate.js | 104 + .../typebox/build/cjs/value/parse/index.d.ts | 1 + .../typebox/build/cjs/value/parse/index.js | 18 + .../typebox/build/cjs/value/parse/parse.d.ts | 22 + .../typebox/build/cjs/value/parse/parse.js | 87 + .../build/cjs/value/pointer/index.d.ts | 1 + .../typebox/build/cjs/value/pointer/index.js | 38 + .../build/cjs/value/pointer/pointer.d.ts | 22 + .../build/cjs/value/pointer/pointer.js | 126 + .../build/cjs/value/transform/decode.d.ts | 22 + .../build/cjs/value/transform/decode.js | 214 + .../build/cjs/value/transform/encode.d.ts | 23 + .../build/cjs/value/transform/encode.js | 225 + .../build/cjs/value/transform/has.d.ts | 3 + .../typebox/build/cjs/value/transform/has.js | 133 + .../build/cjs/value/transform/index.d.ts | 3 + .../build/cjs/value/transform/index.js | 20 + .../typebox/build/cjs/value/value/index.d.ts | 1 + .../typebox/build/cjs/value/value/index.js | 38 + .../typebox/build/cjs/value/value/value.d.ts | 16 + .../typebox/build/cjs/value/value/value.js | 39 + .../typebox/build/esm/compiler/compiler.d.mts | 55 + .../typebox/build/esm/compiler/compiler.mjs | 662 + .../typebox/build/esm/compiler/index.d.mts | 2 + .../typebox/build/esm/compiler/index.mjs | 2 + .../typebox/build/esm/errors/errors.d.mts | 91 + .../typebox/build/esm/errors/errors.mjs | 592 + .../typebox/build/esm/errors/function.d.mts | 21 + .../typebox/build/esm/errors/function.mjs | 147 + .../typebox/build/esm/errors/index.d.mts | 2 + .../typebox/build/esm/errors/index.mjs | 2 + .../@sinclair/typebox/build/esm/index.d.mts | 71 + .../@sinclair/typebox/build/esm/index.mjs | 80 + .../typebox/build/esm/parser/index.d.mts | 2 + .../typebox/build/esm/parser/index.mjs | 2 + .../build/esm/parser/runtime/guard.d.mts | 23 + .../build/esm/parser/runtime/guard.mjs | 72 + .../build/esm/parser/runtime/index.d.mts | 5 + .../build/esm/parser/runtime/index.mjs | 5 + .../build/esm/parser/runtime/module.d.mts | 9 + .../build/esm/parser/runtime/module.mjs | 17 + .../build/esm/parser/runtime/parse.d.mts | 9 + .../build/esm/parser/runtime/parse.mjs | 123 + .../build/esm/parser/runtime/token.d.mts | 8 + .../build/esm/parser/runtime/token.mjs | 223 + .../build/esm/parser/runtime/types.d.mts | 98 + .../build/esm/parser/runtime/types.mjs | 55 + .../build/esm/parser/static/index.d.mts | 3 + .../typebox/build/esm/parser/static/index.mjs | 3 + .../build/esm/parser/static/parse.d.mts | 20 + .../build/esm/parser/static/parse.mjs} | 0 .../build/esm/parser/static/token.d.mts | 108 + .../build/esm/parser/static/token.mjs} | 0 .../build/esm/parser/static/types.d.mts | 69 + .../build/esm/parser/static/types.mjs} | 0 .../typebox/build/esm/syntax/index.d.mts | 1 + .../typebox/build/esm/syntax/index.mjs | 1 + .../typebox/build/esm/syntax/mapping.d.mts | 167 + .../typebox/build/esm/syntax/mapping.mjs | 386 + .../typebox/build/esm/syntax/parser.d.mts | 162 + .../typebox/build/esm/syntax/parser.mjs | 78 + .../typebox/build/esm/syntax/syntax.d.mts | 12 + .../typebox/build/esm/syntax/syntax.mjs | 16 + .../typebox/build/esm/system/index.d.mts | 2 + .../typebox/build/esm/system/index.mjs | 2 + .../typebox/build/esm/system/policy.d.mts | 29 + .../typebox/build/esm/system/policy.mjs | 54 + .../typebox/build/esm/system/system.d.mts | 16 + .../typebox/build/esm/system/system.mjs | 37 + .../typebox/build/esm/type/any/any.d.mts | 8 + .../typebox/build/esm/type/any/any.mjs | 6 + .../typebox/build/esm/type/any/index.d.mts | 1 + .../typebox/build/esm/type/any/index.mjs | 1 + .../build/esm/type/argument/argument.d.mts | 9 + .../build/esm/type/argument/argument.mjs | 6 + .../build/esm/type/argument/index.d.mts | 1 + .../typebox/build/esm/type/argument/index.mjs | 1 + .../typebox/build/esm/type/array/array.d.mts | 28 + .../typebox/build/esm/type/array/array.mjs | 6 + .../typebox/build/esm/type/array/index.d.mts | 1 + .../typebox/build/esm/type/array/index.mjs | 1 + .../type/async-iterator/async-iterator.d.mts | 11 + .../type/async-iterator/async-iterator.mjs | 6 + .../build/esm/type/async-iterator/index.d.mts | 1 + .../build/esm/type/async-iterator/index.mjs | 1 + .../build/esm/type/awaited/awaited.d.mts | 14 + .../build/esm/type/awaited/awaited.mjs | 37 + .../build/esm/type/awaited/index.d.mts | 1 + .../typebox/build/esm/type/awaited/index.mjs | 1 + .../build/esm/type/bigint/bigint.d.mts | 16 + .../typebox/build/esm/type/bigint/bigint.mjs | 6 + .../typebox/build/esm/type/bigint/index.d.mts | 1 + .../typebox/build/esm/type/bigint/index.mjs | 1 + .../build/esm/type/boolean/boolean.d.mts | 9 + .../build/esm/type/boolean/boolean.mjs | 6 + .../build/esm/type/boolean/index.d.mts | 1 + .../typebox/build/esm/type/boolean/index.mjs | 1 + .../typebox/build/esm/type/clone/index.d.mts | 2 + .../typebox/build/esm/type/clone/index.mjs | 2 + .../typebox/build/esm/type/clone/type.d.mts | 5 + .../typebox/build/esm/type/clone/type.mjs | 9 + .../typebox/build/esm/type/clone/value.d.mts | 2 + .../typebox/build/esm/type/clone/value.mjs | 36 + .../build/esm/type/composite/composite.d.mts | 18 + .../build/esm/type/composite/composite.mjs | 42 + .../build/esm/type/composite/index.d.mts | 1 + .../build/esm/type/composite/index.mjs | 1 + .../build/esm/type/computed/computed.d.mts | 9 + .../build/esm/type/computed/computed.mjs | 6 + .../build/esm/type/computed/index.d.mts | 1 + .../typebox/build/esm/type/computed/index.mjs | 1 + .../typebox/build/esm/type/const/const.d.mts | 27 + .../typebox/build/esm/type/const/const.mjs | 54 + .../typebox/build/esm/type/const/index.d.mts | 1 + .../typebox/build/esm/type/const/index.mjs | 1 + .../constructor-parameters.d.mts | 7 + .../constructor-parameters.mjs | 7 + .../type/constructor-parameters/index.d.mts | 1 + .../esm/type/constructor-parameters/index.mjs | 1 + .../esm/type/constructor/constructor.d.mts | 23 + .../esm/type/constructor/constructor.mjs | 6 + .../build/esm/type/constructor/index.d.mts | 1 + .../build/esm/type/constructor/index.mjs | 1 + .../build/esm/type/create/immutable.d.mts | 2 + .../build/esm/type/create/immutable.mjs | 33 + .../typebox/build/esm/type/create/index.d.mts | 1 + .../typebox/build/esm/type/create/index.mjs | 1 + .../typebox/build/esm/type/create/type.d.mts | 3 + .../typebox/build/esm/type/create/type.mjs | 15 + .../typebox/build/esm/type/date/date.d.mts | 21 + .../typebox/build/esm/type/date/date.mjs | 6 + .../typebox/build/esm/type/date/index.d.mts | 1 + .../typebox/build/esm/type/date/index.mjs | 1 + .../build/esm/type/discard/discard.d.mts | 2 + .../build/esm/type/discard/discard.mjs | 8 + .../build/esm/type/discard/index.d.mts | 1 + .../typebox/build/esm/type/discard/index.mjs | 1 + .../typebox/build/esm/type/enum/enum.d.mts | 14 + .../typebox/build/esm/type/enum/enum.mjs | 18 + .../typebox/build/esm/type/enum/index.d.mts | 1 + .../typebox/build/esm/type/enum/index.mjs | 1 + .../typebox/build/esm/type/error/error.d.mts | 4 + .../typebox/build/esm/type/error/error.mjs | 6 + .../typebox/build/esm/type/error/index.d.mts | 1 + .../typebox/build/esm/type/error/index.mjs | 1 + .../exclude/exclude-from-mapped-result.d.mts | 11 + .../exclude/exclude-from-mapped-result.mjs | 18 + .../exclude-from-template-literal.d.mts | 5 + .../exclude/exclude-from-template-literal.mjs | 5 + .../build/esm/type/exclude/exclude.d.mts | 21 + .../build/esm/type/exclude/exclude.mjs | 25 + .../build/esm/type/exclude/index.d.mts | 3 + .../typebox/build/esm/type/exclude/index.mjs | 3 + .../esm/type/extends/extends-check.d.mts | 10 + .../build/esm/type/extends/extends-check.mjs | 635 + .../extends/extends-from-mapped-key.d.mts | 14 + .../type/extends/extends-from-mapped-key.mjs | 25 + .../extends/extends-from-mapped-result.d.mts | 11 + .../extends/extends-from-mapped-result.mjs | 19 + .../esm/type/extends/extends-undefined.d.mts | 3 + .../esm/type/extends/extends-undefined.mjs | 20 + .../build/esm/type/extends/extends.d.mts | 16 + .../build/esm/type/extends/extends.mjs | 23 + .../build/esm/type/extends/index.d.mts | 5 + .../typebox/build/esm/type/extends/index.mjs | 5 + .../extract/extract-from-mapped-result.d.mts | 11 + .../extract/extract-from-mapped-result.mjs | 18 + .../extract-from-template-literal.d.mts | 5 + .../extract/extract-from-template-literal.mjs | 5 + .../build/esm/type/extract/extract.d.mts | 21 + .../build/esm/type/extract/extract.mjs | 25 + .../build/esm/type/extract/index.d.mts | 3 + .../typebox/build/esm/type/extract/index.mjs | 3 + .../build/esm/type/function/function.d.mts | 23 + .../build/esm/type/function/function.mjs | 6 + .../build/esm/type/function/index.d.mts | 1 + .../typebox/build/esm/type/function/index.mjs | 1 + .../typebox/build/esm/type/guard/index.d.mts | 3 + .../typebox/build/esm/type/guard/index.mjs | 3 + .../typebox/build/esm/type/guard/kind.d.mts | 147 + .../typebox/build/esm/type/guard/kind.mjs | 235 + .../typebox/build/esm/type/guard/type.d.mts | 152 + .../typebox/build/esm/type/guard/type.mjs | 509 + .../typebox/build/esm/type/guard/value.d.mts | 34 + .../typebox/build/esm/type/guard/value.mjs | 70 + .../build/esm/type/helpers/helpers.d.mts | 42 + .../build/esm/type/helpers/helpers.mjs | 4 + .../build/esm/type/helpers/index.d.mts | 1 + .../typebox/build/esm/type/helpers/index.mjs | 1 + .../typebox/build/esm/type/index.d.mts | 71 + .../typebox/build/esm/type/index.mjs | 71 + .../build/esm/type/indexed/index.d.mts | 4 + .../typebox/build/esm/type/indexed/index.mjs | 4 + .../indexed/indexed-from-mapped-key.d.mts | 13 + .../type/indexed/indexed-from-mapped-key.mjs | 22 + .../indexed/indexed-from-mapped-result.d.mts | 12 + .../indexed/indexed-from-mapped-result.mjs | 20 + .../type/indexed/indexed-property-keys.d.mts | 14 + .../type/indexed/indexed-property-keys.mjs | 32 + .../build/esm/type/indexed/indexed.d.mts | 52 + .../build/esm/type/indexed/indexed.mjs | 91 + .../build/esm/type/instance-type/index.d.mts | 1 + .../build/esm/type/instance-type/index.mjs | 1 + .../type/instance-type/instance-type.d.mts | 6 + .../esm/type/instance-type/instance-type.mjs | 7 + .../build/esm/type/instantiate/index.d.mts | 1 + .../build/esm/type/instantiate/index.mjs | 1 + .../esm/type/instantiate/instantiate.d.mts | 50 + .../esm/type/instantiate/instantiate.mjs | 115 + .../build/esm/type/integer/index.d.mts | 1 + .../typebox/build/esm/type/integer/index.mjs | 1 + .../build/esm/type/integer/integer.d.mts | 16 + .../build/esm/type/integer/integer.mjs | 6 + .../build/esm/type/intersect/index.d.mts | 3 + .../build/esm/type/intersect/index.mjs | 3 + .../esm/type/intersect/intersect-create.d.mts | 3 + .../esm/type/intersect/intersect-create.mjs | 19 + .../type/intersect/intersect-evaluated.d.mts | 13 + .../type/intersect/intersect-evaluated.mjs | 38 + .../esm/type/intersect/intersect-type.d.mts | 15 + .../esm/type/intersect/intersect-type.mjs | 1 + .../build/esm/type/intersect/intersect.d.mts | 6 + .../build/esm/type/intersect/intersect.mjs | 17 + .../build/esm/type/intrinsic/capitalize.d.mts | 5 + .../build/esm/type/intrinsic/capitalize.mjs | 5 + .../build/esm/type/intrinsic/index.d.mts | 6 + .../build/esm/type/intrinsic/index.mjs | 6 + .../intrinsic/intrinsic-from-mapped-key.d.mts | 14 + .../intrinsic/intrinsic-from-mapped-key.mjs | 26 + .../build/esm/type/intrinsic/intrinsic.d.mts | 16 + .../build/esm/type/intrinsic/intrinsic.mjs | 64 + .../build/esm/type/intrinsic/lowercase.d.mts | 5 + .../build/esm/type/intrinsic/lowercase.mjs | 5 + .../esm/type/intrinsic/uncapitalize.d.mts | 5 + .../build/esm/type/intrinsic/uncapitalize.mjs | 5 + .../build/esm/type/intrinsic/uppercase.d.mts | 5 + .../build/esm/type/intrinsic/uppercase.mjs | 5 + .../build/esm/type/iterator/index.d.mts | 1 + .../typebox/build/esm/type/iterator/index.mjs | 1 + .../build/esm/type/iterator/iterator.d.mts | 11 + .../build/esm/type/iterator/iterator.mjs | 6 + .../typebox/build/esm/type/keyof/index.d.mts | 4 + .../typebox/build/esm/type/keyof/index.mjs | 4 + .../type/keyof/keyof-from-mapped-result.d.mts | 12 + .../type/keyof/keyof-from-mapped-result.mjs | 19 + .../type/keyof/keyof-property-entries.d.mts | 7 + .../esm/type/keyof/keyof-property-entries.mjs | 12 + .../esm/type/keyof/keyof-property-keys.d.mts | 24 + .../esm/type/keyof/keyof-property-keys.mjs | 73 + .../typebox/build/esm/type/keyof/keyof.d.mts | 21 + .../typebox/build/esm/type/keyof/keyof.mjs | 35 + .../build/esm/type/literal/index.d.mts | 1 + .../typebox/build/esm/type/literal/index.mjs | 1 + .../build/esm/type/literal/literal.d.mts | 10 + .../build/esm/type/literal/literal.mjs | 10 + .../typebox/build/esm/type/mapped/index.d.mts | 3 + .../typebox/build/esm/type/mapped/index.mjs | 3 + .../build/esm/type/mapped/mapped-key.d.mts | 8 + .../build/esm/type/mapped/mapped-key.mjs | 9 + .../build/esm/type/mapped/mapped-result.d.mts | 9 + .../build/esm/type/mapped/mapped-result.mjs | 9 + .../build/esm/type/mapped/mapped.d.mts | 47 + .../typebox/build/esm/type/mapped/mapped.mjs | 102 + .../build/esm/type/module/compute.d.mts | 59 + .../typebox/build/esm/type/module/compute.mjs | 166 + .../typebox/build/esm/type/module/index.d.mts | 1 + .../typebox/build/esm/type/module/index.mjs | 1 + .../typebox/build/esm/type/module/infer.d.mts | 49 + .../typebox/build/esm/type/module/infer.mjs} | 0 .../build/esm/type/module/module.d.mts | 27 + .../typebox/build/esm/type/module/module.mjs | 32 + .../typebox/build/esm/type/never/index.d.mts | 1 + .../typebox/build/esm/type/never/index.mjs | 1 + .../typebox/build/esm/type/never/never.d.mts | 9 + .../typebox/build/esm/type/never/never.mjs | 6 + .../typebox/build/esm/type/not/index.d.mts | 1 + .../typebox/build/esm/type/not/index.mjs | 1 + .../typebox/build/esm/type/not/not.d.mts | 10 + .../typebox/build/esm/type/not/not.mjs | 6 + .../typebox/build/esm/type/null/index.d.mts | 1 + .../typebox/build/esm/type/null/index.mjs | 1 + .../typebox/build/esm/type/null/null.d.mts | 9 + .../typebox/build/esm/type/null/null.mjs | 6 + .../typebox/build/esm/type/number/index.d.mts | 1 + .../typebox/build/esm/type/number/index.mjs | 1 + .../build/esm/type/number/number.d.mts | 16 + .../typebox/build/esm/type/number/number.mjs | 6 + .../typebox/build/esm/type/object/index.d.mts | 1 + .../typebox/build/esm/type/object/index.mjs | 1 + .../build/esm/type/object/object.d.mts | 48 + .../typebox/build/esm/type/object/object.mjs | 18 + .../typebox/build/esm/type/omit/index.d.mts | 3 + .../typebox/build/esm/type/omit/index.mjs | 3 + .../esm/type/omit/omit-from-mapped-key.d.mts | 12 + .../esm/type/omit/omit-from-mapped-key.mjs | 22 + .../type/omit/omit-from-mapped-result.d.mts | 12 + .../esm/type/omit/omit-from-mapped-result.mjs | 19 + .../typebox/build/esm/type/omit/omit.d.mts | 36 + .../typebox/build/esm/type/omit/omit.mjs | 71 + .../build/esm/type/optional/index.d.mts | 2 + .../typebox/build/esm/type/optional/index.mjs | 2 + .../optional-from-mapped-result.d.mts | 10 + .../optional/optional-from-mapped-result.mjs | 18 + .../build/esm/type/optional/optional.d.mts | 20 + .../build/esm/type/optional/optional.mjs | 22 + .../build/esm/type/parameters/index.d.mts | 1 + .../build/esm/type/parameters/index.mjs | 1 + .../esm/type/parameters/parameters.d.mts | 7 + .../build/esm/type/parameters/parameters.mjs | 7 + .../build/esm/type/partial/index.d.mts | 2 + .../typebox/build/esm/type/partial/index.mjs | 2 + .../partial/partial-from-mapped-result.d.mts | 12 + .../partial/partial-from-mapped-result.mjs | 19 + .../build/esm/type/partial/partial.d.mts | 35 + .../build/esm/type/partial/partial.mjs | 74 + .../build/esm/type/patterns/index.d.mts | 1 + .../typebox/build/esm/type/patterns/index.mjs | 1 + .../build/esm/type/patterns/patterns.d.mts | 8 + .../build/esm/type/patterns/patterns.mjs | 8 + .../typebox/build/esm/type/pick/index.d.mts | 3 + .../typebox/build/esm/type/pick/index.mjs | 3 + .../esm/type/pick/pick-from-mapped-key.d.mts | 12 + .../esm/type/pick/pick-from-mapped-key.mjs | 24 + .../type/pick/pick-from-mapped-result.d.mts | 12 + .../esm/type/pick/pick-from-mapped-result.mjs | 19 + .../typebox/build/esm/type/pick/pick.d.mts | 36 + .../typebox/build/esm/type/pick/pick.mjs | 66 + .../build/esm/type/promise/index.d.mts | 1 + .../typebox/build/esm/type/promise/index.mjs | 1 + .../build/esm/type/promise/promise.d.mts | 11 + .../build/esm/type/promise/promise.mjs | 6 + .../esm/type/readonly-optional/index.d.mts | 1 + .../esm/type/readonly-optional/index.mjs | 1 + .../readonly-optional/readonly-optional.d.mts | 6 + .../readonly-optional/readonly-optional.mjs | 6 + .../build/esm/type/readonly/index.d.mts | 2 + .../typebox/build/esm/type/readonly/index.mjs | 2 + .../readonly-from-mapped-result.d.mts | 10 + .../readonly/readonly-from-mapped-result.mjs | 18 + .../build/esm/type/readonly/readonly.d.mts | 20 + .../build/esm/type/readonly/readonly.mjs | 22 + .../typebox/build/esm/type/record/index.d.mts | 1 + .../typebox/build/esm/type/record/index.mjs | 1 + .../build/esm/type/record/record.d.mts | 71 + .../typebox/build/esm/type/record/record.mjs | 116 + .../build/esm/type/recursive/index.d.mts | 1 + .../build/esm/type/recursive/index.mjs | 1 + .../build/esm/type/recursive/recursive.d.mts | 16 + .../build/esm/type/recursive/recursive.mjs | 15 + .../typebox/build/esm/type/ref/index.d.mts | 1 + .../typebox/build/esm/type/ref/index.mjs | 1 + .../typebox/build/esm/type/ref/ref.d.mts | 41 + .../typebox/build/esm/type/ref/ref.mjs | 10 + .../typebox/build/esm/type/regexp/index.d.mts | 1 + .../typebox/build/esm/type/regexp/index.mjs | 1 + .../build/esm/type/regexp/regexp.d.mts | 20 + .../typebox/build/esm/type/regexp/regexp.mjs | 8 + .../build/esm/type/registry/format.d.mts | 13 + .../build/esm/type/registry/format.mjs | 26 + .../build/esm/type/registry/index.d.mts | 2 + .../typebox/build/esm/type/registry/index.mjs | 2 + .../build/esm/type/registry/type.d.mts | 13 + .../typebox/build/esm/type/registry/type.mjs | 26 + .../build/esm/type/required/index.d.mts | 2 + .../typebox/build/esm/type/required/index.mjs | 2 + .../required-from-mapped-result.d.mts | 12 + .../required/required-from-mapped-result.mjs | 18 + .../build/esm/type/required/required.d.mts | 35 + .../build/esm/type/required/required.mjs | 73 + .../typebox/build/esm/type/rest/index.d.mts | 1 + .../typebox/build/esm/type/rest/index.mjs | 1 + .../typebox/build/esm/type/rest/rest.d.mts | 10 + .../typebox/build/esm/type/rest/rest.mjs | 15 + .../build/esm/type/return-type/index.d.mts | 1 + .../build/esm/type/return-type/index.mjs | 1 + .../esm/type/return-type/return-type.d.mts | 6 + .../esm/type/return-type/return-type.mjs | 7 + .../build/esm/type/schema/anyschema.d.mts | 33 + .../build/esm/type/schema/anyschema.mjs} | 0 .../typebox/build/esm/type/schema/index.d.mts | 2 + .../typebox/build/esm/type/schema/index.mjs | 2 + .../build/esm/type/schema/schema.d.mts | 29 + .../typebox/build/esm/type/schema/schema.mjs | 1 + .../typebox/build/esm/type/sets/index.d.mts | 1 + .../typebox/build/esm/type/sets/index.mjs | 1 + .../typebox/build/esm/type/sets/set.d.mts | 28 + .../typebox/build/esm/type/sets/set.mjs | 48 + .../typebox/build/esm/type/static/index.d.mts | 1 + .../typebox/build/esm/type/static/index.mjs | 1 + .../build/esm/type/static/static.d.mts | 39 + .../typebox/build/esm/type/static/static.mjs} | 0 .../typebox/build/esm/type/string/index.d.mts | 1 + .../typebox/build/esm/type/string/index.mjs | 1 + .../build/esm/type/string/string.d.mts | 25 + .../typebox/build/esm/type/string/string.mjs | 6 + .../typebox/build/esm/type/symbol/index.d.mts | 1 + .../typebox/build/esm/type/symbol/index.mjs | 1 + .../build/esm/type/symbol/symbol.d.mts | 10 + .../typebox/build/esm/type/symbol/symbol.mjs | 6 + .../build/esm/type/symbols/index.d.mts | 1 + .../typebox/build/esm/type/symbols/index.mjs | 1 + .../build/esm/type/symbols/symbols.d.mts | 10 + .../build/esm/type/symbols/symbols.mjs | 10 + .../esm/type/template-literal/finite.d.mts | 19 + .../esm/type/template-literal/finite.mjs | 49 + .../esm/type/template-literal/generate.d.mts | 21 + .../esm/type/template-literal/generate.mjs | 53 + .../esm/type/template-literal/index.d.mts | 7 + .../build/esm/type/template-literal/index.mjs | 7 + .../esm/type/template-literal/parse.d.mts | 20 + .../build/esm/type/template-literal/parse.mjs | 167 + .../esm/type/template-literal/pattern.d.mts | 5 + .../esm/type/template-literal/pattern.mjs | 33 + .../esm/type/template-literal/syntax.d.mts | 20 + .../esm/type/template-literal/syntax.mjs | 55 + .../template-literal/template-literal.d.mts | 30 + .../template-literal/template-literal.mjs | 13 + .../esm/type/template-literal/union.d.mts | 9 + .../build/esm/type/template-literal/union.mjs | 9 + .../build/esm/type/transform/index.d.mts | 1 + .../build/esm/type/transform/index.mjs | 1 + .../build/esm/type/transform/transform.d.mts | 30 + .../build/esm/type/transform/transform.mjs | 40 + .../typebox/build/esm/type/tuple/index.d.mts | 1 + .../typebox/build/esm/type/tuple/index.mjs | 1 + .../typebox/build/esm/type/tuple/tuple.d.mts | 16 + .../typebox/build/esm/type/tuple/tuple.mjs | 9 + .../typebox/build/esm/type/type/index.d.mts | 6 + .../typebox/build/esm/type/type/index.mjs | 13 + .../build/esm/type/type/javascript.d.mts | 64 + .../build/esm/type/type/javascript.mjs | 99 + .../typebox/build/esm/type/type/json.d.mts | 208 + .../typebox/build/esm/type/type/json.mjs | 221 + .../typebox/build/esm/type/type/type.d.mts | 59 + .../typebox/build/esm/type/type/type.mjs | 62 + .../build/esm/type/uint8array/index.d.mts | 1 + .../build/esm/type/uint8array/index.mjs | 1 + .../esm/type/uint8array/uint8array.d.mts | 13 + .../build/esm/type/uint8array/uint8array.mjs | 6 + .../build/esm/type/undefined/index.d.mts | 1 + .../build/esm/type/undefined/index.mjs | 1 + .../build/esm/type/undefined/undefined.d.mts | 9 + .../build/esm/type/undefined/undefined.mjs | 6 + .../typebox/build/esm/type/union/index.d.mts | 3 + .../typebox/build/esm/type/union/index.mjs | 3 + .../build/esm/type/union/union-create.d.mts | 3 + .../build/esm/type/union/union-create.mjs | 5 + .../esm/type/union/union-evaluated.d.mts | 13 + .../build/esm/type/union/union-evaluated.mjs | 36 + .../build/esm/type/union/union-type.d.mts | 12 + .../build/esm/type/union/union-type.mjs | 1 + .../typebox/build/esm/type/union/union.d.mts | 6 + .../typebox/build/esm/type/union/union.mjs | 10 + .../build/esm/type/unknown/index.d.mts | 1 + .../typebox/build/esm/type/unknown/index.mjs | 1 + .../build/esm/type/unknown/unknown.d.mts | 8 + .../build/esm/type/unknown/unknown.mjs | 6 + .../typebox/build/esm/type/unsafe/index.d.mts | 1 + .../typebox/build/esm/type/unsafe/index.mjs | 1 + .../build/esm/type/unsafe/unsafe.d.mts | 11 + .../typebox/build/esm/type/unsafe/unsafe.mjs | 6 + .../typebox/build/esm/type/void/index.d.mts | 1 + .../typebox/build/esm/type/void/index.mjs | 1 + .../typebox/build/esm/type/void/void.d.mts | 9 + .../typebox/build/esm/type/void/void.mjs | 6 + .../build/esm/value/assert/assert.d.mts | 15 + .../typebox/build/esm/value/assert/assert.mjs | 49 + .../build/esm/value/assert/index.d.mts | 1 + .../typebox/build/esm/value/assert/index.mjs | 1 + .../typebox/build/esm/value/cast/cast.d.mts | 11 + .../typebox/build/esm/value/cast/cast.mjs | 235 + .../typebox/build/esm/value/cast/index.d.mts | 1 + .../typebox/build/esm/value/cast/index.mjs | 1 + .../typebox/build/esm/value/check/check.d.mts | 11 + .../typebox/build/esm/value/check/check.mjs | 469 + .../typebox/build/esm/value/check/index.d.mts | 1 + .../typebox/build/esm/value/check/index.mjs | 1 + .../typebox/build/esm/value/clean/clean.d.mts | 5 + .../typebox/build/esm/value/clean/clean.mjs | 145 + .../typebox/build/esm/value/clean/index.d.mts | 1 + .../typebox/build/esm/value/clean/index.mjs | 1 + .../typebox/build/esm/value/clone/clone.d.mts | 2 + .../typebox/build/esm/value/clone/clone.mjs | 56 + .../typebox/build/esm/value/clone/index.d.mts | 1 + .../typebox/build/esm/value/clone/index.mjs | 1 + .../build/esm/value/convert/convert.d.mts | 5 + .../build/esm/value/convert/convert.mjs | 260 + .../build/esm/value/convert/index.d.mts | 1 + .../typebox/build/esm/value/convert/index.mjs | 1 + .../build/esm/value/create/create.d.mts | 11 + .../typebox/build/esm/value/create/create.mjs | 468 + .../build/esm/value/create/index.d.mts | 1 + .../typebox/build/esm/value/create/index.mjs | 1 + .../build/esm/value/decode/decode.d.mts | 6 + .../typebox/build/esm/value/decode/decode.mjs | 10 + .../build/esm/value/decode/index.d.mts | 1 + .../typebox/build/esm/value/decode/index.mjs | 1 + .../build/esm/value/default/default.d.mts | 5 + .../build/esm/value/default/default.mjs | 172 + .../build/esm/value/default/index.d.mts | 1 + .../typebox/build/esm/value/default/index.mjs | 1 + .../typebox/build/esm/value/delta/delta.d.mts | 32 + .../typebox/build/esm/value/delta/delta.mjs | 171 + .../typebox/build/esm/value/delta/index.d.mts | 1 + .../typebox/build/esm/value/delta/index.mjs | 1 + .../typebox/build/esm/value/deref/deref.d.mts | 12 + .../typebox/build/esm/value/deref/deref.mjs | 29 + .../typebox/build/esm/value/deref/index.d.mts | 1 + .../typebox/build/esm/value/deref/index.mjs | 1 + .../build/esm/value/encode/encode.d.mts | 6 + .../typebox/build/esm/value/encode/encode.mjs | 11 + .../build/esm/value/encode/index.d.mts | 1 + .../typebox/build/esm/value/encode/index.mjs | 1 + .../typebox/build/esm/value/equal/equal.d.mts | 2 + .../typebox/build/esm/value/equal/equal.mjs | 46 + .../typebox/build/esm/value/equal/index.d.mts | 1 + .../typebox/build/esm/value/equal/index.mjs | 1 + .../typebox/build/esm/value/guard/guard.d.mts | 74 + .../typebox/build/esm/value/guard/guard.mjs | 158 + .../typebox/build/esm/value/guard/index.d.mts | 1 + .../typebox/build/esm/value/guard/index.mjs | 1 + .../typebox/build/esm/value/hash/hash.d.mts | 7 + .../typebox/build/esm/value/hash/hash.mjs | 146 + .../typebox/build/esm/value/hash/index.d.mts | 1 + .../typebox/build/esm/value/hash/index.mjs | 1 + .../typebox/build/esm/value/index.d.mts | 20 + .../typebox/build/esm/value/index.mjs | 32 + .../build/esm/value/mutate/index.d.mts | 1 + .../typebox/build/esm/value/mutate/index.mjs | 1 + .../build/esm/value/mutate/mutate.d.mts | 9 + .../typebox/build/esm/value/mutate/mutate.mjs | 98 + .../typebox/build/esm/value/parse/index.d.mts | 1 + .../typebox/build/esm/value/parse/index.mjs | 1 + .../typebox/build/esm/value/parse/parse.d.mts | 22 + .../typebox/build/esm/value/parse/parse.mjs | 81 + .../build/esm/value/pointer/index.d.mts | 1 + .../typebox/build/esm/value/pointer/index.mjs | 1 + .../build/esm/value/pointer/pointer.d.mts | 22 + .../build/esm/value/pointer/pointer.mjs | 115 + .../build/esm/value/transform/decode.d.mts | 22 + .../build/esm/value/transform/decode.mjs | 207 + .../build/esm/value/transform/encode.d.mts | 23 + .../build/esm/value/transform/encode.mjs | 218 + .../build/esm/value/transform/has.d.mts | 3 + .../typebox/build/esm/value/transform/has.mjs | 129 + .../build/esm/value/transform/index.d.mts | 3 + .../build/esm/value/transform/index.mjs | 3 + .../typebox/build/esm/value/value/index.d.mts | 1 + .../typebox/build/esm/value/value/index.mjs | 1 + .../typebox/build/esm/value/value/value.d.mts | 16 + .../typebox/build/esm/value/value/value.mjs | 16 + .../@sinclair/typebox/compiler/compiler.d.ts | 35 - .../@sinclair/typebox/compiler/compiler.js | 577 - .../@sinclair/typebox/compiler/index.d.ts | 2 - .../@sinclair/typebox/compiler/index.js | 47 - .../@sinclair/typebox/compiler/package.json | 4 + .../@sinclair/typebox/errors/errors.d.ts | 88 - .../@sinclair/typebox/errors/errors.js | 609 - .../@sinclair/typebox/errors/index.d.ts | 1 - .../@sinclair/typebox/errors/index.js | 44 - .../@sinclair/typebox/errors/package.json | 4 + node_modules/@sinclair/typebox/license | 6 +- node_modules/@sinclair/typebox/package.json | 131 +- .../@sinclair/typebox/parser/package.json | 4 + node_modules/@sinclair/typebox/readme.md | 1435 ++- .../@sinclair/typebox/syntax/package.json | 4 + .../@sinclair/typebox/system/index.d.ts | 1 - .../@sinclair/typebox/system/index.js | 44 - .../@sinclair/typebox/system/package.json | 4 + .../@sinclair/typebox/system/system.d.ts | 26 - .../@sinclair/typebox/system/system.js | 90 - .../@sinclair/typebox/type/package.json | 4 + node_modules/@sinclair/typebox/typebox.d.ts | 723 -- node_modules/@sinclair/typebox/typebox.js | 2220 ---- .../@sinclair/typebox/value/cast.d.ts | 30 - node_modules/@sinclair/typebox/value/cast.js | 372 - .../@sinclair/typebox/value/check.d.ts | 12 - node_modules/@sinclair/typebox/value/check.js | 484 - .../@sinclair/typebox/value/clone.d.ts | 3 - node_modules/@sinclair/typebox/value/clone.js | 71 - .../@sinclair/typebox/value/convert.d.ts | 13 - .../@sinclair/typebox/value/convert.js | 372 - .../@sinclair/typebox/value/create.d.ts | 26 - .../@sinclair/typebox/value/create.js | 480 - .../@sinclair/typebox/value/delta.d.ts | 43 - node_modules/@sinclair/typebox/value/delta.js | 204 - .../@sinclair/typebox/value/equal.d.ts | 3 - node_modules/@sinclair/typebox/value/equal.js | 80 - .../@sinclair/typebox/value/hash.d.ts | 8 - node_modules/@sinclair/typebox/value/hash.js | 208 - .../@sinclair/typebox/value/index.d.ts | 6 - node_modules/@sinclair/typebox/value/index.js | 56 - node_modules/@sinclair/typebox/value/is.d.ts | 11 - node_modules/@sinclair/typebox/value/is.js | 53 - .../@sinclair/typebox/value/mutate.d.ts | 13 - .../@sinclair/typebox/value/mutate.js | 121 - .../@sinclair/typebox/value/package.json | 4 + .../@sinclair/typebox/value/pointer.d.ts | 24 - .../@sinclair/typebox/value/pointer.js | 142 - .../@sinclair/typebox/value/value.d.ts | 39 - node_modules/@sinclair/typebox/value/value.js | 99 - node_modules/@sinonjs/fake-timers/README.md | 90 +- .../@sinonjs/fake-timers/package.json | 45 +- .../fake-timers/src/fake-timers-src.js | 738 +- node_modules/@tootallnate/once/LICENSE | 21 - node_modules/@tootallnate/once/README.md | 93 - .../@tootallnate/once/dist/index.d.ts | 7 - node_modules/@tootallnate/once/dist/index.js | 24 - .../@tootallnate/once/dist/index.js.map | 1 - .../once/dist/overloaded-parameters.d.ts | 231 - .../once/dist/overloaded-parameters.js | 3 - .../once/dist/overloaded-parameters.js.map | 1 - .../@tootallnate/once/dist/types.d.ts | 17 - node_modules/@tootallnate/once/package.json | 52 - node_modules/@types/graceful-fs/LICENSE | 21 - node_modules/@types/graceful-fs/README.md | 31 - node_modules/@types/graceful-fs/index.d.ts | 12 - node_modules/@types/graceful-fs/package.json | 32 - node_modules/@types/jsdom/README.md | 31 +- node_modules/@types/jsdom/base.d.ts | 13 +- node_modules/@types/jsdom/index.d.ts | 14 +- node_modules/@types/jsdom/package.json | 30 +- node_modules/@types/node/README.md | 30 +- node_modules/@types/node/assert.d.ts | 178 +- node_modules/@types/node/assert/strict.d.ts | 16 +- node_modules/@types/node/async_hooks.d.ts | 16 +- node_modules/@types/node/buffer.buffer.d.ts | 8 +- node_modules/@types/node/buffer.d.ts | 212 +- node_modules/@types/node/child_process.d.ts | 80 +- node_modules/@types/node/cluster.d.ts | 572 +- node_modules/@types/node/console.d.ts | 400 +- node_modules/@types/node/constants.d.ts | 7 +- node_modules/@types/node/crypto.d.ts | 1910 +-- node_modules/@types/node/dgram.d.ts | 66 +- .../@types/node/diagnostics_channel.d.ts | 8 +- node_modules/@types/node/dns.d.ts | 263 +- node_modules/@types/node/dns/promises.d.ts | 6 +- node_modules/@types/node/domain.d.ts | 30 +- node_modules/@types/node/events.d.ts | 1660 +-- node_modules/@types/node/fs.d.ts | 872 +- node_modules/@types/node/fs/promises.d.ts | 15 +- node_modules/@types/node/globals.d.ts | 32 +- .../@types/node/globals.typedarray.d.ts | 60 + node_modules/@types/node/http.d.ts | 517 +- node_modules/@types/node/http2.d.ts | 1332 +- node_modules/@types/node/https.d.ts | 298 +- node_modules/@types/node/index.d.ts | 16 +- node_modules/@types/node/inspector.d.ts | 65 +- .../@types/node/inspector.generated.d.ts | 13 +- .../@types/node/inspector/promises.d.ts | 41 + node_modules/@types/node/module.d.ts | 169 +- node_modules/@types/node/net.d.ts | 247 +- node_modules/@types/node/os.d.ts | 12 +- node_modules/@types/node/package.json | 4 +- node_modules/@types/node/path.d.ts | 253 +- node_modules/@types/node/path/posix.d.ts | 8 + node_modules/@types/node/path/win32.d.ts | 8 + node_modules/@types/node/perf_hooks.d.ts | 925 +- node_modules/@types/node/process.d.ts | 284 +- node_modules/@types/node/punycode.d.ts | 10 +- node_modules/@types/node/querystring.d.ts | 8 +- node_modules/@types/node/quic.d.ts | 910 ++ node_modules/@types/node/readline.d.ts | 187 +- .../@types/node/readline/promises.d.ts | 6 +- node_modules/@types/node/repl.d.ts | 173 +- node_modules/@types/node/sea.d.ts | 2 +- node_modules/@types/node/sqlite.d.ts | 4 +- node_modules/@types/node/stream.d.ts | 1033 +- .../@types/node/stream/consumers.d.ts | 20 +- node_modules/@types/node/stream/promises.d.ts | 151 +- node_modules/@types/node/stream/web.d.ts | 629 +- node_modules/@types/node/string_decoder.d.ts | 8 +- node_modules/@types/node/test.d.ts | 260 +- node_modules/@types/node/test/reporters.d.ts | 96 + node_modules/@types/node/timers.d.ts | 134 +- node_modules/@types/node/timers/promises.d.ts | 8 +- node_modules/@types/node/tls.d.ts | 279 +- node_modules/@types/node/trace_events.d.ts | 18 +- .../@types/node/ts5.6/buffer.buffer.d.ts | 8 +- node_modules/@types/node/ts5.6/index.d.ts | 16 +- node_modules/@types/node/ts5.7/index.d.ts | 16 +- node_modules/@types/node/tty.d.ts | 74 +- node_modules/@types/node/url.d.ts | 646 +- node_modules/@types/node/util.d.ts | 912 +- node_modules/@types/node/util/types.d.ts | 558 + node_modules/@types/node/v8.d.ts | 37 +- node_modules/@types/node/vm.d.ts | 26 +- node_modules/@types/node/wasi.d.ts | 8 +- .../node/web-globals/abortcontroller.d.ts | 29 +- .../@types/node/web-globals/blob.d.ts | 23 + .../@types/node/web-globals/console.d.ts | 9 + .../@types/node/web-globals/crypto.d.ts | 7 + .../@types/node/web-globals/encoding.d.ts | 11 + .../@types/node/web-globals/events.d.ts | 9 + .../@types/node/web-globals/fetch.d.ts | 4 + .../@types/node/web-globals/importmeta.d.ts | 13 + .../@types/node/web-globals/messaging.d.ts | 23 + .../@types/node/web-globals/performance.d.ts | 45 + .../@types/node/web-globals/streams.d.ts | 93 + .../@types/node/web-globals/timers.d.ts | 44 + node_modules/@types/node/web-globals/url.d.ts | 24 + node_modules/@types/node/worker_threads.d.ts | 534 +- node_modules/@types/node/zlib.d.ts | 79 +- .../.github/workflows/node.js.yml | 31 + node_modules/@ungap/structured-clone/LICENSE | 15 + .../@ungap/structured-clone/README.md | 95 + .../structured-clone/cjs/deserialize.js | 84 + .../@ungap/structured-clone/cjs/index.js | 27 + .../@ungap/structured-clone/cjs/json.js | 24 + .../@ungap/structured-clone/cjs/package.json | 1 + .../@ungap/structured-clone/cjs/serialize.js | 170 + .../@ungap/structured-clone/cjs/types.js | 22 + .../structured-clone/esm/deserialize.js | 85 + .../@ungap/structured-clone/esm/index.js | 25 + .../@ungap/structured-clone/esm/json.js | 21 + .../@ungap/structured-clone/esm/serialize.js | 171 + .../@ungap/structured-clone/esm/types.js | 11 + .../@ungap/structured-clone/package.json | 54 + .../structured-clone/structured-json.js | 1 + .../resolver-binding-linux-x64-gnu/README.md | 3 + .../package.json | 26 + .../resolver.linux-x64-gnu.node | Bin 0 -> 2272024 bytes .../resolver-binding-linux-x64-musl/README.md | 3 + .../package.json | 26 + .../resolver.linux-x64-musl.node | Bin 0 -> 2275480 bytes node_modules/abab/LICENSE.md | 13 - node_modules/abab/README.md | 51 - node_modules/abab/index.d.ts | 2 - node_modules/abab/index.js | 9 - node_modules/abab/lib/atob.js | 101 - node_modules/abab/lib/btoa.js | 62 - node_modules/abab/package.json | 42 - node_modules/acorn-globals/LICENSE | 19 - node_modules/acorn-globals/README.md | 81 - node_modules/acorn-globals/index.js | 178 - node_modules/acorn-globals/package.json | 35 - node_modules/acorn-walk/CHANGELOG.md | 199 - node_modules/acorn-walk/LICENSE | 21 - node_modules/acorn-walk/README.md | 124 - node_modules/acorn-walk/dist/walk.d.mts | 177 - node_modules/acorn-walk/dist/walk.d.ts | 177 - node_modules/acorn-walk/dist/walk.js | 455 - node_modules/acorn-walk/dist/walk.mjs | 437 - node_modules/acorn-walk/package.json | 50 - node_modules/acorn/CHANGELOG.md | 954 -- node_modules/acorn/LICENSE | 21 - node_modules/acorn/README.md | 282 - node_modules/acorn/bin/acorn | 4 - node_modules/acorn/dist/acorn.d.mts | 883 -- node_modules/acorn/dist/acorn.d.ts | 883 -- node_modules/acorn/dist/acorn.js | 6262 ---------- node_modules/acorn/dist/acorn.mjs | 6233 ---------- node_modules/acorn/dist/bin.js | 90 - node_modules/acorn/package.json | 50 - node_modules/agent-base/LICENSE | 22 + node_modules/agent-base/README.md | 162 +- node_modules/agent-base/dist/helpers.d.ts | 15 + node_modules/agent-base/dist/helpers.d.ts.map | 1 + node_modules/agent-base/dist/helpers.js | 66 + node_modules/agent-base/dist/helpers.js.map | 1 + node_modules/agent-base/dist/index.d.ts | 41 + node_modules/agent-base/dist/index.d.ts.map | 1 + node_modules/agent-base/dist/index.js | 178 + node_modules/agent-base/dist/index.js.map | 1 + node_modules/agent-base/dist/src/index.d.ts | 78 - node_modules/agent-base/dist/src/index.js | 203 - node_modules/agent-base/dist/src/index.js.map | 1 - .../agent-base/dist/src/promisify.d.ts | 4 - node_modules/agent-base/dist/src/promisify.js | 18 - .../agent-base/dist/src/promisify.js.map | 1 - node_modules/agent-base/package.json | 68 +- node_modules/agent-base/src/index.ts | 345 - node_modules/agent-base/src/promisify.ts | 33 - node_modules/ansi-regex/index.d.ts | 22 +- node_modules/ansi-regex/index.js | 18 +- node_modules/ansi-regex/license | 2 +- node_modules/ansi-regex/package.json | 18 +- node_modules/ansi-regex/readme.md | 30 +- node_modules/asynckit/LICENSE | 21 - node_modules/asynckit/README.md | 233 - node_modules/asynckit/bench.js | 76 - node_modules/asynckit/index.js | 6 - node_modules/asynckit/lib/abort.js | 29 - node_modules/asynckit/lib/async.js | 34 - node_modules/asynckit/lib/defer.js | 26 - node_modules/asynckit/lib/iterate.js | 75 - .../asynckit/lib/readable_asynckit.js | 91 - .../asynckit/lib/readable_parallel.js | 25 - node_modules/asynckit/lib/readable_serial.js | 25 - .../asynckit/lib/readable_serial_ordered.js | 29 - node_modules/asynckit/lib/state.js | 37 - node_modules/asynckit/lib/streamify.js | 141 - node_modules/asynckit/lib/terminator.js | 29 - node_modules/asynckit/package.json | 63 - node_modules/asynckit/parallel.js | 43 - node_modules/asynckit/serial.js | 17 - node_modules/asynckit/serialOrdered.js | 75 - node_modules/asynckit/stream.js | 21 - node_modules/babel-jest/LICENSE | 1 + node_modules/babel-jest/README.md | 18 + node_modules/babel-jest/build/index.d.mts | 14 + node_modules/babel-jest/build/index.d.ts | 16 +- node_modules/babel-jest/build/index.js | 348 +- node_modules/babel-jest/build/index.mjs | 4 + .../babel-jest/build/loadBabelConfig.js | 24 - node_modules/babel-jest/package.json | 29 +- .../babel-plugin-istanbul/CHANGELOG.md | 19 + node_modules/babel-plugin-istanbul/README.md | 2 +- .../babel-plugin-istanbul/lib/index.js | 63 +- .../lib/load-nyc-config-sync.js | 2 - .../istanbul-lib-instrument/CHANGELOG.md | 631 - .../istanbul-lib-instrument/LICENSE | 24 - .../istanbul-lib-instrument/README.md | 22 - .../istanbul-lib-instrument/package.json | 50 - .../istanbul-lib-instrument/src/constants.js | 14 - .../istanbul-lib-instrument/src/index.js | 21 - .../src/instrumenter.js | 162 - .../src/read-coverage.js | 77 - .../src/source-coverage.js | 135 - .../istanbul-lib-instrument/src/visitor.js | 843 -- .../babel-plugin-istanbul/package.json | 26 +- node_modules/babel-plugin-jest-hoist/LICENSE | 1 + .../babel-plugin-jest-hoist/build/index.d.mts | 11 + .../babel-plugin-jest-hoist/build/index.d.ts | 5 +- .../babel-plugin-jest-hoist/build/index.js | 318 +- .../babel-plugin-jest-hoist/build/index.mjs | 3 + .../babel-plugin-jest-hoist/package.json | 32 +- node_modules/babel-preset-jest/LICENSE | 1 + node_modules/babel-preset-jest/index.js | 3 +- node_modules/babel-preset-jest/package.json | 12 +- .../baseline-browser-mapping/README.md | 38 +- .../baseline-browser-mapping/dist/cli.js | 2 +- .../baseline-browser-mapping/dist/index.cjs | 2 +- .../baseline-browser-mapping/dist/index.d.ts | 12 + .../baseline-browser-mapping/dist/index.js | 2 +- .../baseline-browser-mapping/package.json | 21 +- .../brace-expansion/.github/FUNDING.yml | 2 + node_modules/brace-expansion/README.md | 6 + node_modules/brace-expansion/index.js | 170 +- node_modules/brace-expansion/package.json | 9 +- node_modules/browserslist/cli.js | 0 node_modules/browserslist/index.js | 18 +- node_modules/browserslist/package.json | 10 +- .../call-bind-apply-helpers/.eslintrc | 17 - .../.github/FUNDING.yml | 12 - node_modules/call-bind-apply-helpers/.nycrc | 9 - .../call-bind-apply-helpers/CHANGELOG.md | 30 - node_modules/call-bind-apply-helpers/LICENSE | 21 - .../call-bind-apply-helpers/README.md | 62 - .../call-bind-apply-helpers/actualApply.d.ts | 1 - .../call-bind-apply-helpers/actualApply.js | 10 - .../call-bind-apply-helpers/applyBind.d.ts | 19 - .../call-bind-apply-helpers/applyBind.js | 10 - .../functionApply.d.ts | 1 - .../call-bind-apply-helpers/functionApply.js | 4 - .../call-bind-apply-helpers/functionCall.d.ts | 1 - .../call-bind-apply-helpers/functionCall.js | 4 - .../call-bind-apply-helpers/index.d.ts | 64 - node_modules/call-bind-apply-helpers/index.js | 15 - .../call-bind-apply-helpers/package.json | 85 - .../call-bind-apply-helpers/reflectApply.d.ts | 3 - .../call-bind-apply-helpers/reflectApply.js | 4 - .../call-bind-apply-helpers/test/index.js | 63 - .../call-bind-apply-helpers/tsconfig.json | 9 - node_modules/caniuse-lite/data/agents.js | 2 +- .../caniuse-lite/data/browserVersions.js | 2 +- .../caniuse-lite/data/features/aac.js | 2 +- .../data/features/abortcontroller.js | 2 +- .../caniuse-lite/data/features/ac3-ec3.js | 2 +- .../data/features/accelerometer.js | 2 +- .../data/features/addeventlistener.js | 2 +- .../data/features/alternate-stylesheet.js | 2 +- .../data/features/ambient-light.js | 2 +- .../caniuse-lite/data/features/apng.js | 2 +- .../data/features/array-find-index.js | 2 +- .../caniuse-lite/data/features/array-find.js | 2 +- .../caniuse-lite/data/features/array-flat.js | 2 +- .../data/features/array-includes.js | 2 +- .../data/features/arrow-functions.js | 2 +- .../caniuse-lite/data/features/asmjs.js | 2 +- .../data/features/async-clipboard.js | 2 +- .../data/features/async-functions.js | 2 +- .../caniuse-lite/data/features/atob-btoa.js | 2 +- .../caniuse-lite/data/features/audio-api.js | 2 +- .../caniuse-lite/data/features/audio.js | 2 +- .../caniuse-lite/data/features/audiotracks.js | 2 +- .../caniuse-lite/data/features/autofocus.js | 2 +- .../caniuse-lite/data/features/auxclick.js | 2 +- .../caniuse-lite/data/features/av1.js | 2 +- .../caniuse-lite/data/features/avif.js | 2 +- .../data/features/background-attachment.js | 2 +- .../data/features/background-clip-text.js | 2 +- .../data/features/background-img-opts.js | 2 +- .../data/features/background-position-x-y.js | 2 +- .../features/background-repeat-round-space.js | 2 +- .../data/features/background-sync.js | 2 +- .../data/features/battery-status.js | 2 +- .../caniuse-lite/data/features/beacon.js | 2 +- .../data/features/beforeafterprint.js | 2 +- .../caniuse-lite/data/features/bigint.js | 2 +- .../caniuse-lite/data/features/blobbuilder.js | 2 +- .../caniuse-lite/data/features/bloburls.js | 2 +- .../data/features/border-image.js | 2 +- .../data/features/border-radius.js | 2 +- .../data/features/broadcastchannel.js | 2 +- .../caniuse-lite/data/features/brotli.js | 2 +- .../caniuse-lite/data/features/calc.js | 2 +- .../data/features/canvas-blending.js | 2 +- .../caniuse-lite/data/features/canvas-text.js | 2 +- .../caniuse-lite/data/features/canvas.js | 2 +- .../caniuse-lite/data/features/ch-unit.js | 2 +- .../data/features/chacha20-poly1305.js | 2 +- .../data/features/channel-messaging.js | 2 +- .../data/features/childnode-remove.js | 2 +- .../caniuse-lite/data/features/classlist.js | 2 +- .../client-hints-dpr-width-viewport.js | 2 +- .../caniuse-lite/data/features/clipboard.js | 2 +- .../caniuse-lite/data/features/colr-v1.js | 2 +- .../caniuse-lite/data/features/colr.js | 2 +- .../data/features/comparedocumentposition.js | 2 +- .../data/features/console-basic.js | 2 +- .../data/features/console-time.js | 2 +- .../caniuse-lite/data/features/const.js | 2 +- .../data/features/constraint-validation.js | 2 +- .../data/features/contenteditable.js | 2 +- .../data/features/contentsecuritypolicy.js | 2 +- .../data/features/contentsecuritypolicy2.js | 2 +- .../data/features/cookie-store-api.js | 2 +- .../caniuse-lite/data/features/cors.js | 2 +- .../data/features/createimagebitmap.js | 2 +- .../data/features/credential-management.js | 2 +- .../cross-document-view-transitions.js | 2 +- .../data/features/cryptography.js | 2 +- .../caniuse-lite/data/features/css-all.js | 2 +- .../data/features/css-anchor-positioning.js | 2 +- .../data/features/css-animation.js | 2 +- .../data/features/css-any-link.js | 2 +- .../data/features/css-appearance.js | 2 +- .../data/features/css-at-counter-style.js | 2 +- .../data/features/css-autofill.js | 2 +- .../data/features/css-backdrop-filter.js | 2 +- .../data/features/css-background-offsets.js | 2 +- .../data/features/css-backgroundblendmode.js | 2 +- .../data/features/css-boxdecorationbreak.js | 2 +- .../data/features/css-boxshadow.js | 2 +- .../caniuse-lite/data/features/css-canvas.js | 2 +- .../data/features/css-caret-color.js | 2 +- .../data/features/css-cascade-layers.js | 2 +- .../data/features/css-cascade-scope.js | 2 +- .../data/features/css-case-insensitive.js | 2 +- .../data/features/css-clip-path.js | 2 +- .../data/features/css-color-adjust.js | 2 +- .../data/features/css-color-function.js | 2 +- .../data/features/css-conic-gradients.js | 2 +- .../features/css-container-queries-style.js | 2 +- .../data/features/css-container-queries.js | 2 +- .../features/css-container-query-units.js | 2 +- .../data/features/css-containment.js | 2 +- .../data/features/css-content-visibility.js | 2 +- .../data/features/css-counters.js | 2 +- .../data/features/css-crisp-edges.js | 2 +- .../data/features/css-cross-fade.js | 2 +- .../data/features/css-default-pseudo.js | 2 +- .../data/features/css-descendant-gtgt.js | 2 +- .../data/features/css-deviceadaptation.js | 2 +- .../data/features/css-dir-pseudo.js | 2 +- .../data/features/css-display-contents.js | 2 +- .../data/features/css-element-function.js | 2 +- .../data/features/css-env-function.js | 2 +- .../data/features/css-exclusions.js | 2 +- .../data/features/css-featurequeries.js | 2 +- .../data/features/css-file-selector-button.js | 2 +- .../data/features/css-filter-function.js | 2 +- .../caniuse-lite/data/features/css-filters.js | 2 +- .../data/features/css-first-letter.js | 2 +- .../data/features/css-first-line.js | 2 +- .../caniuse-lite/data/features/css-fixed.js | 2 +- .../data/features/css-focus-visible.js | 2 +- .../data/features/css-focus-within.js | 2 +- .../data/features/css-font-palette.js | 2 +- .../features/css-font-rendering-controls.js | 2 +- .../data/features/css-font-stretch.js | 2 +- .../data/features/css-gencontent.js | 2 +- .../data/features/css-gradients.js | 2 +- .../data/features/css-grid-animation.js | 2 +- .../caniuse-lite/data/features/css-grid.js | 2 +- .../data/features/css-hanging-punctuation.js | 2 +- .../caniuse-lite/data/features/css-has.js | 2 +- .../caniuse-lite/data/features/css-hyphens.js | 2 +- .../caniuse-lite/data/features/css-if.js | 2 +- .../data/features/css-image-orientation.js | 2 +- .../data/features/css-image-set.js | 2 +- .../data/features/css-in-out-of-range.js | 2 +- .../data/features/css-indeterminate-pseudo.js | 2 +- .../data/features/css-initial-letter.js | 2 +- .../data/features/css-initial-value.js | 2 +- .../caniuse-lite/data/features/css-lch-lab.js | 2 +- .../data/features/css-letter-spacing.js | 2 +- .../data/features/css-line-clamp.js | 2 +- .../data/features/css-logical-props.js | 2 +- .../data/features/css-marker-pseudo.js | 2 +- .../caniuse-lite/data/features/css-masks.js | 2 +- .../data/features/css-matches-pseudo.js | 2 +- .../data/features/css-math-functions.js | 2 +- .../data/features/css-media-interaction.js | 2 +- .../data/features/css-media-range-syntax.js | 2 +- .../data/features/css-media-resolution.js | 2 +- .../data/features/css-media-scripting.js | 2 +- .../data/features/css-mediaqueries.js | 2 +- .../data/features/css-mixblendmode.js | 2 +- .../data/features/css-module-scripts.js | 2 +- .../data/features/css-motion-paths.js | 2 +- .../data/features/css-namespaces.js | 2 +- .../caniuse-lite/data/features/css-nesting.js | 2 +- .../data/features/css-not-sel-list.js | 2 +- .../data/features/css-nth-child-of.js | 2 +- .../caniuse-lite/data/features/css-opacity.js | 2 +- .../data/features/css-optional-pseudo.js | 2 +- .../data/features/css-overflow-anchor.js | 2 +- .../data/features/css-overflow-overlay.js | 2 +- .../data/features/css-overflow.js | 2 +- .../data/features/css-overscroll-behavior.js | 2 +- .../data/features/css-page-break.js | 2 +- .../data/features/css-paged-media.js | 2 +- .../data/features/css-paint-api.js | 2 +- .../data/features/css-placeholder-shown.js | 2 +- .../data/features/css-placeholder.js | 2 +- .../data/features/css-print-color-adjust.js | 2 +- .../data/features/css-read-only-write.js | 2 +- .../data/features/css-rebeccapurple.js | 2 +- .../data/features/css-reflections.js | 2 +- .../caniuse-lite/data/features/css-regions.js | 2 +- .../data/features/css-relative-colors.js | 2 +- .../data/features/css-repeating-gradients.js | 2 +- .../caniuse-lite/data/features/css-resize.js | 2 +- .../data/features/css-revert-value.js | 2 +- .../data/features/css-rrggbbaa.js | 2 +- .../data/features/css-scroll-behavior.js | 2 +- .../data/features/css-scrollbar.js | 2 +- .../caniuse-lite/data/features/css-sel2.js | 2 +- .../caniuse-lite/data/features/css-sel3.js | 2 +- .../data/features/css-selection.js | 2 +- .../caniuse-lite/data/features/css-shapes.js | 2 +- .../data/features/css-snappoints.js | 2 +- .../caniuse-lite/data/features/css-sticky.js | 2 +- .../caniuse-lite/data/features/css-subgrid.js | 2 +- .../data/features/css-supports-api.js | 2 +- .../caniuse-lite/data/features/css-table.js | 2 +- .../data/features/css-text-align-last.js | 2 +- .../data/features/css-text-box-trim.js | 2 +- .../data/features/css-text-indent.js | 2 +- .../data/features/css-text-justify.js | 2 +- .../data/features/css-text-orientation.js | 2 +- .../data/features/css-text-spacing.js | 2 +- .../data/features/css-text-wrap-balance.js | 2 +- .../data/features/css-textshadow.js | 2 +- .../data/features/css-touch-action.js | 2 +- .../data/features/css-transitions.js | 2 +- .../data/features/css-unicode-bidi.js | 2 +- .../data/features/css-unset-value.js | 2 +- .../data/features/css-variables.js | 2 +- .../data/features/css-when-else.js | 2 +- .../data/features/css-widows-orphans.js | 2 +- .../data/features/css-width-stretch.js | 2 +- .../data/features/css-writing-mode.js | 2 +- .../caniuse-lite/data/features/css-zoom.js | 2 +- .../caniuse-lite/data/features/css3-attr.js | 2 +- .../data/features/css3-boxsizing.js | 2 +- .../caniuse-lite/data/features/css3-colors.js | 2 +- .../data/features/css3-cursors-grab.js | 2 +- .../data/features/css3-cursors-newer.js | 2 +- .../data/features/css3-cursors.js | 2 +- .../data/features/css3-tabsize.js | 2 +- .../data/features/currentcolor.js | 2 +- .../data/features/custom-elements.js | 2 +- .../data/features/custom-elementsv1.js | 2 +- .../caniuse-lite/data/features/customevent.js | 2 +- .../caniuse-lite/data/features/datalist.js | 2 +- .../caniuse-lite/data/features/dataset.js | 2 +- .../caniuse-lite/data/features/datauri.js | 2 +- .../data/features/date-tolocaledatestring.js | 2 +- .../data/features/declarative-shadow-dom.js | 2 +- .../caniuse-lite/data/features/decorators.js | 2 +- .../caniuse-lite/data/features/details.js | 2 +- .../data/features/deviceorientation.js | 2 +- .../data/features/devicepixelratio.js | 2 +- .../caniuse-lite/data/features/dialog.js | 2 +- .../data/features/dispatchevent.js | 2 +- .../caniuse-lite/data/features/dnssec.js | 2 +- .../data/features/do-not-track.js | 2 +- .../data/features/document-currentscript.js | 2 +- .../data/features/document-evaluate-xpath.js | 2 +- .../data/features/document-execcommand.js | 2 +- .../data/features/document-policy.js | 2 +- .../features/document-scrollingelement.js | 2 +- .../data/features/documenthead.js | 2 +- .../data/features/dom-manip-convenience.js | 2 +- .../caniuse-lite/data/features/dom-range.js | 2 +- .../data/features/domcontentloaded.js | 2 +- .../caniuse-lite/data/features/dommatrix.js | 2 +- .../caniuse-lite/data/features/download.js | 2 +- .../caniuse-lite/data/features/dragndrop.js | 2 +- .../data/features/element-closest.js | 2 +- .../data/features/element-from-point.js | 2 +- .../data/features/element-scroll-methods.js | 2 +- .../caniuse-lite/data/features/eme.js | 2 +- .../caniuse-lite/data/features/eot.js | 2 +- .../caniuse-lite/data/features/es5.js | 2 +- .../caniuse-lite/data/features/es6-class.js | 2 +- .../data/features/es6-generators.js | 2 +- .../features/es6-module-dynamic-import.js | 2 +- .../caniuse-lite/data/features/es6-module.js | 2 +- .../caniuse-lite/data/features/es6-number.js | 2 +- .../data/features/es6-string-includes.js | 2 +- .../caniuse-lite/data/features/es6.js | 2 +- .../caniuse-lite/data/features/eventsource.js | 2 +- .../data/features/extended-system-fonts.js | 2 +- .../data/features/feature-policy.js | 2 +- .../caniuse-lite/data/features/fetch.js | 2 +- .../data/features/fieldset-disabled.js | 2 +- .../caniuse-lite/data/features/fileapi.js | 2 +- .../caniuse-lite/data/features/filereader.js | 2 +- .../data/features/filereadersync.js | 2 +- .../caniuse-lite/data/features/filesystem.js | 2 +- .../caniuse-lite/data/features/flac.js | 2 +- .../caniuse-lite/data/features/flexbox-gap.js | 2 +- .../caniuse-lite/data/features/flexbox.js | 2 +- .../caniuse-lite/data/features/flow-root.js | 2 +- .../data/features/focusin-focusout-events.js | 2 +- .../data/features/font-family-system-ui.js | 2 +- .../data/features/font-feature.js | 2 +- .../data/features/font-kerning.js | 2 +- .../data/features/font-loading.js | 2 +- .../data/features/font-size-adjust.js | 2 +- .../caniuse-lite/data/features/font-smooth.js | 2 +- .../data/features/font-unicode-range.js | 2 +- .../data/features/font-variant-alternates.js | 2 +- .../data/features/font-variant-numeric.js | 2 +- .../caniuse-lite/data/features/fontface.js | 2 +- .../data/features/form-attribute.js | 2 +- .../data/features/form-submit-attributes.js | 2 +- .../data/features/form-validation.js | 2 +- .../caniuse-lite/data/features/forms.js | 2 +- .../caniuse-lite/data/features/fullscreen.js | 2 +- .../caniuse-lite/data/features/gamepad.js | 2 +- .../caniuse-lite/data/features/geolocation.js | 2 +- .../data/features/getboundingclientrect.js | 2 +- .../data/features/getcomputedstyle.js | 2 +- .../data/features/getelementsbyclassname.js | 2 +- .../data/features/getrandomvalues.js | 2 +- .../caniuse-lite/data/features/gyroscope.js | 2 +- .../data/features/hardwareconcurrency.js | 2 +- .../caniuse-lite/data/features/hashchange.js | 2 +- .../caniuse-lite/data/features/heif.js | 2 +- .../caniuse-lite/data/features/hevc.js | 2 +- .../caniuse-lite/data/features/hidden.js | 2 +- .../data/features/high-resolution-time.js | 2 +- .../caniuse-lite/data/features/history.js | 2 +- .../data/features/html-media-capture.js | 2 +- .../data/features/html5semantic.js | 2 +- .../data/features/http-live-streaming.js | 2 +- .../caniuse-lite/data/features/http2.js | 2 +- .../caniuse-lite/data/features/http3.js | 2 +- .../data/features/iframe-sandbox.js | 2 +- .../data/features/iframe-seamless.js | 2 +- .../data/features/iframe-srcdoc.js | 2 +- .../data/features/imagecapture.js | 2 +- .../caniuse-lite/data/features/ime.js | 2 +- .../img-naturalwidth-naturalheight.js | 2 +- .../caniuse-lite/data/features/import-maps.js | 2 +- .../caniuse-lite/data/features/imports.js | 2 +- .../data/features/indeterminate-checkbox.js | 2 +- .../caniuse-lite/data/features/indexeddb.js | 2 +- .../caniuse-lite/data/features/indexeddb2.js | 2 +- .../data/features/inline-block.js | 2 +- .../caniuse-lite/data/features/innertext.js | 2 +- .../data/features/input-autocomplete-onoff.js | 2 +- .../caniuse-lite/data/features/input-color.js | 2 +- .../data/features/input-datetime.js | 2 +- .../data/features/input-email-tel-url.js | 2 +- .../caniuse-lite/data/features/input-event.js | 2 +- .../data/features/input-file-accept.js | 2 +- .../data/features/input-file-directory.js | 2 +- .../data/features/input-file-multiple.js | 2 +- .../data/features/input-inputmode.js | 2 +- .../data/features/input-minlength.js | 2 +- .../data/features/input-number.js | 2 +- .../data/features/input-pattern.js | 2 +- .../data/features/input-placeholder.js | 2 +- .../caniuse-lite/data/features/input-range.js | 2 +- .../data/features/input-search.js | 2 +- .../data/features/input-selection.js | 2 +- .../data/features/insert-adjacent.js | 2 +- .../data/features/insertadjacenthtml.js | 2 +- .../data/features/internationalization.js | 2 +- .../data/features/intersectionobserver-v2.js | 2 +- .../data/features/intersectionobserver.js | 2 +- .../data/features/intl-pluralrules.js | 2 +- .../data/features/intrinsic-width.js | 2 +- .../caniuse-lite/data/features/jpeg2000.js | 2 +- .../caniuse-lite/data/features/jpegxl.js | 2 +- .../caniuse-lite/data/features/jpegxr.js | 2 +- .../data/features/js-regexp-lookbehind.js | 2 +- .../caniuse-lite/data/features/json.js | 2 +- .../features/justify-content-space-evenly.js | 2 +- .../data/features/kerning-pairs-ligatures.js | 2 +- .../data/features/keyboardevent-charcode.js | 2 +- .../data/features/keyboardevent-code.js | 2 +- .../keyboardevent-getmodifierstate.js | 2 +- .../data/features/keyboardevent-key.js | 2 +- .../data/features/keyboardevent-location.js | 2 +- .../data/features/keyboardevent-which.js | 2 +- .../caniuse-lite/data/features/lazyload.js | 2 +- .../caniuse-lite/data/features/let.js | 2 +- .../data/features/link-icon-png.js | 2 +- .../data/features/link-icon-svg.js | 2 +- .../data/features/link-rel-dns-prefetch.js | 2 +- .../data/features/link-rel-modulepreload.js | 2 +- .../data/features/link-rel-preconnect.js | 2 +- .../data/features/link-rel-prefetch.js | 2 +- .../data/features/link-rel-preload.js | 2 +- .../data/features/link-rel-prerender.js | 2 +- .../data/features/loading-lazy-attr.js | 2 +- .../data/features/localecompare.js | 2 +- .../data/features/magnetometer.js | 2 +- .../data/features/matchesselector.js | 2 +- .../caniuse-lite/data/features/matchmedia.js | 2 +- .../caniuse-lite/data/features/mathml.js | 2 +- .../caniuse-lite/data/features/maxlength.js | 2 +- .../mdn-css-backdrop-pseudo-element.js | 2 +- .../mdn-css-unicode-bidi-isolate-override.js | 2 +- .../features/mdn-css-unicode-bidi-isolate.js | 2 +- .../mdn-css-unicode-bidi-plaintext.js | 2 +- .../features/mdn-text-decoration-color.js | 2 +- .../data/features/mdn-text-decoration-line.js | 2 +- .../features/mdn-text-decoration-shorthand.js | 2 +- .../features/mdn-text-decoration-style.js | 2 +- .../data/features/media-fragments.js | 2 +- .../data/features/mediacapture-fromelement.js | 2 +- .../data/features/mediarecorder.js | 2 +- .../caniuse-lite/data/features/mediasource.js | 2 +- .../caniuse-lite/data/features/menu.js | 2 +- .../data/features/meta-theme-color.js | 2 +- .../caniuse-lite/data/features/meter.js | 2 +- .../caniuse-lite/data/features/midi.js | 2 +- .../caniuse-lite/data/features/minmaxwh.js | 2 +- .../caniuse-lite/data/features/mp3.js | 2 +- .../caniuse-lite/data/features/mpeg-dash.js | 2 +- .../caniuse-lite/data/features/mpeg4.js | 2 +- .../data/features/multibackgrounds.js | 2 +- .../caniuse-lite/data/features/multicolumn.js | 2 +- .../data/features/mutation-events.js | 2 +- .../data/features/mutationobserver.js | 2 +- .../data/features/namevalue-storage.js | 2 +- .../data/features/native-filesystem-api.js | 2 +- .../caniuse-lite/data/features/nav-timing.js | 2 +- .../caniuse-lite/data/features/netinfo.js | 2 +- .../data/features/notifications.js | 2 +- .../data/features/object-entries.js | 2 +- .../caniuse-lite/data/features/object-fit.js | 2 +- .../data/features/object-observe.js | 2 +- .../data/features/object-values.js | 2 +- .../caniuse-lite/data/features/objectrtc.js | 2 +- .../data/features/offline-apps.js | 2 +- .../data/features/offscreencanvas.js | 2 +- .../caniuse-lite/data/features/ogg-vorbis.js | 2 +- .../caniuse-lite/data/features/ogv.js | 2 +- .../caniuse-lite/data/features/ol-reversed.js | 2 +- .../data/features/once-event-listener.js | 2 +- .../data/features/online-status.js | 2 +- .../caniuse-lite/data/features/opus.js | 2 +- .../data/features/orientation-sensor.js | 2 +- .../caniuse-lite/data/features/outline.js | 2 +- .../data/features/pad-start-end.js | 2 +- .../data/features/page-transition-events.js | 2 +- .../data/features/pagevisibility.js | 2 +- .../data/features/passive-event-listener.js | 2 +- .../caniuse-lite/data/features/passkeys.js | 2 +- .../data/features/passwordrules.js | 2 +- .../caniuse-lite/data/features/path2d.js | 2 +- .../data/features/payment-request.js | 2 +- .../caniuse-lite/data/features/pdf-viewer.js | 2 +- .../data/features/permissions-api.js | 2 +- .../data/features/permissions-policy.js | 2 +- .../data/features/picture-in-picture.js | 2 +- .../caniuse-lite/data/features/picture.js | 2 +- .../caniuse-lite/data/features/ping.js | 2 +- .../caniuse-lite/data/features/png-alpha.js | 2 +- .../data/features/pointer-events.js | 2 +- .../caniuse-lite/data/features/pointer.js | 2 +- .../caniuse-lite/data/features/pointerlock.js | 2 +- .../caniuse-lite/data/features/portals.js | 2 +- .../data/features/prefers-color-scheme.js | 2 +- .../data/features/prefers-reduced-motion.js | 2 +- .../caniuse-lite/data/features/progress.js | 2 +- .../data/features/promise-finally.js | 2 +- .../caniuse-lite/data/features/promises.js | 2 +- .../caniuse-lite/data/features/proximity.js | 2 +- .../caniuse-lite/data/features/proxy.js | 2 +- .../data/features/publickeypinning.js | 2 +- .../caniuse-lite/data/features/push-api.js | 2 +- .../data/features/queryselector.js | 2 +- .../data/features/readonly-attr.js | 2 +- .../data/features/referrer-policy.js | 2 +- .../data/features/registerprotocolhandler.js | 2 +- .../data/features/rel-noopener.js | 2 +- .../data/features/rel-noreferrer.js | 2 +- .../caniuse-lite/data/features/rellist.js | 2 +- .../caniuse-lite/data/features/rem.js | 2 +- .../data/features/requestanimationframe.js | 2 +- .../data/features/requestidlecallback.js | 2 +- .../data/features/resizeobserver.js | 2 +- .../data/features/resource-timing.js | 2 +- .../data/features/rest-parameters.js | 2 +- .../data/features/rtcpeerconnection.js | 2 +- .../caniuse-lite/data/features/ruby.js | 2 +- .../caniuse-lite/data/features/run-in.js | 2 +- .../features/same-site-cookie-attribute.js | 2 +- .../data/features/screen-orientation.js | 2 +- .../data/features/script-async.js | 2 +- .../data/features/script-defer.js | 2 +- .../data/features/scrollintoview.js | 2 +- .../data/features/scrollintoviewifneeded.js | 2 +- .../caniuse-lite/data/features/sdch.js | 2 +- .../data/features/selection-api.js | 2 +- .../caniuse-lite/data/features/selectlist.js | 2 +- .../data/features/server-timing.js | 2 +- .../data/features/serviceworkers.js | 2 +- .../data/features/setimmediate.js | 2 +- .../caniuse-lite/data/features/shadowdom.js | 2 +- .../caniuse-lite/data/features/shadowdomv1.js | 2 +- .../data/features/sharedarraybuffer.js | 2 +- .../data/features/sharedworkers.js | 2 +- .../caniuse-lite/data/features/sni.js | 2 +- .../caniuse-lite/data/features/spdy.js | 2 +- .../data/features/speech-recognition.js | 2 +- .../data/features/speech-synthesis.js | 2 +- .../data/features/spellcheck-attribute.js | 2 +- .../caniuse-lite/data/features/sql-storage.js | 2 +- .../caniuse-lite/data/features/srcset.js | 2 +- .../caniuse-lite/data/features/stream.js | 2 +- .../caniuse-lite/data/features/streams.js | 2 +- .../data/features/stricttransportsecurity.js | 2 +- .../data/features/style-scoped.js | 2 +- .../data/features/subresource-bundling.js | 2 +- .../data/features/subresource-integrity.js | 2 +- .../caniuse-lite/data/features/svg-css.js | 2 +- .../caniuse-lite/data/features/svg-filters.js | 2 +- .../caniuse-lite/data/features/svg-fonts.js | 2 +- .../data/features/svg-fragment.js | 2 +- .../caniuse-lite/data/features/svg-html.js | 2 +- .../caniuse-lite/data/features/svg-html5.js | 2 +- .../caniuse-lite/data/features/svg-img.js | 2 +- .../caniuse-lite/data/features/svg-smil.js | 2 +- .../caniuse-lite/data/features/svg.js | 2 +- .../caniuse-lite/data/features/sxg.js | 2 +- .../data/features/tabindex-attr.js | 2 +- .../data/features/template-literals.js | 2 +- .../caniuse-lite/data/features/template.js | 2 +- .../caniuse-lite/data/features/temporal.js | 2 +- .../caniuse-lite/data/features/testfeat.js | 2 +- .../data/features/text-decoration.js | 2 +- .../data/features/text-emphasis.js | 2 +- .../data/features/text-overflow.js | 2 +- .../data/features/text-size-adjust.js | 2 +- .../caniuse-lite/data/features/text-stroke.js | 2 +- .../caniuse-lite/data/features/textcontent.js | 2 +- .../caniuse-lite/data/features/textencoder.js | 2 +- .../caniuse-lite/data/features/tls1-1.js | 2 +- .../caniuse-lite/data/features/tls1-2.js | 2 +- .../caniuse-lite/data/features/tls1-3.js | 2 +- .../caniuse-lite/data/features/touch.js | 2 +- .../data/features/transforms2d.js | 2 +- .../data/features/transforms3d.js | 2 +- .../data/features/trusted-types.js | 2 +- .../caniuse-lite/data/features/ttf.js | 2 +- .../caniuse-lite/data/features/typedarrays.js | 2 +- .../caniuse-lite/data/features/u2f.js | 2 +- .../data/features/unhandledrejection.js | 2 +- .../data/features/upgradeinsecurerequests.js | 2 +- .../features/url-scroll-to-text-fragment.js | 2 +- .../caniuse-lite/data/features/url.js | 2 +- .../data/features/urlsearchparams.js | 2 +- .../caniuse-lite/data/features/use-strict.js | 2 +- .../data/features/user-select-none.js | 2 +- .../caniuse-lite/data/features/user-timing.js | 2 +- .../data/features/variable-fonts.js | 2 +- .../data/features/vector-effect.js | 2 +- .../caniuse-lite/data/features/vibration.js | 2 +- .../caniuse-lite/data/features/video.js | 2 +- .../caniuse-lite/data/features/videotracks.js | 2 +- .../data/features/view-transitions.js | 2 +- .../data/features/viewport-unit-variants.js | 2 +- .../data/features/viewport-units.js | 2 +- .../caniuse-lite/data/features/wai-aria.js | 2 +- .../caniuse-lite/data/features/wake-lock.js | 2 +- .../caniuse-lite/data/features/wasm-bigint.js | 2 +- .../data/features/wasm-bulk-memory.js | 2 +- .../data/features/wasm-extended-const.js | 2 +- .../caniuse-lite/data/features/wasm-gc.js | 2 +- .../data/features/wasm-multi-memory.js | 2 +- .../data/features/wasm-multi-value.js | 2 +- .../data/features/wasm-mutable-globals.js | 2 +- .../data/features/wasm-nontrapping-fptoint.js | 2 +- .../data/features/wasm-reference-types.js | 2 +- .../data/features/wasm-relaxed-simd.js | 2 +- .../data/features/wasm-signext.js | 2 +- .../caniuse-lite/data/features/wasm-simd.js | 2 +- .../data/features/wasm-tail-calls.js | 2 +- .../data/features/wasm-threads.js | 2 +- .../caniuse-lite/data/features/wasm.js | 2 +- .../caniuse-lite/data/features/wav.js | 2 +- .../caniuse-lite/data/features/wbr-element.js | 2 +- .../data/features/web-animation.js | 2 +- .../data/features/web-app-manifest.js | 2 +- .../data/features/web-bluetooth.js | 2 +- .../caniuse-lite/data/features/web-serial.js | 2 +- .../caniuse-lite/data/features/web-share.js | 2 +- .../caniuse-lite/data/features/webauthn.js | 2 +- .../caniuse-lite/data/features/webcodecs.js | 2 +- .../caniuse-lite/data/features/webgl.js | 2 +- .../caniuse-lite/data/features/webgl2.js | 2 +- .../caniuse-lite/data/features/webgpu.js | 2 +- .../caniuse-lite/data/features/webhid.js | 2 +- .../data/features/webkit-user-drag.js | 2 +- .../caniuse-lite/data/features/webm.js | 2 +- .../caniuse-lite/data/features/webnfc.js | 2 +- .../caniuse-lite/data/features/webp.js | 2 +- .../caniuse-lite/data/features/websockets.js | 2 +- .../data/features/webtransport.js | 2 +- .../caniuse-lite/data/features/webusb.js | 2 +- .../caniuse-lite/data/features/webvr.js | 2 +- .../caniuse-lite/data/features/webvtt.js | 2 +- .../caniuse-lite/data/features/webworkers.js | 2 +- .../caniuse-lite/data/features/webxr.js | 2 +- .../caniuse-lite/data/features/will-change.js | 2 +- .../caniuse-lite/data/features/woff.js | 2 +- .../caniuse-lite/data/features/woff2.js | 2 +- .../caniuse-lite/data/features/word-break.js | 2 +- .../caniuse-lite/data/features/wordwrap.js | 2 +- .../data/features/x-doc-messaging.js | 2 +- .../data/features/x-frame-options.js | 2 +- .../caniuse-lite/data/features/xhr2.js | 2 +- .../caniuse-lite/data/features/xhtml.js | 2 +- .../caniuse-lite/data/features/xhtmlsmil.js | 2 +- .../data/features/xml-serializer.js | 2 +- .../caniuse-lite/data/features/zstd.js | 2 +- node_modules/caniuse-lite/data/regions/AD.js | 2 +- node_modules/caniuse-lite/data/regions/AE.js | 2 +- node_modules/caniuse-lite/data/regions/AF.js | 2 +- node_modules/caniuse-lite/data/regions/AG.js | 2 +- node_modules/caniuse-lite/data/regions/AI.js | 2 +- node_modules/caniuse-lite/data/regions/AL.js | 2 +- node_modules/caniuse-lite/data/regions/AM.js | 2 +- node_modules/caniuse-lite/data/regions/AO.js | 2 +- node_modules/caniuse-lite/data/regions/AR.js | 2 +- node_modules/caniuse-lite/data/regions/AS.js | 2 +- node_modules/caniuse-lite/data/regions/AT.js | 2 +- node_modules/caniuse-lite/data/regions/AU.js | 2 +- node_modules/caniuse-lite/data/regions/AW.js | 2 +- node_modules/caniuse-lite/data/regions/AX.js | 2 +- node_modules/caniuse-lite/data/regions/AZ.js | 2 +- node_modules/caniuse-lite/data/regions/BA.js | 2 +- node_modules/caniuse-lite/data/regions/BB.js | 2 +- node_modules/caniuse-lite/data/regions/BD.js | 2 +- node_modules/caniuse-lite/data/regions/BE.js | 2 +- node_modules/caniuse-lite/data/regions/BF.js | 2 +- node_modules/caniuse-lite/data/regions/BG.js | 2 +- node_modules/caniuse-lite/data/regions/BH.js | 2 +- node_modules/caniuse-lite/data/regions/BI.js | 2 +- node_modules/caniuse-lite/data/regions/BJ.js | 2 +- node_modules/caniuse-lite/data/regions/BM.js | 2 +- node_modules/caniuse-lite/data/regions/BN.js | 2 +- node_modules/caniuse-lite/data/regions/BO.js | 2 +- node_modules/caniuse-lite/data/regions/BR.js | 2 +- node_modules/caniuse-lite/data/regions/BS.js | 2 +- node_modules/caniuse-lite/data/regions/BT.js | 2 +- node_modules/caniuse-lite/data/regions/BW.js | 2 +- node_modules/caniuse-lite/data/regions/BY.js | 2 +- node_modules/caniuse-lite/data/regions/BZ.js | 2 +- node_modules/caniuse-lite/data/regions/CA.js | 2 +- node_modules/caniuse-lite/data/regions/CD.js | 2 +- node_modules/caniuse-lite/data/regions/CF.js | 2 +- node_modules/caniuse-lite/data/regions/CG.js | 2 +- node_modules/caniuse-lite/data/regions/CH.js | 2 +- node_modules/caniuse-lite/data/regions/CI.js | 2 +- node_modules/caniuse-lite/data/regions/CK.js | 2 +- node_modules/caniuse-lite/data/regions/CL.js | 2 +- node_modules/caniuse-lite/data/regions/CM.js | 2 +- node_modules/caniuse-lite/data/regions/CN.js | 2 +- node_modules/caniuse-lite/data/regions/CO.js | 2 +- node_modules/caniuse-lite/data/regions/CR.js | 2 +- node_modules/caniuse-lite/data/regions/CU.js | 2 +- node_modules/caniuse-lite/data/regions/CV.js | 2 +- node_modules/caniuse-lite/data/regions/CX.js | 2 +- node_modules/caniuse-lite/data/regions/CY.js | 2 +- node_modules/caniuse-lite/data/regions/CZ.js | 2 +- node_modules/caniuse-lite/data/regions/DE.js | 2 +- node_modules/caniuse-lite/data/regions/DJ.js | 2 +- node_modules/caniuse-lite/data/regions/DK.js | 2 +- node_modules/caniuse-lite/data/regions/DM.js | 2 +- node_modules/caniuse-lite/data/regions/DO.js | 2 +- node_modules/caniuse-lite/data/regions/DZ.js | 2 +- node_modules/caniuse-lite/data/regions/EC.js | 2 +- node_modules/caniuse-lite/data/regions/EE.js | 2 +- node_modules/caniuse-lite/data/regions/EG.js | 2 +- node_modules/caniuse-lite/data/regions/ER.js | 2 +- node_modules/caniuse-lite/data/regions/ES.js | 2 +- node_modules/caniuse-lite/data/regions/ET.js | 2 +- node_modules/caniuse-lite/data/regions/FI.js | 2 +- node_modules/caniuse-lite/data/regions/FJ.js | 2 +- node_modules/caniuse-lite/data/regions/FK.js | 2 +- node_modules/caniuse-lite/data/regions/FM.js | 2 +- node_modules/caniuse-lite/data/regions/FO.js | 2 +- node_modules/caniuse-lite/data/regions/FR.js | 2 +- node_modules/caniuse-lite/data/regions/GA.js | 2 +- node_modules/caniuse-lite/data/regions/GB.js | 2 +- node_modules/caniuse-lite/data/regions/GD.js | 2 +- node_modules/caniuse-lite/data/regions/GE.js | 2 +- node_modules/caniuse-lite/data/regions/GF.js | 2 +- node_modules/caniuse-lite/data/regions/GG.js | 2 +- node_modules/caniuse-lite/data/regions/GH.js | 2 +- node_modules/caniuse-lite/data/regions/GI.js | 2 +- node_modules/caniuse-lite/data/regions/GL.js | 2 +- node_modules/caniuse-lite/data/regions/GM.js | 2 +- node_modules/caniuse-lite/data/regions/GN.js | 2 +- node_modules/caniuse-lite/data/regions/GP.js | 2 +- node_modules/caniuse-lite/data/regions/GQ.js | 2 +- node_modules/caniuse-lite/data/regions/GR.js | 2 +- node_modules/caniuse-lite/data/regions/GT.js | 2 +- node_modules/caniuse-lite/data/regions/GU.js | 2 +- node_modules/caniuse-lite/data/regions/GW.js | 2 +- node_modules/caniuse-lite/data/regions/GY.js | 2 +- node_modules/caniuse-lite/data/regions/HK.js | 2 +- node_modules/caniuse-lite/data/regions/HN.js | 2 +- node_modules/caniuse-lite/data/regions/HR.js | 2 +- node_modules/caniuse-lite/data/regions/HT.js | 2 +- node_modules/caniuse-lite/data/regions/HU.js | 2 +- node_modules/caniuse-lite/data/regions/ID.js | 2 +- node_modules/caniuse-lite/data/regions/IE.js | 2 +- node_modules/caniuse-lite/data/regions/IL.js | 2 +- node_modules/caniuse-lite/data/regions/IM.js | 2 +- node_modules/caniuse-lite/data/regions/IN.js | 2 +- node_modules/caniuse-lite/data/regions/IQ.js | 2 +- node_modules/caniuse-lite/data/regions/IR.js | 2 +- node_modules/caniuse-lite/data/regions/IS.js | 2 +- node_modules/caniuse-lite/data/regions/IT.js | 2 +- node_modules/caniuse-lite/data/regions/JE.js | 2 +- node_modules/caniuse-lite/data/regions/JM.js | 2 +- node_modules/caniuse-lite/data/regions/JO.js | 2 +- node_modules/caniuse-lite/data/regions/JP.js | 2 +- node_modules/caniuse-lite/data/regions/KE.js | 2 +- node_modules/caniuse-lite/data/regions/KG.js | 2 +- node_modules/caniuse-lite/data/regions/KH.js | 2 +- node_modules/caniuse-lite/data/regions/KI.js | 2 +- node_modules/caniuse-lite/data/regions/KM.js | 2 +- node_modules/caniuse-lite/data/regions/KN.js | 2 +- node_modules/caniuse-lite/data/regions/KP.js | 2 +- node_modules/caniuse-lite/data/regions/KR.js | 2 +- node_modules/caniuse-lite/data/regions/KW.js | 2 +- node_modules/caniuse-lite/data/regions/KY.js | 2 +- node_modules/caniuse-lite/data/regions/KZ.js | 2 +- node_modules/caniuse-lite/data/regions/LA.js | 2 +- node_modules/caniuse-lite/data/regions/LB.js | 2 +- node_modules/caniuse-lite/data/regions/LC.js | 2 +- node_modules/caniuse-lite/data/regions/LI.js | 2 +- node_modules/caniuse-lite/data/regions/LK.js | 2 +- node_modules/caniuse-lite/data/regions/LR.js | 2 +- node_modules/caniuse-lite/data/regions/LS.js | 2 +- node_modules/caniuse-lite/data/regions/LT.js | 2 +- node_modules/caniuse-lite/data/regions/LU.js | 2 +- node_modules/caniuse-lite/data/regions/LV.js | 2 +- node_modules/caniuse-lite/data/regions/LY.js | 2 +- node_modules/caniuse-lite/data/regions/MA.js | 2 +- node_modules/caniuse-lite/data/regions/MC.js | 2 +- node_modules/caniuse-lite/data/regions/MD.js | 2 +- node_modules/caniuse-lite/data/regions/ME.js | 2 +- node_modules/caniuse-lite/data/regions/MG.js | 2 +- node_modules/caniuse-lite/data/regions/MH.js | 2 +- node_modules/caniuse-lite/data/regions/MK.js | 2 +- node_modules/caniuse-lite/data/regions/ML.js | 2 +- node_modules/caniuse-lite/data/regions/MM.js | 2 +- node_modules/caniuse-lite/data/regions/MN.js | 2 +- node_modules/caniuse-lite/data/regions/MO.js | 2 +- node_modules/caniuse-lite/data/regions/MP.js | 2 +- node_modules/caniuse-lite/data/regions/MQ.js | 2 +- node_modules/caniuse-lite/data/regions/MR.js | 2 +- node_modules/caniuse-lite/data/regions/MS.js | 2 +- node_modules/caniuse-lite/data/regions/MT.js | 2 +- node_modules/caniuse-lite/data/regions/MU.js | 2 +- node_modules/caniuse-lite/data/regions/MV.js | 2 +- node_modules/caniuse-lite/data/regions/MW.js | 2 +- node_modules/caniuse-lite/data/regions/MX.js | 2 +- node_modules/caniuse-lite/data/regions/MY.js | 2 +- node_modules/caniuse-lite/data/regions/MZ.js | 2 +- node_modules/caniuse-lite/data/regions/NA.js | 2 +- node_modules/caniuse-lite/data/regions/NC.js | 2 +- node_modules/caniuse-lite/data/regions/NE.js | 2 +- node_modules/caniuse-lite/data/regions/NF.js | 2 +- node_modules/caniuse-lite/data/regions/NG.js | 2 +- node_modules/caniuse-lite/data/regions/NI.js | 2 +- node_modules/caniuse-lite/data/regions/NL.js | 2 +- node_modules/caniuse-lite/data/regions/NO.js | 2 +- node_modules/caniuse-lite/data/regions/NP.js | 2 +- node_modules/caniuse-lite/data/regions/NR.js | 2 +- node_modules/caniuse-lite/data/regions/NU.js | 2 +- node_modules/caniuse-lite/data/regions/NZ.js | 2 +- node_modules/caniuse-lite/data/regions/OM.js | 2 +- node_modules/caniuse-lite/data/regions/PA.js | 2 +- node_modules/caniuse-lite/data/regions/PE.js | 2 +- node_modules/caniuse-lite/data/regions/PF.js | 2 +- node_modules/caniuse-lite/data/regions/PG.js | 2 +- node_modules/caniuse-lite/data/regions/PH.js | 2 +- node_modules/caniuse-lite/data/regions/PK.js | 2 +- node_modules/caniuse-lite/data/regions/PL.js | 2 +- node_modules/caniuse-lite/data/regions/PM.js | 2 +- node_modules/caniuse-lite/data/regions/PN.js | 2 +- node_modules/caniuse-lite/data/regions/PR.js | 2 +- node_modules/caniuse-lite/data/regions/PS.js | 2 +- node_modules/caniuse-lite/data/regions/PT.js | 2 +- node_modules/caniuse-lite/data/regions/PW.js | 2 +- node_modules/caniuse-lite/data/regions/PY.js | 2 +- node_modules/caniuse-lite/data/regions/QA.js | 2 +- node_modules/caniuse-lite/data/regions/RE.js | 2 +- node_modules/caniuse-lite/data/regions/RO.js | 2 +- node_modules/caniuse-lite/data/regions/RS.js | 2 +- node_modules/caniuse-lite/data/regions/RU.js | 2 +- node_modules/caniuse-lite/data/regions/RW.js | 2 +- node_modules/caniuse-lite/data/regions/SA.js | 2 +- node_modules/caniuse-lite/data/regions/SB.js | 2 +- node_modules/caniuse-lite/data/regions/SC.js | 2 +- node_modules/caniuse-lite/data/regions/SD.js | 2 +- node_modules/caniuse-lite/data/regions/SE.js | 2 +- node_modules/caniuse-lite/data/regions/SG.js | 2 +- node_modules/caniuse-lite/data/regions/SH.js | 2 +- node_modules/caniuse-lite/data/regions/SI.js | 2 +- node_modules/caniuse-lite/data/regions/SK.js | 2 +- node_modules/caniuse-lite/data/regions/SL.js | 2 +- node_modules/caniuse-lite/data/regions/SM.js | 2 +- node_modules/caniuse-lite/data/regions/SN.js | 2 +- node_modules/caniuse-lite/data/regions/SO.js | 2 +- node_modules/caniuse-lite/data/regions/SR.js | 2 +- node_modules/caniuse-lite/data/regions/ST.js | 2 +- node_modules/caniuse-lite/data/regions/SV.js | 2 +- node_modules/caniuse-lite/data/regions/SY.js | 2 +- node_modules/caniuse-lite/data/regions/SZ.js | 2 +- node_modules/caniuse-lite/data/regions/TC.js | 2 +- node_modules/caniuse-lite/data/regions/TD.js | 2 +- node_modules/caniuse-lite/data/regions/TG.js | 2 +- node_modules/caniuse-lite/data/regions/TH.js | 2 +- node_modules/caniuse-lite/data/regions/TJ.js | 2 +- node_modules/caniuse-lite/data/regions/TL.js | 2 +- node_modules/caniuse-lite/data/regions/TM.js | 2 +- node_modules/caniuse-lite/data/regions/TN.js | 2 +- node_modules/caniuse-lite/data/regions/TO.js | 2 +- node_modules/caniuse-lite/data/regions/TR.js | 2 +- node_modules/caniuse-lite/data/regions/TT.js | 2 +- node_modules/caniuse-lite/data/regions/TV.js | 2 +- node_modules/caniuse-lite/data/regions/TW.js | 2 +- node_modules/caniuse-lite/data/regions/TZ.js | 2 +- node_modules/caniuse-lite/data/regions/UA.js | 2 +- node_modules/caniuse-lite/data/regions/UG.js | 2 +- node_modules/caniuse-lite/data/regions/US.js | 2 +- node_modules/caniuse-lite/data/regions/UY.js | 2 +- node_modules/caniuse-lite/data/regions/UZ.js | 2 +- node_modules/caniuse-lite/data/regions/VA.js | 2 +- node_modules/caniuse-lite/data/regions/VC.js | 2 +- node_modules/caniuse-lite/data/regions/VE.js | 2 +- node_modules/caniuse-lite/data/regions/VG.js | 2 +- node_modules/caniuse-lite/data/regions/VI.js | 2 +- node_modules/caniuse-lite/data/regions/VN.js | 2 +- node_modules/caniuse-lite/data/regions/VU.js | 2 +- node_modules/caniuse-lite/data/regions/WF.js | 2 +- node_modules/caniuse-lite/data/regions/WS.js | 2 +- node_modules/caniuse-lite/data/regions/YE.js | 2 +- node_modules/caniuse-lite/data/regions/YT.js | 2 +- node_modules/caniuse-lite/data/regions/ZA.js | 2 +- node_modules/caniuse-lite/data/regions/ZM.js | 2 +- node_modules/caniuse-lite/data/regions/ZW.js | 2 +- .../caniuse-lite/data/regions/alt-af.js | 2 +- .../caniuse-lite/data/regions/alt-an.js | 2 +- .../caniuse-lite/data/regions/alt-as.js | 2 +- .../caniuse-lite/data/regions/alt-eu.js | 2 +- .../caniuse-lite/data/regions/alt-na.js | 2 +- .../caniuse-lite/data/regions/alt-oc.js | 2 +- .../caniuse-lite/data/regions/alt-sa.js | 2 +- .../caniuse-lite/data/regions/alt-ww.js | 2 +- node_modules/caniuse-lite/package.json | 2 +- node_modules/ci-info/CHANGELOG.md | 32 + node_modules/ci-info/README.md | 18 +- node_modules/ci-info/index.d.ts | 15 +- node_modules/ci-info/index.js | 104 +- node_modules/ci-info/package.json | 33 +- node_modules/ci-info/vendors.json | 69 +- node_modules/cjs-module-lexer/LICENSE | 0 node_modules/cjs-module-lexer/README.md | 45 +- node_modules/cjs-module-lexer/dist/lexer.js | 2 +- node_modules/cjs-module-lexer/dist/lexer.mjs | 4 +- node_modules/cjs-module-lexer/lexer.d.ts | 0 node_modules/cjs-module-lexer/lexer.js | 6 +- node_modules/cjs-module-lexer/package.json | 2 +- .../cliui/node_modules/ansi-regex/index.d.ts | 37 + .../cliui/node_modules/ansi-regex/index.js | 10 + .../cliui/node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../cliui/node_modules/ansi-regex/readme.md | 78 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../cliui/node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../cliui/node_modules/emoji-regex/index.d.ts | 23 + .../cliui/node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 + .../cliui/node_modules/emoji-regex/text.js | 6 + .../node_modules/string-width/index.d.ts | 29 + .../cliui/node_modules/string-width/index.js | 47 + .../cliui/node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + .../cliui/node_modules/string-width/readme.md | 50 + .../cliui/node_modules/strip-ansi/index.d.ts | 17 + .../cliui/node_modules/strip-ansi/index.js | 4 + .../cliui/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../cliui/node_modules/strip-ansi/readme.md | 46 + .../cliui/node_modules/wrap-ansi/index.js | 216 + .../cliui/node_modules/wrap-ansi/license | 9 + .../cliui/node_modules/wrap-ansi/package.json | 62 + .../cliui/node_modules/wrap-ansi/readme.md | 91 + node_modules/combined-stream/License | 19 - node_modules/combined-stream/Readme.md | 138 - .../combined-stream/lib/combined_stream.js | 208 - node_modules/combined-stream/package.json | 25 - node_modules/combined-stream/yarn.lock | 17 - node_modules/create-jest/LICENSE | 21 - node_modules/create-jest/README.md | 11 - node_modules/create-jest/bin/create-jest.js | 8 - node_modules/create-jest/build/errors.js | 31 - .../create-jest/build/generateConfigFile.js | 92 - node_modules/create-jest/build/index.d.ts | 12 - node_modules/create-jest/build/index.js | 18 - .../create-jest/build/modifyPackageJson.js | 26 - node_modules/create-jest/build/questions.js | 76 - node_modules/create-jest/build/runCreate.js | 237 - node_modules/create-jest/build/types.js | 1 - node_modules/create-jest/package.json | 43 - node_modules/cssom/README.mdown | 67 - node_modules/cssom/lib/CSSRule.js | 43 - node_modules/cssom/lib/clone.js | 74 - node_modules/cssom/lib/index.js | 23 - node_modules/cssom/lib/parse.js | 465 - node_modules/cssom/package.json | 18 - node_modules/cssstyle/README.md | 12 +- .../cssstyle/lib/CSSStyleDeclaration.js | 745 +- .../cssstyle/lib/CSSStyleDeclaration.test.js | 556 - .../cssstyle/lib/allExtraProperties.js | 102 +- node_modules/cssstyle/lib/allProperties.js | 462 - .../cssstyle/lib/allWebkitProperties.js | 294 +- node_modules/cssstyle/lib/constants.js | 6 - .../cssstyle/lib/generated/allProperties.js | 615 + .../lib/generated/implementedProperties.js | 79 + .../cssstyle/lib/generated/properties.js | 2673 +++++ .../cssstyle/lib/implementedProperties.js | 90 - node_modules/cssstyle/lib/named_colors.json | 152 - node_modules/cssstyle/lib/parsers.js | 1075 +- node_modules/cssstyle/lib/parsers.test.js | 139 - node_modules/cssstyle/lib/properties.js | 1833 --- .../cssstyle/lib/properties/azimuth.js | 67 - .../cssstyle/lib/properties/background.js | 59 +- .../lib/properties/backgroundAttachment.js | 38 +- .../lib/properties/backgroundColor.js | 43 +- .../lib/properties/backgroundImage.js | 39 +- .../lib/properties/backgroundPosition.js | 76 +- .../lib/properties/backgroundRepeat.js | 40 +- .../cssstyle/lib/properties/border.js | 59 +- .../cssstyle/lib/properties/borderBottom.js | 45 +- .../lib/properties/borderBottomColor.js | 35 +- .../lib/properties/borderBottomStyle.js | 55 +- .../lib/properties/borderBottomWidth.js | 36 +- .../cssstyle/lib/properties/borderCollapse.js | 32 +- .../cssstyle/lib/properties/borderColor.js | 49 +- .../cssstyle/lib/properties/borderLeft.js | 45 +- .../lib/properties/borderLeftColor.js | 35 +- .../lib/properties/borderLeftStyle.js | 55 +- .../lib/properties/borderLeftWidth.js | 36 +- .../cssstyle/lib/properties/borderRight.js | 45 +- .../lib/properties/borderRightColor.js | 35 +- .../lib/properties/borderRightStyle.js | 55 +- .../lib/properties/borderRightWidth.js | 36 +- .../cssstyle/lib/properties/borderSpacing.js | 58 +- .../cssstyle/lib/properties/borderStyle.js | 70 +- .../cssstyle/lib/properties/borderTop.js | 45 +- .../cssstyle/lib/properties/borderTopColor.js | 35 +- .../cssstyle/lib/properties/borderTopStyle.js | 55 +- .../cssstyle/lib/properties/borderTopWidth.js | 37 +- .../cssstyle/lib/properties/borderWidth.js | 66 +- .../cssstyle/lib/properties/bottom.js | 30 +- node_modules/cssstyle/lib/properties/clear.js | 40 +- node_modules/cssstyle/lib/properties/clip.js | 61 +- node_modules/cssstyle/lib/properties/color.js | 30 +- .../cssstyle/lib/properties/cssFloat.js | 12 - node_modules/cssstyle/lib/properties/flex.js | 90 +- .../cssstyle/lib/properties/flexBasis.js | 37 +- .../cssstyle/lib/properties/flexGrow.js | 29 +- .../cssstyle/lib/properties/flexShrink.js | 29 +- node_modules/cssstyle/lib/properties/float.js | 27 +- .../cssstyle/lib/properties/floodColor.js | 30 +- node_modules/cssstyle/lib/properties/font.js | 212 +- .../cssstyle/lib/properties/fontFamily.js | 104 +- .../cssstyle/lib/properties/fontSize.js | 65 +- .../cssstyle/lib/properties/fontStyle.js | 32 +- .../cssstyle/lib/properties/fontVariant.js | 34 +- .../cssstyle/lib/properties/fontWeight.js | 49 +- .../cssstyle/lib/properties/height.js | 35 +- node_modules/cssstyle/lib/properties/left.js | 30 +- .../cssstyle/lib/properties/lightingColor.js | 30 +- .../cssstyle/lib/properties/lineHeight.js | 45 +- .../cssstyle/lib/properties/margin.js | 94 +- .../cssstyle/lib/properties/marginBottom.js | 41 +- .../cssstyle/lib/properties/marginLeft.js | 41 +- .../cssstyle/lib/properties/marginRight.js | 41 +- .../cssstyle/lib/properties/marginTop.js | 41 +- .../cssstyle/lib/properties/opacity.js | 46 +- .../cssstyle/lib/properties/outlineColor.js | 30 +- .../cssstyle/lib/properties/padding.js | 89 +- .../cssstyle/lib/properties/paddingBottom.js | 43 +- .../cssstyle/lib/properties/paddingLeft.js | 41 +- .../cssstyle/lib/properties/paddingRight.js | 41 +- .../cssstyle/lib/properties/paddingTop.js | 41 +- node_modules/cssstyle/lib/properties/right.js | 30 +- .../cssstyle/lib/properties/stopColor.js | 30 +- .../lib/properties/textLineThroughColor.js | 14 - .../lib/properties/textOverlineColor.js | 14 - .../lib/properties/textUnderlineColor.js | 14 - node_modules/cssstyle/lib/properties/top.js | 30 +- .../lib/properties/webkitBorderAfterColor.js | 30 +- .../lib/properties/webkitBorderBeforeColor.js | 30 +- .../lib/properties/webkitBorderEndColor.js | 30 +- .../lib/properties/webkitBorderStartColor.js | 30 +- .../lib/properties/webkitColumnRuleColor.js | 30 +- .../webkitMatchNearestMailBlockquoteColor.js | 14 - .../lib/properties/webkitTapHighlightColor.js | 30 +- .../lib/properties/webkitTextEmphasisColor.js | 30 +- .../lib/properties/webkitTextFillColor.js | 30 +- .../lib/properties/webkitTextStrokeColor.js | 30 +- node_modules/cssstyle/lib/properties/width.js | 35 +- node_modules/cssstyle/lib/utils/camelize.js | 37 + node_modules/cssstyle/lib/utils/colorSpace.js | 21 - .../lib/utils/getBasicPropertyDescriptor.js | 14 - .../cssstyle/lib/utils/propertyDescriptors.js | 16 + node_modules/cssstyle/lib/utils/strings.js | 167 + .../cssstyle/node_modules/cssom/LICENSE.txt | 20 - .../cssstyle/node_modules/cssom/README.mdown | 67 - .../node_modules/cssom/lib/CSSDocumentRule.js | 39 - .../node_modules/cssom/lib/CSSFontFaceRule.js | 36 - .../node_modules/cssom/lib/CSSHostRule.js | 37 - .../node_modules/cssom/lib/CSSImportRule.js | 132 - .../node_modules/cssom/lib/CSSKeyframeRule.js | 37 - .../cssom/lib/CSSKeyframesRule.js | 39 - .../node_modules/cssom/lib/CSSMediaRule.js | 41 - .../cssstyle/node_modules/cssom/lib/CSSOM.js | 3 - .../node_modules/cssom/lib/CSSRule.js | 43 - .../cssom/lib/CSSStyleDeclaration.js | 148 - .../node_modules/cssom/lib/CSSStyleRule.js | 190 - .../node_modules/cssom/lib/CSSStyleSheet.js | 88 - .../node_modules/cssom/lib/CSSSupportsRule.js | 36 - .../node_modules/cssom/lib/CSSValue.js | 43 - .../cssom/lib/CSSValueExpression.js | 344 - .../node_modules/cssom/lib/MatcherList.js | 62 - .../node_modules/cssom/lib/MediaList.js | 61 - .../node_modules/cssom/lib/StyleSheet.js | 17 - .../cssstyle/node_modules/cssom/lib/clone.js | 82 - .../cssstyle/node_modules/cssom/lib/index.js | 21 - .../cssstyle/node_modules/cssom/lib/parse.js | 464 - .../cssstyle/node_modules/cssom/package.json | 18 - node_modules/cssstyle/package.json | 44 +- node_modules/data-urls/lib/utils.js | 8 +- node_modules/data-urls/package.json | 38 +- node_modules/dedent/dist/dedent.js | 12 + node_modules/dedent/dist/dedent.mjs | 12 + node_modules/dedent/package.json | 6 +- node_modules/delayed-stream/.npmignore | 1 - node_modules/delayed-stream/License | 19 - node_modules/delayed-stream/Makefile | 7 - node_modules/delayed-stream/Readme.md | 141 - .../delayed-stream/lib/delayed_stream.js | 107 - node_modules/delayed-stream/package.json | 27 - node_modules/diff-sequences/LICENSE | 21 - node_modules/diff-sequences/README.md | 404 - node_modules/diff-sequences/build/index.d.ts | 38 - node_modules/diff-sequences/build/index.js | 798 -- node_modules/diff-sequences/package.json | 39 - node_modules/domexception/LICENSE.txt | 21 - node_modules/domexception/README.md | 31 - node_modules/domexception/index.js | 7 - .../domexception/lib/DOMException-impl.js | 22 - node_modules/domexception/lib/Function.js | 42 - node_modules/domexception/lib/VoidFunction.js | 26 - .../domexception/lib/legacy-error-codes.json | 24 - node_modules/domexception/lib/utils.js | 190 - node_modules/domexception/package.json | 42 - .../domexception/webidl2js-wrapper.js | 15 - node_modules/dunder-proto/.eslintrc | 5 - node_modules/dunder-proto/.github/FUNDING.yml | 12 - node_modules/dunder-proto/.nycrc | 13 - node_modules/dunder-proto/CHANGELOG.md | 24 - node_modules/dunder-proto/LICENSE | 21 - node_modules/dunder-proto/README.md | 54 - node_modules/dunder-proto/get.d.ts | 5 - node_modules/dunder-proto/get.js | 30 - node_modules/dunder-proto/package.json | 76 - node_modules/dunder-proto/set.d.ts | 5 - node_modules/dunder-proto/set.js | 35 - node_modules/dunder-proto/test/get.js | 34 - node_modules/dunder-proto/test/index.js | 4 - node_modules/dunder-proto/test/set.js | 50 - node_modules/dunder-proto/tsconfig.json | 9 - node_modules/eastasianwidth/README.md | 32 + node_modules/eastasianwidth/eastasianwidth.js | 311 + node_modules/eastasianwidth/package.json | 18 + .../full-chromium-versions.js | 13 +- .../full-chromium-versions.json | 2 +- .../electron-to-chromium/full-versions.js | 7 +- .../electron-to-chromium/full-versions.json | 2 +- .../electron-to-chromium/package.json | 2 +- node_modules/emoji-regex/README.md | 76 +- node_modules/emoji-regex/RGI_Emoji.d.ts | 5 + node_modules/emoji-regex/RGI_Emoji.js | 6 + .../emoji-regex/es2015/RGI_Emoji.d.ts | 5 + node_modules/emoji-regex/es2015/RGI_Emoji.js | 6 + node_modules/emoji-regex/es2015/index.d.ts | 5 + node_modules/emoji-regex/es2015/index.js | 2 +- node_modules/emoji-regex/es2015/text.d.ts | 5 + node_modules/emoji-regex/es2015/text.js | 2 +- node_modules/emoji-regex/index.d.ts | 22 +- node_modules/emoji-regex/index.js | 2 +- node_modules/emoji-regex/package.json | 24 +- node_modules/emoji-regex/text.d.ts | 5 + node_modules/emoji-regex/text.js | 2 +- node_modules/es-define-property/.eslintrc | 13 - .../es-define-property/.github/FUNDING.yml | 12 - node_modules/es-define-property/.nycrc | 9 - node_modules/es-define-property/CHANGELOG.md | 29 - node_modules/es-define-property/LICENSE | 21 - node_modules/es-define-property/README.md | 49 - node_modules/es-define-property/index.d.ts | 3 - node_modules/es-define-property/index.js | 14 - node_modules/es-define-property/package.json | 81 - node_modules/es-define-property/test/index.js | 56 - node_modules/es-define-property/tsconfig.json | 10 - node_modules/es-errors/.eslintrc | 5 - node_modules/es-errors/.github/FUNDING.yml | 12 - node_modules/es-errors/CHANGELOG.md | 40 - node_modules/es-errors/LICENSE | 21 - node_modules/es-errors/README.md | 55 - node_modules/es-errors/eval.d.ts | 3 - node_modules/es-errors/eval.js | 4 - node_modules/es-errors/index.d.ts | 3 - node_modules/es-errors/index.js | 4 - node_modules/es-errors/package.json | 80 - node_modules/es-errors/range.d.ts | 3 - node_modules/es-errors/range.js | 4 - node_modules/es-errors/ref.d.ts | 3 - node_modules/es-errors/ref.js | 4 - node_modules/es-errors/syntax.d.ts | 3 - node_modules/es-errors/syntax.js | 4 - node_modules/es-errors/test/index.js | 19 - node_modules/es-errors/tsconfig.json | 49 - node_modules/es-errors/type.d.ts | 3 - node_modules/es-errors/type.js | 4 - node_modules/es-errors/uri.d.ts | 3 - node_modules/es-errors/uri.js | 4 - node_modules/es-object-atoms/.eslintrc | 16 - .../es-object-atoms/.github/FUNDING.yml | 12 - node_modules/es-object-atoms/CHANGELOG.md | 37 - node_modules/es-object-atoms/LICENSE | 21 - node_modules/es-object-atoms/README.md | 63 - .../RequireObjectCoercible.d.ts | 3 - .../es-object-atoms/RequireObjectCoercible.js | 11 - node_modules/es-object-atoms/ToObject.d.ts | 7 - node_modules/es-object-atoms/ToObject.js | 10 - node_modules/es-object-atoms/index.d.ts | 3 - node_modules/es-object-atoms/index.js | 4 - node_modules/es-object-atoms/isObject.d.ts | 3 - node_modules/es-object-atoms/isObject.js | 6 - node_modules/es-object-atoms/package.json | 80 - node_modules/es-object-atoms/test/index.js | 38 - node_modules/es-object-atoms/tsconfig.json | 6 - node_modules/es-set-tostringtag/.eslintrc | 13 - node_modules/es-set-tostringtag/.nycrc | 9 - node_modules/es-set-tostringtag/CHANGELOG.md | 67 - node_modules/es-set-tostringtag/LICENSE | 21 - node_modules/es-set-tostringtag/README.md | 53 - node_modules/es-set-tostringtag/index.d.ts | 10 - node_modules/es-set-tostringtag/index.js | 35 - node_modules/es-set-tostringtag/package.json | 78 - node_modules/es-set-tostringtag/test/index.js | 85 - node_modules/es-set-tostringtag/tsconfig.json | 9 - node_modules/escodegen/LICENSE.BSD | 21 - node_modules/escodegen/README.md | 84 - node_modules/escodegen/bin/escodegen.js | 77 - node_modules/escodegen/bin/esgenerate.js | 64 - node_modules/escodegen/escodegen.js | 2667 ---- node_modules/escodegen/package.json | 63 - node_modules/estraverse/.jshintrc | 16 - node_modules/estraverse/LICENSE.BSD | 19 - node_modules/estraverse/README.md | 153 - node_modules/estraverse/estraverse.js | 805 -- node_modules/estraverse/gulpfile.js | 70 - node_modules/estraverse/package.json | 40 - node_modules/esutils/LICENSE.BSD | 19 - node_modules/esutils/README.md | 174 - node_modules/esutils/lib/ast.js | 144 - node_modules/esutils/lib/code.js | 135 - node_modules/esutils/lib/keyword.js | 165 - node_modules/esutils/lib/utils.js | 33 - node_modules/esutils/package.json | 44 - .../node_modules/signal-exit/LICENSE.txt | 16 + .../execa/node_modules/signal-exit/README.md | 39 + .../node_modules}/signal-exit/index.js | 0 .../node_modules/signal-exit/package.json | 38 + .../node_modules}/signal-exit/signals.js | 0 .../exit-x/.github/workflows/test.yml | 39 + node_modules/{exit => exit-x}/.jshintrc | 0 node_modules/{exit => exit-x}/Gruntfile.js | 0 node_modules/{exit => exit-x}/LICENSE-MIT | 0 node_modules/exit-x/README.md | 81 + node_modules/exit-x/lib/exit.d.ts | 8 + node_modules/{exit => exit-x}/lib/exit.js | 0 node_modules/exit-x/package.json | 41 + .../{exit => exit-x}/test/exit_test.js | 0 .../test/fixtures/10-stderr.txt | 0 .../test/fixtures/10-stdout-stderr.txt | 0 .../test/fixtures/10-stdout.txt | 0 .../test/fixtures/100-stderr.txt | 0 .../test/fixtures/100-stdout-stderr.txt | 0 .../test/fixtures/100-stdout.txt | 0 .../test/fixtures/1000-stderr.txt | 0 .../test/fixtures/1000-stdout-stderr.txt | 0 .../test/fixtures/1000-stdout.txt | 0 .../test/fixtures/create-files.sh | 0 .../test/fixtures/log-broken.js | 0 .../{exit => exit-x}/test/fixtures/log.js | 0 node_modules/exit/.travis.yml | 6 - node_modules/exit/README.md | 75 - node_modules/exit/package.json | 47 - node_modules/expect/LICENSE | 1 + .../expect/build/asymmetricMatchers.js | 375 - .../build/extractExpectedAssertionsErrors.js | 86 - node_modules/expect/build/index.d.mts | 387 + node_modules/expect/build/index.d.ts | 233 +- node_modules/expect/build/index.js | 2516 +++- node_modules/expect/build/index.mjs | 6 + .../expect/build/jestMatchersObject.js | 123 - node_modules/expect/build/matchers.js | 1292 -- node_modules/expect/build/print.js | 122 - node_modules/expect/build/spyMatchers.js | 1254 -- node_modules/expect/build/toThrowMatchers.js | 481 - node_modules/expect/build/types.js | 3 - node_modules/expect/package.json | 29 +- node_modules/fast-check/CHANGELOG.md | 1039 -- node_modules/fast-check/README.md | 40 +- .../arbitrary/_internals/AdapterArbitrary.js | 17 +- .../_internals/AlwaysShrinkableArbitrary.js | 20 +- .../arbitrary/_internals/ArrayArbitrary.js | 72 +- .../_internals/ArrayInt64Arbitrary.js | 127 - .../arbitrary/_internals/BigIntArbitrary.js | 36 +- .../arbitrary/_internals/CloneArbitrary.js | 42 +- .../arbitrary/_internals/CommandsArbitrary.js | 48 +- .../arbitrary/_internals/ConstantArbitrary.js | 78 +- .../_internals/FrequencyArbitrary.js | 36 +- .../_internals/GeneratorArbitrary.js | 30 +- .../InitialPoolForEntityGraphArbitrary.js | 25 + .../arbitrary/_internals/IntegerArbitrary.js | 26 +- .../lib/arbitrary/_internals/LazyArbitrary.js | 14 +- .../_internals/LimitedShrinkArbitrary.js | 20 +- .../_internals/MixedCaseArbitrary.js | 54 +- .../OnTheFlyLinksForEntityGraphArbitrary.js | 146 + .../_internals/SchedulerArbitrary.js | 18 +- .../arbitrary/_internals/StreamArbitrary.js | 54 +- .../_internals/StringUnitArbitrary.js | 31 +- .../arbitrary/_internals/SubarrayArbitrary.js | 46 +- .../arbitrary/_internals/TupleArbitrary.js | 41 +- .../UnlinkedEntitiesForEntityGraph.js | 19 + .../WithShrinkFromOtherArbitrary.js | 18 +- .../builders/AnyArbitraryBuilder.js | 81 +- .../builders/BoxedArbitraryBuilder.js | 9 +- .../builders/CharacterArbitraryBuilder.js | 8 - .../CharacterRangeArbitraryBuilder.js | 41 +- .../CompareFunctionArbitraryBuilder.js | 39 +- .../builders/GeneratorValueBuilder.js | 27 +- .../builders/PaddedNumberArbitraryBuilder.js | 11 +- .../builders/PartialRecordArbitraryBuilder.js | 29 +- .../RestrictedIntegerArbitraryBuilder.js | 15 +- .../builders/StableArbitraryGeneratorCache.js | 18 +- .../StringifiedNatArbitraryBuilder.js | 15 +- .../builders/TypedIntArrayArbitraryBuilder.js | 22 +- .../builders/UriPathArbitraryBuilder.js | 17 +- .../UriQueryOrFragmentArbitraryBuilder.js | 11 +- .../_internals/data/GraphemeRanges.js | 11 +- .../_internals/helpers/ArrayInt64.js | 100 - .../_internals/helpers/BiasNumericRange.js | 18 +- .../helpers/BuildInversedRelationsMapping.js | 53 + .../_internals/helpers/BuildSchedulerFor.js | 9 +- .../helpers/BuildSlicedGenerator.js | 13 +- .../_internals/helpers/CustomEqualSet.js | 10 +- .../_internals/helpers/DepthContext.js | 14 +- .../_internals/helpers/DoubleHelpers.js | 76 +- .../_internals/helpers/DoubleOnlyHelpers.js | 28 +- .../helpers/EnumerableKeysExtractor.js | 5 +- .../_internals/helpers/FloatHelpers.js | 21 +- .../_internals/helpers/FloatOnlyHelpers.js | 32 +- .../_internals/helpers/FloatingOnlyHelpers.js | 5 +- .../helpers/GraphemeRangesHelpers.js | 14 +- .../helpers/InvalidSubdomainLabelFiIter.js | 5 +- .../_internals/helpers/IsSubarrayOf.js | 17 +- .../helpers/JsonConstraintsBuilder.js | 17 +- .../helpers/MaxLengthFromMinLength.js | 50 +- .../helpers/NoUndefinedAsContext.js | 14 +- .../helpers/QualifiedObjectConstraints.js | 59 +- .../arbitrary/_internals/helpers/ReadRegex.js | 10 +- .../_internals/helpers/SameValueSet.js | 16 +- .../_internals/helpers/SameValueZeroSet.js | 14 +- .../_internals/helpers/SanitizeRegexAst.js | 25 +- .../_internals/helpers/ShrinkBigInt.js | 19 +- .../_internals/helpers/ShrinkInteger.js | 15 +- .../helpers/SlicesForStringBuilder.js | 32 +- .../_internals/helpers/StrictlyEqualSet.js | 16 +- .../_internals/helpers/TextEscaper.js | 8 +- .../_internals/helpers/ToggleFlags.js | 37 +- .../_internals/helpers/TokenizeRegex.js | 17 +- .../_internals/helpers/TokenizeString.js | 15 +- .../helpers/ZipIterableIterators.js | 5 +- .../implementations/NoopSlicedGenerator.js | 6 +- .../implementations/SchedulerImplem.js | 209 +- .../implementations/SlicedBasedGenerator.js | 18 +- .../_internals/interfaces/CustomSet.js | 3 +- .../interfaces/EntityGraphTypes.js} | 0 .../_internals/interfaces/Scheduler.js | 3 +- .../_internals/interfaces/SlicedGenerator.js | 3 +- .../_internals/mappers/ArrayToMap.js | 8 +- .../_internals/mappers/ArrayToSet.js | 8 +- .../_internals/mappers/CharsToString.js | 14 +- .../_internals/mappers/CodePointsToString.js | 12 +- .../_internals/mappers/EntitiesToIPv6.js | 72 +- .../_internals/mappers/IndexToCharString.js | 23 - .../mappers/IndexToMappedConstant.js | 20 +- .../mappers/IndexToPrintableIndex.js | 8 +- .../mappers/KeyValuePairsToObject.js | 48 +- .../_internals/mappers/NatToStringifiedNat.js | 23 +- .../_internals/mappers/NumberToPaddedEight.js | 12 +- .../_internals/mappers/PaddedEightsToUuid.js | 14 +- .../_internals/mappers/PartsToUrl.js | 8 +- .../_internals/mappers/PatternsToString.js | 27 +- .../_internals/mappers/SegmentsToPath.js | 14 +- .../_internals/mappers/StringToBase64.js | 14 +- .../_internals/mappers/TimeToDate.js | 26 +- .../_internals/mappers/UintToBase32String.js | 19 +- .../_internals/mappers/UnboxedToBoxed.js | 18 +- .../mappers/UnlinkedToLinkedEntities.js | 65 + .../mappers/ValuesAndSeparateKeysToObject.js | 14 +- .../mappers/VersionsApplierForUuid.js | 15 +- .../_internals/mappers/WordsToLorem.js | 50 +- .../_shared/StringSharedConstraints.js | 3 +- .../fast-check/lib/arbitrary/anything.js | 12 +- .../fast-check/lib/arbitrary/array.js | 16 +- .../fast-check/lib/arbitrary/ascii.js | 8 - .../fast-check/lib/arbitrary/asciiString.js | 16 - .../fast-check/lib/arbitrary/base64.js | 25 - .../fast-check/lib/arbitrary/base64String.js | 57 +- .../fast-check/lib/arbitrary/bigInt.js | 20 +- .../fast-check/lib/arbitrary/bigInt64Array.js | 13 +- .../fast-check/lib/arbitrary/bigIntN.js | 13 - .../fast-check/lib/arbitrary/bigUint.js | 16 - .../lib/arbitrary/bigUint64Array.js | 13 +- .../fast-check/lib/arbitrary/bigUintN.js | 13 - .../fast-check/lib/arbitrary/boolean.js | 12 +- node_modules/fast-check/lib/arbitrary/char.js | 10 - .../fast-check/lib/arbitrary/char16bits.js | 8 - .../fast-check/lib/arbitrary/clone.js | 10 +- .../fast-check/lib/arbitrary/commands.js | 16 +- .../lib/arbitrary/compareBooleanFunc.js | 9 +- .../fast-check/lib/arbitrary/compareFunc.js | 9 +- .../fast-check/lib/arbitrary/constant.js | 9 +- .../fast-check/lib/arbitrary/constantFrom.js | 10 +- .../fast-check/lib/arbitrary/context.js | 13 +- node_modules/fast-check/lib/arbitrary/date.js | 21 +- .../fast-check/lib/arbitrary/dictionary.js | 21 +- .../fast-check/lib/arbitrary/domain.js | 49 +- .../fast-check/lib/arbitrary/double.js | 45 +- .../fast-check/lib/arbitrary/emailAddress.js | 33 +- .../fast-check/lib/arbitrary/entityGraph.js | 13 + .../fast-check/lib/arbitrary/falsy.js | 13 +- .../fast-check/lib/arbitrary/float.js | 29 +- .../fast-check/lib/arbitrary/float32Array.js | 17 +- .../fast-check/lib/arbitrary/float64Array.js | 17 +- .../fast-check/lib/arbitrary/fullUnicode.js | 21 - .../lib/arbitrary/fullUnicodeString.js | 16 - node_modules/fast-check/lib/arbitrary/func.js | 41 +- node_modules/fast-check/lib/arbitrary/gen.js | 9 +- node_modules/fast-check/lib/arbitrary/hexa.js | 19 - .../fast-check/lib/arbitrary/hexaString.js | 16 - .../lib/arbitrary/infiniteStream.js | 13 +- .../fast-check/lib/arbitrary/int16Array.js | 13 +- .../fast-check/lib/arbitrary/int32Array.js | 13 +- .../fast-check/lib/arbitrary/int8Array.js | 13 +- .../fast-check/lib/arbitrary/integer.js | 9 +- node_modules/fast-check/lib/arbitrary/ipV4.js | 19 +- .../fast-check/lib/arbitrary/ipV4Extended.js | 19 +- node_modules/fast-check/lib/arbitrary/ipV6.js | 48 +- node_modules/fast-check/lib/arbitrary/json.js | 12 +- .../fast-check/lib/arbitrary/jsonValue.js | 20 +- .../fast-check/lib/arbitrary/letrec.js | 42 +- .../fast-check/lib/arbitrary/limitShrink.js | 9 +- .../fast-check/lib/arbitrary/lorem.js | 23 +- node_modules/fast-check/lib/arbitrary/map.js | 16 + .../fast-check/lib/arbitrary/mapToConstant.js | 19 +- .../lib/arbitrary/maxSafeInteger.js | 9 +- .../fast-check/lib/arbitrary/maxSafeNat.js | 9 +- node_modules/fast-check/lib/arbitrary/memo.js | 9 +- .../fast-check/lib/arbitrary/mixedCase.js | 18 +- node_modules/fast-check/lib/arbitrary/nat.js | 10 +- .../fast-check/lib/arbitrary/noBias.js | 30 +- .../fast-check/lib/arbitrary/noShrink.js | 31 +- .../fast-check/lib/arbitrary/object.js | 16 +- .../fast-check/lib/arbitrary/oneof.js | 22 +- .../fast-check/lib/arbitrary/option.js | 21 +- .../fast-check/lib/arbitrary/record.js | 22 +- .../fast-check/lib/arbitrary/scheduler.js | 17 +- node_modules/fast-check/lib/arbitrary/set.js | 11 + .../lib/arbitrary/shuffledSubarray.js | 9 +- .../fast-check/lib/arbitrary/sparseArray.js | 33 +- .../fast-check/lib/arbitrary/string.js | 34 +- .../fast-check/lib/arbitrary/string16bits.js | 16 - .../lib/arbitrary/stringMatching.js | 109 +- .../fast-check/lib/arbitrary/stringOf.js | 15 - .../fast-check/lib/arbitrary/subarray.js | 9 +- .../fast-check/lib/arbitrary/tuple.js | 9 +- .../fast-check/lib/arbitrary/uint16Array.js | 13 +- .../fast-check/lib/arbitrary/uint32Array.js | 13 +- .../fast-check/lib/arbitrary/uint8Array.js | 13 +- .../lib/arbitrary/uint8ClampedArray.js | 13 +- node_modules/fast-check/lib/arbitrary/ulid.js | 29 +- .../fast-check/lib/arbitrary/unicode.js | 21 - .../fast-check/lib/arbitrary/unicodeJson.js | 8 - .../lib/arbitrary/unicodeJsonValue.js | 9 - .../fast-check/lib/arbitrary/unicodeString.js | 16 - .../fast-check/lib/arbitrary/uniqueArray.js | 33 +- node_modules/fast-check/lib/arbitrary/uuid.js | 35 +- .../fast-check/lib/arbitrary/uuidV.js | 13 - .../fast-check/lib/arbitrary/webAuthority.js | 39 +- .../fast-check/lib/arbitrary/webFragments.js | 9 +- .../fast-check/lib/arbitrary/webPath.js | 13 +- .../lib/arbitrary/webQueryParameters.js | 9 +- .../fast-check/lib/arbitrary/webSegment.js | 11 +- .../fast-check/lib/arbitrary/webUrl.js | 40 +- .../check/arbitrary/definition/Arbitrary.js | 84 +- .../lib/check/arbitrary/definition/Value.js | 12 +- .../fast-check/lib/check/model/ModelRunner.js | 15 +- .../fast-check/lib/check/model/ReplayPath.js | 8 +- .../lib/check/model/command/AsyncCommand.js | 3 +- .../lib/check/model/command/Command.js | 3 +- .../lib/check/model/command/ICommand.js | 3 +- .../check/model/commands/CommandWrapper.js | 31 +- .../model/commands/CommandsContraints.js | 3 +- .../check/model/commands/CommandsIterable.js | 14 +- .../check/model/commands/ScheduledCommand.js | 9 +- .../fast-check/lib/check/precondition/Pre.js | 9 +- .../check/precondition/PreconditionFailure.js | 6 +- .../check/property/AsyncProperty.generic.js | 58 +- .../lib/check/property/AsyncProperty.js | 22 +- .../lib/check/property/IRawProperty.js | 5 +- .../property/IgnoreEqualValuesProperty.js | 28 +- .../lib/check/property/Property.generic.js | 58 +- .../fast-check/lib/check/property/Property.js | 22 +- .../lib/check/property/SkipAfterProperty.js | 28 +- .../lib/check/property/TimeoutProperty.js | 27 +- .../lib/check/property/UnbiasedProperty.js | 20 +- .../lib/check/runner/DecorateProperty.js | 31 +- .../fast-check/lib/check/runner/Runner.js | 73 +- .../lib/check/runner/RunnerIterator.js | 14 +- .../fast-check/lib/check/runner/Sampler.js | 37 +- .../lib/check/runner/SourceValuesIterator.js | 6 +- .../fast-check/lib/check/runner/Tosser.js | 26 +- .../runner/configuration/GlobalParameters.js | 11 +- .../check/runner/configuration/Parameters.js | 3 +- .../configuration/QualifiedParameters.js | 103 +- .../check/runner/configuration/RandomType.js | 3 +- .../runner/configuration/VerbosityLevel.js | 7 +- .../check/runner/reporter/ExecutionStatus.js | 7 +- .../check/runner/reporter/ExecutionTree.js | 3 +- .../lib/check/runner/reporter/RunDetails.js | 3 +- .../lib/check/runner/reporter/RunExecution.js | 31 +- .../lib/check/runner/utils/PathWalker.js | 5 +- .../check/runner/utils/RunDetailsFormatter.js | 84 +- node_modules/fast-check/lib/check/symbols.js | 17 +- .../arbitrary/_internals/AdapterArbitrary.js | 41 + .../_internals/AlwaysShrinkableArbitrary.js | 27 + .../arbitrary/_internals/ArrayArbitrary.js | 223 + .../arbitrary/_internals/BigIntArbitrary.js | 71 + .../arbitrary/_internals/CloneArbitrary.js | 84 + .../arbitrary/_internals/CommandsArbitrary.js | 110 + .../arbitrary/_internals/ConstantArbitrary.js | 65 + .../_internals/FrequencyArbitrary.js | 36 +- .../_internals/GeneratorArbitrary.js | 44 + .../InitialPoolForEntityGraphArbitrary.js | 28 + .../arbitrary/_internals/IntegerArbitrary.js | 76 + .../cjs/arbitrary/_internals/LazyArbitrary.js | 30 + .../_internals/LimitedShrinkArbitrary.js | 54 + .../_internals/MixedCaseArbitrary.js | 95 + .../OnTheFlyLinksForEntityGraphArbitrary.js | 149 + .../_internals/SchedulerArbitrary.js | 32 + .../arbitrary/_internals/StreamArbitrary.js | 59 + .../_internals/StringUnitArbitrary.js | 45 + .../arbitrary/_internals/SubarrayArbitrary.js | 74 + .../arbitrary/_internals/TupleArbitrary.js | 86 + .../UnlinkedEntitiesForEntityGraph.js | 22 + .../WithShrinkFromOtherArbitrary.js | 43 + .../builders/AnyArbitraryBuilder.js | 55 + .../builders/BoxedArbitraryBuilder.js | 7 + .../CharacterRangeArbitraryBuilder.js | 66 + .../CompareFunctionArbitraryBuilder.js | 46 + .../builders/GeneratorValueBuilder.js | 41 + .../builders/PaddedNumberArbitraryBuilder.js | 8 + .../builders/PartialRecordArbitraryBuilder.js | 26 + .../RestrictedIntegerArbitraryBuilder.js | 13 + .../builders/StableArbitraryGeneratorCache.js | 56 + .../StringifiedNatArbitraryBuilder.js | 10 + .../builders/TypedIntArrayArbitraryBuilder.js | 22 + .../builders/UriPathArbitraryBuilder.js | 31 + .../UriQueryOrFragmentArbitraryBuilder.js | 8 + .../_internals/data/GraphemeRanges.js | 11 +- .../_internals/helpers/BiasNumericRange.js | 36 + .../helpers/BuildInversedRelationsMapping.js | 56 + .../_internals/helpers/BuildSchedulerFor.js | 24 + .../helpers/BuildSlicedGenerator.js | 11 + .../_internals/helpers/CustomEqualSet.js | 26 + .../_internals/helpers/DepthContext.js | 25 + .../_internals/helpers/DoubleHelpers.js | 71 + .../_internals/helpers/DoubleOnlyHelpers.js | 31 + .../helpers/EnumerableKeysExtractor.js | 5 +- .../_internals/helpers/FloatHelpers.js | 21 +- .../_internals/helpers/FloatOnlyHelpers.js | 32 + .../_internals/helpers/FloatingOnlyHelpers.js | 5 +- .../helpers/GraphemeRangesHelpers.js | 14 +- .../helpers/InvalidSubdomainLabelFiIter.js | 13 + .../_internals/helpers/IsSubarrayOf.js | 36 + .../helpers/JsonConstraintsBuilder.js | 17 + .../helpers/MaxLengthFromMinLength.js | 106 + .../helpers/NoUndefinedAsContext.js | 15 + .../helpers/QualifiedObjectConstraints.js | 47 + .../arbitrary/_internals/helpers/ReadRegex.js | 10 +- .../_internals/helpers/SameValueSet.js | 38 + .../_internals/helpers/SameValueZeroSet.js | 28 + .../_internals/helpers/SanitizeRegexAst.js | 94 + .../_internals/helpers/ShrinkBigInt.js | 31 + .../_internals/helpers/ShrinkInteger.js | 35 + .../helpers/SlicesForStringBuilder.js | 82 + .../_internals/helpers/StrictlyEqualSet.js | 33 + .../_internals/helpers/TextEscaper.js | 10 + .../_internals/helpers/ToggleFlags.js | 53 + .../_internals/helpers/TokenizeRegex.js | 17 +- .../_internals/helpers/TokenizeString.js | 37 + .../helpers/ZipIterableIterators.js | 5 +- .../implementations/NoopSlicedGenerator.js | 17 + .../implementations/SchedulerImplem.js | 269 + .../implementations/SlicedBasedGenerator.js | 56 + .../_internals/interfaces/CustomSet.js | 2 + .../_internals/interfaces/EntityGraphTypes.js | 2 + .../_internals/interfaces/Scheduler.js | 2 + .../_internals/interfaces/SlicedGenerator.js | 2 + .../_internals/mappers/ArrayToMap.js | 16 + .../_internals/mappers/ArrayToSet.js | 16 + .../_internals/mappers/CharsToString.js | 14 + .../_internals/mappers/CodePointsToString.js | 14 + .../_internals/mappers/EntitiesToIPv6.js | 85 + .../mappers/IndexToMappedConstant.js | 71 + .../mappers/IndexToPrintableIndex.js | 18 + .../mappers/KeyValuePairsToObject.js | 48 + .../_internals/mappers/NatToStringifiedNat.js | 38 + .../_internals/mappers/NumberToPaddedEight.js | 21 + .../_internals/mappers/PaddedEightsToUuid.js | 19 + .../_internals/mappers/PartsToUrl.js | 8 +- .../_internals/mappers/PatternsToString.js | 32 + .../_internals/mappers/SegmentsToPath.js | 17 + .../_internals/mappers/StringToBase64.js | 31 + .../_internals/mappers/TimeToDate.js | 29 + .../_internals/mappers/UintToBase32String.js | 111 + .../_internals/mappers/UnboxedToBoxed.js | 25 + .../mappers/UnlinkedToLinkedEntities.js | 68 + .../mappers/ValuesAndSeparateKeysToObject.js | 14 +- .../mappers/VersionsApplierForUuid.js | 29 + .../_internals/mappers/WordsToLorem.js | 75 + .../_shared/StringSharedConstraints.js | 2 + .../fast-check/lib/cjs/arbitrary/anything.js | 8 + .../fast-check/lib/cjs/arbitrary/array.js | 16 + .../lib/cjs/arbitrary/base64String.js | 59 + .../fast-check/lib/cjs/arbitrary/bigInt.js | 33 + .../lib/cjs/arbitrary/bigInt64Array.js | 9 + .../lib/cjs/arbitrary/bigUint64Array.js | 9 + .../fast-check/lib/cjs/arbitrary/boolean.js | 16 + .../fast-check/lib/cjs/arbitrary/clone.js | 7 + .../fast-check/lib/cjs/arbitrary/commands.js | 11 + .../lib/cjs/arbitrary/compareBooleanFunc.js | 12 + .../lib/cjs/arbitrary/compareFunc.js | 12 + .../fast-check/lib/cjs/arbitrary/constant.js | 7 + .../lib/cjs/arbitrary/constantFrom.js | 10 + .../fast-check/lib/cjs/arbitrary/context.js | 25 + .../fast-check/lib/cjs/arbitrary/date.js | 23 + .../lib/cjs/arbitrary/dictionary.js | 21 + .../fast-check/lib/cjs/arbitrary/domain.js | 59 + .../fast-check/lib/cjs/arbitrary/double.js | 63 + .../lib/cjs/arbitrary/emailAddress.js | 48 + .../lib/cjs/arbitrary/entityGraph.js | 16 + .../fast-check/lib/cjs/arbitrary/falsy.js | 11 + .../fast-check/lib/cjs/arbitrary/float.js | 63 + .../lib/cjs/arbitrary/float32Array.js | 17 + .../lib/cjs/arbitrary/float64Array.js | 17 + .../fast-check/lib/cjs/arbitrary/func.js | 42 + .../fast-check/lib/cjs/arbitrary/gen.js | 7 + .../lib/cjs/arbitrary/infiniteStream.js | 10 + .../lib/cjs/arbitrary/int16Array.js | 9 + .../lib/cjs/arbitrary/int32Array.js | 9 + .../fast-check/lib/cjs/arbitrary/int8Array.js | 9 + .../fast-check/lib/cjs/arbitrary/integer.js | 23 + .../fast-check/lib/cjs/arbitrary/ipV4.js | 19 + .../lib/cjs/arbitrary/ipV4Extended.js | 19 + .../fast-check/lib/cjs/arbitrary/ipV6.js | 49 + .../fast-check/lib/cjs/arbitrary/json.js | 9 + .../fast-check/lib/cjs/arbitrary/jsonValue.js | 15 + .../fast-check/lib/cjs/arbitrary/letrec.js | 29 + .../lib/cjs/arbitrary/limitShrink.js | 7 + .../fast-check/lib/cjs/arbitrary/lorem.js | 27 + .../fast-check/lib/cjs/arbitrary/map.js | 19 + .../lib/cjs/arbitrary/mapToConstant.js | 23 + .../lib/cjs/arbitrary/maxSafeInteger.js | 9 + .../lib/cjs/arbitrary/maxSafeNat.js | 8 + .../fast-check/lib/cjs/arbitrary/memo.js | 18 + .../fast-check/lib/cjs/arbitrary/mixedCase.js | 16 + .../fast-check/lib/cjs/arbitrary/nat.js | 15 + .../fast-check/lib/cjs/arbitrary/noBias.js | 29 + .../fast-check/lib/cjs/arbitrary/noShrink.js | 30 + .../fast-check/lib/cjs/arbitrary/object.js | 16 + .../fast-check/lib/cjs/arbitrary/oneof.js | 28 + .../fast-check/lib/cjs/arbitrary/option.js | 22 + .../fast-check/lib/cjs/arbitrary/record.js | 25 + .../fast-check/lib/cjs/arbitrary/scheduler.js | 21 + .../fast-check/lib/cjs/arbitrary/set.js | 14 + .../lib/cjs/arbitrary/shuffledSubarray.js | 8 + .../lib/cjs/arbitrary/sparseArray.js | 79 + .../fast-check/lib/cjs/arbitrary/string.js | 32 + .../lib/cjs/arbitrary/stringMatching.js | 159 + .../fast-check/lib/cjs/arbitrary/subarray.js | 8 + .../fast-check/lib/cjs/arbitrary/tuple.js | 7 + .../lib/cjs/arbitrary/uint16Array.js | 9 + .../lib/cjs/arbitrary/uint32Array.js | 9 + .../lib/cjs/arbitrary/uint8Array.js | 9 + .../lib/cjs/arbitrary/uint8ClampedArray.js | 9 + .../fast-check/lib/cjs/arbitrary/ulid.js | 29 + .../lib/cjs/arbitrary/uniqueArray.js | 45 + .../fast-check/lib/cjs/arbitrary/uuid.js | 39 + .../lib/cjs/arbitrary/webAuthority.js | 52 + .../lib/cjs/arbitrary/webFragments.js | 7 + .../fast-check/lib/cjs/arbitrary/webPath.js | 10 + .../lib/cjs/arbitrary/webQueryParameters.js | 7 + .../lib/cjs/arbitrary/webSegment.js | 8 + .../fast-check/lib/cjs/arbitrary/webUrl.js | 25 + .../check/arbitrary/definition/Arbitrary.js | 171 + .../cjs/check/arbitrary/definition/Value.js | 30 + .../{esm => cjs}/check/model/ModelRunner.js | 15 +- .../{esm => cjs}/check/model/ReplayPath.js | 8 +- .../cjs/check/model/command/AsyncCommand.js | 2 + .../lib/cjs/check/model/command/Command.js | 2 + .../lib/cjs/check/model/command/ICommand.js | 2 + .../check/model/commands/CommandWrapper.js | 40 + .../model/commands/CommandsContraints.js | 2 + .../check/model/commands/CommandsIterable.js | 25 + .../check/model/commands/ScheduledCommand.js | 9 +- .../lib/cjs/check/precondition/Pre.js | 9 + .../check/precondition/PreconditionFailure.js | 15 + .../check/property/AsyncProperty.generic.js | 69 + .../lib/cjs/check/property/AsyncProperty.js | 18 + .../lib/cjs/check/property/IRawProperty.js | 7 + .../property/IgnoreEqualValuesProperty.js | 52 + .../cjs/check/property/Property.generic.js | 69 + .../lib/cjs/check/property/Property.js | 18 + .../cjs/check/property/SkipAfterProperty.js | 62 + .../lib/cjs/check/property/TimeoutProperty.js | 46 + .../cjs/check/property/UnbiasedProperty.js | 27 + .../lib/cjs/check/runner/DecorateProperty.js | 32 + .../fast-check/lib/cjs/check/runner/Runner.js | 66 + .../lib/cjs/check/runner/RunnerIterator.js | 46 + .../lib/cjs/check/runner/Sampler.js | 57 + .../check/runner/SourceValuesIterator.js | 6 +- .../fast-check/lib/cjs/check/runner/Tosser.js | 32 + .../runner/configuration/GlobalParameters.js | 15 + .../check/runner/configuration/Parameters.js | 2 + .../configuration/QualifiedParameters.js | 141 + .../check/runner/configuration/RandomType.js | 2 + .../runner/configuration/VerbosityLevel.js | 9 + .../check/runner/reporter/ExecutionStatus.js | 9 + .../check/runner/reporter/ExecutionTree.js | 2 + .../cjs/check/runner/reporter/RunDetails.js | 2 + .../check/runner/reporter/RunExecution.js | 31 +- .../check/runner/utils/PathWalker.js | 5 +- .../check/runner/utils/RunDetailsFormatter.js | 193 + .../fast-check/lib/cjs/check/symbols.js | 15 + .../fast-check/lib/cjs/fast-check-default.js | 212 + node_modules/fast-check/lib/cjs/fast-check.js | 19 + node_modules/fast-check/lib/cjs/package.json | 3 + .../lib/cjs/random/generator/Random.js | 40 + .../stream/LazyIterableIterator.js | 5 +- .../fast-check/lib/cjs/stream/Stream.js | 91 + .../lib/cjs/stream/StreamHelpers.js | 64 + .../_internals/AdapterArbitrary.d.ts | 0 .../_internals/AlwaysShrinkableArbitrary.d.ts | 0 .../arbitrary/_internals/ArrayArbitrary.d.ts | 0 .../arbitrary/_internals/BigIntArbitrary.d.ts | 0 .../arbitrary/_internals/CloneArbitrary.d.ts | 0 .../_internals/CommandsArbitrary.d.ts | 0 .../_internals/ConstantArbitrary.d.ts | 0 .../_internals/FrequencyArbitrary.d.ts | 0 .../_internals/GeneratorArbitrary.d.ts | 0 .../InitialPoolForEntityGraphArbitrary.d.ts} | 0 .../_internals/IntegerArbitrary.d.ts | 0 .../arbitrary/_internals/LazyArbitrary.d.ts | 0 .../_internals/LimitedShrinkArbitrary.d.ts | 0 .../_internals/MixedCaseArbitrary.d.ts | 0 ...OnTheFlyLinksForEntityGraphArbitrary.d.ts} | 0 .../_internals/SchedulerArbitrary.d.ts | 0 .../arbitrary/_internals/StreamArbitrary.d.ts | 0 .../_internals/StringUnitArbitrary.d.ts | 0 .../_internals/SubarrayArbitrary.d.ts | 0 .../arbitrary/_internals/TupleArbitrary.d.ts | 0 .../UnlinkedEntitiesForEntityGraph.d.ts} | 0 .../WithShrinkFromOtherArbitrary.d.ts | 0 .../builders/AnyArbitraryBuilder.d.ts | 0 .../builders/BoxedArbitraryBuilder.d.ts | 0 .../CharacterRangeArbitraryBuilder.d.ts | 0 .../CompareFunctionArbitraryBuilder.d.ts | 0 .../builders/GeneratorValueBuilder.d.ts | 0 .../PaddedNumberArbitraryBuilder.d.ts | 0 .../PartialRecordArbitraryBuilder.d.ts | 0 .../RestrictedIntegerArbitraryBuilder.d.ts | 0 .../StableArbitraryGeneratorCache.d.ts | 0 .../StringifiedNatArbitraryBuilder.d.ts | 0 .../TypedIntArrayArbitraryBuilder.d.ts | 0 .../builders/UriPathArbitraryBuilder.d.ts | 0 .../UriQueryOrFragmentArbitraryBuilder.d.ts | 0 .../_internals/data/GraphemeRanges.d.ts | 0 .../_internals/helpers/BiasNumericRange.d.ts | 0 .../BuildInversedRelationsMapping.d.ts} | 0 .../_internals/helpers/BuildSchedulerFor.d.ts | 0 .../helpers/BuildSlicedGenerator.d.ts | 0 .../_internals/helpers/CustomEqualSet.d.ts | 0 .../_internals/helpers/DepthContext.d.ts | 0 .../_internals/helpers/DoubleHelpers.d.ts | 0 .../_internals/helpers/DoubleOnlyHelpers.d.ts | 0 .../helpers/EnumerableKeysExtractor.d.ts | 0 .../_internals/helpers/FloatHelpers.d.ts | 0 .../_internals/helpers/FloatOnlyHelpers.d.ts | 0 .../helpers/FloatingOnlyHelpers.d.ts | 0 .../helpers/GraphemeRangesHelpers.d.ts | 0 .../helpers/InvalidSubdomainLabelFiIter.d.ts | 0 .../_internals/helpers/IsSubarrayOf.d.ts | 0 .../helpers/JsonConstraintsBuilder.d.ts | 58 + .../helpers/MaxLengthFromMinLength.d.ts | 0 .../helpers/NoUndefinedAsContext.d.ts | 0 .../helpers/QualifiedObjectConstraints.d.ts | 0 .../_internals/helpers/ReadRegex.d.ts | 0 .../_internals/helpers/SameValueSet.d.ts | 0 .../_internals/helpers/SameValueZeroSet.d.ts | 0 .../_internals/helpers/SanitizeRegexAst.d.ts | 0 .../_internals/helpers/ShrinkBigInt.d.ts | 0 .../_internals/helpers/ShrinkInteger.d.ts | 0 .../helpers/SlicesForStringBuilder.d.ts | 0 .../_internals/helpers/StrictlyEqualSet.d.ts | 0 .../_internals/helpers/TextEscaper.d.ts | 0 .../_internals/helpers/ToggleFlags.d.ts | 0 .../_internals/helpers/TokenizeRegex.d.ts | 0 .../_internals/helpers/TokenizeString.d.ts | 0 .../helpers/ZipIterableIterators.d.ts | 0 .../implementations/NoopSlicedGenerator.d.ts | 0 .../implementations/SchedulerImplem.d.ts | 0 .../implementations/SlicedBasedGenerator.d.ts | 0 .../_internals/interfaces/CustomSet.d.ts | 0 .../interfaces/EntityGraphTypes.d.ts | 194 + .../_internals/interfaces/Scheduler.d.ts | 186 + .../interfaces/SlicedGenerator.d.ts | 0 .../_internals/mappers/ArrayToMap.d.ts | 0 .../_internals/mappers/ArrayToSet.d.ts | 0 .../_internals/mappers/CharsToString.d.ts | 0 .../mappers/CodePointsToString.d.ts | 0 .../_internals/mappers/EntitiesToIPv6.d.ts | 0 .../mappers/IndexToMappedConstant.d.ts | 0 .../mappers/IndexToPrintableIndex.d.ts | 0 .../mappers/KeyValuePairsToObject.d.ts | 0 .../mappers/NatToStringifiedNat.d.ts | 0 .../mappers/NumberToPaddedEight.d.ts | 0 .../mappers/PaddedEightsToUuid.d.ts | 0 .../_internals/mappers/PartsToUrl.d.ts | 0 .../_internals/mappers/PatternsToString.d.ts | 0 .../_internals/mappers/SegmentsToPath.d.ts | 0 .../_internals/mappers/StringToBase64.d.ts | 0 .../_internals/mappers/TimeToDate.d.ts | 0 .../mappers/UintToBase32String.d.ts | 0 .../_internals/mappers/UnboxedToBoxed.d.ts | 0 .../mappers/UnlinkedToLinkedEntities.d.ts} | 0 .../ValuesAndSeparateKeysToObject.d.ts | 0 .../mappers/VersionsApplierForUuid.d.ts | 0 .../_internals/mappers/WordsToLorem.d.ts | 0 .../_shared/StringSharedConstraints.d.ts | 0 .../lib/cjs/types/arbitrary/anything.d.ts | 49 + .../{esm => cjs}/types/arbitrary/array.d.ts | 0 .../types/arbitrary/base64String.d.ts | 0 .../lib/cjs/types/arbitrary/bigInt.d.ts | 53 + .../cjs/types/arbitrary/bigInt64Array.d.ts | 9 + .../cjs/types/arbitrary/bigUint64Array.d.ts | 9 + .../{esm => cjs}/types/arbitrary/boolean.d.ts | 0 .../{esm => cjs}/types/arbitrary/clone.d.ts | 0 .../types/arbitrary/commands.d.ts | 0 .../types/arbitrary/compareBooleanFunc.d.ts | 0 .../types/arbitrary/compareFunc.d.ts | 0 .../lib/cjs/types/arbitrary/constant.d.ts | 8 + .../lib/cjs/types/arbitrary/constantFrom.d.ts | 24 + .../{esm => cjs}/types/arbitrary/context.d.ts | 0 .../lib/cjs/types/arbitrary/date.d.ts | 35 + .../lib/cjs/types/arbitrary/dictionary.d.ts | 62 + .../{esm => cjs}/types/arbitrary/domain.d.ts | 0 .../{esm => cjs}/types/arbitrary/double.d.ts | 0 .../types/arbitrary/emailAddress.d.ts | 0 .../lib/cjs/types/arbitrary/entityGraph.d.ts | 101 + .../lib/cjs/types/arbitrary/falsy.d.ts | 37 + .../{esm => cjs}/types/arbitrary/float.d.ts | 0 .../lib/cjs/types/arbitrary/float32Array.d.ts | 33 + .../lib/cjs/types/arbitrary/float64Array.d.ts | 33 + .../{esm => cjs}/types/arbitrary/func.d.ts | 0 .../lib/{esm => cjs}/types/arbitrary/gen.d.ts | 0 .../cjs/types/arbitrary/infiniteStream.d.ts | 33 + .../lib/cjs/types/arbitrary/int16Array.d.ts | 9 + .../lib/cjs/types/arbitrary/int32Array.d.ts | 9 + .../lib/cjs/types/arbitrary/int8Array.d.ts | 9 + .../{esm => cjs}/types/arbitrary/integer.d.ts | 0 .../{esm => cjs}/types/arbitrary/ipV4.d.ts | 0 .../types/arbitrary/ipV4Extended.d.ts | 0 .../{esm => cjs}/types/arbitrary/ipV6.d.ts | 0 .../{esm => cjs}/types/arbitrary/json.d.ts | 0 .../types/arbitrary/jsonValue.d.ts | 0 .../{esm => cjs}/types/arbitrary/letrec.d.ts | 0 .../types/arbitrary/limitShrink.d.ts | 0 .../{esm => cjs}/types/arbitrary/lorem.d.ts | 0 .../lib/cjs/types/arbitrary/map.d.ts | 47 + .../types/arbitrary/mapToConstant.d.ts | 0 .../types/arbitrary/maxSafeInteger.d.ts | 0 .../types/arbitrary/maxSafeNat.d.ts | 0 .../{esm => cjs}/types/arbitrary/memo.d.ts | 0 .../types/arbitrary/mixedCase.d.ts | 0 .../lib/cjs/types/arbitrary/nat.d.ts | 49 + .../lib/cjs/types/arbitrary/noBias.d.ts | 13 + .../lib/cjs/types/arbitrary/noShrink.d.ts | 15 + .../{esm => cjs}/types/arbitrary/object.d.ts | 0 .../{esm => cjs}/types/arbitrary/oneof.d.ts | 0 .../lib/cjs/types/arbitrary/option.d.ts | 54 + .../lib/cjs/types/arbitrary/record.d.ts | 55 + .../types/arbitrary/scheduler.d.ts | 0 .../lib/cjs/types/arbitrary/set.d.ts | 54 + .../types/arbitrary/shuffledSubarray.d.ts | 0 .../types/arbitrary/sparseArray.d.ts | 0 .../lib/cjs/types/arbitrary/string.d.ts | 41 + .../types/arbitrary/stringMatching.d.ts | 0 .../types/arbitrary/subarray.d.ts | 0 .../{esm => cjs}/types/arbitrary/tuple.d.ts | 0 .../lib/cjs/types/arbitrary/uint16Array.d.ts | 9 + .../lib/cjs/types/arbitrary/uint32Array.d.ts | 9 + .../lib/cjs/types/arbitrary/uint8Array.d.ts | 9 + .../types/arbitrary/uint8ClampedArray.d.ts | 9 + .../{esm => cjs}/types/arbitrary/ulid.d.ts | 0 .../types/arbitrary/uniqueArray.d.ts | 0 .../lib/cjs/types/arbitrary/uuid.d.ts | 25 + .../types/arbitrary/webAuthority.d.ts | 0 .../types/arbitrary/webFragments.d.ts | 0 .../{esm => cjs}/types/arbitrary/webPath.d.ts | 0 .../types/arbitrary/webQueryParameters.d.ts | 0 .../types/arbitrary/webSegment.d.ts | 0 .../{esm => cjs}/types/arbitrary/webUrl.d.ts | 0 .../check/arbitrary/definition/Arbitrary.d.ts | 127 + .../check/arbitrary/definition/Value.d.ts | 0 .../types/check/model/ModelRunner.d.ts | 0 .../types/check/model/ReplayPath.d.ts | 0 .../check/model/command/AsyncCommand.d.ts | 0 .../types/check/model/command/Command.d.ts | 0 .../types/check/model/command/ICommand.d.ts | 0 .../check/model/commands/CommandWrapper.d.ts | 14 + .../model/commands/CommandsContraints.d.ts | 0 .../model/commands/CommandsIterable.d.ts | 11 + .../model/commands/ScheduledCommand.d.ts | 0 .../types/check/precondition/Pre.d.ts | 0 .../precondition/PreconditionFailure.d.ts | 0 .../types/check/property/AsyncProperty.d.ts | 0 .../check/property/AsyncProperty.generic.d.ts | 0 .../types/check/property/IRawProperty.d.ts | 69 + .../property/IgnoreEqualValuesProperty.d.ts | 0 .../types/check/property/Property.d.ts | 0 .../check/property/Property.generic.d.ts | 0 .../check/property/SkipAfterProperty.d.ts | 0 .../types/check/property/TimeoutProperty.d.ts | 0 .../check/property/UnbiasedProperty.d.ts | 0 .../types/check/runner/DecorateProperty.d.ts | 0 .../types/check/runner/Runner.d.ts | 0 .../types/check/runner/RunnerIterator.d.ts | 0 .../types/check/runner/Sampler.d.ts | 0 .../check/runner/SourceValuesIterator.d.ts | 0 .../types/check/runner/Tosser.d.ts | 0 .../configuration/GlobalParameters.d.ts | 0 .../runner/configuration/Parameters.d.ts | 205 + .../configuration/QualifiedParameters.d.ts | 0 .../runner/configuration/RandomType.d.ts | 0 .../runner/configuration/VerbosityLevel.d.ts | 0 .../runner/reporter/ExecutionStatus.d.ts | 0 .../check/runner/reporter/ExecutionTree.d.ts | 0 .../check/runner/reporter/RunDetails.d.ts | 177 + .../check/runner/reporter/RunExecution.d.ts | 0 .../types/check/runner/utils/PathWalker.d.ts | 0 .../runner/utils/RunDetailsFormatter.d.ts | 0 .../lib/{esm => cjs}/types/check/symbols.d.ts | 0 .../lib/cjs/types/fast-check-default.d.ts | 175 + .../lib/{esm => cjs}/types/fast-check.d.ts | 0 .../cjs/types/random/generator/Random.d.ts | 55 + .../types/stream/LazyIterableIterator.d.ts | 0 .../lib/{esm => cjs}/types/stream/Stream.d.ts | 0 .../types/stream/StreamHelpers.d.ts | 0 .../lib/{esm => cjs}/types/utils/apply.d.ts | 0 .../lib/cjs/types/utils/globals.d.ts | 79 + .../lib/{esm => cjs}/types/utils/hash.d.ts | 0 .../{esm => cjs}/types/utils/stringify.d.ts | 0 .../_internals/AdapterArbitrary.d.ts} | 0 .../AlwaysShrinkableArbitrary.d.ts} | 0 .../arbitrary/_internals/ArrayArbitrary.d.ts} | 0 .../_internals/BigIntArbitrary.d.ts} | 0 .../arbitrary/_internals/CloneArbitrary.d.ts} | 0 .../_internals/CommandsArbitrary.d.ts} | 0 .../_internals/ConstantArbitrary.d.ts} | 0 .../_internals/FrequencyArbitrary.d.ts} | 0 .../_internals/GeneratorArbitrary.d.ts | 16 + .../InitialPoolForEntityGraphArbitrary.d.ts} | 0 .../_internals/IntegerArbitrary.d.ts | 1 + .../arbitrary/_internals/LazyArbitrary.d.ts | 1 + .../_internals/LimitedShrinkArbitrary.d.ts | 1 + .../_internals/MixedCaseArbitrary.d.ts | 1 + .../OnTheFlyLinksForEntityGraphArbitrary.d.ts | 1 + .../_internals/SchedulerArbitrary.d.ts | 1 + .../arbitrary/_internals/StreamArbitrary.d.ts | 1 + .../_internals/StringUnitArbitrary.d.ts | 1 + .../_internals/SubarrayArbitrary.d.ts | 1 + .../arbitrary/_internals/TupleArbitrary.d.ts | 1 + .../UnlinkedEntitiesForEntityGraph.d.ts | 1 + .../WithShrinkFromOtherArbitrary.d.ts | 1 + .../builders/AnyArbitraryBuilder.d.ts | 1 + .../builders/BoxedArbitraryBuilder.d.ts | 1 + .../CharacterRangeArbitraryBuilder.d.ts | 1 + .../CompareFunctionArbitraryBuilder.d.ts | 1 + .../builders/GeneratorValueBuilder.d.ts | 32 + .../PaddedNumberArbitraryBuilder.d.ts | 1 + .../PartialRecordArbitraryBuilder.d.ts | 1 + .../RestrictedIntegerArbitraryBuilder.d.ts | 1 + .../StableArbitraryGeneratorCache.d.ts | 4 + .../StringifiedNatArbitraryBuilder.d.ts | 1 + .../TypedIntArrayArbitraryBuilder.d.ts | 73 + .../builders/UriPathArbitraryBuilder.d.ts | 1 + .../UriQueryOrFragmentArbitraryBuilder.d.ts | 1 + .../_internals/data/GraphemeRanges.d.ts | 1 + .../_internals/helpers/BiasNumericRange.d.ts | 5 + .../BuildInversedRelationsMapping.d.ts | 1 + .../_internals/helpers/BuildSchedulerFor.d.ts | 1 + .../helpers/BuildSlicedGenerator.d.ts | 1 + .../_internals/helpers/CustomEqualSet.d.ts | 1 + .../_internals/helpers/DepthContext.d.ts | 39 + .../_internals/helpers/DoubleHelpers.d.ts | 1 + .../_internals/helpers/DoubleOnlyHelpers.d.ts | 10 + .../helpers/EnumerableKeysExtractor.d.ts | 1 + .../_internals/helpers/FloatHelpers.d.ts | 1 + .../_internals/helpers/FloatOnlyHelpers.d.ts | 10 + .../helpers/FloatingOnlyHelpers.d.ts | 1 + .../helpers/GraphemeRangesHelpers.d.ts | 1 + .../helpers/InvalidSubdomainLabelFiIter.d.ts | 1 + .../_internals/helpers/IsSubarrayOf.d.ts | 1 + .../helpers/JsonConstraintsBuilder.d.ts | 58 + .../helpers/MaxLengthFromMinLength.d.ts | 45 + .../helpers/NoUndefinedAsContext.d.ts | 1 + .../helpers/QualifiedObjectConstraints.d.ts | 113 + .../_internals/helpers/ReadRegex.d.ts | 4 + .../_internals/helpers/SameValueSet.d.ts | 1 + .../_internals/helpers/SameValueZeroSet.d.ts | 1 + .../_internals/helpers/SanitizeRegexAst.d.ts | 1 + .../_internals/helpers/ShrinkBigInt.d.ts | 1 + .../_internals/helpers/ShrinkInteger.d.ts | 1 + .../helpers/SlicesForStringBuilder.d.ts | 1 + .../_internals/helpers/StrictlyEqualSet.d.ts | 1 + .../_internals/helpers/TextEscaper.d.ts | 1 + .../_internals/helpers/ToggleFlags.d.ts | 1 + .../_internals/helpers/TokenizeRegex.d.ts | 88 + .../_internals/helpers/TokenizeString.d.ts | 1 + .../helpers/ZipIterableIterators.d.ts | 1 + .../implementations/NoopSlicedGenerator.d.ts | 1 + .../implementations/SchedulerImplem.d.ts | 1 + .../implementations/SlicedBasedGenerator.d.ts | 1 + .../_internals/interfaces/CustomSet.d.ts | 1 + .../interfaces/EntityGraphTypes.d.ts | 194 + .../_internals/interfaces/Scheduler.d.ts | 186 + .../interfaces/SlicedGenerator.d.ts | 1 + .../_internals/mappers/ArrayToMap.d.ts | 1 + .../_internals/mappers/ArrayToSet.d.ts | 1 + .../_internals/mappers/CharsToString.d.ts | 1 + .../mappers/CodePointsToString.d.ts | 1 + .../_internals/mappers/EntitiesToIPv6.d.ts | 1 + .../mappers/IndexToMappedConstant.d.ts | 1 + .../mappers/IndexToPrintableIndex.d.ts | 1 + .../mappers/KeyValuePairsToObject.d.ts | 1 + .../mappers/NatToStringifiedNat.d.ts | 1 + .../mappers/NumberToPaddedEight.d.ts | 1 + .../mappers/PaddedEightsToUuid.d.ts | 1 + .../_internals/mappers/PartsToUrl.d.ts | 1 + .../_internals/mappers/PatternsToString.d.ts | 1 + .../_internals/mappers/SegmentsToPath.d.ts | 1 + .../_internals/mappers/StringToBase64.d.ts | 1 + .../_internals/mappers/TimeToDate.d.ts | 1 + .../mappers/UintToBase32String.d.ts | 1 + .../_internals/mappers/UnboxedToBoxed.d.ts | 1 + .../mappers/UnlinkedToLinkedEntities.d.ts | 1 + .../ValuesAndSeparateKeysToObject.d.ts | 1 + .../mappers/VersionsApplierForUuid.d.ts | 1 + .../_internals/mappers/WordsToLorem.d.ts | 1 + .../_shared/StringSharedConstraints.d.ts | 25 + .../lib/cjs/types57/arbitrary/anything.d.ts | 49 + .../lib/cjs/types57/arbitrary/array.d.ts | 57 + .../cjs/types57/arbitrary/base64String.d.ts | 15 + .../lib/cjs/types57/arbitrary/bigInt.d.ts | 53 + .../types57}/arbitrary/bigInt64Array.d.ts | 0 .../types57}/arbitrary/bigUint64Array.d.ts | 0 .../lib/cjs/types57/arbitrary/boolean.d.ts | 8 + .../lib/cjs/types57/arbitrary/clone.d.ts | 18 + .../lib/cjs/types57/arbitrary/commands.d.ts | 31 + .../types57/arbitrary/compareBooleanFunc.d.ts | 12 + .../cjs/types57/arbitrary/compareFunc.d.ts | 17 + .../lib/cjs/types57/arbitrary/constant.d.ts | 8 + .../cjs/types57/arbitrary/constantFrom.d.ts | 24 + .../lib/cjs/types57/arbitrary/context.d.ts | 26 + .../lib/cjs/types57/arbitrary/date.d.ts | 35 + .../lib/cjs/types57/arbitrary/dictionary.d.ts | 62 + .../lib/cjs/types57/arbitrary/domain.d.ts | 29 + .../lib/cjs/types57/arbitrary/double.d.ts | 66 + .../cjs/types57/arbitrary/emailAddress.d.ts | 27 + .../cjs/types57/arbitrary/entityGraph.d.ts | 101 + .../lib/cjs/types57/arbitrary/falsy.d.ts | 37 + .../lib/cjs/types57/arbitrary/float.d.ts | 69 + .../types57}/arbitrary/float32Array.d.ts | 0 .../types57}/arbitrary/float64Array.d.ts | 0 .../lib/cjs/types57/arbitrary/func.d.ts | 10 + .../lib/cjs/types57/arbitrary/gen.d.ts | 37 + .../cjs/types57/arbitrary/infiniteStream.d.ts | 33 + .../types57}/arbitrary/int16Array.d.ts | 0 .../types57}/arbitrary/int32Array.d.ts | 0 .../types57}/arbitrary/int8Array.d.ts | 0 .../lib/cjs/types57/arbitrary/integer.d.ts | 29 + .../lib/cjs/types57/arbitrary/ipV4.d.ts | 10 + .../cjs/types57/arbitrary/ipV4Extended.d.ts | 12 + .../lib/cjs/types57/arbitrary/ipV6.d.ts | 10 + .../lib/cjs/types57/arbitrary/json.d.ts | 14 + .../lib/cjs/types57/arbitrary/jsonValue.d.ts | 17 + .../lib/cjs/types57/arbitrary/letrec.d.ts | 87 + .../cjs/types57/arbitrary/limitShrink.d.ts | 22 + .../lib/cjs/types57/arbitrary/lorem.d.ts | 41 + .../lib/cjs/types57/arbitrary/map.d.ts | 47 + .../cjs/types57/arbitrary/mapToConstant.d.ts | 23 + .../cjs/types57/arbitrary/maxSafeInteger.d.ts | 7 + .../lib/cjs/types57/arbitrary/maxSafeNat.d.ts | 7 + .../lib/cjs/types57/arbitrary/memo.d.ts | 27 + .../lib/cjs/types57/arbitrary/mixedCase.d.ts | 34 + .../lib/cjs/types57/arbitrary/nat.d.ts | 49 + .../lib/cjs/types57/arbitrary/noBias.d.ts | 13 + .../lib/cjs/types57/arbitrary/noShrink.d.ts | 15 + .../lib/cjs/types57/arbitrary/object.d.ts | 34 + .../lib/cjs/types57/arbitrary/oneof.d.ts | 105 + .../lib/cjs/types57/arbitrary/option.d.ts | 54 + .../lib/cjs/types57/arbitrary/record.d.ts | 55 + .../lib/cjs/types57/arbitrary/scheduler.d.ts | 76 + .../lib/cjs/types57/arbitrary/set.d.ts | 54 + .../types57/arbitrary/shuffledSubarray.d.ts | 30 + .../cjs/types57/arbitrary/sparseArray.d.ts | 61 + .../lib/cjs/types57/arbitrary/string.d.ts | 41 + .../cjs/types57/arbitrary/stringMatching.d.ts | 24 + .../lib/cjs/types57/arbitrary/subarray.d.ts | 30 + .../lib/cjs/types57/arbitrary/tuple.d.ts | 12 + .../types57}/arbitrary/uint16Array.d.ts | 0 .../types57}/arbitrary/uint32Array.d.ts | 0 .../types57}/arbitrary/uint8Array.d.ts | 0 .../types57}/arbitrary/uint8ClampedArray.d.ts | 0 .../lib/cjs/types57/arbitrary/ulid.d.ts | 12 + .../cjs/types57/arbitrary/uniqueArray.d.ts | 159 + .../lib/cjs/types57/arbitrary/uuid.d.ts | 25 + .../cjs/types57/arbitrary/webAuthority.d.ts | 55 + .../cjs/types57/arbitrary/webFragments.d.ts | 27 + .../lib/cjs/types57/arbitrary/webPath.d.ts | 26 + .../types57/arbitrary/webQueryParameters.d.ts | 27 + .../lib/cjs/types57/arbitrary/webSegment.d.ts | 27 + .../lib/cjs/types57/arbitrary/webUrl.d.ts | 51 + .../check/arbitrary/definition/Arbitrary.d.ts | 127 + .../check/arbitrary/definition/Value.d.ts | 38 + .../cjs/types57/check/model/ModelRunner.d.ts | 58 + .../cjs/types57/check/model/ReplayPath.d.ts | 1 + .../check/model/command/AsyncCommand.d.ts | 10 + .../types57/check/model/command/Command.d.ts | 10 + .../types57/check/model/command/ICommand.d.ts | 33 + .../check/model/commands/CommandWrapper.d.ts | 14 + .../model/commands/CommandsContraints.d.ts | 36 + .../model/commands/CommandsIterable.d.ts | 11 + .../model/commands/ScheduledCommand.d.ts | 1 + .../cjs/types57/check/precondition/Pre.d.ts | 7 + .../precondition/PreconditionFailure.d.ts | 10 + .../types57/check/property/AsyncProperty.d.ts | 13 + .../check/property/AsyncProperty.generic.d.ts | 36 + .../types57/check/property/IRawProperty.d.ts | 69 + .../property/IgnoreEqualValuesProperty.d.ts | 1 + .../cjs/types57/check/property/Property.d.ts | 13 + .../check/property/Property.generic.d.ts | 48 + .../check/property/SkipAfterProperty.d.ts | 1 + .../check/property/TimeoutProperty.d.ts | 1 + .../check/property/UnbiasedProperty.d.ts | 1 + .../check/runner/DecorateProperty.d.ts | 1 + .../lib/cjs/types57/check/runner/Runner.d.ts | 89 + .../types57/check/runner/RunnerIterator.d.ts | 1 + .../lib/cjs/types57/check/runner/Sampler.d.ts | 45 + .../check/runner/SourceValuesIterator.d.ts | 1 + .../lib/cjs/types57/check/runner/Tosser.d.ts | 1 + .../configuration/GlobalParameters.d.ts | 116 + .../runner/configuration/Parameters.d.ts | 205 + .../configuration/QualifiedParameters.d.ts | 1 + .../runner/configuration/RandomType.d.ts | 7 + .../runner/configuration/VerbosityLevel.d.ts | 37 + .../runner/reporter/ExecutionStatus.d.ts | 10 + .../check/runner/reporter/ExecutionTree.d.ts | 23 + .../check/runner/reporter/RunDetails.d.ts | 177 + .../check/runner/reporter/RunExecution.d.ts | 1 + .../check/runner/utils/PathWalker.d.ts | 1 + .../runner/utils/RunDetailsFormatter.d.ts | 70 + .../lib/cjs/types57/check/symbols.d.ts | 34 + .../lib/cjs/types57/fast-check-default.d.ts | 175 + .../types57/fast-check.d.ts} | 0 .../cjs/types57/random/generator/Random.d.ts | 55 + .../types57/stream/LazyIterableIterator.d.ts | 1 + .../lib/cjs/types57/stream/Stream.d.ts | 145 + .../lib/cjs/types57/stream/StreamHelpers.d.ts | 1 + .../lib/cjs/types57/utils/apply.d.ts | 1 + .../lib/cjs/types57/utils/globals.d.ts | 79 + .../lib/cjs/types57/utils/hash.d.ts | 11 + .../lib/cjs/types57/utils/stringify.d.ts | 72 + .../lib/{esm => cjs}/utils/apply.js | 7 +- .../fast-check/lib/cjs/utils/globals.js | 576 + node_modules/fast-check/lib/cjs/utils/hash.js | 71 + .../fast-check/lib/cjs/utils/stringify.js | 266 + .../arbitrary/_internals/AdapterArbitrary.js | 38 - .../_internals/AlwaysShrinkableArbitrary.js | 23 - .../arbitrary/_internals/ArrayArbitrary.js | 219 - .../_internals/ArrayInt64Arbitrary.js | 124 - .../arbitrary/_internals/BigIntArbitrary.js | 67 - .../arbitrary/_internals/CloneArbitrary.js | 80 - .../arbitrary/_internals/CommandsArbitrary.js | 106 - .../arbitrary/_internals/ConstantArbitrary.js | 61 - .../_internals/GeneratorArbitrary.js | 40 - .../arbitrary/_internals/IntegerArbitrary.js | 72 - .../esm/arbitrary/_internals/LazyArbitrary.js | 26 - .../_internals/LimitedShrinkArbitrary.js | 50 - .../_internals/MixedCaseArbitrary.js | 91 - .../_internals/SchedulerArbitrary.js | 28 - .../arbitrary/_internals/StreamArbitrary.js | 43 - .../_internals/StringUnitArbitrary.js | 42 - .../arbitrary/_internals/SubarrayArbitrary.js | 70 - .../arbitrary/_internals/TupleArbitrary.js | 81 - .../WithShrinkFromOtherArbitrary.js | 39 - .../builders/AnyArbitraryBuilder.js | 66 - .../builders/BoxedArbitraryBuilder.js | 4 - .../builders/CharacterArbitraryBuilder.js | 5 - .../CharacterRangeArbitraryBuilder.js | 61 - .../CompareFunctionArbitraryBuilder.js | 43 - .../builders/GeneratorValueBuilder.js | 38 - .../builders/PaddedNumberArbitraryBuilder.js | 5 - .../builders/PartialRecordArbitraryBuilder.js | 23 - .../RestrictedIntegerArbitraryBuilder.js | 10 - .../builders/StableArbitraryGeneratorCache.js | 52 - .../StringifiedNatArbitraryBuilder.js | 7 - .../builders/TypedIntArrayArbitraryBuilder.js | 30 - .../builders/UriPathArbitraryBuilder.js | 28 - .../UriQueryOrFragmentArbitraryBuilder.js | 5 - .../_internals/helpers/ArrayInt64.js | 86 - .../_internals/helpers/BiasNumericRange.js | 32 - .../_internals/helpers/BuildSchedulerFor.js | 21 - .../helpers/BuildSlicedGenerator.js | 8 - .../_internals/helpers/CustomEqualSet.js | 22 - .../_internals/helpers/DepthContext.js | 21 - .../_internals/helpers/DoubleHelpers.js | 85 - .../_internals/helpers/DoubleOnlyHelpers.js | 25 - .../_internals/helpers/FloatOnlyHelpers.js | 26 - .../helpers/InvalidSubdomainLabelFiIter.js | 10 - .../_internals/helpers/IsSubarrayOf.js | 33 - .../helpers/JsonConstraintsBuilder.js | 14 - .../helpers/MaxLengthFromMinLength.js | 83 - .../helpers/NoUndefinedAsContext.js | 11 - .../helpers/QualifiedObjectConstraints.js | 46 - .../_internals/helpers/SameValueSet.js | 34 - .../_internals/helpers/SameValueZeroSet.js | 24 - .../_internals/helpers/SanitizeRegexAst.js | 81 - .../_internals/helpers/ShrinkBigInt.js | 28 - .../_internals/helpers/ShrinkInteger.js | 32 - .../helpers/SlicesForStringBuilder.js | 78 - .../_internals/helpers/StrictlyEqualSet.js | 29 - .../_internals/helpers/TextEscaper.js | 6 - .../_internals/helpers/ToggleFlags.js | 46 - .../_internals/helpers/TokenizeString.js | 34 - .../implementations/NoopSlicedGenerator.js | 13 - .../implementations/SchedulerImplem.js | 192 - .../implementations/SlicedBasedGenerator.js | 52 - .../_internals/mappers/ArrayToMap.js | 12 - .../_internals/mappers/ArrayToSet.js | 12 - .../_internals/mappers/CharsToString.js | 10 - .../_internals/mappers/CodePointsToString.js | 10 - .../_internals/mappers/EntitiesToIPv6.js | 71 - .../_internals/mappers/IndexToCharString.js | 19 - .../mappers/IndexToMappedConstant.js | 67 - .../mappers/IndexToPrintableIndex.js | 14 - .../mappers/KeyValuePairsToObject.js | 48 - .../_internals/mappers/NatToStringifiedNat.js | 33 - .../_internals/mappers/NumberToPaddedEight.js | 17 - .../_internals/mappers/PaddedEightsToUuid.js | 15 - .../_internals/mappers/PatternsToString.js | 27 - .../_internals/mappers/SegmentsToPath.js | 13 - .../_internals/mappers/StringToBase64.js | 27 - .../_internals/mappers/TimeToDate.js | 23 - .../_internals/mappers/UintToBase32String.js | 106 - .../_internals/mappers/UnboxedToBoxed.js | 21 - .../mappers/VersionsApplierForUuid.js | 26 - .../_internals/mappers/WordsToLorem.js | 67 - .../fast-check/lib/esm/arbitrary/anything.js | 6 - .../fast-check/lib/esm/arbitrary/array.js | 14 - .../fast-check/lib/esm/arbitrary/ascii.js | 5 - .../lib/esm/arbitrary/asciiString.js | 13 - .../fast-check/lib/esm/arbitrary/base64.js | 22 - .../lib/esm/arbitrary/base64String.js | 30 - .../fast-check/lib/esm/arbitrary/bigInt.js | 31 - .../lib/esm/arbitrary/bigInt64Array.js | 6 - .../fast-check/lib/esm/arbitrary/bigIntN.js | 10 - .../fast-check/lib/esm/arbitrary/bigUint.js | 14 - .../lib/esm/arbitrary/bigUint64Array.js | 6 - .../fast-check/lib/esm/arbitrary/bigUintN.js | 10 - .../fast-check/lib/esm/arbitrary/boolean.js | 14 - .../fast-check/lib/esm/arbitrary/char.js | 7 - .../lib/esm/arbitrary/char16bits.js | 5 - .../fast-check/lib/esm/arbitrary/clone.js | 5 - .../fast-check/lib/esm/arbitrary/commands.js | 9 - .../lib/esm/arbitrary/compareBooleanFunc.js | 9 - .../lib/esm/arbitrary/compareFunc.js | 9 - .../fast-check/lib/esm/arbitrary/constant.js | 4 - .../lib/esm/arbitrary/constantFrom.js | 8 - .../fast-check/lib/esm/arbitrary/context.js | 22 - .../fast-check/lib/esm/arbitrary/date.js | 20 - .../lib/esm/arbitrary/dictionary.js | 18 - .../fast-check/lib/esm/arbitrary/domain.js | 56 - .../fast-check/lib/esm/arbitrary/double.js | 60 - .../lib/esm/arbitrary/emailAddress.js | 45 - .../fast-check/lib/esm/arbitrary/falsy.js | 8 - .../fast-check/lib/esm/arbitrary/float.js | 60 - .../lib/esm/arbitrary/float32Array.js | 14 - .../lib/esm/arbitrary/float64Array.js | 14 - .../lib/esm/arbitrary/fullUnicode.js | 18 - .../lib/esm/arbitrary/fullUnicodeString.js | 13 - .../fast-check/lib/esm/arbitrary/func.js | 39 - .../fast-check/lib/esm/arbitrary/gen.js | 4 - .../fast-check/lib/esm/arbitrary/hexa.js | 16 - .../lib/esm/arbitrary/hexaString.js | 14 - .../lib/esm/arbitrary/infiniteStream.js | 5 - .../lib/esm/arbitrary/int16Array.js | 6 - .../lib/esm/arbitrary/int32Array.js | 6 - .../fast-check/lib/esm/arbitrary/int8Array.js | 6 - .../fast-check/lib/esm/arbitrary/integer.js | 20 - .../fast-check/lib/esm/arbitrary/ipV4.js | 16 - .../lib/esm/arbitrary/ipV4Extended.js | 16 - .../fast-check/lib/esm/arbitrary/ipV6.js | 21 - .../fast-check/lib/esm/arbitrary/json.js | 5 - .../fast-check/lib/esm/arbitrary/jsonValue.js | 13 - .../fast-check/lib/esm/arbitrary/letrec.js | 23 - .../lib/esm/arbitrary/limitShrink.js | 4 - .../fast-check/lib/esm/arbitrary/lorem.js | 24 - .../lib/esm/arbitrary/mapToConstant.js | 20 - .../lib/esm/arbitrary/maxSafeInteger.js | 6 - .../lib/esm/arbitrary/maxSafeNat.js | 5 - .../fast-check/lib/esm/arbitrary/memo.js | 15 - .../fast-check/lib/esm/arbitrary/mixedCase.js | 16 - .../fast-check/lib/esm/arbitrary/nat.js | 13 - .../fast-check/lib/esm/arbitrary/noBias.js | 3 - .../fast-check/lib/esm/arbitrary/noShrink.js | 3 - .../fast-check/lib/esm/arbitrary/object.js | 14 - .../fast-check/lib/esm/arbitrary/oneof.js | 26 - .../fast-check/lib/esm/arbitrary/option.js | 19 - .../fast-check/lib/esm/arbitrary/record.js | 27 - .../fast-check/lib/esm/arbitrary/scheduler.js | 18 - .../lib/esm/arbitrary/shuffledSubarray.js | 5 - .../lib/esm/arbitrary/sparseArray.js | 76 - .../fast-check/lib/esm/arbitrary/string.js | 32 - .../lib/esm/arbitrary/string16bits.js | 13 - .../lib/esm/arbitrary/stringMatching.js | 152 - .../fast-check/lib/esm/arbitrary/stringOf.js | 12 - .../fast-check/lib/esm/arbitrary/subarray.js | 5 - .../fast-check/lib/esm/arbitrary/tuple.js | 4 - .../lib/esm/arbitrary/uint16Array.js | 6 - .../lib/esm/arbitrary/uint32Array.js | 6 - .../lib/esm/arbitrary/uint8Array.js | 6 - .../lib/esm/arbitrary/uint8ClampedArray.js | 6 - .../fast-check/lib/esm/arbitrary/ulid.js | 26 - .../fast-check/lib/esm/arbitrary/unicode.js | 18 - .../lib/esm/arbitrary/unicodeJson.js | 5 - .../lib/esm/arbitrary/unicodeJsonValue.js | 6 - .../lib/esm/arbitrary/unicodeString.js | 13 - .../lib/esm/arbitrary/uniqueArray.js | 42 - .../fast-check/lib/esm/arbitrary/uuid.js | 36 - .../fast-check/lib/esm/arbitrary/uuidV.js | 10 - .../lib/esm/arbitrary/webAuthority.js | 49 - .../lib/esm/arbitrary/webFragments.js | 4 - .../fast-check/lib/esm/arbitrary/webPath.js | 7 - .../lib/esm/arbitrary/webQueryParameters.js | 4 - .../lib/esm/arbitrary/webSegment.js | 5 - .../fast-check/lib/esm/arbitrary/webUrl.js | 25 - .../check/arbitrary/definition/Arbitrary.js | 207 - .../esm/check/arbitrary/definition/Value.js | 26 - .../check/model/commands/CommandWrapper.js | 35 - .../check/model/commands/CommandsIterable.js | 21 - .../lib/esm/check/precondition/Pre.js | 6 - .../check/precondition/PreconditionFailure.js | 11 - .../check/property/AsyncProperty.generic.js | 79 - .../lib/esm/check/property/AsyncProperty.js | 16 - .../lib/esm/check/property/IRawProperty.js | 4 - .../property/IgnoreEqualValuesProperty.js | 46 - .../esm/check/property/Property.generic.js | 79 - .../lib/esm/check/property/Property.js | 16 - .../esm/check/property/SkipAfterProperty.js | 56 - .../lib/esm/check/property/TimeoutProperty.js | 43 - .../esm/check/property/UnbiasedProperty.js | 21 - .../lib/esm/check/runner/DecorateProperty.js | 29 - .../fast-check/lib/esm/check/runner/Runner.js | 71 - .../lib/esm/check/runner/RunnerIterator.js | 42 - .../lib/esm/check/runner/Sampler.js | 52 - .../fast-check/lib/esm/check/runner/Tosser.js | 28 - .../runner/configuration/GlobalParameters.js | 10 - .../configuration/QualifiedParameters.js | 140 - .../runner/configuration/VerbosityLevel.js | 6 - .../check/runner/reporter/ExecutionStatus.js | 6 - .../check/runner/utils/RunDetailsFormatter.js | 161 - .../fast-check/lib/esm/check/symbols.js | 10 - .../fast-check/lib/esm/fast-check-default.js | 112 - .../lib/esm/random/generator/Random.js | 39 - .../fast-check/lib/esm/stream/Stream.js | 86 - .../lib/esm/stream/StreamHelpers.js | 55 - .../helpers/JsonConstraintsBuilder.d.ts | 82 - .../_internals/interfaces/Scheduler.d.ts | 165 - .../lib/esm/types/arbitrary/anything.d.ts | 49 - .../lib/esm/types/arbitrary/ascii.d.ts | 8 - .../lib/esm/types/arbitrary/asciiString.d.ts | 13 - .../lib/esm/types/arbitrary/base64.d.ts | 8 - .../lib/esm/types/arbitrary/bigInt.d.ts | 44 - .../lib/esm/types/arbitrary/bigIntN.d.ts | 13 - .../lib/esm/types/arbitrary/bigUint.d.ts | 40 - .../lib/esm/types/arbitrary/bigUintN.d.ts | 13 - .../lib/esm/types/arbitrary/char.d.ts | 11 - .../lib/esm/types/arbitrary/char16bits.d.ts | 14 - .../lib/esm/types/arbitrary/constant.d.ts | 8 - .../lib/esm/types/arbitrary/constantFrom.d.ts | 24 - .../lib/esm/types/arbitrary/date.d.ts | 35 - .../lib/esm/types/arbitrary/dictionary.d.ts | 52 - .../lib/esm/types/arbitrary/falsy.d.ts | 37 - .../lib/esm/types/arbitrary/fullUnicode.d.ts | 13 - .../types/arbitrary/fullUnicodeString.d.ts | 13 - .../lib/esm/types/arbitrary/hexa.d.ts | 8 - .../lib/esm/types/arbitrary/hexaString.d.ts | 14 - .../esm/types/arbitrary/infiniteStream.d.ts | 14 - .../lib/esm/types/arbitrary/nat.d.ts | 40 - .../lib/esm/types/arbitrary/noBias.d.ts | 10 - .../lib/esm/types/arbitrary/noShrink.d.ts | 15 - .../lib/esm/types/arbitrary/option.d.ts | 54 - .../lib/esm/types/arbitrary/record.d.ts | 94 - .../lib/esm/types/arbitrary/string.d.ts | 39 - .../lib/esm/types/arbitrary/string16bits.d.ts | 13 - .../lib/esm/types/arbitrary/stringOf.d.ts | 14 - .../lib/esm/types/arbitrary/unicode.d.ts | 8 - .../lib/esm/types/arbitrary/unicodeJson.d.ts | 15 - .../esm/types/arbitrary/unicodeJsonValue.d.ts | 18 - .../esm/types/arbitrary/unicodeString.d.ts | 13 - .../lib/esm/types/arbitrary/uuid.d.ts | 25 - .../lib/esm/types/arbitrary/uuidV.d.ts | 13 - .../check/arbitrary/definition/Arbitrary.d.ts | 148 - .../check/model/commands/CommandWrapper.d.ts | 17 - .../model/commands/CommandsIterable.d.ts | 13 - .../types/check/property/IRawProperty.d.ts | 75 - .../runner/configuration/Parameters.d.ts | 203 - .../check/runner/reporter/RunDetails.d.ts | 186 - .../lib/esm/types/fast-check-default.d.ts | 190 - .../esm/types/random/generator/Random.d.ts | 70 - .../lib/esm/types/utils/globals.d.ts | 76 - .../fast-check/lib/esm/utils/globals.js | 503 - node_modules/fast-check/lib/esm/utils/hash.js | 68 - .../fast-check/lib/esm/utils/stringify.js | 260 - .../fast-check/lib/fast-check-default.js | 340 +- node_modules/fast-check/lib/fast-check.js | 22 +- .../fast-check/lib/random/generator/Random.js | 19 +- .../lib/stream/LazyIterableIterator.js | 5 +- node_modules/fast-check/lib/stream/Stream.js | 25 +- .../fast-check/lib/stream/StreamHelpers.js | 23 +- .../InitialPoolForEntityGraphArbitrary.d.ts | 1 + .../OnTheFlyLinksForEntityGraphArbitrary.d.ts | 1 + .../UnlinkedEntitiesForEntityGraph.d.ts | 1 + .../BuildInversedRelationsMapping.d.ts | 1 + .../helpers/JsonConstraintsBuilder.d.ts | 26 +- .../interfaces/EntityGraphTypes.d.ts | 194 + .../_internals/interfaces/Scheduler.d.ts | 21 + .../mappers/UnlinkedToLinkedEntities.d.ts | 1 + .../lib/types/arbitrary/anything.d.ts | 2 +- .../fast-check/lib/types/arbitrary/ascii.d.ts | 8 - .../lib/types/arbitrary/asciiString.d.ts | 13 - .../lib/types/arbitrary/base64.d.ts | 8 - .../lib/types/arbitrary/bigInt.d.ts | 9 + .../lib/types/arbitrary/bigInt64Array.d.ts | 2 +- .../lib/types/arbitrary/bigIntN.d.ts | 13 - .../lib/types/arbitrary/bigUint.d.ts | 40 - .../lib/types/arbitrary/bigUint64Array.d.ts | 2 +- .../lib/types/arbitrary/bigUintN.d.ts | 13 - .../fast-check/lib/types/arbitrary/char.d.ts | 11 - .../lib/types/arbitrary/char16bits.d.ts | 14 - .../lib/types/arbitrary/constant.d.ts | 2 +- .../lib/types/arbitrary/constantFrom.d.ts | 2 +- .../fast-check/lib/types/arbitrary/date.d.ts | 2 +- .../lib/types/arbitrary/dictionary.d.ts | 12 +- .../lib/types/arbitrary/entityGraph.d.ts | 101 + .../fast-check/lib/types/arbitrary/falsy.d.ts | 2 +- .../lib/types/arbitrary/float32Array.d.ts | 2 +- .../lib/types/arbitrary/float64Array.d.ts | 2 +- .../lib/types/arbitrary/fullUnicode.d.ts | 13 - .../types/arbitrary/fullUnicodeString.d.ts | 13 - .../fast-check/lib/types/arbitrary/hexa.d.ts | 8 - .../lib/types/arbitrary/hexaString.d.ts | 14 - .../lib/types/arbitrary/infiniteStream.d.ts | 21 +- .../lib/types/arbitrary/int16Array.d.ts | 2 +- .../lib/types/arbitrary/int32Array.d.ts | 2 +- .../lib/types/arbitrary/int8Array.d.ts | 2 +- .../fast-check/lib/types/arbitrary/map.d.ts | 47 + .../fast-check/lib/types/arbitrary/nat.d.ts | 9 + .../lib/types/arbitrary/noBias.d.ts | 5 +- .../lib/types/arbitrary/noShrink.d.ts | 2 +- .../lib/types/arbitrary/option.d.ts | 4 +- .../lib/types/arbitrary/record.d.ts | 57 +- .../fast-check/lib/types/arbitrary/set.d.ts | 54 + .../lib/types/arbitrary/string.d.ts | 2 + .../lib/types/arbitrary/string16bits.d.ts | 13 - .../lib/types/arbitrary/stringOf.d.ts | 14 - .../lib/types/arbitrary/uint16Array.d.ts | 2 +- .../lib/types/arbitrary/uint32Array.d.ts | 2 +- .../lib/types/arbitrary/uint8Array.d.ts | 2 +- .../types/arbitrary/uint8ClampedArray.d.ts | 2 +- .../lib/types/arbitrary/unicode.d.ts | 8 - .../lib/types/arbitrary/unicodeJson.d.ts | 15 - .../lib/types/arbitrary/unicodeJsonValue.d.ts | 18 - .../lib/types/arbitrary/unicodeString.d.ts | 13 - .../fast-check/lib/types/arbitrary/uuid.d.ts | 2 +- .../fast-check/lib/types/arbitrary/uuidV.d.ts | 13 - .../check/arbitrary/definition/Arbitrary.d.ts | 21 - .../check/model/commands/CommandWrapper.d.ts | 3 - .../model/commands/CommandsIterable.d.ts | 2 - .../types/check/property/IRawProperty.d.ts | 12 +- .../runner/configuration/Parameters.d.ts | 14 +- .../check/runner/reporter/RunDetails.d.ts | 9 - .../lib/types/fast-check-default.d.ts | 35 +- .../lib/types/random/generator/Random.d.ts | 15 - .../fast-check/lib/types/utils/globals.d.ts | 3 + .../_internals/AdapterArbitrary.d.ts | 1 + .../_internals/AlwaysShrinkableArbitrary.d.ts | 1 + .../arbitrary/_internals/ArrayArbitrary.d.ts | 1 + .../arbitrary/_internals/BigIntArbitrary.d.ts | 1 + .../arbitrary/_internals/CloneArbitrary.d.ts | 1 + .../_internals/CommandsArbitrary.d.ts | 1 + .../_internals/ConstantArbitrary.d.ts | 1 + .../_internals/FrequencyArbitrary.d.ts | 1 + .../_internals/GeneratorArbitrary.d.ts | 16 + .../InitialPoolForEntityGraphArbitrary.d.ts | 1 + .../_internals/IntegerArbitrary.d.ts | 1 + .../arbitrary/_internals/LazyArbitrary.d.ts | 1 + .../_internals/LimitedShrinkArbitrary.d.ts | 1 + .../_internals/MixedCaseArbitrary.d.ts | 1 + .../OnTheFlyLinksForEntityGraphArbitrary.d.ts | 1 + .../_internals/SchedulerArbitrary.d.ts | 1 + .../arbitrary/_internals/StreamArbitrary.d.ts | 1 + .../_internals/StringUnitArbitrary.d.ts | 1 + .../_internals/SubarrayArbitrary.d.ts | 1 + .../arbitrary/_internals/TupleArbitrary.d.ts | 1 + .../UnlinkedEntitiesForEntityGraph.d.ts | 1 + .../WithShrinkFromOtherArbitrary.d.ts | 1 + .../builders/AnyArbitraryBuilder.d.ts | 1 + .../builders/BoxedArbitraryBuilder.d.ts | 1 + .../CharacterRangeArbitraryBuilder.d.ts | 1 + .../CompareFunctionArbitraryBuilder.d.ts | 1 + .../builders/GeneratorValueBuilder.d.ts | 32 + .../PaddedNumberArbitraryBuilder.d.ts | 1 + .../PartialRecordArbitraryBuilder.d.ts | 1 + .../RestrictedIntegerArbitraryBuilder.d.ts | 1 + .../StableArbitraryGeneratorCache.d.ts | 4 + .../StringifiedNatArbitraryBuilder.d.ts | 1 + .../TypedIntArrayArbitraryBuilder.d.ts | 73 + .../builders/UriPathArbitraryBuilder.d.ts | 1 + .../UriQueryOrFragmentArbitraryBuilder.d.ts | 1 + .../_internals/data/GraphemeRanges.d.ts | 1 + .../_internals/helpers/BiasNumericRange.d.ts | 5 + .../BuildInversedRelationsMapping.d.ts | 1 + .../_internals/helpers/BuildSchedulerFor.d.ts | 1 + .../helpers/BuildSlicedGenerator.d.ts | 1 + .../_internals/helpers/CustomEqualSet.d.ts | 1 + .../_internals/helpers/DepthContext.d.ts | 39 + .../_internals/helpers/DoubleHelpers.d.ts | 1 + .../_internals/helpers/DoubleOnlyHelpers.d.ts | 10 + .../helpers/EnumerableKeysExtractor.d.ts | 1 + .../_internals/helpers/FloatHelpers.d.ts | 1 + .../_internals/helpers/FloatOnlyHelpers.d.ts | 10 + .../helpers/FloatingOnlyHelpers.d.ts | 1 + .../helpers/GraphemeRangesHelpers.d.ts | 1 + .../helpers/InvalidSubdomainLabelFiIter.d.ts | 1 + .../_internals/helpers/IsSubarrayOf.d.ts | 1 + .../helpers/JsonConstraintsBuilder.d.ts | 58 + .../helpers/MaxLengthFromMinLength.d.ts | 45 + .../helpers/NoUndefinedAsContext.d.ts | 1 + .../helpers/QualifiedObjectConstraints.d.ts | 113 + .../_internals/helpers/ReadRegex.d.ts | 4 + .../_internals/helpers/SameValueSet.d.ts | 1 + .../_internals/helpers/SameValueZeroSet.d.ts | 1 + .../_internals/helpers/SanitizeRegexAst.d.ts | 1 + .../_internals/helpers/ShrinkBigInt.d.ts | 1 + .../_internals/helpers/ShrinkInteger.d.ts | 1 + .../helpers/SlicesForStringBuilder.d.ts | 1 + .../_internals/helpers/StrictlyEqualSet.d.ts | 1 + .../_internals/helpers/TextEscaper.d.ts | 1 + .../_internals/helpers/ToggleFlags.d.ts | 1 + .../_internals/helpers/TokenizeRegex.d.ts | 88 + .../_internals/helpers/TokenizeString.d.ts | 1 + .../helpers/ZipIterableIterators.d.ts | 1 + .../implementations/NoopSlicedGenerator.d.ts | 1 + .../implementations/SchedulerImplem.d.ts | 1 + .../implementations/SlicedBasedGenerator.d.ts | 1 + .../_internals/interfaces/CustomSet.d.ts | 1 + .../interfaces/EntityGraphTypes.d.ts | 194 + .../_internals/interfaces/Scheduler.d.ts | 186 + .../interfaces/SlicedGenerator.d.ts | 1 + .../_internals/mappers/ArrayToMap.d.ts | 1 + .../_internals/mappers/ArrayToSet.d.ts | 1 + .../_internals/mappers/CharsToString.d.ts | 1 + .../mappers/CodePointsToString.d.ts | 1 + .../_internals/mappers/EntitiesToIPv6.d.ts | 1 + .../mappers/IndexToMappedConstant.d.ts | 1 + .../mappers/IndexToPrintableIndex.d.ts | 1 + .../mappers/KeyValuePairsToObject.d.ts | 1 + .../mappers/NatToStringifiedNat.d.ts | 1 + .../mappers/NumberToPaddedEight.d.ts | 1 + .../mappers/PaddedEightsToUuid.d.ts | 1 + .../_internals/mappers/PartsToUrl.d.ts | 1 + .../_internals/mappers/PatternsToString.d.ts | 1 + .../_internals/mappers/SegmentsToPath.d.ts | 1 + .../_internals/mappers/StringToBase64.d.ts | 1 + .../_internals/mappers/TimeToDate.d.ts | 1 + .../mappers/UintToBase32String.d.ts | 1 + .../_internals/mappers/UnboxedToBoxed.d.ts | 1 + .../mappers/UnlinkedToLinkedEntities.d.ts | 1 + .../ValuesAndSeparateKeysToObject.d.ts | 1 + .../mappers/VersionsApplierForUuid.d.ts | 1 + .../_internals/mappers/WordsToLorem.d.ts | 1 + .../_shared/StringSharedConstraints.d.ts | 25 + .../lib/types57/arbitrary/anything.d.ts | 49 + .../lib/types57/arbitrary/array.d.ts | 57 + .../lib/types57/arbitrary/base64String.d.ts | 15 + .../lib/types57/arbitrary/bigInt.d.ts | 53 + .../lib/types57/arbitrary/bigInt64Array.d.ts | 9 + .../lib/types57/arbitrary/bigUint64Array.d.ts | 9 + .../lib/types57/arbitrary/boolean.d.ts | 8 + .../lib/types57/arbitrary/clone.d.ts | 18 + .../lib/types57/arbitrary/commands.d.ts | 31 + .../types57/arbitrary/compareBooleanFunc.d.ts | 12 + .../lib/types57/arbitrary/compareFunc.d.ts | 17 + .../lib/types57/arbitrary/constant.d.ts | 8 + .../lib/types57/arbitrary/constantFrom.d.ts | 24 + .../lib/types57/arbitrary/context.d.ts | 26 + .../lib/types57/arbitrary/date.d.ts | 35 + .../lib/types57/arbitrary/dictionary.d.ts | 62 + .../lib/types57/arbitrary/domain.d.ts | 29 + .../lib/types57/arbitrary/double.d.ts | 66 + .../lib/types57/arbitrary/emailAddress.d.ts | 27 + .../lib/types57/arbitrary/entityGraph.d.ts | 101 + .../lib/types57/arbitrary/falsy.d.ts | 37 + .../lib/types57/arbitrary/float.d.ts | 69 + .../lib/types57/arbitrary/float32Array.d.ts | 33 + .../lib/types57/arbitrary/float64Array.d.ts | 33 + .../lib/types57/arbitrary/func.d.ts | 10 + .../fast-check/lib/types57/arbitrary/gen.d.ts | 37 + .../lib/types57/arbitrary/infiniteStream.d.ts | 33 + .../lib/types57/arbitrary/int16Array.d.ts | 9 + .../lib/types57/arbitrary/int32Array.d.ts | 9 + .../lib/types57/arbitrary/int8Array.d.ts | 9 + .../lib/types57/arbitrary/integer.d.ts | 29 + .../lib/types57/arbitrary/ipV4.d.ts | 10 + .../lib/types57/arbitrary/ipV4Extended.d.ts | 12 + .../lib/types57/arbitrary/ipV6.d.ts | 10 + .../lib/types57/arbitrary/json.d.ts | 14 + .../lib/types57/arbitrary/jsonValue.d.ts | 17 + .../lib/types57/arbitrary/letrec.d.ts | 87 + .../lib/types57/arbitrary/limitShrink.d.ts | 22 + .../lib/types57/arbitrary/lorem.d.ts | 41 + .../fast-check/lib/types57/arbitrary/map.d.ts | 47 + .../lib/types57/arbitrary/mapToConstant.d.ts | 23 + .../lib/types57/arbitrary/maxSafeInteger.d.ts | 7 + .../lib/types57/arbitrary/maxSafeNat.d.ts | 7 + .../lib/types57/arbitrary/memo.d.ts | 27 + .../lib/types57/arbitrary/mixedCase.d.ts | 34 + .../fast-check/lib/types57/arbitrary/nat.d.ts | 49 + .../lib/types57/arbitrary/noBias.d.ts | 13 + .../lib/types57/arbitrary/noShrink.d.ts | 15 + .../lib/types57/arbitrary/object.d.ts | 34 + .../lib/types57/arbitrary/oneof.d.ts | 105 + .../lib/types57/arbitrary/option.d.ts | 54 + .../lib/types57/arbitrary/record.d.ts | 55 + .../lib/types57/arbitrary/scheduler.d.ts | 76 + .../fast-check/lib/types57/arbitrary/set.d.ts | 54 + .../types57/arbitrary/shuffledSubarray.d.ts | 30 + .../lib/types57/arbitrary/sparseArray.d.ts | 61 + .../lib/types57/arbitrary/string.d.ts | 41 + .../lib/types57/arbitrary/stringMatching.d.ts | 24 + .../lib/types57/arbitrary/subarray.d.ts | 30 + .../lib/types57/arbitrary/tuple.d.ts | 12 + .../lib/types57/arbitrary/uint16Array.d.ts | 9 + .../lib/types57/arbitrary/uint32Array.d.ts | 9 + .../lib/types57/arbitrary/uint8Array.d.ts | 9 + .../types57/arbitrary/uint8ClampedArray.d.ts | 9 + .../lib/types57/arbitrary/ulid.d.ts | 12 + .../lib/types57/arbitrary/uniqueArray.d.ts | 159 + .../lib/types57/arbitrary/uuid.d.ts | 25 + .../lib/types57/arbitrary/webAuthority.d.ts | 55 + .../lib/types57/arbitrary/webFragments.d.ts | 27 + .../lib/types57/arbitrary/webPath.d.ts | 26 + .../types57/arbitrary/webQueryParameters.d.ts | 27 + .../lib/types57/arbitrary/webSegment.d.ts | 27 + .../lib/types57/arbitrary/webUrl.d.ts | 51 + .../check/arbitrary/definition/Arbitrary.d.ts | 127 + .../check/arbitrary/definition/Value.d.ts | 38 + .../lib/types57/check/model/ModelRunner.d.ts | 58 + .../lib/types57/check/model/ReplayPath.d.ts | 1 + .../check/model/command/AsyncCommand.d.ts | 10 + .../types57/check/model/command/Command.d.ts | 10 + .../types57/check/model/command/ICommand.d.ts | 33 + .../check/model/commands/CommandWrapper.d.ts | 14 + .../model/commands/CommandsContraints.d.ts | 36 + .../model/commands/CommandsIterable.d.ts | 11 + .../model/commands/ScheduledCommand.d.ts | 1 + .../lib/types57/check/precondition/Pre.d.ts | 7 + .../precondition/PreconditionFailure.d.ts | 10 + .../types57/check/property/AsyncProperty.d.ts | 13 + .../check/property/AsyncProperty.generic.d.ts | 36 + .../types57/check/property/IRawProperty.d.ts | 69 + .../property/IgnoreEqualValuesProperty.d.ts | 1 + .../lib/types57/check/property/Property.d.ts | 13 + .../check/property/Property.generic.d.ts | 48 + .../check/property/SkipAfterProperty.d.ts | 1 + .../check/property/TimeoutProperty.d.ts | 1 + .../check/property/UnbiasedProperty.d.ts | 1 + .../check/runner/DecorateProperty.d.ts | 1 + .../lib/types57/check/runner/Runner.d.ts | 89 + .../types57/check/runner/RunnerIterator.d.ts | 1 + .../lib/types57/check/runner/Sampler.d.ts | 45 + .../check/runner/SourceValuesIterator.d.ts | 1 + .../lib/types57/check/runner/Tosser.d.ts | 1 + .../configuration/GlobalParameters.d.ts | 116 + .../runner/configuration/Parameters.d.ts | 205 + .../configuration/QualifiedParameters.d.ts | 1 + .../runner/configuration/RandomType.d.ts | 7 + .../runner/configuration/VerbosityLevel.d.ts | 37 + .../runner/reporter/ExecutionStatus.d.ts | 10 + .../check/runner/reporter/ExecutionTree.d.ts | 23 + .../check/runner/reporter/RunDetails.d.ts | 177 + .../check/runner/reporter/RunExecution.d.ts | 1 + .../check/runner/utils/PathWalker.d.ts | 1 + .../runner/utils/RunDetailsFormatter.d.ts | 70 + .../fast-check/lib/types57/check/symbols.d.ts | 34 + .../lib/types57/fast-check-default.d.ts | 175 + .../fast-check/lib/types57/fast-check.d.ts | 3 + .../lib/types57/random/generator/Random.d.ts | 55 + .../types57/stream/LazyIterableIterator.d.ts | 1 + .../fast-check/lib/types57/stream/Stream.d.ts | 145 + .../lib/types57/stream/StreamHelpers.d.ts | 1 + .../fast-check/lib/types57/utils/apply.d.ts | 1 + .../fast-check/lib/types57/utils/globals.d.ts | 79 + .../fast-check/lib/types57/utils/hash.d.ts | 11 + .../lib/types57/utils/stringify.d.ts | 72 + node_modules/fast-check/lib/utils/apply.js | 7 +- node_modules/fast-check/lib/utils/globals.js | 332 +- node_modules/fast-check/lib/utils/hash.js | 11 +- .../fast-check/lib/utils/stringify.js | 86 +- node_modules/fast-check/package.json | 80 +- node_modules/foreground-child/LICENSE | 15 + node_modules/foreground-child/README.md | 128 + .../dist/commonjs/all-signals.d.ts | 2 + .../dist/commonjs/all-signals.d.ts.map | 1 + .../dist/commonjs/all-signals.js | 58 + .../dist/commonjs/all-signals.js.map | 1 + .../foreground-child/dist/commonjs/index.d.ts | 58 + .../dist/commonjs/index.d.ts.map | 1 + .../foreground-child/dist/commonjs/index.js | 123 + .../dist/commonjs/index.js.map | 1 + .../dist/commonjs/package.json | 3 + .../dist/commonjs/proxy-signals.d.ts | 6 + .../dist/commonjs/proxy-signals.d.ts.map | 1 + .../dist/commonjs/proxy-signals.js | 38 + .../dist/commonjs/proxy-signals.js.map | 1 + .../dist/commonjs/watchdog.d.ts | 10 + .../dist/commonjs/watchdog.d.ts.map | 1 + .../dist/commonjs/watchdog.js | 50 + .../dist/commonjs/watchdog.js.map | 1 + .../dist/esm/all-signals.d.ts | 2 + .../dist/esm/all-signals.d.ts.map | 1 + .../foreground-child/dist/esm/all-signals.js | 52 + .../dist/esm/all-signals.js.map | 1 + .../foreground-child/dist/esm/index.d.ts | 58 + .../foreground-child/dist/esm/index.d.ts.map | 1 + .../foreground-child/dist/esm/index.js | 115 + .../foreground-child/dist/esm/index.js.map | 1 + .../foreground-child/dist/esm/package.json | 3 + .../dist/esm/proxy-signals.d.ts | 6 + .../dist/esm/proxy-signals.d.ts.map | 1 + .../dist/esm/proxy-signals.js | 34 + .../dist/esm/proxy-signals.js.map | 1 + .../foreground-child/dist/esm/watchdog.d.ts | 10 + .../dist/esm/watchdog.d.ts.map | 1 + .../foreground-child/dist/esm/watchdog.js | 46 + .../foreground-child/dist/esm/watchdog.js.map | 1 + node_modules/foreground-child/package.json | 106 + node_modules/form-data/CHANGELOG.md | 659 - node_modules/form-data/License | 19 - node_modules/form-data/README.md | 355 - node_modules/form-data/index.d.ts | 62 - node_modules/form-data/lib/browser.js | 4 - node_modules/form-data/lib/form_data.js | 494 - node_modules/form-data/lib/populate.js | 10 - node_modules/form-data/package.json | 82 - node_modules/function-bind/.eslintrc | 21 - .../function-bind/.github/FUNDING.yml | 12 - .../function-bind/.github/SECURITY.md | 3 - node_modules/function-bind/.nycrc | 13 - node_modules/function-bind/CHANGELOG.md | 136 - node_modules/function-bind/LICENSE | 20 - node_modules/function-bind/README.md | 46 - node_modules/function-bind/implementation.js | 84 - node_modules/function-bind/index.js | 5 - node_modules/function-bind/package.json | 87 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/get-intrinsic/.eslintrc | 42 - .../get-intrinsic/.github/FUNDING.yml | 12 - node_modules/get-intrinsic/.nycrc | 9 - node_modules/get-intrinsic/CHANGELOG.md | 186 - node_modules/get-intrinsic/LICENSE | 21 - node_modules/get-intrinsic/README.md | 71 - node_modules/get-intrinsic/index.js | 378 - node_modules/get-intrinsic/package.json | 97 - .../get-intrinsic/test/GetIntrinsic.js | 274 - node_modules/get-proto/.eslintrc | 10 - node_modules/get-proto/.github/FUNDING.yml | 12 - node_modules/get-proto/.nycrc | 9 - node_modules/get-proto/CHANGELOG.md | 21 - node_modules/get-proto/LICENSE | 21 - .../get-proto/Object.getPrototypeOf.d.ts | 5 - .../get-proto/Object.getPrototypeOf.js | 6 - node_modules/get-proto/README.md | 50 - .../get-proto/Reflect.getPrototypeOf.d.ts | 3 - .../get-proto/Reflect.getPrototypeOf.js | 4 - node_modules/get-proto/index.d.ts | 5 - node_modules/get-proto/index.js | 27 - node_modules/get-proto/package.json | 81 - node_modules/get-proto/test/index.js | 68 - node_modules/get-proto/tsconfig.json | 9 - node_modules/glob/LICENSE | 8 +- node_modules/glob/README.md | 1455 ++- node_modules/glob/dist/commonjs/glob.d.ts | 388 + node_modules/glob/dist/commonjs/glob.d.ts.map | 1 + node_modules/glob/dist/commonjs/glob.js | 247 + node_modules/glob/dist/commonjs/glob.js.map | 1 + .../glob/dist/commonjs/has-magic.d.ts | 14 + .../glob/dist/commonjs/has-magic.d.ts.map | 1 + node_modules/glob/dist/commonjs/has-magic.js | 27 + .../glob/dist/commonjs/has-magic.js.map | 1 + node_modules/glob/dist/commonjs/ignore.d.ts | 24 + .../glob/dist/commonjs/ignore.d.ts.map | 1 + node_modules/glob/dist/commonjs/ignore.js | 119 + node_modules/glob/dist/commonjs/ignore.js.map | 1 + node_modules/glob/dist/commonjs/index.d.ts | 97 + .../glob/dist/commonjs/index.d.ts.map | 1 + node_modules/glob/dist/commonjs/index.js | 68 + node_modules/glob/dist/commonjs/index.js.map | 1 + node_modules/glob/dist/commonjs/package.json | 3 + node_modules/glob/dist/commonjs/pattern.d.ts | 76 + .../glob/dist/commonjs/pattern.d.ts.map | 1 + node_modules/glob/dist/commonjs/pattern.js | 219 + .../glob/dist/commonjs/pattern.js.map | 1 + .../glob/dist/commonjs/processor.d.ts | 59 + .../glob/dist/commonjs/processor.d.ts.map | 1 + node_modules/glob/dist/commonjs/processor.js | 301 + .../glob/dist/commonjs/processor.js.map | 1 + node_modules/glob/dist/commonjs/walker.d.ts | 97 + .../glob/dist/commonjs/walker.d.ts.map | 1 + node_modules/glob/dist/commonjs/walker.js | 387 + node_modules/glob/dist/commonjs/walker.js.map | 1 + node_modules/glob/dist/esm/bin.d.mts | 3 + node_modules/glob/dist/esm/bin.d.mts.map | 1 + node_modules/glob/dist/esm/bin.mjs | 346 + node_modules/glob/dist/esm/bin.mjs.map | 1 + node_modules/glob/dist/esm/glob.d.ts | 388 + node_modules/glob/dist/esm/glob.d.ts.map | 1 + node_modules/glob/dist/esm/glob.js | 243 + node_modules/glob/dist/esm/glob.js.map | 1 + node_modules/glob/dist/esm/has-magic.d.ts | 14 + node_modules/glob/dist/esm/has-magic.d.ts.map | 1 + node_modules/glob/dist/esm/has-magic.js | 23 + node_modules/glob/dist/esm/has-magic.js.map | 1 + node_modules/glob/dist/esm/ignore.d.ts | 24 + node_modules/glob/dist/esm/ignore.d.ts.map | 1 + node_modules/glob/dist/esm/ignore.js | 115 + node_modules/glob/dist/esm/ignore.js.map | 1 + node_modules/glob/dist/esm/index.d.ts | 97 + node_modules/glob/dist/esm/index.d.ts.map | 1 + node_modules/glob/dist/esm/index.js | 55 + node_modules/glob/dist/esm/index.js.map | 1 + node_modules/glob/dist/esm/package.json | 3 + node_modules/glob/dist/esm/pattern.d.ts | 76 + node_modules/glob/dist/esm/pattern.d.ts.map | 1 + node_modules/glob/dist/esm/pattern.js | 215 + node_modules/glob/dist/esm/pattern.js.map | 1 + node_modules/glob/dist/esm/processor.d.ts | 59 + node_modules/glob/dist/esm/processor.d.ts.map | 1 + node_modules/glob/dist/esm/processor.js | 294 + node_modules/glob/dist/esm/processor.js.map | 1 + node_modules/glob/dist/esm/walker.d.ts | 97 + node_modules/glob/dist/esm/walker.d.ts.map | 1 + node_modules/glob/dist/esm/walker.js | 381 + node_modules/glob/dist/esm/walker.js.map | 1 + node_modules/glob/package.json | 114 +- node_modules/gopd/.eslintrc | 16 - node_modules/gopd/.github/FUNDING.yml | 12 - node_modules/gopd/CHANGELOG.md | 45 - node_modules/gopd/LICENSE | 21 - node_modules/gopd/README.md | 40 - node_modules/gopd/gOPD.d.ts | 1 - node_modules/gopd/gOPD.js | 4 - node_modules/gopd/index.d.ts | 5 - node_modules/gopd/index.js | 15 - node_modules/gopd/package.json | 77 - node_modules/gopd/test/index.js | 36 - node_modules/gopd/tsconfig.json | 9 - node_modules/has-symbols/.eslintrc | 11 - node_modules/has-symbols/.github/FUNDING.yml | 12 - node_modules/has-symbols/.nycrc | 9 - node_modules/has-symbols/CHANGELOG.md | 91 - node_modules/has-symbols/LICENSE | 21 - node_modules/has-symbols/README.md | 46 - node_modules/has-symbols/index.d.ts | 3 - node_modules/has-symbols/index.js | 14 - node_modules/has-symbols/package.json | 111 - node_modules/has-symbols/shams.d.ts | 3 - node_modules/has-symbols/shams.js | 45 - node_modules/has-symbols/test/index.js | 22 - .../has-symbols/test/shams/core-js.js | 29 - .../test/shams/get-own-property-symbols.js | 29 - node_modules/has-symbols/test/tests.js | 58 - node_modules/has-symbols/tsconfig.json | 10 - node_modules/has-tostringtag/.eslintrc | 5 - .../has-tostringtag/.github/FUNDING.yml | 12 - node_modules/has-tostringtag/.nycrc | 13 - node_modules/has-tostringtag/CHANGELOG.md | 42 - node_modules/has-tostringtag/LICENSE | 21 - node_modules/has-tostringtag/README.md | 46 - node_modules/has-tostringtag/index.d.ts | 3 - node_modules/has-tostringtag/index.js | 8 - node_modules/has-tostringtag/package.json | 108 - node_modules/has-tostringtag/shams.d.ts | 3 - node_modules/has-tostringtag/shams.js | 8 - node_modules/has-tostringtag/test/index.js | 21 - .../has-tostringtag/test/shams/core-js.js | 31 - .../test/shams/get-own-property-symbols.js | 30 - node_modules/has-tostringtag/test/tests.js | 15 - node_modules/has-tostringtag/tsconfig.json | 49 - node_modules/hasown/.eslintrc | 5 - node_modules/hasown/.github/FUNDING.yml | 12 - node_modules/hasown/.nycrc | 13 - node_modules/hasown/CHANGELOG.md | 40 - node_modules/hasown/LICENSE | 21 - node_modules/hasown/README.md | 40 - node_modules/hasown/index.d.ts | 3 - node_modules/hasown/index.js | 8 - node_modules/hasown/package.json | 92 - node_modules/hasown/tsconfig.json | 6 - .../html-encoding-sniffer/package.json | 13 +- node_modules/http-proxy-agent/LICENSE | 22 + node_modules/http-proxy-agent/README.md | 68 +- node_modules/http-proxy-agent/dist/agent.d.ts | 32 - node_modules/http-proxy-agent/dist/agent.js | 145 - .../http-proxy-agent/dist/agent.js.map | 1 - node_modules/http-proxy-agent/dist/index.d.ts | 61 +- .../http-proxy-agent/dist/index.d.ts.map | 1 + node_modules/http-proxy-agent/dist/index.js | 150 +- .../http-proxy-agent/dist/index.js.map | 2 +- node_modules/http-proxy-agent/package.json | 54 +- node_modules/https-proxy-agent/LICENSE | 22 + node_modules/https-proxy-agent/README.md | 99 +- .../https-proxy-agent/dist/agent.d.ts | 30 - node_modules/https-proxy-agent/dist/agent.js | 177 - .../https-proxy-agent/dist/agent.js.map | 1 - .../https-proxy-agent/dist/index.d.ts | 66 +- .../https-proxy-agent/dist/index.d.ts.map | 1 + node_modules/https-proxy-agent/dist/index.js | 182 +- .../https-proxy-agent/dist/index.js.map | 2 +- .../dist/parse-proxy-response.d.ts | 14 +- .../dist/parse-proxy-response.d.ts.map | 1 + .../dist/parse-proxy-response.js | 59 +- .../dist/parse-proxy-response.js.map | 2 +- node_modules/https-proxy-agent/package.json | 56 +- node_modules/is-core-module/.eslintrc | 18 - node_modules/is-core-module/.nycrc | 9 - node_modules/is-core-module/CHANGELOG.md | 218 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 40 - node_modules/is-core-module/core.json | 162 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 76 - node_modules/is-core-module/test/index.js | 157 - .../istanbul-lib-source-maps/CHANGELOG.md | 58 + .../istanbul-lib-source-maps/README.md | 5 +- .../lib/get-mapping.js | 46 +- .../istanbul-lib-source-maps/lib/map-store.js | 20 +- .../lib/transformer.js | 13 + .../istanbul-lib-source-maps/package.json | 6 +- node_modules/jackspeak/LICENSE.md | 55 + node_modules/jackspeak/README.md | 357 + .../jackspeak/dist/commonjs/index.d.ts | 315 + .../jackspeak/dist/commonjs/index.d.ts.map | 1 + node_modules/jackspeak/dist/commonjs/index.js | 1010 ++ .../jackspeak/dist/commonjs/index.js.map | 1 + .../jackspeak/dist/commonjs/package.json | 3 + .../dist/commonjs/parse-args-cjs.cjs.map | 1 + .../dist/commonjs/parse-args-cjs.d.cts.map | 1 + .../jackspeak/dist/commonjs/parse-args.d.ts | 4 + .../jackspeak/dist/commonjs/parse-args.js | 50 + node_modules/jackspeak/dist/esm/index.d.ts | 315 + .../jackspeak/dist/esm/index.d.ts.map | 1 + node_modules/jackspeak/dist/esm/index.js | 1000 ++ node_modules/jackspeak/dist/esm/index.js.map | 1 + node_modules/jackspeak/dist/esm/package.json | 3 + .../jackspeak/dist/esm/parse-args.d.ts | 4 + .../jackspeak/dist/esm/parse-args.d.ts.map | 1 + node_modules/jackspeak/dist/esm/parse-args.js | 26 + .../jackspeak/dist/esm/parse-args.js.map | 1 + node_modules/jackspeak/package.json | 95 + node_modules/jest-changed-files/LICENSE | 1 + node_modules/jest-changed-files/build/git.js | 169 - node_modules/jest-changed-files/build/hg.js | 130 - .../jest-changed-files/build/index.d.mts | 30 + .../jest-changed-files/build/index.d.ts | 1 + .../jest-changed-files/build/index.js | 328 +- .../jest-changed-files/build/index.mjs | 4 + node_modules/jest-changed-files/build/sl.js | 134 - .../jest-changed-files/build/types.js | 1 - node_modules/jest-changed-files/package.json | 12 +- node_modules/jest-circus/LICENSE | 1 + node_modules/jest-circus/README.md | 4 +- .../jest-circus/build/eventHandler.js | 281 - .../build/formatNodeAssertErrors.js | 186 - .../jest-circus/build/globalErrorHandlers.js | 44 - node_modules/jest-circus/build/index.d.ts | 34 +- node_modules/jest-circus/build/index.js | 1618 ++- node_modules/jest-circus/build/index.mjs | 16 + .../jest-circus/build/jestAdapterInit.d.mts | 51 + .../jest-circus/build/jestAdapterInit.js | 2049 ++++ .../jest-circus/build/jestAdapterInit.mjs | 1249 ++ .../legacy-code-todo-rewrite/jestAdapter.js | 117 - .../jestAdapterInit.js | 240 - node_modules/jest-circus/build/run.js | 350 - node_modules/jest-circus/build/runner.d.mts | 10 + node_modules/jest-circus/build/runner.js | 200 + node_modules/jest-circus/build/runner.mjs | 81 + .../jest-circus/build/shuffleArray.js | 41 - node_modules/jest-circus/build/state.js | 80 - .../build/testCaseReportHandler.js | 32 - node_modules/jest-circus/build/types.js | 27 - node_modules/jest-circus/build/utils.js | 511 - node_modules/jest-circus/package.json | 58 +- node_modules/jest-circus/runner.js | 10 - node_modules/jest-cli/LICENSE | 1 + node_modules/jest-cli/bin/jest.js | 0 node_modules/jest-cli/build/args.js | 731 -- node_modules/jest-cli/build/index.d.mts | 14 + node_modules/jest-cli/build/index.d.ts | 8 +- node_modules/jest-cli/build/index.js | 793 +- node_modules/jest-cli/build/index.mjs | 5 + node_modules/jest-cli/build/run.js | 239 - node_modules/jest-cli/package.json | 34 +- node_modules/jest-config/LICENSE | 1 + node_modules/jest-config/build/Defaults.js | 129 - node_modules/jest-config/build/Deprecated.js | 85 - .../jest-config/build/Descriptions.js | 104 - .../build/ReporterValidationErrors.js | 122 - node_modules/jest-config/build/ValidConfig.js | 342 - .../jest-config/build/chunk-BQ42LXoh.mjs | 14 + node_modules/jest-config/build/color.js | 31 - node_modules/jest-config/build/constants.js | 96 - .../jest-config/build/getCacheDirectory.js | 91 - .../jest-config/build/getMaxWorkers.js | 56 - node_modules/jest-config/build/index.d.mts | 101 + node_modules/jest-config/build/index.d.ts | 10 +- node_modules/jest-config/build/index.js | 2720 ++++- node_modules/jest-config/build/index.mjs | 12 + node_modules/jest-config/build/normalize.js | 1180 -- .../jest-config/build/parseShardPair.js | 41 - .../build/readConfigFileAndSetRootDir.js | 195 - .../jest-config/build/resolveConfigPath.js | 217 - node_modules/jest-config/build/setFromArgv.js | 58 - .../jest-config/build/stringToBytes.js | 79 - node_modules/jest-config/build/utils.js | 172 - .../jest-config/build/validatePattern.js | 24 - node_modules/jest-config/package.json | 66 +- node_modules/jest-diff/LICENSE | 1 + node_modules/jest-diff/README.md | 6 +- .../jest-diff/build/cleanupSemantic.js | 599 - node_modules/jest-diff/build/constants.js | 19 - node_modules/jest-diff/build/diffLines.js | 193 - node_modules/jest-diff/build/diffStrings.js | 66 - .../jest-diff/build/getAlignedDiffs.js | 223 - node_modules/jest-diff/build/index.d.mts | 96 + node_modules/jest-diff/build/index.d.ts | 3 +- node_modules/jest-diff/build/index.js | 1486 ++- node_modules/jest-diff/build/index.mjs | 12 + .../jest-diff/build/joinAlignedDiffs.js | 271 - .../jest-diff/build/normalizeDiffOptions.js | 59 - node_modules/jest-diff/build/printDiffs.js | 79 - node_modules/jest-diff/build/types.js | 1 - node_modules/jest-diff/package.json | 19 +- node_modules/jest-docblock/LICENSE | 1 + node_modules/jest-docblock/build/index.d.mts | 24 + node_modules/jest-docblock/build/index.d.ts | 3 +- node_modules/jest-docblock/build/index.js | 102 +- node_modules/jest-docblock/build/index.mjs | 7 + node_modules/jest-docblock/package.json | 10 +- node_modules/jest-each/LICENSE | 1 + node_modules/jest-each/README.md | 11 +- node_modules/jest-each/build/bind.js | 81 - node_modules/jest-each/build/index.d.mts | 78 + node_modules/jest-each/build/index.d.ts | 48 +- node_modules/jest-each/build/index.js | 415 +- node_modules/jest-each/build/index.mjs | 4 + node_modules/jest-each/build/table/array.js | 130 - .../jest-each/build/table/interpolation.js | 53 - .../jest-each/build/table/template.js | 44 - node_modules/jest-each/build/validation.js | 107 - node_modules/jest-each/package.json | 18 +- node_modules/jest-environment-jsdom/LICENSE | 1 + .../jest-environment-jsdom/build/index.d.mts | 11 + .../jest-environment-jsdom/build/index.d.ts | 33 +- .../jest-environment-jsdom/build/index.js | 202 +- .../jest-environment-jsdom/build/index.mjs | 4 + .../jest-environment-jsdom/package.json | 23 +- node_modules/jest-environment-node/LICENSE | 1 + .../jest-environment-node/build/index.d.mts | 31 + .../jest-environment-node/build/index.d.ts | 21 +- .../jest-environment-node/build/index.js | 258 +- .../jest-environment-node/build/index.mjs | 4 + .../jest-environment-node/package.json | 29 +- node_modules/jest-get-type/LICENSE | 21 - node_modules/jest-get-type/build/index.d.ts | 27 - node_modules/jest-get-type/build/index.js | 53 - node_modules/jest-get-type/package.json | 27 - node_modules/jest-haste-map/LICENSE | 1 + node_modules/jest-haste-map/README.md | 92 + node_modules/jest-haste-map/build/HasteFS.js | 139 - .../jest-haste-map/build/ModuleMap.js | 249 - .../jest-haste-map/build/blacklist.js | 64 - .../jest-haste-map/build/constants.js | 46 - .../jest-haste-map/build/crawlers/node.js | 269 - .../jest-haste-map/build/crawlers/watchman.js | 339 - .../jest-haste-map/build/getMockName.js | 69 - node_modules/jest-haste-map/build/index.d.mts | 184 + node_modules/jest-haste-map/build/index.d.ts | 6 +- node_modules/jest-haste-map/build/index.js | 2826 ++++- node_modules/jest-haste-map/build/index.mjs | 5 + .../build/lib/dependencyExtractor.js | 84 - .../jest-haste-map/build/lib/fast_path.js | 76 - .../build/lib/getPlatformExtension.js | 30 - .../build/lib/isWatchmanInstalled.js | 37 - .../build/lib/normalizePathSep.js | 68 - node_modules/jest-haste-map/build/types.js | 1 - .../build/watchers/FSEventsWatcher.js | 244 - .../build/watchers/NodeWatcher.js | 369 - .../build/watchers/RecrawlWarning.js | 49 - .../build/watchers/WatchmanWatcher.js | 383 - .../jest-haste-map/build/watchers/common.js | 111 - .../jest-haste-map/build/worker.d.mts | 24 + node_modules/jest-haste-map/build/worker.js | 303 +- node_modules/jest-haste-map/build/worker.mjs | 184 + node_modules/jest-haste-map/package.json | 32 +- node_modules/jest-leak-detector/LICENSE | 1 + node_modules/jest-leak-detector/README.md | 4 +- .../jest-leak-detector/build/index.d.mts | 16 + .../jest-leak-detector/build/index.d.ts | 9 +- .../jest-leak-detector/build/index.js | 70 +- .../jest-leak-detector/build/index.mjs | 3 + node_modules/jest-leak-detector/package.json | 12 +- node_modules/jest-matcher-utils/LICENSE | 1 + node_modules/jest-matcher-utils/README.md | 2 +- .../jest-matcher-utils/build/Replaceable.js | 64 - .../build/deepCyclicCopyReplaceable.js | 111 - .../jest-matcher-utils/build/index.d.mts | 65 + .../jest-matcher-utils/build/index.d.ts | 15 +- .../jest-matcher-utils/build/index.js | 562 +- .../jest-matcher-utils/build/index.mjs | 26 + node_modules/jest-matcher-utils/package.json | 18 +- node_modules/jest-message-util/LICENSE | 1 + .../jest-message-util/build/index.d.mts | 29 + .../jest-message-util/build/index.d.ts | 16 +- node_modules/jest-message-util/build/index.js | 380 +- .../jest-message-util/build/index.mjs | 10 + node_modules/jest-message-util/build/types.js | 1 - node_modules/jest-message-util/package.json | 32 +- node_modules/jest-mock/LICENSE | 1 + node_modules/jest-mock/build/index.d.mts | 206 + node_modules/jest-mock/build/index.d.ts | 115 +- node_modules/jest-mock/build/index.js | 483 +- node_modules/jest-mock/build/index.mjs | 7 + node_modules/jest-mock/package.json | 16 +- node_modules/jest-regex-util/LICENSE | 1 + node_modules/jest-regex-util/build/index.d.ts | 1 + node_modules/jest-regex-util/build/index.js | 42 +- node_modules/jest-regex-util/build/index.mjs | 5 + node_modules/jest-regex-util/package.json | 8 +- .../jest-resolve-dependencies/LICENSE | 1 + .../build/index.d.mts | 25 + .../build/index.d.ts | 6 +- .../jest-resolve-dependencies/build/index.js | 142 +- .../jest-resolve-dependencies/build/index.mjs | 3 + .../jest-resolve-dependencies/package.json | 22 +- node_modules/jest-resolve/LICENSE | 1 + .../jest-resolve/build/ModuleNotFoundError.js | 108 - .../jest-resolve/build/defaultResolver.js | 240 - .../jest-resolve/build/fileWalkers.js | 178 - node_modules/jest-resolve/build/index.d.mts | 232 + node_modules/jest-resolve/build/index.d.ts | 78 +- node_modules/jest-resolve/build/index.js | 1450 ++- node_modules/jest-resolve/build/index.mjs | 7 + .../jest-resolve/build/isBuiltinModule.js | 27 - .../jest-resolve/build/nodeModulesPaths.js | 131 - node_modules/jest-resolve/build/resolver.js | 796 -- .../jest-resolve/build/shouldLoadAsEsm.js | 90 - node_modules/jest-resolve/build/types.js | 1 - node_modules/jest-resolve/build/utils.js | 233 - node_modules/jest-resolve/package.json | 32 +- node_modules/jest-runner/LICENSE | 1 + node_modules/jest-runner/build/index.d.mts | 55 + node_modules/jest-runner/build/index.d.ts | 11 +- node_modules/jest-runner/build/index.js | 603 +- node_modules/jest-runner/build/index.mjs | 5 + node_modules/jest-runner/build/runTest.js | 462 - .../jest-runner/build/testWorker.d.mts | 36 + node_modules/jest-runner/build/testWorker.js | 469 +- node_modules/jest-runner/build/testWorker.mjs | 254 + node_modules/jest-runner/build/types.js | 28 - node_modules/jest-runner/package.json | 54 +- node_modules/jest-runtime/LICENSE | 1 + node_modules/jest-runtime/build/helpers.js | 134 - node_modules/jest-runtime/build/index.d.mts | 147 + node_modules/jest-runtime/build/index.d.ts | 41 +- node_modules/jest-runtime/build/index.js | 1599 +-- node_modules/jest-runtime/build/index.mjs | 3 + node_modules/jest-runtime/package.json | 53 +- node_modules/jest-snapshot/LICENSE | 1 + .../jest-snapshot/build/InlineSnapshots.js | 421 - .../jest-snapshot/build/SnapshotResolver.js | 153 - node_modules/jest-snapshot/build/State.js | 288 - node_modules/jest-snapshot/build/colors.js | 39 - .../jest-snapshot/build/dedentLines.js | 132 - node_modules/jest-snapshot/build/index.d.mts | 145 + node_modules/jest-snapshot/build/index.d.ts | 13 +- node_modules/jest-snapshot/build/index.js | 1782 ++- node_modules/jest-snapshot/build/index.mjs | 13 + .../jest-snapshot/build/mockSerializer.js | 47 - node_modules/jest-snapshot/build/plugins.js | 43 - .../jest-snapshot/build/printSnapshot.js | 340 - node_modules/jest-snapshot/build/types.js | 1 - node_modules/jest-snapshot/build/utils.js | 320 - node_modules/jest-snapshot/build/worker.d.mts | 1 + node_modules/jest-snapshot/build/worker.js | 513 + node_modules/jest-snapshot/build/worker.mjs | 100 + node_modules/jest-snapshot/package.json | 71 +- node_modules/jest-util/LICENSE | 1 + node_modules/jest-util/Readme.md | 4 +- .../jest-util/build/ErrorWithStack.js | 28 - .../jest-util/build/chunk-BQ42LXoh.mjs | 14 + node_modules/jest-util/build/clearLine.js | 18 - .../build/convertDescriptorToString.js | 30 - .../jest-util/build/createDirectory.js | 71 - .../jest-util/build/createProcessObject.js | 109 - .../jest-util/build/deepCyclicCopy.js | 76 - node_modules/jest-util/build/formatTime.js | 24 - .../jest-util/build/globsToMatcher.js | 98 - node_modules/jest-util/build/index.d.mts | 231 + node_modules/jest-util/build/index.d.ts | 73 +- node_modules/jest-util/build/index.js | 1358 ++- node_modules/jest-util/build/index.mjs | 26 + .../jest-util/build/installCommonGlobals.js | 115 - .../jest-util/build/interopRequireDefault.js | 22 - node_modules/jest-util/build/invariant.js | 18 - node_modules/jest-util/build/isInteractive.js | 22 - node_modules/jest-util/build/isNonNullable.js | 16 - node_modules/jest-util/build/isPromise.js | 20 - node_modules/jest-util/build/pluralize.js | 16 - node_modules/jest-util/build/preRunMessage.js | 38 - .../jest-util/build/replacePathSepForGlob.js | 16 - .../jest-util/build/requireOrImportModule.js | 77 - node_modules/jest-util/build/setGlobal.js | 17 - node_modules/jest-util/build/specialChars.js | 25 - .../build/testPathPatternToRegExp.js | 19 - node_modules/jest-util/build/tryRealpath.js | 30 - .../jest-util/node_modules/picomatch/LICENSE | 21 + .../node_modules/picomatch/README.md | 738 ++ .../jest-util/node_modules/picomatch/index.js | 17 + .../node_modules/picomatch/lib/constants.js | 180 + .../node_modules/picomatch/lib/parse.js | 1085 ++ .../node_modules/picomatch/lib/picomatch.js | 341 + .../node_modules/picomatch/lib/scan.js | 391 + .../node_modules/picomatch/lib/utils.js | 72 + .../node_modules/picomatch/package.json | 83 + .../jest-util/node_modules/picomatch/posix.js | 3 + node_modules/jest-util/package.json | 23 +- node_modules/jest-validate/LICENSE | 1 + node_modules/jest-validate/README.md | 4 +- node_modules/jest-validate/build/condition.js | 44 - .../jest-validate/build/defaultConfig.js | 37 - .../jest-validate/build/deprecated.js | 28 - node_modules/jest-validate/build/errors.js | 64 - .../jest-validate/build/exampleConfig.js | 38 - node_modules/jest-validate/build/index.d.mts | 56 + node_modules/jest-validate/build/index.d.ts | 5 +- node_modules/jest-validate/build/index.js | 561 +- node_modules/jest-validate/build/index.mjs | 9 + node_modules/jest-validate/build/types.js | 1 - node_modules/jest-validate/build/utils.js | 100 - node_modules/jest-validate/build/validate.js | 117 - .../jest-validate/build/validateCLIOptions.js | 127 - node_modules/jest-validate/build/warnings.js | 41 - node_modules/jest-validate/package.json | 20 +- node_modules/jest-watcher/LICENSE | 1 + .../jest-watcher/build/BaseWatchPlugin.js | 35 - node_modules/jest-watcher/build/JestHooks.js | 63 - .../jest-watcher/build/PatternPrompt.js | 74 - .../jest-watcher/build/TestWatcher.js | 45 - node_modules/jest-watcher/build/constants.js | 27 - node_modules/jest-watcher/build/index.d.mts | 169 + node_modules/jest-watcher/build/index.d.ts | 34 +- node_modules/jest-watcher/build/index.js | 530 +- node_modules/jest-watcher/build/index.mjs | 10 + node_modules/jest-watcher/build/lib/Prompt.js | 113 - .../jest-watcher/build/lib/colorize.js | 30 - .../build/lib/formatTestNameByPattern.js | 67 - .../build/lib/patternModeHelpers.js | 54 - node_modules/jest-watcher/build/lib/scroll.js | 31 - node_modules/jest-watcher/build/types.js | 1 - node_modules/jest-watcher/package.json | 20 +- node_modules/jest-worker/LICENSE | 1 + node_modules/jest-worker/README.md | 2 +- node_modules/jest-worker/build/Farm.js | 152 - node_modules/jest-worker/build/FifoQueue.js | 89 - .../jest-worker/build/PriorityQueue.js | 137 - node_modules/jest-worker/build/WorkerPool.js | 34 - .../jest-worker/build/base/BaseWorkerPool.js | 156 - node_modules/jest-worker/build/index.d.mts | 259 + node_modules/jest-worker/build/index.d.ts | 18 +- node_modules/jest-worker/build/index.js | 1808 ++- node_modules/jest-worker/build/index.mjs | 6 + .../jest-worker/build/processChild.d.mts | 1 + .../jest-worker/build/processChild.js | 310 + .../jest-worker/build/processChild.mjs | 147 + .../jest-worker/build/threadChild.d.mts | 1 + node_modules/jest-worker/build/threadChild.js | 347 + .../jest-worker/build/threadChild.mjs | 172 + node_modules/jest-worker/build/types.js | 72 - .../build/workers/ChildProcessWorker.js | 490 - .../build/workers/NodeThreadsWorker.js | 359 - .../build/workers/WorkerAbstract.js | 135 - .../build/workers/messageParent.js | 33 - .../jest-worker/build/workers/processChild.js | 159 - .../jest-worker/build/workers/threadChild.js | 177 - node_modules/jest-worker/package.json | 26 +- node_modules/jest/LICENSE | 1 + node_modules/jest/bin/jest.js | 0 node_modules/jest/build/index.d.mts | 9 + node_modules/jest/build/index.d.ts | 17 +- node_modules/jest/build/index.js | 55 +- node_modules/jest/build/index.mjs | 8 + node_modules/jest/package.json | 20 +- node_modules/jsdom/README.md | 51 +- node_modules/jsdom/lib/api.js | 3 +- .../jsdom/lib/jsdom/browser/Window.js | 485 +- .../jsdom/lib/jsdom/browser/js-globals.json | 9 +- .../jsdom/lib/jsdom/browser/parser/xml.js | 2 +- .../resources/per-document-resource-loader.js | 5 +- node_modules/jsdom/lib/jsdom/level2/style.js | 2 +- node_modules/jsdom/lib/jsdom/level3/xpath.js | 7 +- .../jsdom/living/aborting/AbortSignal-impl.js | 64 +- .../jsdom/lib/jsdom/living/attributes.js | 2 +- .../living/attributes/NamedNodeMap-impl.js | 2 +- .../lib/jsdom/living/crypto/Crypto-impl.js | 7 +- .../CustomElementRegistry-impl.js | 12 +- .../custom-elements/ElementInternals-impl.js | 52 + .../jsdom/living/domparsing/DOMParser-impl.js | 5 +- .../living/domparsing/XMLSerializer-impl.js | 2 +- .../jsdom/living/domparsing/serialization.js | 8 +- .../jsdom/living/events/EventTarget-impl.js | 2 +- .../jsdom/living/events/MouseEvent-impl.js | 23 + .../jsdom/living/events/SubmitEvent-impl.js | 13 + .../lib/jsdom/living/fetch/Headers-impl.js | 16 +- .../lib/jsdom/living/fetch/header-list.js | 23 +- .../jsdom/living/file-api/FileReader-impl.js | 2 +- .../lib/jsdom/living/generated/AbortSignal.js | 67 +- .../lib/jsdom/living/generated/Crypto.js | 10 + .../jsdom/living/generated}/DOMException.js | 2 +- .../lib/jsdom/living/generated/DOMRect.js | 276 + .../lib/jsdom/living/generated/DOMRectInit.js | 76 + .../jsdom/living/generated/DOMRectReadOnly.js | 285 + .../lib/jsdom/living/generated/Document.js | 644 +- .../lib/jsdom/living/generated/Element.js | 2012 +++- .../living/generated/ElementInternals.js | 2150 ++++ .../lib/jsdom/living/generated/FormData.js | 16 + .../living/generated/HTMLAnchorElement.js | 40 +- .../jsdom/living/generated/HTMLAreaElement.js | 26 +- .../jsdom/living/generated/HTMLBRElement.js | 4 +- .../jsdom/living/generated/HTMLBaseElement.js | 4 +- .../jsdom/living/generated/HTMLBodyElement.js | 24 +- .../living/generated/HTMLButtonElement.js | 30 +- .../living/generated/HTMLDListElement.js | 6 +- .../jsdom/living/generated/HTMLDataElement.js | 4 +- .../living/generated/HTMLDetailsElement.js | 6 +- .../living/generated/HTMLDialogElement.js | 6 +- .../living/generated/HTMLDirectoryElement.js | 6 +- .../jsdom/living/generated/HTMLDivElement.js | 4 +- .../lib/jsdom/living/generated/HTMLElement.js | 690 +- .../living/generated/HTMLEmbedElement.js | 44 +- .../living/generated/HTMLFieldSetElement.js | 10 +- .../jsdom/living/generated/HTMLFontElement.js | 12 +- .../jsdom/living/generated/HTMLFormElement.js | 205 +- .../living/generated/HTMLFrameElement.js | 72 +- .../living/generated/HTMLFrameSetElement.js | 8 +- .../jsdom/living/generated/HTMLHRElement.js | 22 +- .../living/generated/HTMLHeadingElement.js | 4 +- .../jsdom/living/generated/HTMLHtmlElement.js | 4 +- .../living/generated/HTMLIFrameElement.js | 88 +- .../living/generated/HTMLImageElement.js | 143 +- .../living/generated/HTMLInputElement.js | 183 +- .../jsdom/living/generated/HTMLLIElement.js | 18 +- .../living/generated/HTMLLabelElement.js | 4 +- .../living/generated/HTMLLegendElement.js | 4 +- .../jsdom/living/generated/HTMLLinkElement.js | 61 +- .../jsdom/living/generated/HTMLMapElement.js | 4 +- .../living/generated/HTMLMarqueeElement.js | 90 +- .../living/generated/HTMLMediaElement.js | 61 +- .../jsdom/living/generated/HTMLMenuElement.js | 6 +- .../jsdom/living/generated/HTMLMetaElement.js | 16 +- .../jsdom/living/generated/HTMLModElement.js | 28 +- .../living/generated/HTMLOListElement.js | 16 +- .../living/generated/HTMLObjectElement.js | 128 +- .../living/generated/HTMLOptGroupElement.js | 10 +- .../living/generated/HTMLOptionElement.js | 12 +- .../living/generated/HTMLOutputElement.js | 4 +- .../living/generated/HTMLParagraphElement.js | 4 +- .../living/generated/HTMLParamElement.js | 16 +- .../jsdom/living/generated/HTMLPreElement.js | 14 +- .../living/generated/HTMLProgressElement.js | 14 +- .../living/generated/HTMLQuoteElement.js | 24 +- .../living/generated/HTMLScriptElement.js | 55 +- .../living/generated/HTMLSelectElement.js | 44 +- .../jsdom/living/generated/HTMLSlotElement.js | 4 +- .../living/generated/HTMLSourceElement.js | 40 +- .../living/generated/HTMLStyleElement.js | 8 +- .../generated/HTMLTableCaptionElement.js | 4 +- .../living/generated/HTMLTableCellElement.js | 83 +- .../living/generated/HTMLTableColElement.js | 42 +- .../living/generated/HTMLTableElement.js | 36 +- .../living/generated/HTMLTableRowElement.js | 20 +- .../generated/HTMLTableSectionElement.js | 16 +- .../living/generated/HTMLTextAreaElement.js | 117 +- .../jsdom/living/generated/HTMLTimeElement.js | 4 +- .../living/generated/HTMLTrackElement.js | 42 +- .../living/generated/HTMLUListElement.js | 10 +- .../living/generated/HTMLVideoElement.js | 62 +- .../lib/jsdom/living/generated/Headers.js | 10 + .../lib/jsdom/living/generated/MouseEvent.js | 70 + .../jsdom/living/generated/MouseEventInit.js | 48 + .../SVGAnimatedPreserveAspectRatio.js | 136 + .../jsdom/living/generated/SVGAnimatedRect.js | 136 + .../jsdom/living/generated/SVGDefsElement.js | 109 + .../jsdom/living/generated/SVGDescElement.js | 109 + .../lib/jsdom/living/generated/SVGElement.js | 662 +- .../lib/jsdom/living/generated/SVGGElement.js | 109 + .../living/generated/SVGMetadataElement.js | 109 + .../generated/SVGPreserveAspectRatio.js | 196 + .../lib/jsdom/living/generated/SVGRect.js | 210 + .../jsdom/living/generated/SVGSVGElement.js | 49 + .../living/generated/SVGSwitchElement.js | 109 + .../living/generated/SVGSymbolElement.js | 146 + .../lib/jsdom/living/generated/SubmitEvent.js | 144 + .../jsdom/living/generated/SubmitEventInit.js | 36 + .../lib/jsdom/living/geometry/DOMRect-impl.js | 39 + .../living/geometry/DOMRectReadOnly-impl.js | 72 + .../lib/jsdom/living/helpers/agent-factory.js | 8 +- .../jsdom/lib/jsdom/living/helpers/colors.js | 245 + .../jsdom/living/helpers/create-element.js | 15 +- .../jsdom/living/helpers/custom-elements.js | 4 +- .../jsdom/living/helpers/document-base-url.js | 54 - .../lib/jsdom/living/helpers/form-controls.js | 5 +- .../lib/jsdom/living/helpers/http-request.js | 40 +- .../lib/jsdom/living/helpers/namespaces.js | 1 + .../jsdom/lib/jsdom/living/helpers/strings.js | 18 +- .../lib/jsdom/living/helpers/style-rules.js | 179 +- .../lib/jsdom/living/helpers/stylesheets.js | 14 +- .../jsdom/living/helpers/validate-names.js | 2 +- .../jsdom/living/hr-time/Performance-impl.js | 1 - .../jsdom/lib/jsdom/living/interfaces.js | 24 +- .../jsdom/living/named-properties-window.js | 16 +- .../jsdom/living/nodes/CharacterData-impl.js | 2 +- .../jsdom/living/nodes/DOMStringMap-impl.js | 2 +- .../jsdom/living/nodes/DOMTokenList-impl.js | 2 +- .../lib/jsdom/living/nodes/Document-impl.js | 73 +- .../lib/jsdom/living/nodes/Element-impl.js | 35 +- .../nodes/ElementCSSInlineStyle-impl.js | 3 - .../living/nodes/GlobalEventHandlers-impl.js | 106 +- .../living/nodes/HTMLBaseElement-impl.js | 21 +- .../jsdom/living/nodes/HTMLElement-impl.js | 50 + .../living/nodes/HTMLFormElement-impl.js | 37 +- .../living/nodes/HTMLFrameElement-impl.js | 13 +- .../nodes/HTMLHyperlinkElementUtils-impl.js | 5 +- .../living/nodes/HTMLImageElement-impl.js | 3 +- .../living/nodes/HTMLInputElement-impl.js | 74 +- .../living/nodes/HTMLLinkElement-impl.js | 12 +- .../living/nodes/HTMLMediaElement-impl.js | 2 +- .../living/nodes/HTMLOptionElement-impl.js | 4 +- .../nodes/HTMLOptionsCollection-impl.js | 2 +- .../living/nodes/HTMLOrSVGElement-impl.js | 13 +- .../living/nodes/HTMLProgressElement-impl.js | 40 +- .../living/nodes/HTMLScriptElement-impl.js | 6 +- .../living/nodes/HTMLSelectElement-impl.js | 64 +- .../living/nodes/HTMLStyleElement-impl.js | 3 +- .../living/nodes/HTMLTableElement-impl.js | 2 +- .../living/nodes/HTMLTableRowElement-impl.js | 2 +- .../nodes/HTMLTableSectionElement-impl.js | 2 +- .../living/nodes/HTMLTextAreaElement-impl.js | 36 +- .../jsdom/lib/jsdom/living/nodes/Node-impl.js | 31 +- .../lib/jsdom/living/nodes/ParentNode-impl.js | 8 +- .../jsdom/living/nodes/SVGDefsElement-impl.js | 9 + .../jsdom/living/nodes/SVGDescElement-impl.js | 9 + .../lib/jsdom/living/nodes/SVGElement-impl.js | 20 +- .../jsdom/living/nodes/SVGGElement-impl.js | 9 + .../living/nodes/SVGMetadataElement-impl.js | 9 + .../jsdom/living/nodes/SVGSVGElement-impl.js | 5 + .../living/nodes/SVGSwitchElement-impl.js | 9 + .../living/nodes/SVGSymbolElement-impl.js | 9 + .../lib/jsdom/living/nodes/ShadowRoot-impl.js | 1 + .../jsdom/lib/jsdom/living/nodes/Text-impl.js | 2 +- .../jsdom/lib/jsdom/living/post-message.js | 39 - .../lib/jsdom/living/range/Range-impl.js | 2 +- .../jsdom/living/range/StaticRange-impl.js | 2 +- .../jsdom/living/selection/Selection-impl.js | 20 +- .../SVGAnimatedPreserveAspectRatio-impl.js | 24 + .../jsdom/living/svg/SVGAnimatedRect-impl.js | 122 + .../living/svg/SVGAnimatedString-impl.js | 12 +- .../jsdom/lib/jsdom/living/svg/SVGListBase.js | 2 +- .../lib/jsdom/living/svg/SVGNumber-impl.js | 2 +- .../living/svg/SVGPreserveAspectRatio-impl.js | 100 + .../lib/jsdom/living/svg/SVGRect-impl.js | 143 + .../jsdom/living/traversal/TreeWalker-impl.js | 2 +- .../lib/jsdom/living/traversal/helpers.js | 2 +- .../jsdom/living/webidl/DOMException-impl.js | 46 + .../websockets/WebSocket-impl-browser.js | 175 - .../jsdom/living/websockets/WebSocket-impl.js | 2 +- .../jsdom/living/webstorage/Storage-impl.js | 2 +- .../lib/jsdom/living/window/History-impl.js | 73 +- .../lib/jsdom/living/window/Location-impl.js | 23 +- .../lib/jsdom/living/xhr/FormData-impl.js | 30 +- .../jsdom/living/xhr/XMLHttpRequest-impl.js | 52 +- .../jsdom/living/xhr/multipart-form-data.js | 105 + .../lib/jsdom/living/xhr/xhr-sync-worker.js | 1 - .../jsdom/lib/jsdom/living/xhr/xhr-utils.js | 36 +- node_modules/jsdom/lib/jsdom/utils.js | 68 +- node_modules/jsdom/lib/jsdom/vm-shim.js | 106 - node_modules/jsdom/package.json | 96 +- node_modules/kleur/index.js | 104 - node_modules/kleur/kleur.d.ts | 45 - node_modules/kleur/license | 21 - node_modules/kleur/package.json | 35 - node_modules/kleur/readme.md | 172 - node_modules/math-intrinsics/.eslintrc | 16 - .../math-intrinsics/.github/FUNDING.yml | 12 - node_modules/math-intrinsics/CHANGELOG.md | 24 - node_modules/math-intrinsics/LICENSE | 21 - node_modules/math-intrinsics/README.md | 50 - node_modules/math-intrinsics/abs.d.ts | 1 - node_modules/math-intrinsics/abs.js | 4 - .../constants/maxArrayLength.d.ts | 3 - .../constants/maxArrayLength.js | 4 - .../constants/maxSafeInteger.d.ts | 3 - .../constants/maxSafeInteger.js | 5 - .../math-intrinsics/constants/maxValue.d.ts | 3 - .../math-intrinsics/constants/maxValue.js | 5 - node_modules/math-intrinsics/floor.d.ts | 1 - node_modules/math-intrinsics/floor.js | 4 - node_modules/math-intrinsics/isFinite.d.ts | 3 - node_modules/math-intrinsics/isFinite.js | 12 - node_modules/math-intrinsics/isInteger.d.ts | 3 - node_modules/math-intrinsics/isInteger.js | 16 - node_modules/math-intrinsics/isNaN.d.ts | 1 - node_modules/math-intrinsics/isNaN.js | 6 - .../math-intrinsics/isNegativeZero.d.ts | 3 - .../math-intrinsics/isNegativeZero.js | 6 - node_modules/math-intrinsics/max.d.ts | 1 - node_modules/math-intrinsics/max.js | 4 - node_modules/math-intrinsics/min.d.ts | 1 - node_modules/math-intrinsics/min.js | 4 - node_modules/math-intrinsics/mod.d.ts | 3 - node_modules/math-intrinsics/mod.js | 9 - node_modules/math-intrinsics/package.json | 86 - node_modules/math-intrinsics/pow.d.ts | 1 - node_modules/math-intrinsics/pow.js | 4 - node_modules/math-intrinsics/round.d.ts | 1 - node_modules/math-intrinsics/round.js | 4 - node_modules/math-intrinsics/sign.d.ts | 3 - node_modules/math-intrinsics/sign.js | 11 - node_modules/math-intrinsics/test/index.js | 192 - node_modules/math-intrinsics/tsconfig.json | 3 - node_modules/mime-db/HISTORY.md | 507 - node_modules/mime-db/LICENSE | 23 - node_modules/mime-db/README.md | 100 - node_modules/mime-db/db.json | 8519 ------------- node_modules/mime-db/index.js | 12 - node_modules/mime-db/package.json | 60 - node_modules/mime-types/HISTORY.md | 397 - node_modules/mime-types/LICENSE | 23 - node_modules/mime-types/README.md | 113 - node_modules/mime-types/index.js | 188 - node_modules/mime-types/package.json | 44 - node_modules/minimatch/LICENSE | 2 +- node_modules/minimatch/README.md | 354 +- .../dist/commonjs/assert-valid-pattern.d.ts | 2 + .../commonjs/assert-valid-pattern.d.ts.map | 1 + .../dist/commonjs/assert-valid-pattern.js | 14 + .../dist/commonjs/assert-valid-pattern.js.map | 1 + node_modules/minimatch/dist/commonjs/ast.d.ts | 20 + .../minimatch/dist/commonjs/ast.d.ts.map | 1 + node_modules/minimatch/dist/commonjs/ast.js | 592 + .../minimatch/dist/commonjs/ast.js.map | 1 + .../dist/commonjs/brace-expressions.d.ts | 8 + .../dist/commonjs/brace-expressions.d.ts.map | 1 + .../dist/commonjs/brace-expressions.js | 152 + .../dist/commonjs/brace-expressions.js.map | 1 + .../minimatch/dist/commonjs/escape.d.ts | 12 + .../minimatch/dist/commonjs/escape.d.ts.map | 1 + .../minimatch/dist/commonjs/escape.js | 22 + .../minimatch/dist/commonjs/escape.js.map | 1 + .../minimatch/dist/commonjs/index.d.ts | 94 + .../minimatch/dist/commonjs/index.d.ts.map | 1 + node_modules/minimatch/dist/commonjs/index.js | 1017 ++ .../minimatch/dist/commonjs/index.js.map | 1 + .../minimatch/dist/commonjs/package.json | 3 + .../minimatch/dist/commonjs/unescape.d.ts | 17 + .../minimatch/dist/commonjs/unescape.d.ts.map | 1 + .../minimatch/dist/commonjs/unescape.js | 24 + .../minimatch/dist/commonjs/unescape.js.map | 1 + .../dist/esm/assert-valid-pattern.d.ts | 2 + .../dist/esm/assert-valid-pattern.d.ts.map | 1 + .../dist/esm/assert-valid-pattern.js | 10 + .../dist/esm/assert-valid-pattern.js.map | 1 + node_modules/minimatch/dist/esm/ast.d.ts | 20 + node_modules/minimatch/dist/esm/ast.d.ts.map | 1 + node_modules/minimatch/dist/esm/ast.js | 588 + node_modules/minimatch/dist/esm/ast.js.map | 1 + .../minimatch/dist/esm/brace-expressions.d.ts | 8 + .../dist/esm/brace-expressions.d.ts.map | 1 + .../minimatch/dist/esm/brace-expressions.js | 148 + .../dist/esm/brace-expressions.js.map | 1 + node_modules/minimatch/dist/esm/escape.d.ts | 12 + .../minimatch/dist/esm/escape.d.ts.map | 1 + node_modules/minimatch/dist/esm/escape.js | 18 + node_modules/minimatch/dist/esm/escape.js.map | 1 + node_modules/minimatch/dist/esm/index.d.ts | 94 + .../minimatch/dist/esm/index.d.ts.map | 1 + node_modules/minimatch/dist/esm/index.js | 1001 ++ node_modules/minimatch/dist/esm/index.js.map | 1 + node_modules/minimatch/dist/esm/package.json | 3 + node_modules/minimatch/dist/esm/unescape.d.ts | 17 + .../minimatch/dist/esm/unescape.d.ts.map | 1 + node_modules/minimatch/dist/esm/unescape.js | 20 + .../minimatch/dist/esm/unescape.js.map | 1 + node_modules/minimatch/package.json | 75 +- node_modules/minipass/LICENSE | 15 + node_modules/minipass/README.md | 825 ++ .../minipass/dist/commonjs/index.d.ts | 549 + .../minipass/dist/commonjs/index.d.ts.map | 1 + node_modules/minipass/dist/commonjs/index.js | 1028 ++ .../minipass/dist/commonjs/index.js.map | 1 + .../minipass/dist/commonjs/package.json | 3 + node_modules/minipass/dist/esm/index.d.ts | 549 + node_modules/minipass/dist/esm/index.d.ts.map | 1 + node_modules/minipass/dist/esm/index.js | 1018 ++ node_modules/minipass/dist/esm/index.js.map | 1 + node_modules/minipass/dist/esm/package.json | 3 + node_modules/minipass/package.json | 82 + node_modules/napi-postinstall/LICENSE | 21 + node_modules/napi-postinstall/README.md | 147 + node_modules/napi-postinstall/lib/cli.d.ts | 2 + node_modules/napi-postinstall/lib/cli.js | 27 + node_modules/napi-postinstall/lib/cli.js.map | 1 + .../napi-postinstall/lib/constants.d.ts | 9 + .../napi-postinstall/lib/constants.js | 14 + .../napi-postinstall/lib/constants.js.map | 1 + .../napi-postinstall/lib/fallback.d.ts | 2 + node_modules/napi-postinstall/lib/fallback.js | 74 + .../napi-postinstall/lib/fallback.js.map | 1 + .../napi-postinstall/lib/helpers.d.ts | 13 + node_modules/napi-postinstall/lib/helpers.js | 257 + .../napi-postinstall/lib/helpers.js.map | 1 + node_modules/napi-postinstall/lib/index.d.ts | 6 + node_modules/napi-postinstall/lib/index.js | 242 + .../napi-postinstall/lib/index.js.map | 1 + node_modules/napi-postinstall/lib/target.d.ts | 2 + node_modules/napi-postinstall/lib/target.js | 63 + .../napi-postinstall/lib/target.js.map | 1 + node_modules/napi-postinstall/lib/types.d.ts | 37 + .../dist => napi-postinstall/lib}/types.js | 0 .../lib}/types.js.map | 0 node_modules/napi-postinstall/package.json | 31 + node_modules/nwsapi/package.json | 2 +- node_modules/nwsapi/src/nwsapi.js | 8 +- .../package-json-from-dist/LICENSE.md | 63 + node_modules/package-json-from-dist/README.md | 110 + .../dist/commonjs/index.d.ts | 89 + .../dist/commonjs/index.d.ts.map | 1 + .../dist/commonjs/index.js | 134 + .../dist/commonjs/index.js.map | 1 + .../dist/commonjs/package.json | 3 + .../dist/esm/index.d.ts | 89 + .../dist/esm/index.d.ts.map | 1 + .../package-json-from-dist/dist/esm/index.js | 129 + .../dist/esm/index.js.map | 1 + .../dist/esm/package.json | 3 + .../package-json-from-dist/package.json | 68 + node_modules/path-parse/LICENSE | 21 - node_modules/path-parse/README.md | 42 - node_modules/path-parse/index.js | 75 - node_modules/path-parse/package.json | 33 - node_modules/path-scurry/LICENSE.md | 55 + node_modules/path-scurry/README.md | 636 + .../path-scurry/dist/commonjs/index.d.ts | 1116 ++ .../path-scurry/dist/commonjs/index.d.ts.map | 1 + .../path-scurry/dist/commonjs/index.js | 2014 ++++ .../path-scurry/dist/commonjs/index.js.map | 1 + .../path-scurry/dist/commonjs/package.json | 3 + node_modules/path-scurry/dist/esm/index.d.ts | 1116 ++ .../path-scurry/dist/esm/index.d.ts.map | 1 + node_modules/path-scurry/dist/esm/index.js | 1979 +++ .../path-scurry/dist/esm/index.js.map | 1 + .../path-scurry/dist/esm/package.json | 3 + .../node_modules/lru-cache/LICENSE | 15 + .../node_modules/lru-cache/README.md | 331 + .../lru-cache/dist/commonjs/index.d.ts | 1277 ++ .../lru-cache/dist/commonjs/index.d.ts.map | 1 + .../lru-cache/dist/commonjs/index.js | 1546 +++ .../lru-cache/dist/commonjs/index.js.map | 1 + .../lru-cache/dist/commonjs/index.min.js | 2 + .../lru-cache/dist/commonjs/index.min.js.map | 7 + .../lru-cache/dist/commonjs/package.json | 3 + .../lru-cache/dist/esm/index.d.ts | 1277 ++ .../lru-cache/dist/esm/index.d.ts.map | 1 + .../node_modules/lru-cache/dist/esm/index.js | 1542 +++ .../lru-cache/dist/esm/index.js.map | 1 + .../lru-cache/dist/esm/index.min.js | 2 + .../lru-cache/dist/esm/index.min.js.map | 7 + .../lru-cache/dist/esm/package.json | 3 + .../node_modules/lru-cache/package.json | 116 + node_modules/path-scurry/package.json | 89 + node_modules/pretty-format/LICENSE | 1 + node_modules/pretty-format/README.md | 0 .../pretty-format/build/collections.js | 180 - node_modules/pretty-format/build/index.d.mts | 113 + node_modules/pretty-format/build/index.d.ts | 15 +- node_modules/pretty-format/build/index.js | 1035 +- node_modules/pretty-format/build/index.mjs | 6 + .../build/plugins/AsymmetricMatcher.js | 89 - .../build/plugins/DOMCollection.js | 67 - .../pretty-format/build/plugins/DOMElement.js | 101 - .../pretty-format/build/plugins/Immutable.js | 217 - .../build/plugins/ReactElement.js | 143 - .../build/plugins/ReactTestComponent.js | 66 - .../build/plugins/lib/escapeHTML.js | 16 - .../pretty-format/build/plugins/lib/markup.js | 113 - node_modules/pretty-format/build/types.js | 1 - node_modules/pretty-format/package.json | 30 +- .../prompts/dist/dateparts/datepart.js | 39 - node_modules/prompts/dist/dateparts/day.js | 35 - node_modules/prompts/dist/dateparts/hours.js | 30 - node_modules/prompts/dist/dateparts/index.js | 13 - .../prompts/dist/dateparts/meridiem.js | 25 - .../prompts/dist/dateparts/milliseconds.js | 28 - .../prompts/dist/dateparts/minutes.js | 29 - node_modules/prompts/dist/dateparts/month.js | 31 - .../prompts/dist/dateparts/seconds.js | 29 - node_modules/prompts/dist/dateparts/year.js | 29 - .../prompts/dist/elements/autocomplete.js | 285 - .../dist/elements/autocompleteMultiselect.js | 201 - node_modules/prompts/dist/elements/confirm.js | 93 - node_modules/prompts/dist/elements/date.js | 250 - node_modules/prompts/dist/elements/index.js | 13 - .../prompts/dist/elements/multiselect.js | 289 - node_modules/prompts/dist/elements/number.js | 250 - node_modules/prompts/dist/elements/prompt.js | 82 - node_modules/prompts/dist/elements/select.js | 190 - node_modules/prompts/dist/elements/text.js | 245 - node_modules/prompts/dist/elements/toggle.js | 124 - node_modules/prompts/dist/index.js | 154 - node_modules/prompts/dist/prompts.js | 222 - node_modules/prompts/dist/util/action.js | 38 - node_modules/prompts/dist/util/clear.js | 42 - .../prompts/dist/util/entriesToDisplay.js | 21 - node_modules/prompts/dist/util/figures.js | 32 - node_modules/prompts/dist/util/index.js | 12 - node_modules/prompts/dist/util/lines.js | 14 - node_modules/prompts/dist/util/strip.js | 7 - node_modules/prompts/dist/util/style.js | 51 - node_modules/prompts/dist/util/wrap.js | 16 - node_modules/prompts/index.js | 14 - .../prompts/lib/dateparts/datepart.js | 35 - node_modules/prompts/lib/dateparts/day.js | 42 - node_modules/prompts/lib/dateparts/hours.js | 30 - node_modules/prompts/lib/dateparts/index.js | 13 - .../prompts/lib/dateparts/meridiem.js | 24 - .../prompts/lib/dateparts/milliseconds.js | 28 - node_modules/prompts/lib/dateparts/minutes.js | 28 - node_modules/prompts/lib/dateparts/month.js | 33 - node_modules/prompts/lib/dateparts/seconds.js | 28 - node_modules/prompts/lib/dateparts/year.js | 28 - .../prompts/lib/elements/autocomplete.js | 264 - .../lib/elements/autocompleteMultiselect.js | 194 - node_modules/prompts/lib/elements/confirm.js | 89 - node_modules/prompts/lib/elements/date.js | 209 - node_modules/prompts/lib/elements/index.js | 13 - .../prompts/lib/elements/multiselect.js | 271 - node_modules/prompts/lib/elements/number.js | 213 - node_modules/prompts/lib/elements/prompt.js | 68 - node_modules/prompts/lib/elements/select.js | 175 - node_modules/prompts/lib/elements/text.js | 208 - node_modules/prompts/lib/elements/toggle.js | 118 - node_modules/prompts/lib/index.js | 98 - node_modules/prompts/lib/prompts.js | 206 - node_modules/prompts/lib/util/action.js | 39 - node_modules/prompts/lib/util/clear.js | 22 - .../prompts/lib/util/entriesToDisplay.js | 21 - node_modules/prompts/lib/util/figures.js | 33 - node_modules/prompts/lib/util/index.js | 12 - node_modules/prompts/lib/util/lines.js | 15 - node_modules/prompts/lib/util/strip.js | 11 - node_modules/prompts/lib/util/style.js | 40 - node_modules/prompts/lib/util/wrap.js | 27 - node_modules/prompts/license | 21 - node_modules/prompts/package.json | 53 - node_modules/prompts/readme.md | 882 -- node_modules/psl/LICENSE | 9 - node_modules/psl/README.md | 260 - node_modules/psl/SECURITY.md | 13 - node_modules/psl/browserstack-logo.svg | 90 - node_modules/psl/data/rules.js | 9778 --------------- node_modules/psl/dist/psl.cjs | 1 - node_modules/psl/dist/psl.mjs | 10008 ---------------- node_modules/psl/dist/psl.umd.cjs | 1 - node_modules/psl/index.js | 247 - node_modules/psl/package.json | 51 - node_modules/psl/types/index.d.ts | 52 - node_modules/psl/types/test.ts | 14 - node_modules/psl/types/tsconfig.json | 22 - node_modules/psl/vite.config.js | 20 - node_modules/pure-rand/CHANGELOG.md | 92 +- node_modules/pure-rand/README.md | 44 + .../lib/distribution/Distribution.js | 2 - .../pure-rand/lib/distribution/GenerateN.js | 9 + .../pure-rand/lib/distribution/SkipN.js | 9 + .../UniformArrayIntDistribution.js | 5 +- .../distribution/UniformBigIntDistribution.js | 5 +- .../distribution/UniformIntDistribution.js | 5 +- .../lib/distribution/UnsafeGenerateN.js | 10 + .../pure-rand/lib/distribution/UnsafeSkipN.js | 8 + .../UnsafeUniformArrayIntDistribution.js | 5 +- .../UnsafeUniformBigIntDistribution.js | 42 +- .../UnsafeUniformIntDistribution.js | 11 +- .../lib/distribution/internals/ArrayInt.js | 62 +- .../lib/distribution/internals/ArrayInt64.js | 53 + ...safeUniformArrayIntDistributionInternal.js | 5 +- .../UnsafeUniformIntDistributionInternal.js | 5 +- .../lib/esm/distribution/GenerateN.js | 6 + .../pure-rand/lib/esm/distribution/SkipN.js | 6 + .../lib/esm/distribution/UnsafeGenerateN.js | 7 + .../lib/esm/distribution/UnsafeSkipN.js | 5 + .../UnsafeUniformBigIntDistribution.js | 37 +- .../UnsafeUniformIntDistribution.js | 2 +- .../esm/distribution/internals/ArrayInt.js | 49 - .../esm/distribution/internals/ArrayInt64.js | 49 + .../lib/esm/generator/MersenneTwister.js | 2 +- .../lib/esm/generator/RandomGenerator.js | 22 - .../pure-rand/lib/esm/pure-rand-default.js | 11 +- .../pure-rand/lib/esm/types/Distribution.js | 1 + .../lib/esm/types/RandomGenerator.js | 1 + .../esm/types/distribution/Distribution.d.ts | 2 - .../lib/esm/types/distribution/GenerateN.d.ts | 2 + .../lib/esm/types/distribution/SkipN.d.ts | 2 + .../UniformArrayIntDistribution.d.ts | 6 +- .../UniformBigIntDistribution.d.ts | 4 +- .../distribution/UniformIntDistribution.d.ts | 4 +- .../types/distribution/UnsafeGenerateN.d.ts | 2 + .../esm/types/distribution/UnsafeSkipN.d.ts | 2 + .../UnsafeUniformArrayIntDistribution.d.ts | 4 +- .../UnsafeUniformBigIntDistribution.d.ts | 2 +- .../UnsafeUniformIntDistribution.d.ts | 2 +- .../distribution/internals/ArrayInt.d.ts | 5 - .../distribution/internals/ArrayInt64.d.ts | 6 + ...feUniformArrayIntDistributionInternal.d.ts | 4 +- .../UnsafeUniformIntDistributionInternal.d.ts | 2 +- .../types/generator/LinearCongruential.d.ts | 2 +- .../esm/types/generator/MersenneTwister.d.ts | 6 +- .../esm/types/generator/RandomGenerator.d.ts | 12 - .../lib/esm/types/generator/XorShift.d.ts | 2 +- .../lib/esm/types/generator/XoroShiro.d.ts | 2 +- .../lib/esm/types/pure-rand-default.d.ts | 10 +- .../lib/esm/types/types/Distribution.d.ts | 2 + .../lib/esm/types/types/RandomGenerator.d.ts | 8 + .../lib/generator/LinearCongruential.js | 2 +- .../lib/generator/MersenneTwister.js | 5 +- .../lib/generator/RandomGenerator.js | 29 - .../pure-rand/lib/generator/XorShift.js | 2 +- .../pure-rand/lib/generator/XoroShiro.js | 2 +- .../pure-rand/lib/pure-rand-default.js | 39 +- node_modules/pure-rand/lib/pure-rand.js | 4 +- .../pure-rand/lib/types/Distribution.js | 2 + .../pure-rand/lib/types/RandomGenerator.js | 2 + .../lib/types/distribution/Distribution.d.ts | 2 - .../lib/types/distribution/GenerateN.d.ts | 2 + .../lib/types/distribution/SkipN.d.ts | 2 + .../UniformArrayIntDistribution.d.ts | 6 +- .../UniformBigIntDistribution.d.ts | 4 +- .../distribution/UniformIntDistribution.d.ts | 4 +- .../types/distribution/UnsafeGenerateN.d.ts | 2 + .../lib/types/distribution/UnsafeSkipN.d.ts | 2 + .../UnsafeUniformArrayIntDistribution.d.ts | 4 +- .../UnsafeUniformBigIntDistribution.d.ts | 2 +- .../UnsafeUniformIntDistribution.d.ts | 2 +- .../distribution/internals/ArrayInt.d.ts | 5 - .../distribution/internals/ArrayInt64.d.ts | 6 + ...feUniformArrayIntDistributionInternal.d.ts | 4 +- .../UnsafeUniformIntDistributionInternal.d.ts | 2 +- .../types/generator/LinearCongruential.d.ts | 2 +- .../lib/types/generator/MersenneTwister.d.ts | 6 +- .../lib/types/generator/RandomGenerator.d.ts | 12 - .../lib/types/generator/XorShift.d.ts | 2 +- .../lib/types/generator/XoroShiro.d.ts | 2 +- .../lib/types/pure-rand-default.d.ts | 10 +- .../lib/types/types/Distribution.d.ts | 2 + .../lib/types/types/RandomGenerator.d.ts | 8 + node_modules/pure-rand/package.json | 52 +- node_modules/querystringify/LICENSE | 22 - node_modules/querystringify/README.md | 61 - node_modules/querystringify/index.js | 118 - node_modules/querystringify/package.json | 38 - node_modules/requires-port/.npmignore | 2 - node_modules/requires-port/.travis.yml | 19 - node_modules/requires-port/LICENSE | 22 - node_modules/requires-port/README.md | 47 - node_modules/requires-port/index.js | 38 - node_modules/requires-port/package.json | 47 - node_modules/requires-port/test.js | 98 - node_modules/resolve.exports/dist/index.js | 1 - node_modules/resolve.exports/dist/index.mjs | 1 - node_modules/resolve.exports/index.d.ts | 100 - node_modules/resolve.exports/license | 21 - node_modules/resolve.exports/package.json | 50 - node_modules/resolve.exports/readme.md | 458 - node_modules/resolve/.editorconfig | 37 - node_modules/resolve/.eslintrc | 65 - node_modules/resolve/.github/FUNDING.yml | 12 - .../.github/INCIDENT_RESPONSE_PROCESS.md | 119 - node_modules/resolve/.github/THREAT_MODEL.md | 74 - node_modules/resolve/LICENSE | 21 - node_modules/resolve/SECURITY.md | 11 - node_modules/resolve/async.js | 3 - node_modules/resolve/bin/resolve | 50 - node_modules/resolve/example/async.js | 5 - node_modules/resolve/example/sync.js | 3 - node_modules/resolve/index.js | 6 - node_modules/resolve/lib/async.js | 333 - node_modules/resolve/lib/caller.js | 8 - node_modules/resolve/lib/core.js | 12 - node_modules/resolve/lib/core.json | 162 - node_modules/resolve/lib/homedir.js | 24 - node_modules/resolve/lib/is-core.js | 5 - .../resolve/lib/node-modules-paths.js | 45 - node_modules/resolve/lib/normalize-options.js | 10 - node_modules/resolve/lib/sync.js | 212 - node_modules/resolve/package.json | 75 - node_modules/resolve/readme.markdown | 301 - node_modules/resolve/sync.js | 3 - node_modules/resolve/test/core.js | 88 - node_modules/resolve/test/dotdot.js | 29 - node_modules/resolve/test/dotdot/abc/index.js | 2 - node_modules/resolve/test/dotdot/index.js | 1 - node_modules/resolve/test/faulty_basedir.js | 29 - node_modules/resolve/test/filter.js | 34 - node_modules/resolve/test/filter_sync.js | 33 - node_modules/resolve/test/home_paths.js | 127 - node_modules/resolve/test/home_paths_sync.js | 114 - node_modules/resolve/test/mock.js | 315 - node_modules/resolve/test/mock_sync.js | 214 - node_modules/resolve/test/module_dir.js | 56 - .../test/module_dir/xmodules/aaa/index.js | 1 - .../test/module_dir/ymodules/aaa/index.js | 1 - .../test/module_dir/zmodules/bbb/main.js | 1 - .../test/module_dir/zmodules/bbb/package.json | 3 - .../resolve/test/node-modules-paths.js | 143 - node_modules/resolve/test/node_path.js | 70 - .../resolve/test/node_path/x/aaa/index.js | 1 - .../resolve/test/node_path/x/ccc/index.js | 1 - .../resolve/test/node_path/y/bbb/index.js | 1 - .../resolve/test/node_path/y/ccc/index.js | 1 - node_modules/resolve/test/nonstring.js | 9 - node_modules/resolve/test/pathfilter.js | 75 - node_modules/resolve/test/precedence.js | 23 - node_modules/resolve/test/precedence/aaa.js | 1 - .../resolve/test/precedence/aaa/index.js | 1 - .../resolve/test/precedence/aaa/main.js | 1 - node_modules/resolve/test/precedence/bbb.js | 1 - .../resolve/test/precedence/bbb/main.js | 1 - node_modules/resolve/test/resolver.js | 597 - .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 - .../resolve/test/resolver/baz/quux.js | 1 - .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 - node_modules/resolve/test/resolver/cup.coffee | 1 - .../resolve/test/resolver/dot_main/index.js | 1 - .../test/resolver/dot_main/package.json | 3 - .../test/resolver/dot_slash_main/index.js | 1 - .../test/resolver/dot_slash_main/package.json | 3 - .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 - node_modules/resolve/test/resolver/foo.js | 1 - .../test/resolver/incorrect_main/index.js | 2 - .../test/resolver/incorrect_main/package.json | 3 - .../test/resolver/invalid_main/package.json | 7 - node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 - .../test/resolver/multirepo/package.json | 20 - .../multirepo/packages/package-a/index.js | 35 - .../multirepo/packages/package-a/package.json | 14 - .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 - .../resolver/nested_symlinks/mylib/async.js | 26 - .../nested_symlinks/mylib/package.json | 15 - .../resolver/nested_symlinks/mylib/sync.js | 12 - .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 - .../resolve/test/resolver/same_names/foo.js | 1 - .../test/resolver/same_names/foo/index.js | 1 - .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 - .../resolver/symlinked/package/package.json | 3 - .../test/resolver/without_basedir/main.js | 5 - node_modules/resolve/test/resolver_sync.js | 730 -- node_modules/resolve/test/shadowed_core.js | 54 - .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 - node_modules/resolve/test/symlinks.js | 176 - .../{cssom => rrweb-cssom}/LICENSE.txt | 0 node_modules/rrweb-cssom/README.mdown | 74 + node_modules/rrweb-cssom/build/CSSOM.js | 1995 +++ .../lib/CSSConditionRule.js | 0 .../rrweb-cssom/lib/CSSContainerRule.js | 50 + .../lib/CSSDocumentRule.js | 0 .../lib/CSSFontFaceRule.js | 0 .../lib/CSSGroupingRule.js | 3 +- .../{cssom => rrweb-cssom}/lib/CSSHostRule.js | 0 .../lib/CSSImportRule.js | 0 .../lib/CSSKeyframeRule.js | 0 .../lib/CSSKeyframesRule.js | 0 .../rrweb-cssom/lib/CSSLayerBlockRule.js | 48 + .../lib/CSSMediaRule.js | 0 .../{cssom => rrweb-cssom}/lib/CSSOM.js | 0 node_modules/rrweb-cssom/lib/CSSRule.js | 42 + .../rrweb-cssom/lib/CSSStartingStyleRule.js | 37 + .../lib/CSSStyleDeclaration.js | 0 .../lib/CSSStyleRule.js | 0 .../lib/CSSStyleSheet.js | 0 .../lib/CSSSupportsRule.js | 0 .../{cssom => rrweb-cssom}/lib/CSSValue.js | 0 .../lib/CSSValueExpression.js | 0 .../{cssom => rrweb-cssom}/lib/MatcherList.js | 0 .../{cssom => rrweb-cssom}/lib/MediaList.js | 0 .../{cssom => rrweb-cssom}/lib/StyleSheet.js | 0 node_modules/rrweb-cssom/lib/clone.js | 80 + node_modules/rrweb-cssom/lib/index.js | 26 + node_modules/rrweb-cssom/lib/parse.js | 525 + node_modules/rrweb-cssom/package.json | 27 + node_modules/signal-exit/LICENSE.txt | 2 +- node_modules/signal-exit/README.md | 77 +- .../signal-exit/dist/cjs/browser.d.ts | 12 + .../signal-exit/dist/cjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/browser.js | 10 + .../signal-exit/dist/cjs/browser.js.map | 1 + node_modules/signal-exit/dist/cjs/index.d.ts | 48 + .../signal-exit/dist/cjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/index.js | 279 + .../signal-exit/dist/cjs/index.js.map | 1 + .../signal-exit/dist/cjs/package.json | 3 + .../signal-exit/dist/cjs/signals.d.ts | 29 + .../signal-exit/dist/cjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/signals.js | 42 + .../signal-exit/dist/cjs/signals.js.map | 1 + .../signal-exit/dist/mjs/browser.d.ts | 12 + .../signal-exit/dist/mjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/browser.js | 4 + .../signal-exit/dist/mjs/browser.js.map | 1 + node_modules/signal-exit/dist/mjs/index.d.ts | 48 + .../signal-exit/dist/mjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/index.js | 275 + .../signal-exit/dist/mjs/index.js.map | 1 + .../signal-exit/dist/mjs/package.json | 3 + .../signal-exit/dist/mjs/signals.d.ts | 29 + .../signal-exit/dist/mjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/signals.js | 39 + .../signal-exit/dist/mjs/signals.js.map | 1 + node_modules/signal-exit/package.json | 106 +- node_modules/sisteransi/license | 21 - node_modules/sisteransi/package.json | 34 - node_modules/sisteransi/readme.md | 113 - node_modules/sisteransi/src/index.js | 58 - node_modules/sisteransi/src/sisteransi.d.ts | 35 - .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../node_modules/ansi-regex/readme.md | 78 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 46 + node_modules/string-width-cjs/index.d.ts | 29 + node_modules/string-width-cjs/index.js | 47 + node_modules/string-width-cjs/license | 9 + .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../node_modules/ansi-regex/readme.md | 78 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 23 + .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 + .../node_modules/emoji-regex/text.js | 6 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 46 + node_modules/string-width-cjs/package.json | 56 + node_modules/string-width-cjs/readme.md | 50 + node_modules/string-width/index.d.ts | 42 +- node_modules/string-width/index.js | 45 +- node_modules/string-width/license | 2 +- node_modules/string-width/package.json | 21 +- node_modules/string-width/readme.md | 25 +- node_modules/strip-ansi-cjs/index.d.ts | 17 + node_modules/strip-ansi-cjs/index.js | 4 + node_modules/strip-ansi-cjs/license | 9 + .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../node_modules/ansi-regex/readme.md | 78 + node_modules/strip-ansi-cjs/package.json | 54 + node_modules/strip-ansi-cjs/readme.md | 46 + node_modules/strip-ansi/index.d.ts | 6 +- node_modules/strip-ansi/index.js | 16 +- node_modules/strip-ansi/license | 2 +- node_modules/strip-ansi/package.json | 19 +- node_modules/strip-ansi/readme.md | 21 +- .../supports-preserve-symlinks-flag/.eslintrc | 14 - .../.github/FUNDING.yml | 12 - .../supports-preserve-symlinks-flag/.nycrc | 9 - .../CHANGELOG.md | 22 - .../supports-preserve-symlinks-flag/LICENSE | 21 - .../supports-preserve-symlinks-flag/README.md | 42 - .../browser.js | 3 - .../supports-preserve-symlinks-flag/index.js | 9 - .../package.json | 70 - .../test/index.js | 29 - node_modules/synckit/LICENSE | 21 + node_modules/synckit/README.md | 256 + node_modules/synckit/lib/common.d.ts | 5 + node_modules/synckit/lib/common.js | 22 + node_modules/synckit/lib/common.js.map | 1 + node_modules/synckit/lib/constants.d.ts | 38 + node_modules/synckit/lib/constants.js | 54 + node_modules/synckit/lib/constants.js.map | 1 + node_modules/synckit/lib/helpers.d.ts | 27 + node_modules/synckit/lib/helpers.js | 413 + node_modules/synckit/lib/helpers.js.map | 1 + node_modules/synckit/lib/index.cjs | 590 + node_modules/synckit/lib/index.d.cts | 138 + node_modules/synckit/lib/index.d.ts | 7 + node_modules/synckit/lib/index.js | 73 + node_modules/synckit/lib/index.js.map | 1 + node_modules/synckit/lib/types.d.ts | 48 + node_modules/synckit/lib/types.js | 2 + node_modules/synckit/lib/types.js.map | 1 + node_modules/synckit/package.json | 45 + .../node_modules/brace-expansion/LICENSE | 21 + .../node_modules/brace-expansion/README.md | 129 + .../node_modules/brace-expansion/index.js | 201 + .../node_modules/brace-expansion/package.json | 50 + .../test-exclude/node_modules/glob/LICENSE | 21 + .../test-exclude/node_modules/glob/README.md | 378 + .../node_modules}/glob/common.js | 0 .../node_modules}/glob/glob.js | 0 .../node_modules/glob/package.json | 55 + .../node_modules}/glob/sync.js | 0 .../node_modules/minimatch/LICENSE | 15 + .../node_modules/minimatch/README.md | 230 + .../node_modules}/minimatch/minimatch.js | 0 .../node_modules/minimatch/package.json | 33 + node_modules/tldts-core/LICENSE | 13 + node_modules/tldts-core/README.md | 3 + node_modules/tldts-core/dist/cjs/index.js | 561 + node_modules/tldts-core/dist/cjs/index.js.map | 1 + .../dist/cjs/src/domain-without-suffix.js | 15 + .../dist/cjs/src/domain-without-suffix.js.map | 1 + .../tldts-core/dist/cjs/src/domain.js | 83 + .../tldts-core/dist/cjs/src/domain.js.map | 1 + .../dist/cjs/src/extract-hostname.js | 149 + .../dist/cjs/src/extract-hostname.js.map | 1 + .../tldts-core/dist/cjs/src/factory.js | 104 + .../tldts-core/dist/cjs/src/factory.js.map | 1 + node_modules/tldts-core/dist/cjs/src/is-ip.js | 72 + .../tldts-core/dist/cjs/src/is-ip.js.map | 1 + .../tldts-core/dist/cjs/src/is-valid.js | 69 + .../tldts-core/dist/cjs/src/is-valid.js.map | 1 + .../dist/cjs/src/lookup/fast-path.js | 69 + .../dist/cjs/src/lookup/fast-path.js.map | 1 + .../dist/cjs/src/lookup/interface.js | 3 + .../dist/cjs/src/lookup/interface.js.map | 1 + .../tldts-core/dist/cjs/src/options.js | 22 + .../tldts-core/dist/cjs/src/options.js.map | 1 + .../tldts-core/dist/cjs/src/subdomain.js | 14 + .../tldts-core/dist/cjs/src/subdomain.js.map | 1 + .../tldts-core/dist/cjs/tsconfig.tsbuildinfo | 1 + node_modules/tldts-core/dist/es6/index.js | 4 + node_modules/tldts-core/dist/es6/index.js.map | 1 + .../dist/es6/src/domain-without-suffix.js | 12 + .../dist/es6/src/domain-without-suffix.js.map | 1 + .../tldts-core/dist/es6/src/domain.js | 80 + .../tldts-core/dist/es6/src/domain.js.map | 1 + .../dist/es6/src/extract-hostname.js | 146 + .../dist/es6/src/extract-hostname.js.map | 1 + .../tldts-core/dist/es6/src/factory.js | 99 + .../tldts-core/dist/es6/src/factory.js.map | 1 + node_modules/tldts-core/dist/es6/src/is-ip.js | 69 + .../tldts-core/dist/es6/src/is-ip.js.map | 1 + .../tldts-core/dist/es6/src/is-valid.js | 66 + .../tldts-core/dist/es6/src/is-valid.js.map | 1 + .../dist/es6/src/lookup/fast-path.js | 66 + .../dist/es6/src/lookup/fast-path.js.map | 1 + .../dist/es6/src/lookup/interface.js | 2 + .../dist/es6/src/lookup/interface.js.map | 1 + .../tldts-core/dist/es6/src/options.js | 19 + .../tldts-core/dist/es6/src/options.js.map | 1 + .../tldts-core/dist/es6/src/subdomain.js | 11 + .../tldts-core/dist/es6/src/subdomain.js.map | 1 + .../dist/es6/tsconfig.bundle.tsbuildinfo | 1 + node_modules/tldts-core/dist/types/index.d.ts | 4 + .../dist/types/src/domain-without-suffix.d.ts | 6 + .../tldts-core/dist/types/src/domain.d.ts | 5 + .../dist/types/src/extract-hostname.d.ts | 5 + .../tldts-core/dist/types/src/factory.d.ts | 28 + .../tldts-core/dist/types/src/is-ip.d.ts | 6 + .../tldts-core/dist/types/src/is-valid.d.ts | 15 + .../dist/types/src/lookup/fast-path.d.ts | 2 + .../dist/types/src/lookup/interface.d.ts | 9 + .../tldts-core/dist/types/src/options.d.ts | 10 + .../tldts-core/dist/types/src/subdomain.d.ts | 4 + node_modules/tldts-core/index.ts | 10 + node_modules/tldts-core/package.json | 68 + .../tldts-core/src/domain-without-suffix.ts | 14 + node_modules/tldts-core/src/domain.ts | 100 + .../tldts-core/src/extract-hostname.ts | 170 + node_modules/tldts-core/src/factory.ts | 160 + node_modules/tldts-core/src/is-ip.ts | 87 + node_modules/tldts-core/src/is-valid.ts | 79 + .../tldts-core/src/lookup/fast-path.ts | 80 + .../tldts-core/src/lookup/interface.ts | 10 + node_modules/tldts-core/src/options.ts | 39 + node_modules/tldts-core/src/subdomain.ts | 11 + node_modules/tldts/LICENSE | 13 + node_modules/tldts/README.md | 327 + node_modules/tldts/bin/cli.js | 21 + node_modules/tldts/dist/cjs/index.js | 666 + node_modules/tldts/dist/cjs/index.js.map | 1 + node_modules/tldts/dist/cjs/src/data/trie.js | 14 + .../tldts/dist/cjs/src/data/trie.js.map | 1 + .../tldts/dist/cjs/src/suffix-trie.js | 67 + .../tldts/dist/cjs/src/suffix-trie.js.map | 1 + .../tldts/dist/cjs/tsconfig.tsbuildinfo | 1 + node_modules/tldts/dist/es6/index.js | 33 + node_modules/tldts/dist/es6/index.js.map | 1 + node_modules/tldts/dist/es6/src/data/trie.js | 11 + .../tldts/dist/es6/src/data/trie.js.map | 1 + .../tldts/dist/es6/src/suffix-trie.js | 64 + .../tldts/dist/es6/src/suffix-trie.js.map | 1 + .../dist/es6/tsconfig.bundle.tsbuildinfo | 1 + node_modules/tldts/dist/index.cjs.min.js | 2 + node_modules/tldts/dist/index.cjs.min.js.map | 1 + node_modules/tldts/dist/index.esm.min.js | 2 + node_modules/tldts/dist/index.esm.min.js.map | 1 + node_modules/tldts/dist/index.umd.min.js | 2 + node_modules/tldts/dist/index.umd.min.js.map | 1 + node_modules/tldts/dist/types/index.d.ts | 7 + .../tldts/dist/types/src/data/trie.d.ts | 5 + .../tldts/dist/types/src/suffix-trie.d.ts | 5 + node_modules/tldts/index.ts | 62 + node_modules/tldts/package.json | 91 + node_modules/tldts/src/data/trie.ts | 14 + node_modules/tldts/src/suffix-trie.ts | 110 + node_modules/tough-cookie/README.md | 670 +- .../dist/cookie/canonicalDomain.d.ts | 33 + .../dist/cookie/canonicalDomain.js | 65 + .../tough-cookie/dist/cookie/constants.d.ts | 54 + .../tough-cookie/dist/cookie/constants.js | 38 + .../tough-cookie/dist/cookie/cookie.d.ts | 326 + .../tough-cookie/dist/cookie/cookie.js | 831 ++ .../dist/cookie/cookieCompare.d.ts | 58 + .../tough-cookie/dist/cookie/cookieCompare.js | 84 + .../tough-cookie/dist/cookie/cookieJar.d.ts | 621 + .../tough-cookie/dist/cookie/cookieJar.js | 1000 ++ .../tough-cookie/dist/cookie/defaultPath.d.ts | 40 + .../tough-cookie/dist/cookie/defaultPath.js | 60 + .../tough-cookie/dist/cookie/domainMatch.d.ts | 38 + .../tough-cookie/dist/cookie/domainMatch.js | 94 + .../tough-cookie/dist/cookie/formatDate.d.ts | 15 + .../tough-cookie/dist/cookie/formatDate.js | 20 + .../tough-cookie/dist/cookie/index.d.ts | 29 + .../tough-cookie/dist/cookie/index.js | 54 + .../tough-cookie/dist/cookie/parseDate.d.ts | 103 + .../tough-cookie/dist/cookie/parseDate.js | 323 + .../tough-cookie/dist/cookie/permutePath.d.ts | 14 + .../tough-cookie/dist/cookie/permutePath.js | 32 + .../tough-cookie/dist/getPublicSuffix.d.ts | 55 + .../tough-cookie/dist/getPublicSuffix.js | 71 + node_modules/tough-cookie/dist/memstore.d.ts | 220 + node_modules/tough-cookie/dist/memstore.js | 187 + node_modules/tough-cookie/dist/pathMatch.d.ts | 17 + node_modules/tough-cookie/dist/pathMatch.js | 40 + .../tough-cookie/dist/permuteDomain.d.ts | 15 + .../tough-cookie/dist/permuteDomain.js | 44 + node_modules/tough-cookie/dist/store.d.ts | 211 + node_modules/tough-cookie/dist/store.js | 76 + node_modules/tough-cookie/dist/utils.d.ts | 34 + node_modules/tough-cookie/dist/utils.js | 99 + .../tough-cookie/dist/validators.d.ts | 24 + node_modules/tough-cookie/dist/validators.js | 90 + node_modules/tough-cookie/dist/version.d.ts | 5 + node_modules/tough-cookie/dist/version.js | 8 + node_modules/tough-cookie/lib/cookie.js | 1758 --- node_modules/tough-cookie/lib/memstore.js | 242 - node_modules/tough-cookie/lib/pathMatch.js | 61 - .../tough-cookie/lib/permuteDomain.js | 65 - .../tough-cookie/lib/pubsuffix-psl.js | 73 - node_modules/tough-cookie/lib/store.js | 76 - node_modules/tough-cookie/lib/utilHelper.js | 39 - node_modules/tough-cookie/lib/validators.js | 110 - node_modules/tough-cookie/lib/version.js | 2 - node_modules/tough-cookie/package.json | 78 +- node_modules/tr46/README.md | 48 +- node_modules/tr46/index.js | 150 +- node_modules/tr46/lib/mappingTable.json | 2 +- node_modules/tr46/lib/regexes.js | 28 +- node_modules/tr46/lib/statusMapping.js | 2 - node_modules/tr46/package.json | 25 +- node_modules/universalify/LICENSE | 20 - node_modules/universalify/README.md | 76 - node_modules/universalify/index.js | 29 - node_modules/universalify/package.json | 34 - node_modules/unrs-resolver/README.md | 356 + node_modules/unrs-resolver/browser.js | 1 + node_modules/unrs-resolver/index.d.ts | 279 + node_modules/unrs-resolver/index.js | 394 + node_modules/unrs-resolver/package.json | 79 + node_modules/update-browserslist-db/README.md | 4 + node_modules/update-browserslist-db/cli.js | 0 node_modules/update-browserslist-db/index.js | 24 +- .../update-browserslist-db/package.json | 2 +- node_modules/url-parse/LICENSE | 22 - node_modules/url-parse/README.md | 153 - node_modules/url-parse/dist/url-parse.js | 755 -- node_modules/url-parse/dist/url-parse.min.js | 1 - .../url-parse/dist/url-parse.min.js.map | 1 - node_modules/url-parse/index.js | 589 - node_modules/url-parse/package.json | 49 - node_modules/w3c-xmlserializer/package.json | 13 +- .../whatwg-encoding/lib/labels-to-names.json | 3 +- .../whatwg-encoding/lib/supported-names.json | 3 +- .../whatwg-encoding/lib/whatwg-encoding.js | 15 +- node_modules/whatwg-encoding/package.json | 13 +- node_modules/whatwg-mimetype/package.json | 32 +- node_modules/whatwg-url/README.md | 4 +- node_modules/whatwg-url/lib/URL-impl.js | 32 +- node_modules/whatwg-url/lib/URL.js | 57 + .../whatwg-url/lib/URLSearchParams-impl.js | 21 +- .../whatwg-url/lib/URLSearchParams.js | 33 + .../whatwg-url/lib/percent-encoding.js | 4 +- .../whatwg-url/lib/url-state-machine.js | 114 +- node_modules/whatwg-url/lib/urlencoded.js | 23 +- node_modules/whatwg-url/package.json | 55 +- node_modules/wrap-ansi-cjs/index.js | 216 + node_modules/wrap-ansi-cjs/license | 9 + .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../node_modules/ansi-regex/readme.md | 78 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 23 + .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 + .../node_modules/emoji-regex/text.js | 6 + .../node_modules/string-width/index.d.ts | 29 + .../node_modules/string-width/index.js | 47 + .../node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + .../node_modules/string-width/readme.md | 50 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 46 + node_modules/wrap-ansi-cjs/package.json | 62 + node_modules/wrap-ansi-cjs/readme.md | 91 + node_modules/wrap-ansi/index.d.ts | 41 + node_modules/wrap-ansi/index.js | 22 +- .../node_modules/ansi-styles/index.d.ts | 236 + .../node_modules/ansi-styles/index.js | 223 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 54 + .../node_modules/ansi-styles/readme.md | 173 + node_modules/wrap-ansi/package.json | 33 +- node_modules/wrap-ansi/readme.md | 6 +- node_modules/write-file-atomic/lib/index.js | 2 +- node_modules/write-file-atomic/package.json | 24 +- node_modules/xml-name-validator/package.json | 12 +- .../yargs/node_modules/ansi-regex/index.d.ts | 37 + .../yargs/node_modules/ansi-regex/index.js | 10 + .../yargs/node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + .../yargs/node_modules/ansi-regex/readme.md | 78 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../yargs/node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../yargs/node_modules/emoji-regex/index.d.ts | 23 + .../yargs/node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 + .../yargs/node_modules/emoji-regex/text.js | 6 + .../node_modules/string-width/index.d.ts | 29 + .../yargs/node_modules/string-width/index.js | 47 + .../yargs/node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + .../yargs/node_modules/string-width/readme.md | 50 + .../yargs/node_modules/strip-ansi/index.d.ts | 17 + .../yargs/node_modules/strip-ansi/index.js | 4 + .../yargs/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../yargs/node_modules/strip-ansi/readme.md | 46 + package-lock.json | 3137 +++-- package.json | 8 +- tests/unit/systems/AchievementSystem.test.js | 451 + tests/unit/utils/SaveSystem.test.js | 270 + 6097 files changed, 237285 insertions(+), 180002 deletions(-) create mode 100644 framework/systems/AchievementSystem.js create mode 100644 framework/utils/SaveSystem.js delete mode 100644 node_modules/.bin/acorn mode change 100644 => 120000 node_modules/.bin/baseline-browser-mapping mode change 100644 => 120000 node_modules/.bin/browserslist delete mode 100644 node_modules/.bin/create-jest delete mode 100644 node_modules/.bin/escodegen delete mode 100644 node_modules/.bin/esgenerate create mode 120000 node_modules/.bin/glob mode change 100644 => 120000 node_modules/.bin/jest create mode 120000 node_modules/.bin/napi-postinstall delete mode 100644 node_modules/.bin/resolve create mode 120000 node_modules/.bin/tldts mode change 100644 => 120000 node_modules/.bin/update-browserslist-db create mode 100644 node_modules/@asamuzakjp/css-color/LICENSE create mode 100644 node_modules/@asamuzakjp/css-color/README.md create mode 100644 node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs create mode 100644 node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/cjs/index.d.cts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/index.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/index.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/index.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/cache.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/color.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/color.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/color.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/common.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/common.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/common.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/constant.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/convert.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js.map create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/typedef.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/util.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/util.js create mode 100644 node_modules/@asamuzakjp/css-color/dist/esm/js/util.js.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/LICENSE create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/README.md create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.d.ts.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.js create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.js.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.min.js create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/index.min.js.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/commonjs/package.json create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.d.ts create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.d.ts.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.js create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.js.map create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.min.js create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/dist/esm/index.min.js.map rename node_modules/{fast-check/lib => @asamuzakjp/css-color/node_modules/lru-cache/dist}/esm/package.json (100%) create mode 100644 node_modules/@asamuzakjp/css-color/node_modules/lru-cache/package.json create mode 100644 node_modules/@asamuzakjp/css-color/package.json create mode 100644 node_modules/@asamuzakjp/css-color/src/index.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/cache.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/color.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/common.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/constant.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/convert.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/css-calc.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/css-gradient.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/css-var.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/relative-color.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/resolve.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/typedef.ts create mode 100644 node_modules/@asamuzakjp/css-color/src/js/util.ts create mode 100644 node_modules/@csstools/color-helpers/CHANGELOG.md create mode 100644 node_modules/@csstools/color-helpers/LICENSE.md create mode 100644 node_modules/@csstools/color-helpers/README.md create mode 100644 node_modules/@csstools/color-helpers/dist/index.cjs create mode 100644 node_modules/@csstools/color-helpers/dist/index.d.ts create mode 100644 node_modules/@csstools/color-helpers/dist/index.mjs create mode 100644 node_modules/@csstools/color-helpers/package.json create mode 100644 node_modules/@csstools/css-calc/CHANGELOG.md create mode 100644 node_modules/@csstools/css-calc/LICENSE.md create mode 100644 node_modules/@csstools/css-calc/README.md create mode 100644 node_modules/@csstools/css-calc/dist/index.cjs create mode 100644 node_modules/@csstools/css-calc/dist/index.d.ts create mode 100644 node_modules/@csstools/css-calc/dist/index.mjs create mode 100644 node_modules/@csstools/css-calc/package.json create mode 100644 node_modules/@csstools/css-color-parser/CHANGELOG.md create mode 100644 node_modules/@csstools/css-color-parser/LICENSE.md create mode 100644 node_modules/@csstools/css-color-parser/README.md create mode 100644 node_modules/@csstools/css-color-parser/dist/index.cjs create mode 100644 node_modules/@csstools/css-color-parser/dist/index.d.ts create mode 100644 node_modules/@csstools/css-color-parser/dist/index.mjs create mode 100644 node_modules/@csstools/css-color-parser/package.json create mode 100644 node_modules/@csstools/css-parser-algorithms/CHANGELOG.md create mode 100644 node_modules/@csstools/css-parser-algorithms/LICENSE.md create mode 100644 node_modules/@csstools/css-parser-algorithms/README.md create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.cjs create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.mjs create mode 100644 node_modules/@csstools/css-parser-algorithms/package.json create mode 100644 node_modules/@csstools/css-tokenizer/CHANGELOG.md create mode 100644 node_modules/@csstools/css-tokenizer/LICENSE.md create mode 100644 node_modules/@csstools/css-tokenizer/README.md create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.cjs create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.mjs create mode 100644 node_modules/@csstools/css-tokenizer/package.json create mode 100644 node_modules/@isaacs/cliui/LICENSE.txt create mode 100644 node_modules/@isaacs/cliui/README.md create mode 100644 node_modules/@isaacs/cliui/build/index.cjs create mode 100644 node_modules/@isaacs/cliui/build/index.d.cts create mode 100644 node_modules/@isaacs/cliui/build/lib/index.js create mode 100644 node_modules/@isaacs/cliui/index.mjs create mode 100644 node_modules/@isaacs/cliui/package.json delete mode 100644 node_modules/@jest/console/build/BufferedConsole.js delete mode 100644 node_modules/@jest/console/build/CustomConsole.js delete mode 100644 node_modules/@jest/console/build/NullConsole.js delete mode 100644 node_modules/@jest/console/build/getConsoleOutput.js create mode 100644 node_modules/@jest/console/build/index.d.mts create mode 100644 node_modules/@jest/console/build/index.mjs delete mode 100644 node_modules/@jest/console/build/types.js delete mode 100644 node_modules/@jest/core/build/FailedTestsCache.js delete mode 100644 node_modules/@jest/core/build/FailedTestsInteractiveMode.js delete mode 100644 node_modules/@jest/core/build/ReporterDispatcher.js delete mode 100644 node_modules/@jest/core/build/SearchSource.js delete mode 100644 node_modules/@jest/core/build/SnapshotInteractiveMode.js delete mode 100644 node_modules/@jest/core/build/TestNamePatternPrompt.js delete mode 100644 node_modules/@jest/core/build/TestPathPatternPrompt.js delete mode 100644 node_modules/@jest/core/build/TestScheduler.js delete mode 100644 node_modules/@jest/core/build/cli/index.js delete mode 100644 node_modules/@jest/core/build/collectHandles.js delete mode 100644 node_modules/@jest/core/build/getChangedFilesPromise.js delete mode 100644 node_modules/@jest/core/build/getConfigsOfProjectsToRun.js delete mode 100644 node_modules/@jest/core/build/getNoTestFound.js delete mode 100644 node_modules/@jest/core/build/getNoTestFoundFailed.js delete mode 100644 node_modules/@jest/core/build/getNoTestFoundPassWithNoTests.js delete mode 100644 node_modules/@jest/core/build/getNoTestFoundRelatedToChangedFiles.js delete mode 100644 node_modules/@jest/core/build/getNoTestFoundVerbose.js delete mode 100644 node_modules/@jest/core/build/getNoTestsFoundMessage.js delete mode 100644 node_modules/@jest/core/build/getProjectDisplayName.js delete mode 100644 node_modules/@jest/core/build/getProjectNamesMissingWarning.js delete mode 100644 node_modules/@jest/core/build/getSelectProjectsMessage.js create mode 100644 node_modules/@jest/core/build/index.d.mts create mode 100644 node_modules/@jest/core/build/index.mjs delete mode 100644 node_modules/@jest/core/build/lib/activeFiltersMessage.js delete mode 100644 node_modules/@jest/core/build/lib/createContext.js delete mode 100644 node_modules/@jest/core/build/lib/handleDeprecationWarnings.js delete mode 100644 node_modules/@jest/core/build/lib/isValidPath.js delete mode 100644 node_modules/@jest/core/build/lib/logDebugMessages.js delete mode 100644 node_modules/@jest/core/build/lib/updateGlobalConfig.js delete mode 100644 node_modules/@jest/core/build/lib/watchPluginsHelpers.js delete mode 100644 node_modules/@jest/core/build/plugins/FailedTestsInteractive.js delete mode 100644 node_modules/@jest/core/build/plugins/Quit.js delete mode 100644 node_modules/@jest/core/build/plugins/TestNamePattern.js delete mode 100644 node_modules/@jest/core/build/plugins/TestPathPattern.js delete mode 100644 node_modules/@jest/core/build/plugins/UpdateSnapshots.js delete mode 100644 node_modules/@jest/core/build/plugins/UpdateSnapshotsInteractive.js delete mode 100644 node_modules/@jest/core/build/runGlobalHook.js delete mode 100644 node_modules/@jest/core/build/runJest.js delete mode 100644 node_modules/@jest/core/build/testSchedulerHelper.js delete mode 100644 node_modules/@jest/core/build/types.js delete mode 100644 node_modules/@jest/core/build/version.js delete mode 100644 node_modules/@jest/core/build/watch.js create mode 100644 node_modules/@jest/diff-sequences/LICENSE create mode 100644 node_modules/@jest/diff-sequences/README.md create mode 100644 node_modules/@jest/diff-sequences/build/index.d.ts create mode 100644 node_modules/@jest/diff-sequences/build/index.js create mode 100644 node_modules/@jest/diff-sequences/build/index.mjs create mode 100644 node_modules/@jest/diff-sequences/package.json create mode 100644 node_modules/@jest/environment-jsdom-abstract/LICENSE create mode 100644 node_modules/@jest/environment-jsdom-abstract/build/index.d.mts create mode 100644 node_modules/@jest/environment-jsdom-abstract/build/index.d.ts create mode 100644 node_modules/@jest/environment-jsdom-abstract/build/index.js create mode 100644 node_modules/@jest/environment-jsdom-abstract/build/index.mjs create mode 100644 node_modules/@jest/environment-jsdom-abstract/package.json create mode 100644 node_modules/@jest/environment/build/index.d.mts rename node_modules/{exit/.npmignore => @jest/environment/build/index.mjs} (100%) delete mode 100644 node_modules/@jest/expect-utils/build/immutableUtils.js create mode 100644 node_modules/@jest/expect-utils/build/index.d.mts create mode 100644 node_modules/@jest/expect-utils/build/index.mjs delete mode 100644 node_modules/@jest/expect-utils/build/jasmineUtils.js delete mode 100644 node_modules/@jest/expect-utils/build/types.js delete mode 100644 node_modules/@jest/expect-utils/build/utils.js create mode 100644 node_modules/@jest/expect/build/index.d.mts create mode 100644 node_modules/@jest/expect/build/index.mjs delete mode 100644 node_modules/@jest/expect/build/types.js create mode 100644 node_modules/@jest/fake-timers/build/index.d.mts create mode 100644 node_modules/@jest/fake-timers/build/index.mjs delete mode 100644 node_modules/@jest/fake-timers/build/legacyFakeTimers.js delete mode 100644 node_modules/@jest/fake-timers/build/modernFakeTimers.js create mode 100644 node_modules/@jest/get-type/LICENSE create mode 100644 node_modules/@jest/get-type/build/index.d.mts create mode 100644 node_modules/@jest/get-type/build/index.d.ts create mode 100644 node_modules/@jest/get-type/build/index.js create mode 100644 node_modules/@jest/get-type/build/index.mjs create mode 100644 node_modules/@jest/get-type/package.json create mode 100644 node_modules/@jest/pattern/LICENSE create mode 100644 node_modules/@jest/pattern/README.md create mode 100644 node_modules/@jest/pattern/api-extractor.json create mode 100644 node_modules/@jest/pattern/build/index.d.ts create mode 100644 node_modules/@jest/pattern/build/index.js create mode 100644 node_modules/@jest/pattern/build/index.mjs create mode 100644 node_modules/@jest/pattern/package.json create mode 100644 node_modules/@jest/pattern/src/TestPathPatterns.ts create mode 100644 node_modules/@jest/pattern/src/__tests__/TestPathPatterns.test.ts create mode 100644 node_modules/@jest/pattern/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap create mode 100644 node_modules/@jest/pattern/src/index.ts create mode 100644 node_modules/@jest/pattern/tsconfig.json delete mode 100644 node_modules/@jest/reporters/build/BaseReporter.js delete mode 100644 node_modules/@jest/reporters/build/CoverageReporter.js create mode 100644 node_modules/@jest/reporters/build/CoverageWorker.d.mts create mode 100644 node_modules/@jest/reporters/build/CoverageWorker.mjs delete mode 100644 node_modules/@jest/reporters/build/DefaultReporter.js delete mode 100644 node_modules/@jest/reporters/build/GitHubActionsReporter.js delete mode 100644 node_modules/@jest/reporters/build/NotifyReporter.js delete mode 100644 node_modules/@jest/reporters/build/Status.js delete mode 100644 node_modules/@jest/reporters/build/SummaryReporter.js delete mode 100644 node_modules/@jest/reporters/build/VerboseReporter.js delete mode 100644 node_modules/@jest/reporters/build/formatTestPath.js delete mode 100644 node_modules/@jest/reporters/build/generateEmptyCoverage.js delete mode 100644 node_modules/@jest/reporters/build/getResultHeader.js delete mode 100644 node_modules/@jest/reporters/build/getSnapshotStatus.js delete mode 100644 node_modules/@jest/reporters/build/getSnapshotSummary.js delete mode 100644 node_modules/@jest/reporters/build/getSummary.js delete mode 100644 node_modules/@jest/reporters/build/getWatermarks.js create mode 100644 node_modules/@jest/reporters/build/index.d.mts create mode 100644 node_modules/@jest/reporters/build/index.mjs delete mode 100644 node_modules/@jest/reporters/build/printDisplayName.js delete mode 100644 node_modules/@jest/reporters/build/relativePath.js delete mode 100644 node_modules/@jest/reporters/build/trimAndFormatPath.js delete mode 100644 node_modules/@jest/reporters/build/types.js delete mode 100644 node_modules/@jest/reporters/build/wrapAnsiString.js create mode 100644 node_modules/@jest/schemas/build/index.d.mts create mode 100644 node_modules/@jest/schemas/build/index.mjs create mode 100644 node_modules/@jest/snapshot-utils/LICENSE create mode 100644 node_modules/@jest/snapshot-utils/api-extractor.json create mode 100644 node_modules/@jest/snapshot-utils/build/index.d.mts create mode 100644 node_modules/@jest/snapshot-utils/build/index.d.ts create mode 100644 node_modules/@jest/snapshot-utils/build/index.js create mode 100644 node_modules/@jest/snapshot-utils/build/index.mjs create mode 100644 node_modules/@jest/snapshot-utils/package.json create mode 100644 node_modules/@jest/snapshot-utils/src/__tests__/utils.test.ts create mode 100644 node_modules/@jest/snapshot-utils/src/index.ts create mode 100644 node_modules/@jest/snapshot-utils/src/types.ts create mode 100644 node_modules/@jest/snapshot-utils/src/utils.ts create mode 100644 node_modules/@jest/snapshot-utils/tsconfig.json delete mode 100644 node_modules/@jest/source-map/build/getCallsite.js create mode 100644 node_modules/@jest/source-map/build/index.mjs delete mode 100644 node_modules/@jest/source-map/build/types.js delete mode 100644 node_modules/@jest/test-result/build/formatTestResults.js delete mode 100644 node_modules/@jest/test-result/build/helpers.js create mode 100644 node_modules/@jest/test-result/build/index.d.mts create mode 100644 node_modules/@jest/test-result/build/index.mjs delete mode 100644 node_modules/@jest/test-result/build/types.js create mode 100644 node_modules/@jest/test-sequencer/build/index.d.mts create mode 100644 node_modules/@jest/test-sequencer/build/index.mjs delete mode 100644 node_modules/@jest/transform/build/ScriptTransformer.js delete mode 100644 node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.js create mode 100644 node_modules/@jest/transform/build/index.d.mts create mode 100644 node_modules/@jest/transform/build/index.mjs delete mode 100644 node_modules/@jest/transform/build/runtimeErrorsAndWarnings.js delete mode 100644 node_modules/@jest/transform/build/shouldInstrument.js delete mode 100644 node_modules/@jest/transform/build/types.js delete mode 100644 node_modules/@jest/types/build/Circus.js delete mode 100644 node_modules/@jest/types/build/Config.js delete mode 100644 node_modules/@jest/types/build/Global.js delete mode 100644 node_modules/@jest/types/build/TestResult.js delete mode 100644 node_modules/@jest/types/build/Transform.js create mode 100644 node_modules/@jest/types/build/index.d.mts rename node_modules/{resolve/test/pathfilter/deep_ref/main.js => @jest/types/build/index.mjs} (100%) create mode 100644 node_modules/@pkgjs/parseargs/.editorconfig create mode 100644 node_modules/@pkgjs/parseargs/CHANGELOG.md create mode 100644 node_modules/@pkgjs/parseargs/LICENSE create mode 100644 node_modules/@pkgjs/parseargs/README.md create mode 100644 node_modules/@pkgjs/parseargs/examples/is-default-value.js create mode 100644 node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js create mode 100644 node_modules/@pkgjs/parseargs/examples/negate.js create mode 100644 node_modules/@pkgjs/parseargs/examples/no-repeated-options.js create mode 100644 node_modules/@pkgjs/parseargs/examples/ordered-options.mjs create mode 100644 node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js create mode 100644 node_modules/@pkgjs/parseargs/index.js create mode 100644 node_modules/@pkgjs/parseargs/internal/errors.js create mode 100644 node_modules/@pkgjs/parseargs/internal/primordials.js create mode 100644 node_modules/@pkgjs/parseargs/internal/util.js create mode 100644 node_modules/@pkgjs/parseargs/internal/validators.js create mode 100644 node_modules/@pkgjs/parseargs/package.json create mode 100644 node_modules/@pkgjs/parseargs/utils.js create mode 100644 node_modules/@pkgr/core/index.d.cts create mode 100644 node_modules/@pkgr/core/lib/constants.d.ts create mode 100644 node_modules/@pkgr/core/lib/constants.js create mode 100644 node_modules/@pkgr/core/lib/constants.js.map create mode 100644 node_modules/@pkgr/core/lib/helpers.d.ts create mode 100644 node_modules/@pkgr/core/lib/helpers.js create mode 100644 node_modules/@pkgr/core/lib/helpers.js.map create mode 100644 node_modules/@pkgr/core/lib/index.cjs create mode 100644 node_modules/@pkgr/core/lib/index.d.ts create mode 100644 node_modules/@pkgr/core/lib/index.js create mode 100644 node_modules/@pkgr/core/lib/index.js.map create mode 100644 node_modules/@pkgr/core/package.json create mode 100644 node_modules/@sinclair/typebox/build/cjs/compiler/compiler.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/compiler/compiler.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/compiler/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/compiler/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/errors.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/errors.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/function.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/function.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/errors/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/parse.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/parse.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/token.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/token.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/types.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/parser/static/types.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/mapping.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/mapping.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/parser.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/parser.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/syntax.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/syntax/syntax.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/policy.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/policy.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/system.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/system/system.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/any/any.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/any/any.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/any/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/any/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/argument/argument.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/argument/argument.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/argument/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/argument/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/array/array.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/array/array.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/array/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/array/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/awaited/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/awaited/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/bigint/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/bigint/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/boolean/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/boolean/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/value.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/clone/value.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/composite/composite.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/composite/composite.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/composite/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/composite/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/computed/computed.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/computed/computed.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/computed/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/computed/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/const/const.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/const/const.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/const/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/const/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/constructor/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/immutable.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/immutable.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/create/type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/date/date.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/date/date.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/date/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/date/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/discard/discard.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/discard/discard.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/discard/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/discard/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/enum/enum.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/enum/enum.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/enum/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/enum/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/error/error.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/error/error.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/error/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/error/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/exclude/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/extends.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extends/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/extract.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/extract/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/function/function.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/function/function.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/function/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/function/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/kind.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/kind.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/value.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/guard/value.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/helpers/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/helpers/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/integer/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/integer/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/integer/integer.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/integer/integer.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/iterator/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/iterator/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/literal/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/literal/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/literal/literal.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/compute.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/compute.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/infer.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/infer.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/module.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/module/module.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/never/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/never/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/never/never.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/never/never.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/not/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/not/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/not/not.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/not/not.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/null/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/null/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/null/null.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/null/null.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/number/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/number/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/number/number.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/object/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/object/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/object/object.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/omit/omit.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/optional/optional.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/parameters/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/parameters/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/partial.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/partial/partial.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/patterns/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/patterns/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/pick/pick.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/promise/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/promise/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/promise/promise.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/promise/promise.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/record/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/record/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/record/record.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/record/record.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/recursive/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/recursive/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/ref/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/ref/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/ref/ref.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/ref/ref.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/regexp/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/regexp/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/format.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/format.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/registry/type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/required.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/required/required.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/rest/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/rest/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/rest/rest.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/rest/rest.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/return-type/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/return-type/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/schema/schema.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/sets/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/sets/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/sets/set.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/sets/set.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/static/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/static/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/static/static.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/string/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/string/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/string/string.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbol/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbol/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbols/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbols/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/transform/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/transform/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/transform/transform.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/transform/transform.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/tuple/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/tuple/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/javascript.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/javascript.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/json.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/json.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/type/type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/undefined/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/undefined/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-create.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-create.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union-type.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/union/union.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unknown/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unknown/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/void/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/void/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/void/void.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/type/void/void.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/assert/assert.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/assert/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/assert/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/cast/cast.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/cast/cast.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/cast/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/cast/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/check/check.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/check/check.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/check/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/check/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clean/clean.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clean/clean.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clean/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clean/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clone/clone.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clone/clone.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clone/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/clone/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/convert/convert.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/convert/convert.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/convert/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/convert/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/create/create.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/create/create.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/create/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/create/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/decode/decode.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/decode/decode.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/decode/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/decode/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/default/default.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/default/default.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/default/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/default/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/delta/delta.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/delta/delta.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/delta/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/delta/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/deref/deref.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/deref/deref.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/deref/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/deref/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/encode/encode.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/encode/encode.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/encode/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/encode/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/equal/equal.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/equal/equal.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/equal/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/equal/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/guard/guard.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/guard/guard.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/guard/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/guard/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/hash/hash.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/hash/hash.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/hash/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/hash/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/mutate/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/mutate/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/parse/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/parse/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/parse/parse.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/parse/parse.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/pointer/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/pointer/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/decode.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/decode.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/encode.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/encode.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/has.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/has.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/transform/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/value/index.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/value/index.js create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/value/value.d.ts create mode 100644 node_modules/@sinclair/typebox/build/cjs/value/value/value.js create mode 100644 node_modules/@sinclair/typebox/build/esm/compiler/compiler.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/compiler/compiler.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/compiler/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/compiler/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/errors.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/errors.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/function.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/function.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/errors/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/module.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/module.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/token.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/token.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/types.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/runtime/types.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/static/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/static/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/static/parse.d.mts rename node_modules/{fast-check/lib/esm/arbitrary/_internals/interfaces/CustomSet.js => @sinclair/typebox/build/esm/parser/static/parse.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/static/token.d.mts rename node_modules/{fast-check/lib/esm/arbitrary/_internals/interfaces/Scheduler.js => @sinclair/typebox/build/esm/parser/static/token.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/parser/static/types.d.mts rename node_modules/{fast-check/lib/esm/arbitrary/_internals/interfaces/SlicedGenerator.js => @sinclair/typebox/build/esm/parser/static/types.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/mapping.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/mapping.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/parser.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/parser.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/syntax.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/syntax/syntax.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/system/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/system/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/system/policy.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/system/policy.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/system/system.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/system/system.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/any/any.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/any/any.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/any/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/any/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/argument/argument.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/argument/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/argument/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/array/array.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/array/array.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/array/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/array/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/awaited/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/awaited/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/bigint/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/bigint/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/boolean/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/boolean/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/value.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/composite/composite.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/composite/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/composite/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/computed/computed.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/computed/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/computed/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/const/const.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/const/const.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/const/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/const/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/constructor/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/immutable.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/create/type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/date/date.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/date/date.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/date/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/date/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/discard/discard.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/discard/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/discard/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/enum/enum.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/enum/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/enum/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/error/error.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/error/error.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/error/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/error/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/exclude/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extends/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/extract/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/function/function.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/function/function.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/function/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/function/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/kind.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/value.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/helpers/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/helpers/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instance-type/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instance-type/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instantiate/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instantiate/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/integer/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/integer/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/integer/integer.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/iterator/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/iterator/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/literal/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/literal/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/literal/literal.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/compute.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/infer.d.mts rename node_modules/{fast-check/lib/esm/arbitrary/_shared/StringSharedConstraints.js => @sinclair/typebox/build/esm/type/module/infer.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/module.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/module/module.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/never/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/never/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/never/never.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/never/never.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/not/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/not/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/not/not.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/not/not.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/null/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/null/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/null/null.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/null/null.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/number/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/number/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/number/number.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/number/number.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/object/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/object/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/object/object.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/object/object.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/optional.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/parameters/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/parameters/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/partial.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/patterns/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/patterns/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/promise/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/promise/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/promise/promise.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/record/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/record/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/record/record.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/record/record.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/recursive/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/recursive/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/ref/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/ref/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/ref/ref.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/regexp/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/regexp/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/format.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/required.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/required/required.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/rest/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/rest/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/rest/rest.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/return-type/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/return-type/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.d.mts rename node_modules/{fast-check/lib/esm/check/model/command/AsyncCommand.js => @sinclair/typebox/build/esm/type/schema/anyschema.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/type/schema/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/schema/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/schema/schema.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/schema/schema.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/sets/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/sets/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/sets/set.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/static/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/static/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/static/static.d.mts rename node_modules/{fast-check/lib/esm/check/model/command/Command.js => @sinclair/typebox/build/esm/type/static/static.mjs} (100%) create mode 100644 node_modules/@sinclair/typebox/build/esm/type/string/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/string/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/string/string.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/string/string.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbol/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbol/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbols/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbols/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/union.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/transform/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/transform/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/transform/transform.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/tuple/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/tuple/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/javascript.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/javascript.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/json.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/json.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/type/type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/uint8array/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/uint8array/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/undefined/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/undefined/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-create.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-type.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union-type.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/union/union.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unknown/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unknown/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unsafe/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unsafe/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/void/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/void/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/type/void/void.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/type/void/void.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/assert/assert.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/assert/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/assert/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/cast/cast.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/cast/cast.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/cast/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/cast/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/check/check.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/check/check.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/check/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/check/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clean/clean.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clean/clean.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clean/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clean/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clone/clone.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clone/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/clone/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/convert/convert.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/convert/convert.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/convert/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/convert/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/create/create.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/create/create.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/create/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/create/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/decode/decode.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/decode/decode.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/decode/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/decode/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/default/default.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/default/default.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/default/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/default/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/delta/delta.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/delta/delta.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/delta/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/delta/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/deref/deref.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/deref/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/deref/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/encode/encode.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/encode/encode.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/encode/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/encode/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/equal/equal.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/equal/equal.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/equal/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/equal/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/guard/guard.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/guard/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/guard/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/hash/hash.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/hash/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/hash/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/mutate/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/mutate/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/parse/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/parse/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/parse/parse.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/parse/parse.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/pointer/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/pointer/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/decode.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/encode.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/has.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/transform/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/value/index.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/value/index.mjs create mode 100644 node_modules/@sinclair/typebox/build/esm/value/value/value.d.mts create mode 100644 node_modules/@sinclair/typebox/build/esm/value/value/value.mjs delete mode 100644 node_modules/@sinclair/typebox/compiler/compiler.d.ts delete mode 100644 node_modules/@sinclair/typebox/compiler/compiler.js delete mode 100644 node_modules/@sinclair/typebox/compiler/index.d.ts delete mode 100644 node_modules/@sinclair/typebox/compiler/index.js create mode 100644 node_modules/@sinclair/typebox/compiler/package.json delete mode 100644 node_modules/@sinclair/typebox/errors/errors.d.ts delete mode 100644 node_modules/@sinclair/typebox/errors/errors.js delete mode 100644 node_modules/@sinclair/typebox/errors/index.d.ts delete mode 100644 node_modules/@sinclair/typebox/errors/index.js create mode 100644 node_modules/@sinclair/typebox/errors/package.json create mode 100644 node_modules/@sinclair/typebox/parser/package.json create mode 100644 node_modules/@sinclair/typebox/syntax/package.json delete mode 100644 node_modules/@sinclair/typebox/system/index.d.ts delete mode 100644 node_modules/@sinclair/typebox/system/index.js create mode 100644 node_modules/@sinclair/typebox/system/package.json delete mode 100644 node_modules/@sinclair/typebox/system/system.d.ts delete mode 100644 node_modules/@sinclair/typebox/system/system.js create mode 100644 node_modules/@sinclair/typebox/type/package.json delete mode 100644 node_modules/@sinclair/typebox/typebox.d.ts delete mode 100644 node_modules/@sinclair/typebox/typebox.js delete mode 100644 node_modules/@sinclair/typebox/value/cast.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/cast.js delete mode 100644 node_modules/@sinclair/typebox/value/check.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/check.js delete mode 100644 node_modules/@sinclair/typebox/value/clone.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/clone.js delete mode 100644 node_modules/@sinclair/typebox/value/convert.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/convert.js delete mode 100644 node_modules/@sinclair/typebox/value/create.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/create.js delete mode 100644 node_modules/@sinclair/typebox/value/delta.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/delta.js delete mode 100644 node_modules/@sinclair/typebox/value/equal.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/equal.js delete mode 100644 node_modules/@sinclair/typebox/value/hash.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/hash.js delete mode 100644 node_modules/@sinclair/typebox/value/index.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/index.js delete mode 100644 node_modules/@sinclair/typebox/value/is.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/is.js delete mode 100644 node_modules/@sinclair/typebox/value/mutate.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/mutate.js create mode 100644 node_modules/@sinclair/typebox/value/package.json delete mode 100644 node_modules/@sinclair/typebox/value/pointer.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/pointer.js delete mode 100644 node_modules/@sinclair/typebox/value/value.d.ts delete mode 100644 node_modules/@sinclair/typebox/value/value.js delete mode 100644 node_modules/@tootallnate/once/LICENSE delete mode 100644 node_modules/@tootallnate/once/README.md delete mode 100644 node_modules/@tootallnate/once/dist/index.d.ts delete mode 100644 node_modules/@tootallnate/once/dist/index.js delete mode 100644 node_modules/@tootallnate/once/dist/index.js.map delete mode 100644 node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts delete mode 100644 node_modules/@tootallnate/once/dist/overloaded-parameters.js delete mode 100644 node_modules/@tootallnate/once/dist/overloaded-parameters.js.map delete mode 100644 node_modules/@tootallnate/once/dist/types.d.ts delete mode 100644 node_modules/@tootallnate/once/package.json delete mode 100644 node_modules/@types/graceful-fs/LICENSE delete mode 100644 node_modules/@types/graceful-fs/README.md delete mode 100644 node_modules/@types/graceful-fs/index.d.ts delete mode 100644 node_modules/@types/graceful-fs/package.json create mode 100644 node_modules/@types/node/inspector/promises.d.ts create mode 100644 node_modules/@types/node/path/posix.d.ts create mode 100644 node_modules/@types/node/path/win32.d.ts create mode 100644 node_modules/@types/node/quic.d.ts create mode 100644 node_modules/@types/node/test/reporters.d.ts create mode 100644 node_modules/@types/node/util/types.d.ts create mode 100644 node_modules/@types/node/web-globals/blob.d.ts create mode 100644 node_modules/@types/node/web-globals/console.d.ts create mode 100644 node_modules/@types/node/web-globals/encoding.d.ts create mode 100644 node_modules/@types/node/web-globals/importmeta.d.ts create mode 100644 node_modules/@types/node/web-globals/messaging.d.ts create mode 100644 node_modules/@types/node/web-globals/performance.d.ts create mode 100644 node_modules/@types/node/web-globals/timers.d.ts create mode 100644 node_modules/@types/node/web-globals/url.d.ts create mode 100644 node_modules/@ungap/structured-clone/.github/workflows/node.js.yml create mode 100644 node_modules/@ungap/structured-clone/LICENSE create mode 100644 node_modules/@ungap/structured-clone/README.md create mode 100644 node_modules/@ungap/structured-clone/cjs/deserialize.js create mode 100644 node_modules/@ungap/structured-clone/cjs/index.js create mode 100644 node_modules/@ungap/structured-clone/cjs/json.js create mode 100644 node_modules/@ungap/structured-clone/cjs/package.json create mode 100644 node_modules/@ungap/structured-clone/cjs/serialize.js create mode 100644 node_modules/@ungap/structured-clone/cjs/types.js create mode 100644 node_modules/@ungap/structured-clone/esm/deserialize.js create mode 100644 node_modules/@ungap/structured-clone/esm/index.js create mode 100644 node_modules/@ungap/structured-clone/esm/json.js create mode 100644 node_modules/@ungap/structured-clone/esm/serialize.js create mode 100644 node_modules/@ungap/structured-clone/esm/types.js create mode 100644 node_modules/@ungap/structured-clone/package.json create mode 100644 node_modules/@ungap/structured-clone/structured-json.js create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-gnu/README.md create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-gnu/package.json create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-gnu/resolver.linux-x64-gnu.node create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-musl/README.md create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-musl/package.json create mode 100644 node_modules/@unrs/resolver-binding-linux-x64-musl/resolver.linux-x64-musl.node delete mode 100644 node_modules/abab/LICENSE.md delete mode 100644 node_modules/abab/README.md delete mode 100644 node_modules/abab/index.d.ts delete mode 100644 node_modules/abab/index.js delete mode 100644 node_modules/abab/lib/atob.js delete mode 100644 node_modules/abab/lib/btoa.js delete mode 100644 node_modules/abab/package.json delete mode 100644 node_modules/acorn-globals/LICENSE delete mode 100644 node_modules/acorn-globals/README.md delete mode 100644 node_modules/acorn-globals/index.js delete mode 100644 node_modules/acorn-globals/package.json delete mode 100644 node_modules/acorn-walk/CHANGELOG.md delete mode 100644 node_modules/acorn-walk/LICENSE delete mode 100644 node_modules/acorn-walk/README.md delete mode 100644 node_modules/acorn-walk/dist/walk.d.mts delete mode 100644 node_modules/acorn-walk/dist/walk.d.ts delete mode 100644 node_modules/acorn-walk/dist/walk.js delete mode 100644 node_modules/acorn-walk/dist/walk.mjs delete mode 100644 node_modules/acorn-walk/package.json delete mode 100644 node_modules/acorn/CHANGELOG.md delete mode 100644 node_modules/acorn/LICENSE delete mode 100644 node_modules/acorn/README.md delete mode 100644 node_modules/acorn/bin/acorn delete mode 100644 node_modules/acorn/dist/acorn.d.mts delete mode 100644 node_modules/acorn/dist/acorn.d.ts delete mode 100644 node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/acorn/dist/acorn.mjs delete mode 100644 node_modules/acorn/dist/bin.js delete mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/agent-base/LICENSE create mode 100644 node_modules/agent-base/dist/helpers.d.ts create mode 100644 node_modules/agent-base/dist/helpers.d.ts.map create mode 100644 node_modules/agent-base/dist/helpers.js create mode 100644 node_modules/agent-base/dist/helpers.js.map create mode 100644 node_modules/agent-base/dist/index.d.ts create mode 100644 node_modules/agent-base/dist/index.d.ts.map create mode 100644 node_modules/agent-base/dist/index.js create mode 100644 node_modules/agent-base/dist/index.js.map delete mode 100644 node_modules/agent-base/dist/src/index.d.ts delete mode 100644 node_modules/agent-base/dist/src/index.js delete mode 100644 node_modules/agent-base/dist/src/index.js.map delete mode 100644 node_modules/agent-base/dist/src/promisify.d.ts delete mode 100644 node_modules/agent-base/dist/src/promisify.js delete mode 100644 node_modules/agent-base/dist/src/promisify.js.map delete mode 100644 node_modules/agent-base/src/index.ts delete mode 100644 node_modules/agent-base/src/promisify.ts delete mode 100644 node_modules/asynckit/LICENSE delete mode 100644 node_modules/asynckit/README.md delete mode 100644 node_modules/asynckit/bench.js delete mode 100644 node_modules/asynckit/index.js delete mode 100644 node_modules/asynckit/lib/abort.js delete mode 100644 node_modules/asynckit/lib/async.js delete mode 100644 node_modules/asynckit/lib/defer.js delete mode 100644 node_modules/asynckit/lib/iterate.js delete mode 100644 node_modules/asynckit/lib/readable_asynckit.js delete mode 100644 node_modules/asynckit/lib/readable_parallel.js delete mode 100644 node_modules/asynckit/lib/readable_serial.js delete mode 100644 node_modules/asynckit/lib/readable_serial_ordered.js delete mode 100644 node_modules/asynckit/lib/state.js delete mode 100644 node_modules/asynckit/lib/streamify.js delete mode 100644 node_modules/asynckit/lib/terminator.js delete mode 100644 node_modules/asynckit/package.json delete mode 100644 node_modules/asynckit/parallel.js delete mode 100644 node_modules/asynckit/serial.js delete mode 100644 node_modules/asynckit/serialOrdered.js delete mode 100644 node_modules/asynckit/stream.js create mode 100644 node_modules/babel-jest/build/index.d.mts create mode 100644 node_modules/babel-jest/build/index.mjs delete mode 100644 node_modules/babel-jest/build/loadBabelConfig.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/CHANGELOG.md delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/LICENSE delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/README.md delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/package.json delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/constants.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/index.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/instrumenter.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/read-coverage.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/source-coverage.js delete mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/visitor.js create mode 100644 node_modules/babel-plugin-jest-hoist/build/index.d.mts create mode 100644 node_modules/babel-plugin-jest-hoist/build/index.mjs mode change 100644 => 100755 node_modules/baseline-browser-mapping/dist/cli.js create mode 100644 node_modules/brace-expansion/.github/FUNDING.yml mode change 100644 => 100755 node_modules/browserslist/cli.js delete mode 100644 node_modules/call-bind-apply-helpers/.eslintrc delete mode 100644 node_modules/call-bind-apply-helpers/.github/FUNDING.yml delete mode 100644 node_modules/call-bind-apply-helpers/.nycrc delete mode 100644 node_modules/call-bind-apply-helpers/CHANGELOG.md delete mode 100644 node_modules/call-bind-apply-helpers/LICENSE delete mode 100644 node_modules/call-bind-apply-helpers/README.md delete mode 100644 node_modules/call-bind-apply-helpers/actualApply.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/actualApply.js delete mode 100644 node_modules/call-bind-apply-helpers/applyBind.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/applyBind.js delete mode 100644 node_modules/call-bind-apply-helpers/functionApply.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/functionApply.js delete mode 100644 node_modules/call-bind-apply-helpers/functionCall.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/functionCall.js delete mode 100644 node_modules/call-bind-apply-helpers/index.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/index.js delete mode 100644 node_modules/call-bind-apply-helpers/package.json delete mode 100644 node_modules/call-bind-apply-helpers/reflectApply.d.ts delete mode 100644 node_modules/call-bind-apply-helpers/reflectApply.js delete mode 100644 node_modules/call-bind-apply-helpers/test/index.js delete mode 100644 node_modules/call-bind-apply-helpers/tsconfig.json mode change 100644 => 100755 node_modules/cjs-module-lexer/LICENSE mode change 100644 => 100755 node_modules/cjs-module-lexer/README.md mode change 100644 => 100755 node_modules/cjs-module-lexer/lexer.d.ts mode change 100644 => 100755 node_modules/cjs-module-lexer/lexer.js mode change 100644 => 100755 node_modules/cjs-module-lexer/package.json create mode 100644 node_modules/cliui/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/cliui/node_modules/ansi-regex/index.js create mode 100644 node_modules/cliui/node_modules/ansi-regex/license create mode 100644 node_modules/cliui/node_modules/ansi-regex/package.json create mode 100644 node_modules/cliui/node_modules/ansi-regex/readme.md create mode 100644 node_modules/cliui/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/cliui/node_modules/emoji-regex/README.md create mode 100644 node_modules/cliui/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/cliui/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/cliui/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/cliui/node_modules/emoji-regex/index.js create mode 100644 node_modules/cliui/node_modules/emoji-regex/package.json create mode 100644 node_modules/cliui/node_modules/emoji-regex/text.js create mode 100644 node_modules/cliui/node_modules/string-width/index.d.ts create mode 100644 node_modules/cliui/node_modules/string-width/index.js create mode 100644 node_modules/cliui/node_modules/string-width/license create mode 100644 node_modules/cliui/node_modules/string-width/package.json create mode 100644 node_modules/cliui/node_modules/string-width/readme.md create mode 100644 node_modules/cliui/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/cliui/node_modules/strip-ansi/index.js create mode 100644 node_modules/cliui/node_modules/strip-ansi/license create mode 100644 node_modules/cliui/node_modules/strip-ansi/package.json create mode 100644 node_modules/cliui/node_modules/strip-ansi/readme.md create mode 100755 node_modules/cliui/node_modules/wrap-ansi/index.js create mode 100644 node_modules/cliui/node_modules/wrap-ansi/license create mode 100644 node_modules/cliui/node_modules/wrap-ansi/package.json create mode 100644 node_modules/cliui/node_modules/wrap-ansi/readme.md delete mode 100644 node_modules/combined-stream/License delete mode 100644 node_modules/combined-stream/Readme.md delete mode 100644 node_modules/combined-stream/lib/combined_stream.js delete mode 100644 node_modules/combined-stream/package.json delete mode 100644 node_modules/combined-stream/yarn.lock delete mode 100644 node_modules/create-jest/LICENSE delete mode 100644 node_modules/create-jest/README.md delete mode 100644 node_modules/create-jest/bin/create-jest.js delete mode 100644 node_modules/create-jest/build/errors.js delete mode 100644 node_modules/create-jest/build/generateConfigFile.js delete mode 100644 node_modules/create-jest/build/index.d.ts delete mode 100644 node_modules/create-jest/build/index.js delete mode 100644 node_modules/create-jest/build/modifyPackageJson.js delete mode 100644 node_modules/create-jest/build/questions.js delete mode 100644 node_modules/create-jest/build/runCreate.js delete mode 100644 node_modules/create-jest/build/types.js delete mode 100644 node_modules/create-jest/package.json delete mode 100644 node_modules/cssom/README.mdown delete mode 100644 node_modules/cssom/lib/CSSRule.js delete mode 100644 node_modules/cssom/lib/clone.js delete mode 100644 node_modules/cssom/lib/index.js delete mode 100644 node_modules/cssom/lib/parse.js delete mode 100644 node_modules/cssom/package.json delete mode 100644 node_modules/cssstyle/lib/CSSStyleDeclaration.test.js delete mode 100644 node_modules/cssstyle/lib/allProperties.js delete mode 100644 node_modules/cssstyle/lib/constants.js create mode 100644 node_modules/cssstyle/lib/generated/allProperties.js create mode 100644 node_modules/cssstyle/lib/generated/implementedProperties.js create mode 100644 node_modules/cssstyle/lib/generated/properties.js delete mode 100644 node_modules/cssstyle/lib/implementedProperties.js delete mode 100644 node_modules/cssstyle/lib/named_colors.json delete mode 100644 node_modules/cssstyle/lib/parsers.test.js delete mode 100644 node_modules/cssstyle/lib/properties.js delete mode 100644 node_modules/cssstyle/lib/properties/azimuth.js delete mode 100644 node_modules/cssstyle/lib/properties/cssFloat.js delete mode 100644 node_modules/cssstyle/lib/properties/textLineThroughColor.js delete mode 100644 node_modules/cssstyle/lib/properties/textOverlineColor.js delete mode 100644 node_modules/cssstyle/lib/properties/textUnderlineColor.js delete mode 100644 node_modules/cssstyle/lib/properties/webkitMatchNearestMailBlockquoteColor.js create mode 100644 node_modules/cssstyle/lib/utils/camelize.js delete mode 100644 node_modules/cssstyle/lib/utils/colorSpace.js delete mode 100644 node_modules/cssstyle/lib/utils/getBasicPropertyDescriptor.js create mode 100644 node_modules/cssstyle/lib/utils/propertyDescriptors.js create mode 100644 node_modules/cssstyle/lib/utils/strings.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/LICENSE.txt delete mode 100644 node_modules/cssstyle/node_modules/cssom/README.mdown delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSHostRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSImportRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSMediaRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSOM.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSStyleRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSValue.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/CSSValueExpression.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/MatcherList.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/MediaList.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/StyleSheet.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/clone.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/index.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/lib/parse.js delete mode 100644 node_modules/cssstyle/node_modules/cssom/package.json delete mode 100644 node_modules/delayed-stream/.npmignore delete mode 100644 node_modules/delayed-stream/License delete mode 100644 node_modules/delayed-stream/Makefile delete mode 100644 node_modules/delayed-stream/Readme.md delete mode 100644 node_modules/delayed-stream/lib/delayed_stream.js delete mode 100644 node_modules/delayed-stream/package.json delete mode 100644 node_modules/diff-sequences/LICENSE delete mode 100644 node_modules/diff-sequences/README.md delete mode 100644 node_modules/diff-sequences/build/index.d.ts delete mode 100644 node_modules/diff-sequences/build/index.js delete mode 100644 node_modules/diff-sequences/package.json delete mode 100644 node_modules/domexception/LICENSE.txt delete mode 100644 node_modules/domexception/README.md delete mode 100644 node_modules/domexception/index.js delete mode 100644 node_modules/domexception/lib/DOMException-impl.js delete mode 100644 node_modules/domexception/lib/Function.js delete mode 100644 node_modules/domexception/lib/VoidFunction.js delete mode 100644 node_modules/domexception/lib/legacy-error-codes.json delete mode 100644 node_modules/domexception/lib/utils.js delete mode 100644 node_modules/domexception/package.json delete mode 100644 node_modules/domexception/webidl2js-wrapper.js delete mode 100644 node_modules/dunder-proto/.eslintrc delete mode 100644 node_modules/dunder-proto/.github/FUNDING.yml delete mode 100644 node_modules/dunder-proto/.nycrc delete mode 100644 node_modules/dunder-proto/CHANGELOG.md delete mode 100644 node_modules/dunder-proto/LICENSE delete mode 100644 node_modules/dunder-proto/README.md delete mode 100644 node_modules/dunder-proto/get.d.ts delete mode 100644 node_modules/dunder-proto/get.js delete mode 100644 node_modules/dunder-proto/package.json delete mode 100644 node_modules/dunder-proto/set.d.ts delete mode 100644 node_modules/dunder-proto/set.js delete mode 100644 node_modules/dunder-proto/test/get.js delete mode 100644 node_modules/dunder-proto/test/index.js delete mode 100644 node_modules/dunder-proto/test/set.js delete mode 100644 node_modules/dunder-proto/tsconfig.json create mode 100644 node_modules/eastasianwidth/README.md create mode 100644 node_modules/eastasianwidth/eastasianwidth.js create mode 100644 node_modules/eastasianwidth/package.json create mode 100644 node_modules/emoji-regex/RGI_Emoji.d.ts create mode 100644 node_modules/emoji-regex/RGI_Emoji.js create mode 100644 node_modules/emoji-regex/es2015/RGI_Emoji.d.ts create mode 100644 node_modules/emoji-regex/es2015/RGI_Emoji.js create mode 100644 node_modules/emoji-regex/es2015/index.d.ts create mode 100644 node_modules/emoji-regex/es2015/text.d.ts create mode 100644 node_modules/emoji-regex/text.d.ts delete mode 100644 node_modules/es-define-property/.eslintrc delete mode 100644 node_modules/es-define-property/.github/FUNDING.yml delete mode 100644 node_modules/es-define-property/.nycrc delete mode 100644 node_modules/es-define-property/CHANGELOG.md delete mode 100644 node_modules/es-define-property/LICENSE delete mode 100644 node_modules/es-define-property/README.md delete mode 100644 node_modules/es-define-property/index.d.ts delete mode 100644 node_modules/es-define-property/index.js delete mode 100644 node_modules/es-define-property/package.json delete mode 100644 node_modules/es-define-property/test/index.js delete mode 100644 node_modules/es-define-property/tsconfig.json delete mode 100644 node_modules/es-errors/.eslintrc delete mode 100644 node_modules/es-errors/.github/FUNDING.yml delete mode 100644 node_modules/es-errors/CHANGELOG.md delete mode 100644 node_modules/es-errors/LICENSE delete mode 100644 node_modules/es-errors/README.md delete mode 100644 node_modules/es-errors/eval.d.ts delete mode 100644 node_modules/es-errors/eval.js delete mode 100644 node_modules/es-errors/index.d.ts delete mode 100644 node_modules/es-errors/index.js delete mode 100644 node_modules/es-errors/package.json delete mode 100644 node_modules/es-errors/range.d.ts delete mode 100644 node_modules/es-errors/range.js delete mode 100644 node_modules/es-errors/ref.d.ts delete mode 100644 node_modules/es-errors/ref.js delete mode 100644 node_modules/es-errors/syntax.d.ts delete mode 100644 node_modules/es-errors/syntax.js delete mode 100644 node_modules/es-errors/test/index.js delete mode 100644 node_modules/es-errors/tsconfig.json delete mode 100644 node_modules/es-errors/type.d.ts delete mode 100644 node_modules/es-errors/type.js delete mode 100644 node_modules/es-errors/uri.d.ts delete mode 100644 node_modules/es-errors/uri.js delete mode 100644 node_modules/es-object-atoms/.eslintrc delete mode 100644 node_modules/es-object-atoms/.github/FUNDING.yml delete mode 100644 node_modules/es-object-atoms/CHANGELOG.md delete mode 100644 node_modules/es-object-atoms/LICENSE delete mode 100644 node_modules/es-object-atoms/README.md delete mode 100644 node_modules/es-object-atoms/RequireObjectCoercible.d.ts delete mode 100644 node_modules/es-object-atoms/RequireObjectCoercible.js delete mode 100644 node_modules/es-object-atoms/ToObject.d.ts delete mode 100644 node_modules/es-object-atoms/ToObject.js delete mode 100644 node_modules/es-object-atoms/index.d.ts delete mode 100644 node_modules/es-object-atoms/index.js delete mode 100644 node_modules/es-object-atoms/isObject.d.ts delete mode 100644 node_modules/es-object-atoms/isObject.js delete mode 100644 node_modules/es-object-atoms/package.json delete mode 100644 node_modules/es-object-atoms/test/index.js delete mode 100644 node_modules/es-object-atoms/tsconfig.json delete mode 100644 node_modules/es-set-tostringtag/.eslintrc delete mode 100644 node_modules/es-set-tostringtag/.nycrc delete mode 100644 node_modules/es-set-tostringtag/CHANGELOG.md delete mode 100644 node_modules/es-set-tostringtag/LICENSE delete mode 100644 node_modules/es-set-tostringtag/README.md delete mode 100644 node_modules/es-set-tostringtag/index.d.ts delete mode 100644 node_modules/es-set-tostringtag/index.js delete mode 100644 node_modules/es-set-tostringtag/package.json delete mode 100644 node_modules/es-set-tostringtag/test/index.js delete mode 100644 node_modules/es-set-tostringtag/tsconfig.json delete mode 100644 node_modules/escodegen/LICENSE.BSD delete mode 100644 node_modules/escodegen/README.md delete mode 100644 node_modules/escodegen/bin/escodegen.js delete mode 100644 node_modules/escodegen/bin/esgenerate.js delete mode 100644 node_modules/escodegen/escodegen.js delete mode 100644 node_modules/escodegen/package.json delete mode 100644 node_modules/estraverse/.jshintrc delete mode 100644 node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/estraverse/README.md delete mode 100644 node_modules/estraverse/estraverse.js delete mode 100644 node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/estraverse/package.json delete mode 100644 node_modules/esutils/LICENSE.BSD delete mode 100644 node_modules/esutils/README.md delete mode 100644 node_modules/esutils/lib/ast.js delete mode 100644 node_modules/esutils/lib/code.js delete mode 100644 node_modules/esutils/lib/keyword.js delete mode 100644 node_modules/esutils/lib/utils.js delete mode 100644 node_modules/esutils/package.json create mode 100644 node_modules/execa/node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/execa/node_modules/signal-exit/README.md rename node_modules/{ => execa/node_modules}/signal-exit/index.js (100%) create mode 100644 node_modules/execa/node_modules/signal-exit/package.json rename node_modules/{ => execa/node_modules}/signal-exit/signals.js (100%) create mode 100644 node_modules/exit-x/.github/workflows/test.yml rename node_modules/{exit => exit-x}/.jshintrc (100%) rename node_modules/{exit => exit-x}/Gruntfile.js (100%) rename node_modules/{exit => exit-x}/LICENSE-MIT (100%) create mode 100644 node_modules/exit-x/README.md create mode 100644 node_modules/exit-x/lib/exit.d.ts rename node_modules/{exit => exit-x}/lib/exit.js (100%) create mode 100644 node_modules/exit-x/package.json rename node_modules/{exit => exit-x}/test/exit_test.js (100%) rename node_modules/{exit => exit-x}/test/fixtures/10-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/10-stdout-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/10-stdout.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/100-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/100-stdout-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/100-stdout.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/1000-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/1000-stdout-stderr.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/1000-stdout.txt (100%) rename node_modules/{exit => exit-x}/test/fixtures/create-files.sh (100%) mode change 100644 => 100755 rename node_modules/{exit => exit-x}/test/fixtures/log-broken.js (100%) rename node_modules/{exit => exit-x}/test/fixtures/log.js (100%) delete mode 100644 node_modules/exit/.travis.yml delete mode 100644 node_modules/exit/README.md delete mode 100644 node_modules/exit/package.json delete mode 100644 node_modules/expect/build/asymmetricMatchers.js delete mode 100644 node_modules/expect/build/extractExpectedAssertionsErrors.js create mode 100644 node_modules/expect/build/index.d.mts create mode 100644 node_modules/expect/build/index.mjs delete mode 100644 node_modules/expect/build/jestMatchersObject.js delete mode 100644 node_modules/expect/build/matchers.js delete mode 100644 node_modules/expect/build/print.js delete mode 100644 node_modules/expect/build/spyMatchers.js delete mode 100644 node_modules/expect/build/toThrowMatchers.js delete mode 100644 node_modules/expect/build/types.js delete mode 100644 node_modules/fast-check/CHANGELOG.md delete mode 100644 node_modules/fast-check/lib/arbitrary/_internals/ArrayInt64Arbitrary.js create mode 100644 node_modules/fast-check/lib/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.js create mode 100644 node_modules/fast-check/lib/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.js create mode 100644 node_modules/fast-check/lib/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.js delete mode 100644 node_modules/fast-check/lib/arbitrary/_internals/builders/CharacterArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/arbitrary/_internals/helpers/ArrayInt64.js create mode 100644 node_modules/fast-check/lib/arbitrary/_internals/helpers/BuildInversedRelationsMapping.js rename node_modules/fast-check/lib/{esm/check/model/command/ICommand.js => arbitrary/_internals/interfaces/EntityGraphTypes.js} (100%) delete mode 100644 node_modules/fast-check/lib/arbitrary/_internals/mappers/IndexToCharString.js create mode 100644 node_modules/fast-check/lib/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.js delete mode 100644 node_modules/fast-check/lib/arbitrary/ascii.js delete mode 100644 node_modules/fast-check/lib/arbitrary/asciiString.js delete mode 100644 node_modules/fast-check/lib/arbitrary/base64.js delete mode 100644 node_modules/fast-check/lib/arbitrary/bigIntN.js delete mode 100644 node_modules/fast-check/lib/arbitrary/bigUint.js delete mode 100644 node_modules/fast-check/lib/arbitrary/bigUintN.js delete mode 100644 node_modules/fast-check/lib/arbitrary/char.js delete mode 100644 node_modules/fast-check/lib/arbitrary/char16bits.js create mode 100644 node_modules/fast-check/lib/arbitrary/entityGraph.js delete mode 100644 node_modules/fast-check/lib/arbitrary/fullUnicode.js delete mode 100644 node_modules/fast-check/lib/arbitrary/fullUnicodeString.js delete mode 100644 node_modules/fast-check/lib/arbitrary/hexa.js delete mode 100644 node_modules/fast-check/lib/arbitrary/hexaString.js create mode 100644 node_modules/fast-check/lib/arbitrary/map.js create mode 100644 node_modules/fast-check/lib/arbitrary/set.js delete mode 100644 node_modules/fast-check/lib/arbitrary/string16bits.js delete mode 100644 node_modules/fast-check/lib/arbitrary/stringOf.js delete mode 100644 node_modules/fast-check/lib/arbitrary/unicode.js delete mode 100644 node_modules/fast-check/lib/arbitrary/unicodeJson.js delete mode 100644 node_modules/fast-check/lib/arbitrary/unicodeJsonValue.js delete mode 100644 node_modules/fast-check/lib/arbitrary/unicodeString.js delete mode 100644 node_modules/fast-check/lib/arbitrary/uuidV.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/AdapterArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/AlwaysShrinkableArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/ArrayArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/BigIntArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/CloneArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/CommandsArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/ConstantArbitrary.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/FrequencyArbitrary.js (81%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/GeneratorArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/IntegerArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/LazyArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/LimitedShrinkArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/MixedCaseArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/SchedulerArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/StreamArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/StringUnitArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/SubarrayArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/TupleArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/WithShrinkFromOtherArbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/AnyArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/BoxedArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/CharacterRangeArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/CompareFunctionArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/GeneratorValueBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/PaddedNumberArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/PartialRecordArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/StableArbitraryGeneratorCache.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/StringifiedNatArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/UriPathArbitraryBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/builders/UriQueryOrFragmentArbitraryBuilder.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/data/GraphemeRanges.js (98%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/BiasNumericRange.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/BuildInversedRelationsMapping.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/BuildSchedulerFor.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/BuildSlicedGenerator.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/CustomEqualSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/DepthContext.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/DoubleHelpers.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/DoubleOnlyHelpers.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/EnumerableKeysExtractor.js (77%) rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/FloatHelpers.js (75%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/FloatOnlyHelpers.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/FloatingOnlyHelpers.js (85%) rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/GraphemeRangesHelpers.js (75%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/IsSubarrayOf.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/JsonConstraintsBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/MaxLengthFromMinLength.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/NoUndefinedAsContext.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/QualifiedObjectConstraints.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/ReadRegex.js (96%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/SameValueSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/SameValueZeroSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/SanitizeRegexAst.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/ShrinkBigInt.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/ShrinkInteger.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/SlicesForStringBuilder.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/StrictlyEqualSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/TextEscaper.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/ToggleFlags.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/TokenizeRegex.js (92%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/helpers/TokenizeString.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/helpers/ZipIterableIterators.js (79%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/implementations/NoopSlicedGenerator.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/implementations/SchedulerImplem.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/implementations/SlicedBasedGenerator.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/interfaces/CustomSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/interfaces/EntityGraphTypes.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/interfaces/Scheduler.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/interfaces/SlicedGenerator.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/ArrayToMap.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/ArrayToSet.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/CharsToString.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/CodePointsToString.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/EntitiesToIPv6.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/IndexToMappedConstant.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/IndexToPrintableIndex.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/KeyValuePairsToObject.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/NatToStringifiedNat.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/NumberToPaddedEight.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/PaddedEightsToUuid.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/mappers/PartsToUrl.js (79%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/PatternsToString.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/SegmentsToPath.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/StringToBase64.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/TimeToDate.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/UintToBase32String.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/UnboxedToBoxed.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.js rename node_modules/fast-check/lib/{esm => cjs}/arbitrary/_internals/mappers/ValuesAndSeparateKeysToObject.js (81%) create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/VersionsApplierForUuid.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_internals/mappers/WordsToLorem.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/_shared/StringSharedConstraints.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/anything.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/base64String.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/bigInt.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/bigInt64Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/bigUint64Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/boolean.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/clone.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/commands.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/compareBooleanFunc.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/compareFunc.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/constant.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/constantFrom.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/context.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/date.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/dictionary.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/domain.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/double.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/emailAddress.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/entityGraph.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/falsy.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/float.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/float32Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/float64Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/func.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/gen.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/infiniteStream.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/int16Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/int32Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/int8Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/integer.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/ipV4.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/ipV4Extended.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/ipV6.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/json.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/jsonValue.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/letrec.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/limitShrink.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/lorem.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/map.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/mapToConstant.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/maxSafeInteger.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/maxSafeNat.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/memo.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/mixedCase.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/nat.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/noBias.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/noShrink.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/object.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/oneof.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/option.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/record.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/scheduler.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/set.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/shuffledSubarray.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/sparseArray.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/string.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/stringMatching.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/subarray.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/tuple.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uint16Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uint32Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uint8Array.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uint8ClampedArray.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/ulid.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uniqueArray.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/uuid.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webAuthority.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webFragments.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webPath.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webQueryParameters.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webSegment.js create mode 100644 node_modules/fast-check/lib/cjs/arbitrary/webUrl.js create mode 100644 node_modules/fast-check/lib/cjs/check/arbitrary/definition/Arbitrary.js create mode 100644 node_modules/fast-check/lib/cjs/check/arbitrary/definition/Value.js rename node_modules/fast-check/lib/{esm => cjs}/check/model/ModelRunner.js (77%) rename node_modules/fast-check/lib/{esm => cjs}/check/model/ReplayPath.js (92%) create mode 100644 node_modules/fast-check/lib/cjs/check/model/command/AsyncCommand.js create mode 100644 node_modules/fast-check/lib/cjs/check/model/command/Command.js create mode 100644 node_modules/fast-check/lib/cjs/check/model/command/ICommand.js create mode 100644 node_modules/fast-check/lib/cjs/check/model/commands/CommandWrapper.js create mode 100644 node_modules/fast-check/lib/cjs/check/model/commands/CommandsContraints.js create mode 100644 node_modules/fast-check/lib/cjs/check/model/commands/CommandsIterable.js rename node_modules/fast-check/lib/{esm => cjs}/check/model/commands/ScheduledCommand.js (81%) create mode 100644 node_modules/fast-check/lib/cjs/check/precondition/Pre.js create mode 100644 node_modules/fast-check/lib/cjs/check/precondition/PreconditionFailure.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/AsyncProperty.generic.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/AsyncProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/IRawProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/IgnoreEqualValuesProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/Property.generic.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/Property.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/SkipAfterProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/TimeoutProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/property/UnbiasedProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/DecorateProperty.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/Runner.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/RunnerIterator.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/Sampler.js rename node_modules/fast-check/lib/{esm => cjs}/check/runner/SourceValuesIterator.js (76%) create mode 100644 node_modules/fast-check/lib/cjs/check/runner/Tosser.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/configuration/GlobalParameters.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/configuration/Parameters.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/configuration/QualifiedParameters.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/configuration/RandomType.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/configuration/VerbosityLevel.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/reporter/ExecutionStatus.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/reporter/ExecutionTree.js create mode 100644 node_modules/fast-check/lib/cjs/check/runner/reporter/RunDetails.js rename node_modules/fast-check/lib/{esm => cjs}/check/runner/reporter/RunExecution.js (76%) rename node_modules/fast-check/lib/{esm => cjs}/check/runner/utils/PathWalker.js (81%) create mode 100644 node_modules/fast-check/lib/cjs/check/runner/utils/RunDetailsFormatter.js create mode 100644 node_modules/fast-check/lib/cjs/check/symbols.js create mode 100644 node_modules/fast-check/lib/cjs/fast-check-default.js create mode 100644 node_modules/fast-check/lib/cjs/fast-check.js create mode 100644 node_modules/fast-check/lib/cjs/package.json create mode 100644 node_modules/fast-check/lib/cjs/random/generator/Random.js rename node_modules/fast-check/lib/{esm => cjs}/stream/LazyIterableIterator.js (75%) create mode 100644 node_modules/fast-check/lib/cjs/stream/Stream.js create mode 100644 node_modules/fast-check/lib/cjs/stream/StreamHelpers.js rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/AdapterArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/AlwaysShrinkableArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/ArrayArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/BigIntArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/CloneArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/CommandsArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/ConstantArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/FrequencyArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/GeneratorArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm/check/model/commands/CommandsContraints.js => cjs/types/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/IntegerArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/LazyArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/LimitedShrinkArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/MixedCaseArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm/check/runner/configuration/Parameters.js => cjs/types/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/SchedulerArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/StreamArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/StringUnitArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/SubarrayArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/TupleArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm/check/runner/configuration/RandomType.js => cjs/types/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.d.ts} (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/WithShrinkFromOtherArbitrary.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/AnyArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/BoxedArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/CharacterRangeArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/CompareFunctionArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/GeneratorValueBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/PaddedNumberArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/PartialRecordArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/StableArbitraryGeneratorCache.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/StringifiedNatArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/UriPathArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/builders/UriQueryOrFragmentArbitraryBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/data/GraphemeRanges.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/BiasNumericRange.d.ts (100%) rename node_modules/fast-check/lib/{esm/check/runner/reporter/ExecutionTree.js => cjs/types/arbitrary/_internals/helpers/BuildInversedRelationsMapping.d.ts} (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/BuildSchedulerFor.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/BuildSlicedGenerator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/CustomEqualSet.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/DepthContext.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/DoubleHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/DoubleOnlyHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/EnumerableKeysExtractor.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/FloatHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/FloatOnlyHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/FloatingOnlyHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/GraphemeRangesHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/IsSubarrayOf.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/_internals/helpers/JsonConstraintsBuilder.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/MaxLengthFromMinLength.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/NoUndefinedAsContext.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/QualifiedObjectConstraints.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/ReadRegex.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/SameValueSet.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/SameValueZeroSet.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/SanitizeRegexAst.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/ShrinkBigInt.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/ShrinkInteger.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/SlicesForStringBuilder.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/StrictlyEqualSet.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/TextEscaper.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/ToggleFlags.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/TokenizeRegex.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/TokenizeString.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/helpers/ZipIterableIterators.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/implementations/NoopSlicedGenerator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/implementations/SchedulerImplem.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/implementations/SlicedBasedGenerator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/interfaces/CustomSet.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/_internals/interfaces/EntityGraphTypes.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/_internals/interfaces/Scheduler.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/interfaces/SlicedGenerator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/ArrayToMap.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/ArrayToSet.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/CharsToString.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/CodePointsToString.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/EntitiesToIPv6.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/IndexToMappedConstant.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/IndexToPrintableIndex.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/KeyValuePairsToObject.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/NatToStringifiedNat.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/NumberToPaddedEight.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/PaddedEightsToUuid.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/PartsToUrl.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/PatternsToString.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/SegmentsToPath.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/StringToBase64.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/TimeToDate.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/UintToBase32String.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/UnboxedToBoxed.d.ts (100%) rename node_modules/fast-check/lib/{esm/check/runner/reporter/RunDetails.js => cjs/types/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.d.ts} (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/ValuesAndSeparateKeysToObject.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/VersionsApplierForUuid.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_internals/mappers/WordsToLorem.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/_shared/StringSharedConstraints.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/anything.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/array.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/base64String.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/bigInt.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/bigInt64Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/bigUint64Array.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/boolean.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/clone.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/commands.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/compareBooleanFunc.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/compareFunc.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/constant.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/constantFrom.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/context.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/date.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/dictionary.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/domain.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/double.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/emailAddress.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/entityGraph.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/falsy.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/float.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/float32Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/float64Array.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/func.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/gen.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/infiniteStream.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/int16Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/int32Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/int8Array.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/integer.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/ipV4.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/ipV4Extended.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/ipV6.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/json.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/jsonValue.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/letrec.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/limitShrink.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/lorem.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/map.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/mapToConstant.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/maxSafeInteger.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/maxSafeNat.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/memo.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/mixedCase.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/nat.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/noBias.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/noShrink.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/object.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/oneof.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/option.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/record.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/scheduler.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/set.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/shuffledSubarray.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/sparseArray.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/string.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/stringMatching.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/subarray.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/tuple.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/uint16Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/uint32Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/uint8Array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/uint8ClampedArray.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/ulid.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/uniqueArray.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/arbitrary/uuid.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webAuthority.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webFragments.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webPath.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webQueryParameters.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webSegment.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/arbitrary/webUrl.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/arbitrary/definition/Arbitrary.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/arbitrary/definition/Value.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/ModelRunner.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/ReplayPath.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/command/AsyncCommand.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/command/Command.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/command/ICommand.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/model/commands/CommandWrapper.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/commands/CommandsContraints.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/model/commands/CommandsIterable.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/model/commands/ScheduledCommand.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/precondition/Pre.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/precondition/PreconditionFailure.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/AsyncProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/AsyncProperty.generic.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/property/IRawProperty.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/IgnoreEqualValuesProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/Property.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/Property.generic.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/SkipAfterProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/TimeoutProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/property/UnbiasedProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/DecorateProperty.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/Runner.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/RunnerIterator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/Sampler.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/SourceValuesIterator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/Tosser.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/configuration/GlobalParameters.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/runner/configuration/Parameters.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/configuration/QualifiedParameters.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/configuration/RandomType.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/configuration/VerbosityLevel.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/reporter/ExecutionStatus.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/reporter/ExecutionTree.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/check/runner/reporter/RunDetails.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/reporter/RunExecution.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/utils/PathWalker.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/runner/utils/RunDetailsFormatter.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/check/symbols.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/fast-check-default.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/fast-check.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/random/generator/Random.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/stream/LazyIterableIterator.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/stream/Stream.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/stream/StreamHelpers.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/utils/apply.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types/utils/globals.d.ts rename node_modules/fast-check/lib/{esm => cjs}/types/utils/hash.d.ts (100%) rename node_modules/fast-check/lib/{esm => cjs}/types/utils/stringify.d.ts (100%) rename node_modules/fast-check/lib/{esm/types/arbitrary/_internals/ArrayInt64Arbitrary.d.ts => cjs/types57/arbitrary/_internals/AdapterArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{esm/types/arbitrary/_internals/builders/CharacterArbitraryBuilder.d.ts => cjs/types57/arbitrary/_internals/AlwaysShrinkableArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{esm/types/arbitrary/_internals/helpers/ArrayInt64.d.ts => cjs/types57/arbitrary/_internals/ArrayArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{esm/types/arbitrary/_internals/mappers/IndexToCharString.d.ts => cjs/types57/arbitrary/_internals/BigIntArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{types/arbitrary/_internals/ArrayInt64Arbitrary.d.ts => cjs/types57/arbitrary/_internals/CloneArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{types/arbitrary/_internals/builders/CharacterArbitraryBuilder.d.ts => cjs/types57/arbitrary/_internals/CommandsArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{types/arbitrary/_internals/helpers/ArrayInt64.d.ts => cjs/types57/arbitrary/_internals/ConstantArbitrary.d.ts} (100%) rename node_modules/fast-check/lib/{types/arbitrary/_internals/mappers/IndexToCharString.d.ts => cjs/types57/arbitrary/_internals/FrequencyArbitrary.d.ts} (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/GeneratorArbitrary.d.ts rename node_modules/{pure-rand/lib/esm/distribution/Distribution.js => fast-check/lib/cjs/types57/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.d.ts} (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/IntegerArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/LazyArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/LimitedShrinkArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/MixedCaseArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/SchedulerArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/StreamArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/StringUnitArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/SubarrayArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/TupleArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/WithShrinkFromOtherArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/AnyArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/BoxedArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/CharacterRangeArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/CompareFunctionArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/GeneratorValueBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/PaddedNumberArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/PartialRecordArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/StableArbitraryGeneratorCache.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/StringifiedNatArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/UriPathArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/builders/UriQueryOrFragmentArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/data/GraphemeRanges.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/BiasNumericRange.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/BuildInversedRelationsMapping.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/BuildSchedulerFor.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/BuildSlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/CustomEqualSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/DepthContext.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/DoubleHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/DoubleOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/EnumerableKeysExtractor.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/FloatHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/FloatOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/FloatingOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/GraphemeRangesHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/IsSubarrayOf.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/JsonConstraintsBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/MaxLengthFromMinLength.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/NoUndefinedAsContext.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/QualifiedObjectConstraints.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/ReadRegex.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/SameValueSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/SameValueZeroSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/SanitizeRegexAst.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/ShrinkBigInt.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/ShrinkInteger.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/SlicesForStringBuilder.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/StrictlyEqualSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/TextEscaper.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/ToggleFlags.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/TokenizeRegex.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/TokenizeString.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/helpers/ZipIterableIterators.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/implementations/NoopSlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/implementations/SchedulerImplem.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/implementations/SlicedBasedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/interfaces/CustomSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/interfaces/EntityGraphTypes.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/interfaces/Scheduler.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/interfaces/SlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/ArrayToMap.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/ArrayToSet.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/CharsToString.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/CodePointsToString.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/EntitiesToIPv6.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/IndexToMappedConstant.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/IndexToPrintableIndex.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/KeyValuePairsToObject.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/NatToStringifiedNat.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/NumberToPaddedEight.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/PaddedEightsToUuid.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/PartsToUrl.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/PatternsToString.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/SegmentsToPath.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/StringToBase64.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/TimeToDate.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/UintToBase32String.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/UnboxedToBoxed.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/ValuesAndSeparateKeysToObject.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/VersionsApplierForUuid.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_internals/mappers/WordsToLorem.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/_shared/StringSharedConstraints.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/anything.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/array.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/base64String.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/bigInt.d.ts rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/bigInt64Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/bigUint64Array.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/boolean.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/clone.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/commands.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/compareBooleanFunc.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/compareFunc.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/constant.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/constantFrom.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/context.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/date.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/dictionary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/domain.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/double.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/emailAddress.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/entityGraph.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/falsy.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/float.d.ts rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/float32Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/float64Array.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/func.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/gen.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/infiniteStream.d.ts rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/int16Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/int32Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/int8Array.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/integer.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/ipV4.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/ipV4Extended.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/ipV6.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/json.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/jsonValue.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/letrec.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/limitShrink.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/lorem.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/map.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/mapToConstant.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/maxSafeInteger.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/maxSafeNat.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/memo.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/mixedCase.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/nat.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/noBias.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/noShrink.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/object.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/oneof.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/option.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/record.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/scheduler.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/set.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/shuffledSubarray.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/sparseArray.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/string.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/stringMatching.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/subarray.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/tuple.d.ts rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/uint16Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/uint32Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/uint8Array.d.ts (100%) rename node_modules/fast-check/lib/{esm/types => cjs/types57}/arbitrary/uint8ClampedArray.d.ts (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/ulid.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/uniqueArray.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/uuid.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webAuthority.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webFragments.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webPath.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webQueryParameters.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webSegment.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/arbitrary/webUrl.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/arbitrary/definition/Arbitrary.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/arbitrary/definition/Value.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/ModelRunner.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/ReplayPath.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/command/AsyncCommand.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/command/Command.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/command/ICommand.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/commands/CommandWrapper.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/commands/CommandsContraints.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/commands/CommandsIterable.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/model/commands/ScheduledCommand.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/precondition/Pre.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/precondition/PreconditionFailure.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/AsyncProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/AsyncProperty.generic.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/IRawProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/IgnoreEqualValuesProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/Property.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/Property.generic.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/SkipAfterProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/TimeoutProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/property/UnbiasedProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/DecorateProperty.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/Runner.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/RunnerIterator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/Sampler.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/SourceValuesIterator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/Tosser.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/configuration/GlobalParameters.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/configuration/Parameters.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/configuration/QualifiedParameters.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/configuration/RandomType.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/configuration/VerbosityLevel.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/reporter/ExecutionStatus.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/reporter/ExecutionTree.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/reporter/RunDetails.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/reporter/RunExecution.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/utils/PathWalker.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/runner/utils/RunDetailsFormatter.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/check/symbols.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/fast-check-default.d.ts rename node_modules/fast-check/lib/{esm/fast-check.js => cjs/types57/fast-check.d.ts} (100%) create mode 100644 node_modules/fast-check/lib/cjs/types57/random/generator/Random.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/stream/LazyIterableIterator.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/stream/Stream.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/stream/StreamHelpers.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/utils/apply.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/utils/globals.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/utils/hash.d.ts create mode 100644 node_modules/fast-check/lib/cjs/types57/utils/stringify.d.ts rename node_modules/fast-check/lib/{esm => cjs}/utils/apply.js (76%) create mode 100644 node_modules/fast-check/lib/cjs/utils/globals.js create mode 100644 node_modules/fast-check/lib/cjs/utils/hash.js create mode 100644 node_modules/fast-check/lib/cjs/utils/stringify.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/AdapterArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/AlwaysShrinkableArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayInt64Arbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/BigIntArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/CloneArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/CommandsArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/ConstantArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/GeneratorArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/IntegerArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/LazyArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/LimitedShrinkArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/MixedCaseArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/SchedulerArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/StreamArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/StringUnitArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/SubarrayArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/WithShrinkFromOtherArbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/AnyArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/BoxedArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CharacterArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CharacterRangeArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CompareFunctionArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/GeneratorValueBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/PaddedNumberArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/PartialRecordArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/StableArbitraryGeneratorCache.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/StringifiedNatArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/UriPathArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/builders/UriQueryOrFragmentArbitraryBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ArrayInt64.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BiasNumericRange.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BuildSchedulerFor.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BuildSlicedGenerator.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/CustomEqualSet.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DepthContext.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleHelpers.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleOnlyHelpers.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatOnlyHelpers.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/IsSubarrayOf.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/JsonConstraintsBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/MaxLengthFromMinLength.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/NoUndefinedAsContext.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/QualifiedObjectConstraints.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueSet.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueZeroSet.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SanitizeRegexAst.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkBigInt.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkInteger.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SlicesForStringBuilder.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/StrictlyEqualSet.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/TextEscaper.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ToggleFlags.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/TokenizeString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/NoopSlicedGenerator.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/SchedulerImplem.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/SlicedBasedGenerator.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToMap.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToSet.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/CharsToString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/CodePointsToString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/EntitiesToIPv6.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToCharString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToMappedConstant.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToPrintableIndex.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/KeyValuePairsToObject.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/NatToStringifiedNat.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/NumberToPaddedEight.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/PaddedEightsToUuid.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/PatternsToString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/SegmentsToPath.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/StringToBase64.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/TimeToDate.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/UintToBase32String.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/UnboxedToBoxed.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/VersionsApplierForUuid.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/WordsToLorem.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/anything.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/ascii.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/asciiString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/base64.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/base64String.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigInt.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigInt64Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigIntN.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigUint.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigUint64Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/bigUintN.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/boolean.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/char.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/char16bits.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/clone.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/commands.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/compareBooleanFunc.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/compareFunc.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/constant.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/constantFrom.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/context.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/date.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/dictionary.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/domain.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/double.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/emailAddress.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/falsy.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/float.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/float32Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/float64Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/fullUnicode.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/fullUnicodeString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/func.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/gen.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/hexa.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/hexaString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/infiniteStream.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/int16Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/int32Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/int8Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/integer.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/ipV4.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/ipV4Extended.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/ipV6.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/json.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/jsonValue.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/letrec.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/limitShrink.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/lorem.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/mapToConstant.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/maxSafeInteger.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/maxSafeNat.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/memo.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/mixedCase.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/nat.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/noBias.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/noShrink.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/object.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/oneof.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/option.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/record.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/scheduler.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/shuffledSubarray.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/sparseArray.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/string.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/string16bits.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/stringMatching.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/stringOf.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/subarray.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/tuple.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uint16Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uint32Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uint8Array.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uint8ClampedArray.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/ulid.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/unicode.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/unicodeJson.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/unicodeJsonValue.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/unicodeString.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uniqueArray.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uuid.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/uuidV.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webAuthority.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webFragments.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webPath.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webQueryParameters.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webSegment.js delete mode 100644 node_modules/fast-check/lib/esm/arbitrary/webUrl.js delete mode 100644 node_modules/fast-check/lib/esm/check/arbitrary/definition/Arbitrary.js delete mode 100644 node_modules/fast-check/lib/esm/check/arbitrary/definition/Value.js delete mode 100644 node_modules/fast-check/lib/esm/check/model/commands/CommandWrapper.js delete mode 100644 node_modules/fast-check/lib/esm/check/model/commands/CommandsIterable.js delete mode 100644 node_modules/fast-check/lib/esm/check/precondition/Pre.js delete mode 100644 node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/AsyncProperty.generic.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/AsyncProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/IRawProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/IgnoreEqualValuesProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/Property.generic.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/Property.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/SkipAfterProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/TimeoutProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/property/UnbiasedProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/DecorateProperty.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/Runner.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/RunnerIterator.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/Sampler.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/Tosser.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/configuration/GlobalParameters.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/configuration/QualifiedParameters.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/configuration/VerbosityLevel.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/reporter/ExecutionStatus.js delete mode 100644 node_modules/fast-check/lib/esm/check/runner/utils/RunDetailsFormatter.js delete mode 100644 node_modules/fast-check/lib/esm/check/symbols.js delete mode 100644 node_modules/fast-check/lib/esm/fast-check-default.js delete mode 100644 node_modules/fast-check/lib/esm/random/generator/Random.js delete mode 100644 node_modules/fast-check/lib/esm/stream/Stream.js delete mode 100644 node_modules/fast-check/lib/esm/stream/StreamHelpers.js delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/_internals/helpers/JsonConstraintsBuilder.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/_internals/interfaces/Scheduler.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/anything.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/ascii.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/asciiString.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/base64.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/bigInt.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/bigIntN.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/bigUint.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/bigUintN.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/char.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/char16bits.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/constant.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/constantFrom.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/date.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/dictionary.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/falsy.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/fullUnicode.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/fullUnicodeString.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/hexa.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/hexaString.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/infiniteStream.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/nat.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/noBias.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/noShrink.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/option.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/record.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/string.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/string16bits.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/stringOf.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/unicode.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/unicodeJson.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/unicodeJsonValue.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/unicodeString.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/uuid.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/arbitrary/uuidV.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/arbitrary/definition/Arbitrary.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/model/commands/CommandWrapper.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/model/commands/CommandsIterable.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/property/IRawProperty.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/runner/configuration/Parameters.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/check/runner/reporter/RunDetails.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/fast-check-default.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/random/generator/Random.d.ts delete mode 100644 node_modules/fast-check/lib/esm/types/utils/globals.d.ts delete mode 100644 node_modules/fast-check/lib/esm/utils/globals.js delete mode 100644 node_modules/fast-check/lib/esm/utils/hash.js delete mode 100644 node_modules/fast-check/lib/esm/utils/stringify.js create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/helpers/BuildInversedRelationsMapping.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/interfaces/EntityGraphTypes.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/ascii.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/asciiString.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/base64.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/bigIntN.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/bigUint.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/bigUintN.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/char.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/char16bits.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/entityGraph.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/fullUnicode.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/fullUnicodeString.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/hexa.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/hexaString.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/map.d.ts create mode 100644 node_modules/fast-check/lib/types/arbitrary/set.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/string16bits.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/stringOf.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/unicode.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/unicodeJson.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/unicodeJsonValue.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/unicodeString.d.ts delete mode 100644 node_modules/fast-check/lib/types/arbitrary/uuidV.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/AdapterArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/AlwaysShrinkableArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/ArrayArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/BigIntArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/CloneArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/CommandsArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/ConstantArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/FrequencyArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/GeneratorArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/InitialPoolForEntityGraphArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/IntegerArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/LazyArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/LimitedShrinkArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/MixedCaseArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/OnTheFlyLinksForEntityGraphArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/SchedulerArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/StreamArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/StringUnitArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/SubarrayArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/TupleArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/UnlinkedEntitiesForEntityGraph.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/WithShrinkFromOtherArbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/AnyArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/BoxedArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/CharacterRangeArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/CompareFunctionArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/GeneratorValueBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/PaddedNumberArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/PartialRecordArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/StableArbitraryGeneratorCache.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/StringifiedNatArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/UriPathArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/builders/UriQueryOrFragmentArbitraryBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/data/GraphemeRanges.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/BiasNumericRange.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/BuildInversedRelationsMapping.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/BuildSchedulerFor.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/BuildSlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/CustomEqualSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/DepthContext.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/DoubleHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/DoubleOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/EnumerableKeysExtractor.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/FloatHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/FloatOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/FloatingOnlyHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/GraphemeRangesHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/IsSubarrayOf.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/JsonConstraintsBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/MaxLengthFromMinLength.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/NoUndefinedAsContext.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/QualifiedObjectConstraints.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/ReadRegex.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/SameValueSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/SameValueZeroSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/SanitizeRegexAst.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/ShrinkBigInt.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/ShrinkInteger.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/SlicesForStringBuilder.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/StrictlyEqualSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/TextEscaper.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/ToggleFlags.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/TokenizeRegex.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/TokenizeString.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/helpers/ZipIterableIterators.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/implementations/NoopSlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/implementations/SchedulerImplem.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/implementations/SlicedBasedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/interfaces/CustomSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/interfaces/EntityGraphTypes.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/interfaces/Scheduler.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/interfaces/SlicedGenerator.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/ArrayToMap.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/ArrayToSet.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/CharsToString.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/CodePointsToString.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/EntitiesToIPv6.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/IndexToMappedConstant.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/IndexToPrintableIndex.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/KeyValuePairsToObject.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/NatToStringifiedNat.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/NumberToPaddedEight.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/PaddedEightsToUuid.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/PartsToUrl.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/PatternsToString.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/SegmentsToPath.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/StringToBase64.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/TimeToDate.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/UintToBase32String.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/UnboxedToBoxed.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/UnlinkedToLinkedEntities.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/ValuesAndSeparateKeysToObject.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/VersionsApplierForUuid.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_internals/mappers/WordsToLorem.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/_shared/StringSharedConstraints.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/anything.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/base64String.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/bigInt.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/bigInt64Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/bigUint64Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/boolean.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/clone.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/commands.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/compareBooleanFunc.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/compareFunc.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/constant.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/constantFrom.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/context.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/date.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/dictionary.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/domain.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/double.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/emailAddress.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/entityGraph.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/falsy.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/float.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/float32Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/float64Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/func.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/gen.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/infiniteStream.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/int16Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/int32Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/int8Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/integer.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/ipV4.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/ipV4Extended.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/ipV6.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/json.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/jsonValue.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/letrec.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/limitShrink.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/lorem.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/map.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/mapToConstant.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/maxSafeInteger.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/maxSafeNat.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/memo.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/mixedCase.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/nat.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/noBias.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/noShrink.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/object.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/oneof.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/option.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/record.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/scheduler.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/set.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/shuffledSubarray.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/sparseArray.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/string.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/stringMatching.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/subarray.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/tuple.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uint16Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uint32Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uint8Array.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uint8ClampedArray.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/ulid.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uniqueArray.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/uuid.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webAuthority.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webFragments.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webPath.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webQueryParameters.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webSegment.d.ts create mode 100644 node_modules/fast-check/lib/types57/arbitrary/webUrl.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/arbitrary/definition/Arbitrary.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/arbitrary/definition/Value.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/ModelRunner.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/ReplayPath.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/command/AsyncCommand.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/command/Command.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/command/ICommand.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/commands/CommandWrapper.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/commands/CommandsContraints.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/commands/CommandsIterable.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/model/commands/ScheduledCommand.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/precondition/Pre.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/precondition/PreconditionFailure.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/AsyncProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/AsyncProperty.generic.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/IRawProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/IgnoreEqualValuesProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/Property.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/Property.generic.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/SkipAfterProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/TimeoutProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/property/UnbiasedProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/DecorateProperty.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/Runner.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/RunnerIterator.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/Sampler.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/SourceValuesIterator.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/Tosser.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/configuration/GlobalParameters.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/configuration/Parameters.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/configuration/QualifiedParameters.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/configuration/RandomType.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/configuration/VerbosityLevel.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/reporter/ExecutionStatus.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/reporter/ExecutionTree.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/reporter/RunDetails.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/reporter/RunExecution.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/utils/PathWalker.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/runner/utils/RunDetailsFormatter.d.ts create mode 100644 node_modules/fast-check/lib/types57/check/symbols.d.ts create mode 100644 node_modules/fast-check/lib/types57/fast-check-default.d.ts create mode 100644 node_modules/fast-check/lib/types57/fast-check.d.ts create mode 100644 node_modules/fast-check/lib/types57/random/generator/Random.d.ts create mode 100644 node_modules/fast-check/lib/types57/stream/LazyIterableIterator.d.ts create mode 100644 node_modules/fast-check/lib/types57/stream/Stream.d.ts create mode 100644 node_modules/fast-check/lib/types57/stream/StreamHelpers.d.ts create mode 100644 node_modules/fast-check/lib/types57/utils/apply.d.ts create mode 100644 node_modules/fast-check/lib/types57/utils/globals.d.ts create mode 100644 node_modules/fast-check/lib/types57/utils/hash.d.ts create mode 100644 node_modules/fast-check/lib/types57/utils/stringify.d.ts create mode 100644 node_modules/foreground-child/LICENSE create mode 100644 node_modules/foreground-child/README.md create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.js create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/index.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/index.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/index.js create mode 100644 node_modules/foreground-child/dist/commonjs/index.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/package.json create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.js create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.js create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.js.map create mode 100644 node_modules/foreground-child/dist/esm/all-signals.d.ts create mode 100644 node_modules/foreground-child/dist/esm/all-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/all-signals.js create mode 100644 node_modules/foreground-child/dist/esm/all-signals.js.map create mode 100644 node_modules/foreground-child/dist/esm/index.d.ts create mode 100644 node_modules/foreground-child/dist/esm/index.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/index.js create mode 100644 node_modules/foreground-child/dist/esm/index.js.map create mode 100644 node_modules/foreground-child/dist/esm/package.json create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.d.ts create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.js create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.js.map create mode 100644 node_modules/foreground-child/dist/esm/watchdog.d.ts create mode 100644 node_modules/foreground-child/dist/esm/watchdog.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/watchdog.js create mode 100644 node_modules/foreground-child/dist/esm/watchdog.js.map create mode 100644 node_modules/foreground-child/package.json delete mode 100644 node_modules/form-data/CHANGELOG.md delete mode 100644 node_modules/form-data/License delete mode 100644 node_modules/form-data/README.md delete mode 100644 node_modules/form-data/index.d.ts delete mode 100644 node_modules/form-data/lib/browser.js delete mode 100644 node_modules/form-data/lib/form_data.js delete mode 100644 node_modules/form-data/lib/populate.js delete mode 100644 node_modules/form-data/package.json delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.github/FUNDING.yml delete mode 100644 node_modules/function-bind/.github/SECURITY.md delete mode 100644 node_modules/function-bind/.nycrc delete mode 100644 node_modules/function-bind/CHANGELOG.md delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/get-intrinsic/.eslintrc delete mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml delete mode 100644 node_modules/get-intrinsic/.nycrc delete mode 100644 node_modules/get-intrinsic/CHANGELOG.md delete mode 100644 node_modules/get-intrinsic/LICENSE delete mode 100644 node_modules/get-intrinsic/README.md delete mode 100644 node_modules/get-intrinsic/index.js delete mode 100644 node_modules/get-intrinsic/package.json delete mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js delete mode 100644 node_modules/get-proto/.eslintrc delete mode 100644 node_modules/get-proto/.github/FUNDING.yml delete mode 100644 node_modules/get-proto/.nycrc delete mode 100644 node_modules/get-proto/CHANGELOG.md delete mode 100644 node_modules/get-proto/LICENSE delete mode 100644 node_modules/get-proto/Object.getPrototypeOf.d.ts delete mode 100644 node_modules/get-proto/Object.getPrototypeOf.js delete mode 100644 node_modules/get-proto/README.md delete mode 100644 node_modules/get-proto/Reflect.getPrototypeOf.d.ts delete mode 100644 node_modules/get-proto/Reflect.getPrototypeOf.js delete mode 100644 node_modules/get-proto/index.d.ts delete mode 100644 node_modules/get-proto/index.js delete mode 100644 node_modules/get-proto/package.json delete mode 100644 node_modules/get-proto/test/index.js delete mode 100644 node_modules/get-proto/tsconfig.json create mode 100644 node_modules/glob/dist/commonjs/glob.d.ts create mode 100644 node_modules/glob/dist/commonjs/glob.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/glob.js create mode 100644 node_modules/glob/dist/commonjs/glob.js.map create mode 100644 node_modules/glob/dist/commonjs/has-magic.d.ts create mode 100644 node_modules/glob/dist/commonjs/has-magic.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/has-magic.js create mode 100644 node_modules/glob/dist/commonjs/has-magic.js.map create mode 100644 node_modules/glob/dist/commonjs/ignore.d.ts create mode 100644 node_modules/glob/dist/commonjs/ignore.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/ignore.js create mode 100644 node_modules/glob/dist/commonjs/ignore.js.map create mode 100644 node_modules/glob/dist/commonjs/index.d.ts create mode 100644 node_modules/glob/dist/commonjs/index.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/index.js create mode 100644 node_modules/glob/dist/commonjs/index.js.map create mode 100644 node_modules/glob/dist/commonjs/package.json create mode 100644 node_modules/glob/dist/commonjs/pattern.d.ts create mode 100644 node_modules/glob/dist/commonjs/pattern.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/pattern.js create mode 100644 node_modules/glob/dist/commonjs/pattern.js.map create mode 100644 node_modules/glob/dist/commonjs/processor.d.ts create mode 100644 node_modules/glob/dist/commonjs/processor.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/processor.js create mode 100644 node_modules/glob/dist/commonjs/processor.js.map create mode 100644 node_modules/glob/dist/commonjs/walker.d.ts create mode 100644 node_modules/glob/dist/commonjs/walker.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/walker.js create mode 100644 node_modules/glob/dist/commonjs/walker.js.map create mode 100644 node_modules/glob/dist/esm/bin.d.mts create mode 100644 node_modules/glob/dist/esm/bin.d.mts.map create mode 100755 node_modules/glob/dist/esm/bin.mjs create mode 100644 node_modules/glob/dist/esm/bin.mjs.map create mode 100644 node_modules/glob/dist/esm/glob.d.ts create mode 100644 node_modules/glob/dist/esm/glob.d.ts.map create mode 100644 node_modules/glob/dist/esm/glob.js create mode 100644 node_modules/glob/dist/esm/glob.js.map create mode 100644 node_modules/glob/dist/esm/has-magic.d.ts create mode 100644 node_modules/glob/dist/esm/has-magic.d.ts.map create mode 100644 node_modules/glob/dist/esm/has-magic.js create mode 100644 node_modules/glob/dist/esm/has-magic.js.map create mode 100644 node_modules/glob/dist/esm/ignore.d.ts create mode 100644 node_modules/glob/dist/esm/ignore.d.ts.map create mode 100644 node_modules/glob/dist/esm/ignore.js create mode 100644 node_modules/glob/dist/esm/ignore.js.map create mode 100644 node_modules/glob/dist/esm/index.d.ts create mode 100644 node_modules/glob/dist/esm/index.d.ts.map create mode 100644 node_modules/glob/dist/esm/index.js create mode 100644 node_modules/glob/dist/esm/index.js.map create mode 100644 node_modules/glob/dist/esm/package.json create mode 100644 node_modules/glob/dist/esm/pattern.d.ts create mode 100644 node_modules/glob/dist/esm/pattern.d.ts.map create mode 100644 node_modules/glob/dist/esm/pattern.js create mode 100644 node_modules/glob/dist/esm/pattern.js.map create mode 100644 node_modules/glob/dist/esm/processor.d.ts create mode 100644 node_modules/glob/dist/esm/processor.d.ts.map create mode 100644 node_modules/glob/dist/esm/processor.js create mode 100644 node_modules/glob/dist/esm/processor.js.map create mode 100644 node_modules/glob/dist/esm/walker.d.ts create mode 100644 node_modules/glob/dist/esm/walker.d.ts.map create mode 100644 node_modules/glob/dist/esm/walker.js create mode 100644 node_modules/glob/dist/esm/walker.js.map delete mode 100644 node_modules/gopd/.eslintrc delete mode 100644 node_modules/gopd/.github/FUNDING.yml delete mode 100644 node_modules/gopd/CHANGELOG.md delete mode 100644 node_modules/gopd/LICENSE delete mode 100644 node_modules/gopd/README.md delete mode 100644 node_modules/gopd/gOPD.d.ts delete mode 100644 node_modules/gopd/gOPD.js delete mode 100644 node_modules/gopd/index.d.ts delete mode 100644 node_modules/gopd/index.js delete mode 100644 node_modules/gopd/package.json delete mode 100644 node_modules/gopd/test/index.js delete mode 100644 node_modules/gopd/tsconfig.json delete mode 100644 node_modules/has-symbols/.eslintrc delete mode 100644 node_modules/has-symbols/.github/FUNDING.yml delete mode 100644 node_modules/has-symbols/.nycrc delete mode 100644 node_modules/has-symbols/CHANGELOG.md delete mode 100644 node_modules/has-symbols/LICENSE delete mode 100644 node_modules/has-symbols/README.md delete mode 100644 node_modules/has-symbols/index.d.ts delete mode 100644 node_modules/has-symbols/index.js delete mode 100644 node_modules/has-symbols/package.json delete mode 100644 node_modules/has-symbols/shams.d.ts delete mode 100644 node_modules/has-symbols/shams.js delete mode 100644 node_modules/has-symbols/test/index.js delete mode 100644 node_modules/has-symbols/test/shams/core-js.js delete mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js delete mode 100644 node_modules/has-symbols/test/tests.js delete mode 100644 node_modules/has-symbols/tsconfig.json delete mode 100644 node_modules/has-tostringtag/.eslintrc delete mode 100644 node_modules/has-tostringtag/.github/FUNDING.yml delete mode 100644 node_modules/has-tostringtag/.nycrc delete mode 100644 node_modules/has-tostringtag/CHANGELOG.md delete mode 100644 node_modules/has-tostringtag/LICENSE delete mode 100644 node_modules/has-tostringtag/README.md delete mode 100644 node_modules/has-tostringtag/index.d.ts delete mode 100644 node_modules/has-tostringtag/index.js delete mode 100644 node_modules/has-tostringtag/package.json delete mode 100644 node_modules/has-tostringtag/shams.d.ts delete mode 100644 node_modules/has-tostringtag/shams.js delete mode 100644 node_modules/has-tostringtag/test/index.js delete mode 100644 node_modules/has-tostringtag/test/shams/core-js.js delete mode 100644 node_modules/has-tostringtag/test/shams/get-own-property-symbols.js delete mode 100644 node_modules/has-tostringtag/test/tests.js delete mode 100644 node_modules/has-tostringtag/tsconfig.json delete mode 100644 node_modules/hasown/.eslintrc delete mode 100644 node_modules/hasown/.github/FUNDING.yml delete mode 100644 node_modules/hasown/.nycrc delete mode 100644 node_modules/hasown/CHANGELOG.md delete mode 100644 node_modules/hasown/LICENSE delete mode 100644 node_modules/hasown/README.md delete mode 100644 node_modules/hasown/index.d.ts delete mode 100644 node_modules/hasown/index.js delete mode 100644 node_modules/hasown/package.json delete mode 100644 node_modules/hasown/tsconfig.json create mode 100644 node_modules/http-proxy-agent/LICENSE delete mode 100644 node_modules/http-proxy-agent/dist/agent.d.ts delete mode 100644 node_modules/http-proxy-agent/dist/agent.js delete mode 100644 node_modules/http-proxy-agent/dist/agent.js.map create mode 100644 node_modules/http-proxy-agent/dist/index.d.ts.map create mode 100644 node_modules/https-proxy-agent/LICENSE delete mode 100644 node_modules/https-proxy-agent/dist/agent.d.ts delete mode 100644 node_modules/https-proxy-agent/dist/agent.js delete mode 100644 node_modules/https-proxy-agent/dist/agent.js.map create mode 100644 node_modules/https-proxy-agent/dist/index.d.ts.map create mode 100644 node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map delete mode 100644 node_modules/is-core-module/.eslintrc delete mode 100644 node_modules/is-core-module/.nycrc delete mode 100644 node_modules/is-core-module/CHANGELOG.md delete mode 100644 node_modules/is-core-module/LICENSE delete mode 100644 node_modules/is-core-module/README.md delete mode 100644 node_modules/is-core-module/core.json delete mode 100644 node_modules/is-core-module/index.js delete mode 100644 node_modules/is-core-module/package.json delete mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/jackspeak/LICENSE.md create mode 100644 node_modules/jackspeak/README.md create mode 100644 node_modules/jackspeak/dist/commonjs/index.d.ts create mode 100644 node_modules/jackspeak/dist/commonjs/index.d.ts.map create mode 100644 node_modules/jackspeak/dist/commonjs/index.js create mode 100644 node_modules/jackspeak/dist/commonjs/index.js.map create mode 100644 node_modules/jackspeak/dist/commonjs/package.json create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args-cjs.cjs.map create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args-cjs.d.cts.map create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args.d.ts create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args.js create mode 100644 node_modules/jackspeak/dist/esm/index.d.ts create mode 100644 node_modules/jackspeak/dist/esm/index.d.ts.map create mode 100644 node_modules/jackspeak/dist/esm/index.js create mode 100644 node_modules/jackspeak/dist/esm/index.js.map create mode 100644 node_modules/jackspeak/dist/esm/package.json create mode 100644 node_modules/jackspeak/dist/esm/parse-args.d.ts create mode 100644 node_modules/jackspeak/dist/esm/parse-args.d.ts.map create mode 100644 node_modules/jackspeak/dist/esm/parse-args.js create mode 100644 node_modules/jackspeak/dist/esm/parse-args.js.map create mode 100644 node_modules/jackspeak/package.json delete mode 100644 node_modules/jest-changed-files/build/git.js delete mode 100644 node_modules/jest-changed-files/build/hg.js create mode 100644 node_modules/jest-changed-files/build/index.d.mts create mode 100644 node_modules/jest-changed-files/build/index.mjs delete mode 100644 node_modules/jest-changed-files/build/sl.js delete mode 100644 node_modules/jest-changed-files/build/types.js delete mode 100644 node_modules/jest-circus/build/eventHandler.js delete mode 100644 node_modules/jest-circus/build/formatNodeAssertErrors.js delete mode 100644 node_modules/jest-circus/build/globalErrorHandlers.js create mode 100644 node_modules/jest-circus/build/index.mjs create mode 100644 node_modules/jest-circus/build/jestAdapterInit.d.mts create mode 100644 node_modules/jest-circus/build/jestAdapterInit.js create mode 100644 node_modules/jest-circus/build/jestAdapterInit.mjs delete mode 100644 node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js delete mode 100644 node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js delete mode 100644 node_modules/jest-circus/build/run.js create mode 100644 node_modules/jest-circus/build/runner.d.mts create mode 100644 node_modules/jest-circus/build/runner.js create mode 100644 node_modules/jest-circus/build/runner.mjs delete mode 100644 node_modules/jest-circus/build/shuffleArray.js delete mode 100644 node_modules/jest-circus/build/state.js delete mode 100644 node_modules/jest-circus/build/testCaseReportHandler.js delete mode 100644 node_modules/jest-circus/build/types.js delete mode 100644 node_modules/jest-circus/build/utils.js delete mode 100644 node_modules/jest-circus/runner.js mode change 100644 => 100755 node_modules/jest-cli/bin/jest.js delete mode 100644 node_modules/jest-cli/build/args.js create mode 100644 node_modules/jest-cli/build/index.d.mts create mode 100644 node_modules/jest-cli/build/index.mjs delete mode 100644 node_modules/jest-cli/build/run.js delete mode 100644 node_modules/jest-config/build/Defaults.js delete mode 100644 node_modules/jest-config/build/Deprecated.js delete mode 100644 node_modules/jest-config/build/Descriptions.js delete mode 100644 node_modules/jest-config/build/ReporterValidationErrors.js delete mode 100644 node_modules/jest-config/build/ValidConfig.js create mode 100644 node_modules/jest-config/build/chunk-BQ42LXoh.mjs delete mode 100644 node_modules/jest-config/build/color.js delete mode 100644 node_modules/jest-config/build/constants.js delete mode 100644 node_modules/jest-config/build/getCacheDirectory.js delete mode 100644 node_modules/jest-config/build/getMaxWorkers.js create mode 100644 node_modules/jest-config/build/index.d.mts create mode 100644 node_modules/jest-config/build/index.mjs delete mode 100644 node_modules/jest-config/build/normalize.js delete mode 100644 node_modules/jest-config/build/parseShardPair.js delete mode 100644 node_modules/jest-config/build/readConfigFileAndSetRootDir.js delete mode 100644 node_modules/jest-config/build/resolveConfigPath.js delete mode 100644 node_modules/jest-config/build/setFromArgv.js delete mode 100644 node_modules/jest-config/build/stringToBytes.js delete mode 100644 node_modules/jest-config/build/utils.js delete mode 100644 node_modules/jest-config/build/validatePattern.js delete mode 100644 node_modules/jest-diff/build/cleanupSemantic.js delete mode 100644 node_modules/jest-diff/build/constants.js delete mode 100644 node_modules/jest-diff/build/diffLines.js delete mode 100644 node_modules/jest-diff/build/diffStrings.js delete mode 100644 node_modules/jest-diff/build/getAlignedDiffs.js create mode 100644 node_modules/jest-diff/build/index.d.mts create mode 100644 node_modules/jest-diff/build/index.mjs delete mode 100644 node_modules/jest-diff/build/joinAlignedDiffs.js delete mode 100644 node_modules/jest-diff/build/normalizeDiffOptions.js delete mode 100644 node_modules/jest-diff/build/printDiffs.js delete mode 100644 node_modules/jest-diff/build/types.js create mode 100644 node_modules/jest-docblock/build/index.d.mts create mode 100644 node_modules/jest-docblock/build/index.mjs delete mode 100644 node_modules/jest-each/build/bind.js create mode 100644 node_modules/jest-each/build/index.d.mts create mode 100644 node_modules/jest-each/build/index.mjs delete mode 100644 node_modules/jest-each/build/table/array.js delete mode 100644 node_modules/jest-each/build/table/interpolation.js delete mode 100644 node_modules/jest-each/build/table/template.js delete mode 100644 node_modules/jest-each/build/validation.js create mode 100644 node_modules/jest-environment-jsdom/build/index.d.mts create mode 100644 node_modules/jest-environment-jsdom/build/index.mjs create mode 100644 node_modules/jest-environment-node/build/index.d.mts create mode 100644 node_modules/jest-environment-node/build/index.mjs delete mode 100644 node_modules/jest-get-type/LICENSE delete mode 100644 node_modules/jest-get-type/build/index.d.ts delete mode 100644 node_modules/jest-get-type/build/index.js delete mode 100644 node_modules/jest-get-type/package.json create mode 100644 node_modules/jest-haste-map/README.md delete mode 100644 node_modules/jest-haste-map/build/HasteFS.js delete mode 100644 node_modules/jest-haste-map/build/ModuleMap.js delete mode 100644 node_modules/jest-haste-map/build/blacklist.js delete mode 100644 node_modules/jest-haste-map/build/constants.js delete mode 100644 node_modules/jest-haste-map/build/crawlers/node.js delete mode 100644 node_modules/jest-haste-map/build/crawlers/watchman.js delete mode 100644 node_modules/jest-haste-map/build/getMockName.js create mode 100644 node_modules/jest-haste-map/build/index.d.mts create mode 100644 node_modules/jest-haste-map/build/index.mjs delete mode 100644 node_modules/jest-haste-map/build/lib/dependencyExtractor.js delete mode 100644 node_modules/jest-haste-map/build/lib/fast_path.js delete mode 100644 node_modules/jest-haste-map/build/lib/getPlatformExtension.js delete mode 100644 node_modules/jest-haste-map/build/lib/isWatchmanInstalled.js delete mode 100644 node_modules/jest-haste-map/build/lib/normalizePathSep.js delete mode 100644 node_modules/jest-haste-map/build/types.js delete mode 100644 node_modules/jest-haste-map/build/watchers/FSEventsWatcher.js delete mode 100644 node_modules/jest-haste-map/build/watchers/NodeWatcher.js delete mode 100644 node_modules/jest-haste-map/build/watchers/RecrawlWarning.js delete mode 100644 node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js delete mode 100644 node_modules/jest-haste-map/build/watchers/common.js create mode 100644 node_modules/jest-haste-map/build/worker.d.mts create mode 100644 node_modules/jest-haste-map/build/worker.mjs create mode 100644 node_modules/jest-leak-detector/build/index.d.mts create mode 100644 node_modules/jest-leak-detector/build/index.mjs delete mode 100644 node_modules/jest-matcher-utils/build/Replaceable.js delete mode 100644 node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js create mode 100644 node_modules/jest-matcher-utils/build/index.d.mts create mode 100644 node_modules/jest-matcher-utils/build/index.mjs create mode 100644 node_modules/jest-message-util/build/index.d.mts create mode 100644 node_modules/jest-message-util/build/index.mjs delete mode 100644 node_modules/jest-message-util/build/types.js create mode 100644 node_modules/jest-mock/build/index.d.mts create mode 100644 node_modules/jest-mock/build/index.mjs create mode 100644 node_modules/jest-regex-util/build/index.mjs create mode 100644 node_modules/jest-resolve-dependencies/build/index.d.mts create mode 100644 node_modules/jest-resolve-dependencies/build/index.mjs delete mode 100644 node_modules/jest-resolve/build/ModuleNotFoundError.js delete mode 100644 node_modules/jest-resolve/build/defaultResolver.js delete mode 100644 node_modules/jest-resolve/build/fileWalkers.js create mode 100644 node_modules/jest-resolve/build/index.d.mts create mode 100644 node_modules/jest-resolve/build/index.mjs delete mode 100644 node_modules/jest-resolve/build/isBuiltinModule.js delete mode 100644 node_modules/jest-resolve/build/nodeModulesPaths.js delete mode 100644 node_modules/jest-resolve/build/resolver.js delete mode 100644 node_modules/jest-resolve/build/shouldLoadAsEsm.js delete mode 100644 node_modules/jest-resolve/build/types.js delete mode 100644 node_modules/jest-resolve/build/utils.js create mode 100644 node_modules/jest-runner/build/index.d.mts create mode 100644 node_modules/jest-runner/build/index.mjs delete mode 100644 node_modules/jest-runner/build/runTest.js create mode 100644 node_modules/jest-runner/build/testWorker.d.mts create mode 100644 node_modules/jest-runner/build/testWorker.mjs delete mode 100644 node_modules/jest-runner/build/types.js delete mode 100644 node_modules/jest-runtime/build/helpers.js create mode 100644 node_modules/jest-runtime/build/index.d.mts create mode 100644 node_modules/jest-runtime/build/index.mjs delete mode 100644 node_modules/jest-snapshot/build/InlineSnapshots.js delete mode 100644 node_modules/jest-snapshot/build/SnapshotResolver.js delete mode 100644 node_modules/jest-snapshot/build/State.js delete mode 100644 node_modules/jest-snapshot/build/colors.js delete mode 100644 node_modules/jest-snapshot/build/dedentLines.js create mode 100644 node_modules/jest-snapshot/build/index.d.mts create mode 100644 node_modules/jest-snapshot/build/index.mjs delete mode 100644 node_modules/jest-snapshot/build/mockSerializer.js delete mode 100644 node_modules/jest-snapshot/build/plugins.js delete mode 100644 node_modules/jest-snapshot/build/printSnapshot.js delete mode 100644 node_modules/jest-snapshot/build/types.js delete mode 100644 node_modules/jest-snapshot/build/utils.js create mode 100644 node_modules/jest-snapshot/build/worker.d.mts create mode 100644 node_modules/jest-snapshot/build/worker.js create mode 100644 node_modules/jest-snapshot/build/worker.mjs delete mode 100644 node_modules/jest-util/build/ErrorWithStack.js create mode 100644 node_modules/jest-util/build/chunk-BQ42LXoh.mjs delete mode 100644 node_modules/jest-util/build/clearLine.js delete mode 100644 node_modules/jest-util/build/convertDescriptorToString.js delete mode 100644 node_modules/jest-util/build/createDirectory.js delete mode 100644 node_modules/jest-util/build/createProcessObject.js delete mode 100644 node_modules/jest-util/build/deepCyclicCopy.js delete mode 100644 node_modules/jest-util/build/formatTime.js delete mode 100644 node_modules/jest-util/build/globsToMatcher.js create mode 100644 node_modules/jest-util/build/index.d.mts create mode 100644 node_modules/jest-util/build/index.mjs delete mode 100644 node_modules/jest-util/build/installCommonGlobals.js delete mode 100644 node_modules/jest-util/build/interopRequireDefault.js delete mode 100644 node_modules/jest-util/build/invariant.js delete mode 100644 node_modules/jest-util/build/isInteractive.js delete mode 100644 node_modules/jest-util/build/isNonNullable.js delete mode 100644 node_modules/jest-util/build/isPromise.js delete mode 100644 node_modules/jest-util/build/pluralize.js delete mode 100644 node_modules/jest-util/build/preRunMessage.js delete mode 100644 node_modules/jest-util/build/replacePathSepForGlob.js delete mode 100644 node_modules/jest-util/build/requireOrImportModule.js delete mode 100644 node_modules/jest-util/build/setGlobal.js delete mode 100644 node_modules/jest-util/build/specialChars.js delete mode 100644 node_modules/jest-util/build/testPathPatternToRegExp.js delete mode 100644 node_modules/jest-util/build/tryRealpath.js create mode 100644 node_modules/jest-util/node_modules/picomatch/LICENSE create mode 100644 node_modules/jest-util/node_modules/picomatch/README.md create mode 100644 node_modules/jest-util/node_modules/picomatch/index.js create mode 100644 node_modules/jest-util/node_modules/picomatch/lib/constants.js create mode 100644 node_modules/jest-util/node_modules/picomatch/lib/parse.js create mode 100644 node_modules/jest-util/node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/jest-util/node_modules/picomatch/lib/scan.js create mode 100644 node_modules/jest-util/node_modules/picomatch/lib/utils.js create mode 100644 node_modules/jest-util/node_modules/picomatch/package.json create mode 100644 node_modules/jest-util/node_modules/picomatch/posix.js delete mode 100644 node_modules/jest-validate/build/condition.js delete mode 100644 node_modules/jest-validate/build/defaultConfig.js delete mode 100644 node_modules/jest-validate/build/deprecated.js delete mode 100644 node_modules/jest-validate/build/errors.js delete mode 100644 node_modules/jest-validate/build/exampleConfig.js create mode 100644 node_modules/jest-validate/build/index.d.mts create mode 100644 node_modules/jest-validate/build/index.mjs delete mode 100644 node_modules/jest-validate/build/types.js delete mode 100644 node_modules/jest-validate/build/utils.js delete mode 100644 node_modules/jest-validate/build/validate.js delete mode 100644 node_modules/jest-validate/build/validateCLIOptions.js delete mode 100644 node_modules/jest-validate/build/warnings.js delete mode 100644 node_modules/jest-watcher/build/BaseWatchPlugin.js delete mode 100644 node_modules/jest-watcher/build/JestHooks.js delete mode 100644 node_modules/jest-watcher/build/PatternPrompt.js delete mode 100644 node_modules/jest-watcher/build/TestWatcher.js delete mode 100644 node_modules/jest-watcher/build/constants.js create mode 100644 node_modules/jest-watcher/build/index.d.mts create mode 100644 node_modules/jest-watcher/build/index.mjs delete mode 100644 node_modules/jest-watcher/build/lib/Prompt.js delete mode 100644 node_modules/jest-watcher/build/lib/colorize.js delete mode 100644 node_modules/jest-watcher/build/lib/formatTestNameByPattern.js delete mode 100644 node_modules/jest-watcher/build/lib/patternModeHelpers.js delete mode 100644 node_modules/jest-watcher/build/lib/scroll.js delete mode 100644 node_modules/jest-watcher/build/types.js delete mode 100644 node_modules/jest-worker/build/Farm.js delete mode 100644 node_modules/jest-worker/build/FifoQueue.js delete mode 100644 node_modules/jest-worker/build/PriorityQueue.js delete mode 100644 node_modules/jest-worker/build/WorkerPool.js delete mode 100644 node_modules/jest-worker/build/base/BaseWorkerPool.js create mode 100644 node_modules/jest-worker/build/index.d.mts create mode 100644 node_modules/jest-worker/build/index.mjs create mode 100644 node_modules/jest-worker/build/processChild.d.mts create mode 100644 node_modules/jest-worker/build/processChild.js create mode 100644 node_modules/jest-worker/build/processChild.mjs create mode 100644 node_modules/jest-worker/build/threadChild.d.mts create mode 100644 node_modules/jest-worker/build/threadChild.js create mode 100644 node_modules/jest-worker/build/threadChild.mjs delete mode 100644 node_modules/jest-worker/build/types.js delete mode 100644 node_modules/jest-worker/build/workers/ChildProcessWorker.js delete mode 100644 node_modules/jest-worker/build/workers/NodeThreadsWorker.js delete mode 100644 node_modules/jest-worker/build/workers/WorkerAbstract.js delete mode 100644 node_modules/jest-worker/build/workers/messageParent.js delete mode 100644 node_modules/jest-worker/build/workers/processChild.js delete mode 100644 node_modules/jest-worker/build/workers/threadChild.js mode change 100644 => 100755 node_modules/jest/bin/jest.js create mode 100644 node_modules/jest/build/index.d.mts create mode 100644 node_modules/jest/build/index.mjs create mode 100644 node_modules/jsdom/lib/jsdom/living/custom-elements/ElementInternals-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/events/SubmitEvent-impl.js rename node_modules/{domexception/lib => jsdom/lib/jsdom/living/generated}/DOMException.js (99%) create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/DOMRect.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/DOMRectInit.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/DOMRectReadOnly.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/ElementInternals.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedPreserveAspectRatio.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedRect.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGDefsElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGDescElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGGElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGMetadataElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGPreserveAspectRatio.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGRect.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGSwitchElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SVGSymbolElement.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SubmitEvent.js create mode 100644 node_modules/jsdom/lib/jsdom/living/generated/SubmitEventInit.js create mode 100644 node_modules/jsdom/lib/jsdom/living/geometry/DOMRect-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/geometry/DOMRectReadOnly-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/helpers/colors.js delete mode 100644 node_modules/jsdom/lib/jsdom/living/helpers/document-base-url.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGDefsElement-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGDescElement-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGGElement-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGMetadataElement-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGSwitchElement-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/nodes/SVGSymbolElement-impl.js delete mode 100644 node_modules/jsdom/lib/jsdom/living/post-message.js create mode 100644 node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedPreserveAspectRatio-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedRect-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/svg/SVGPreserveAspectRatio-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/svg/SVGRect-impl.js create mode 100644 node_modules/jsdom/lib/jsdom/living/webidl/DOMException-impl.js delete mode 100644 node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl-browser.js create mode 100644 node_modules/jsdom/lib/jsdom/living/xhr/multipart-form-data.js delete mode 100644 node_modules/jsdom/lib/jsdom/vm-shim.js delete mode 100644 node_modules/kleur/index.js delete mode 100644 node_modules/kleur/kleur.d.ts delete mode 100644 node_modules/kleur/license delete mode 100644 node_modules/kleur/package.json delete mode 100644 node_modules/kleur/readme.md delete mode 100644 node_modules/math-intrinsics/.eslintrc delete mode 100644 node_modules/math-intrinsics/.github/FUNDING.yml delete mode 100644 node_modules/math-intrinsics/CHANGELOG.md delete mode 100644 node_modules/math-intrinsics/LICENSE delete mode 100644 node_modules/math-intrinsics/README.md delete mode 100644 node_modules/math-intrinsics/abs.d.ts delete mode 100644 node_modules/math-intrinsics/abs.js delete mode 100644 node_modules/math-intrinsics/constants/maxArrayLength.d.ts delete mode 100644 node_modules/math-intrinsics/constants/maxArrayLength.js delete mode 100644 node_modules/math-intrinsics/constants/maxSafeInteger.d.ts delete mode 100644 node_modules/math-intrinsics/constants/maxSafeInteger.js delete mode 100644 node_modules/math-intrinsics/constants/maxValue.d.ts delete mode 100644 node_modules/math-intrinsics/constants/maxValue.js delete mode 100644 node_modules/math-intrinsics/floor.d.ts delete mode 100644 node_modules/math-intrinsics/floor.js delete mode 100644 node_modules/math-intrinsics/isFinite.d.ts delete mode 100644 node_modules/math-intrinsics/isFinite.js delete mode 100644 node_modules/math-intrinsics/isInteger.d.ts delete mode 100644 node_modules/math-intrinsics/isInteger.js delete mode 100644 node_modules/math-intrinsics/isNaN.d.ts delete mode 100644 node_modules/math-intrinsics/isNaN.js delete mode 100644 node_modules/math-intrinsics/isNegativeZero.d.ts delete mode 100644 node_modules/math-intrinsics/isNegativeZero.js delete mode 100644 node_modules/math-intrinsics/max.d.ts delete mode 100644 node_modules/math-intrinsics/max.js delete mode 100644 node_modules/math-intrinsics/min.d.ts delete mode 100644 node_modules/math-intrinsics/min.js delete mode 100644 node_modules/math-intrinsics/mod.d.ts delete mode 100644 node_modules/math-intrinsics/mod.js delete mode 100644 node_modules/math-intrinsics/package.json delete mode 100644 node_modules/math-intrinsics/pow.d.ts delete mode 100644 node_modules/math-intrinsics/pow.js delete mode 100644 node_modules/math-intrinsics/round.d.ts delete mode 100644 node_modules/math-intrinsics/round.js delete mode 100644 node_modules/math-intrinsics/sign.d.ts delete mode 100644 node_modules/math-intrinsics/sign.js delete mode 100644 node_modules/math-intrinsics/test/index.js delete mode 100644 node_modules/math-intrinsics/tsconfig.json delete mode 100644 node_modules/mime-db/HISTORY.md delete mode 100644 node_modules/mime-db/LICENSE delete mode 100644 node_modules/mime-db/README.md delete mode 100644 node_modules/mime-db/db.json delete mode 100644 node_modules/mime-db/index.js delete mode 100644 node_modules/mime-db/package.json delete mode 100644 node_modules/mime-types/HISTORY.md delete mode 100644 node_modules/mime-types/LICENSE delete mode 100644 node_modules/mime-types/README.md delete mode 100644 node_modules/mime-types/index.js delete mode 100644 node_modules/mime-types/package.json create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.js create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map create mode 100644 node_modules/minimatch/dist/commonjs/ast.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/ast.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/ast.js create mode 100644 node_modules/minimatch/dist/commonjs/ast.js.map create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.js create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.js.map create mode 100644 node_modules/minimatch/dist/commonjs/escape.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/escape.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/escape.js create mode 100644 node_modules/minimatch/dist/commonjs/escape.js.map create mode 100644 node_modules/minimatch/dist/commonjs/index.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/index.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/index.js create mode 100644 node_modules/minimatch/dist/commonjs/index.js.map create mode 100644 node_modules/minimatch/dist/commonjs/package.json create mode 100644 node_modules/minimatch/dist/commonjs/unescape.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/unescape.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/unescape.js create mode 100644 node_modules/minimatch/dist/commonjs/unescape.js.map create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.js create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.js.map create mode 100644 node_modules/minimatch/dist/esm/ast.d.ts create mode 100644 node_modules/minimatch/dist/esm/ast.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/ast.js create mode 100644 node_modules/minimatch/dist/esm/ast.js.map create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.d.ts create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.js create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.js.map create mode 100644 node_modules/minimatch/dist/esm/escape.d.ts create mode 100644 node_modules/minimatch/dist/esm/escape.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/escape.js create mode 100644 node_modules/minimatch/dist/esm/escape.js.map create mode 100644 node_modules/minimatch/dist/esm/index.d.ts create mode 100644 node_modules/minimatch/dist/esm/index.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/index.js create mode 100644 node_modules/minimatch/dist/esm/index.js.map create mode 100644 node_modules/minimatch/dist/esm/package.json create mode 100644 node_modules/minimatch/dist/esm/unescape.d.ts create mode 100644 node_modules/minimatch/dist/esm/unescape.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/unescape.js create mode 100644 node_modules/minimatch/dist/esm/unescape.js.map create mode 100644 node_modules/minipass/LICENSE create mode 100644 node_modules/minipass/README.md create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts.map create mode 100644 node_modules/minipass/dist/commonjs/index.js create mode 100644 node_modules/minipass/dist/commonjs/index.js.map create mode 100644 node_modules/minipass/dist/commonjs/package.json create mode 100644 node_modules/minipass/dist/esm/index.d.ts create mode 100644 node_modules/minipass/dist/esm/index.d.ts.map create mode 100644 node_modules/minipass/dist/esm/index.js create mode 100644 node_modules/minipass/dist/esm/index.js.map create mode 100644 node_modules/minipass/dist/esm/package.json create mode 100644 node_modules/minipass/package.json create mode 100644 node_modules/napi-postinstall/LICENSE create mode 100644 node_modules/napi-postinstall/README.md create mode 100644 node_modules/napi-postinstall/lib/cli.d.ts create mode 100755 node_modules/napi-postinstall/lib/cli.js create mode 100644 node_modules/napi-postinstall/lib/cli.js.map create mode 100644 node_modules/napi-postinstall/lib/constants.d.ts create mode 100644 node_modules/napi-postinstall/lib/constants.js create mode 100644 node_modules/napi-postinstall/lib/constants.js.map create mode 100644 node_modules/napi-postinstall/lib/fallback.d.ts create mode 100644 node_modules/napi-postinstall/lib/fallback.js create mode 100644 node_modules/napi-postinstall/lib/fallback.js.map create mode 100644 node_modules/napi-postinstall/lib/helpers.d.ts create mode 100644 node_modules/napi-postinstall/lib/helpers.js create mode 100644 node_modules/napi-postinstall/lib/helpers.js.map create mode 100644 node_modules/napi-postinstall/lib/index.d.ts create mode 100644 node_modules/napi-postinstall/lib/index.js create mode 100644 node_modules/napi-postinstall/lib/index.js.map create mode 100644 node_modules/napi-postinstall/lib/target.d.ts create mode 100644 node_modules/napi-postinstall/lib/target.js create mode 100644 node_modules/napi-postinstall/lib/target.js.map create mode 100644 node_modules/napi-postinstall/lib/types.d.ts rename node_modules/{@tootallnate/once/dist => napi-postinstall/lib}/types.js (100%) rename node_modules/{@tootallnate/once/dist => napi-postinstall/lib}/types.js.map (100%) create mode 100644 node_modules/napi-postinstall/package.json create mode 100644 node_modules/package-json-from-dist/LICENSE.md create mode 100644 node_modules/package-json-from-dist/README.md create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.d.ts create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.js create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.js.map create mode 100644 node_modules/package-json-from-dist/dist/commonjs/package.json create mode 100644 node_modules/package-json-from-dist/dist/esm/index.d.ts create mode 100644 node_modules/package-json-from-dist/dist/esm/index.d.ts.map create mode 100644 node_modules/package-json-from-dist/dist/esm/index.js create mode 100644 node_modules/package-json-from-dist/dist/esm/index.js.map create mode 100644 node_modules/package-json-from-dist/dist/esm/package.json create mode 100644 node_modules/package-json-from-dist/package.json delete mode 100644 node_modules/path-parse/LICENSE delete mode 100644 node_modules/path-parse/README.md delete mode 100644 node_modules/path-parse/index.js delete mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-scurry/LICENSE.md create mode 100644 node_modules/path-scurry/README.md create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/commonjs/index.js create mode 100644 node_modules/path-scurry/dist/commonjs/index.js.map create mode 100644 node_modules/path-scurry/dist/commonjs/package.json create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/esm/index.js create mode 100644 node_modules/path-scurry/dist/esm/index.js.map create mode 100644 node_modules/path-scurry/dist/esm/package.json create mode 100644 node_modules/path-scurry/node_modules/lru-cache/LICENSE create mode 100644 node_modules/path-scurry/node_modules/lru-cache/README.md create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map create mode 100644 node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json create mode 100644 node_modules/path-scurry/node_modules/lru-cache/package.json create mode 100644 node_modules/path-scurry/package.json mode change 100644 => 100755 node_modules/pretty-format/README.md delete mode 100644 node_modules/pretty-format/build/collections.js create mode 100644 node_modules/pretty-format/build/index.d.mts create mode 100644 node_modules/pretty-format/build/index.mjs delete mode 100644 node_modules/pretty-format/build/plugins/AsymmetricMatcher.js delete mode 100644 node_modules/pretty-format/build/plugins/DOMCollection.js delete mode 100644 node_modules/pretty-format/build/plugins/DOMElement.js delete mode 100644 node_modules/pretty-format/build/plugins/Immutable.js delete mode 100644 node_modules/pretty-format/build/plugins/ReactElement.js delete mode 100644 node_modules/pretty-format/build/plugins/ReactTestComponent.js delete mode 100644 node_modules/pretty-format/build/plugins/lib/escapeHTML.js delete mode 100644 node_modules/pretty-format/build/plugins/lib/markup.js delete mode 100644 node_modules/pretty-format/build/types.js delete mode 100644 node_modules/prompts/dist/dateparts/datepart.js delete mode 100644 node_modules/prompts/dist/dateparts/day.js delete mode 100644 node_modules/prompts/dist/dateparts/hours.js delete mode 100644 node_modules/prompts/dist/dateparts/index.js delete mode 100644 node_modules/prompts/dist/dateparts/meridiem.js delete mode 100644 node_modules/prompts/dist/dateparts/milliseconds.js delete mode 100644 node_modules/prompts/dist/dateparts/minutes.js delete mode 100644 node_modules/prompts/dist/dateparts/month.js delete mode 100644 node_modules/prompts/dist/dateparts/seconds.js delete mode 100644 node_modules/prompts/dist/dateparts/year.js delete mode 100644 node_modules/prompts/dist/elements/autocomplete.js delete mode 100644 node_modules/prompts/dist/elements/autocompleteMultiselect.js delete mode 100644 node_modules/prompts/dist/elements/confirm.js delete mode 100644 node_modules/prompts/dist/elements/date.js delete mode 100644 node_modules/prompts/dist/elements/index.js delete mode 100644 node_modules/prompts/dist/elements/multiselect.js delete mode 100644 node_modules/prompts/dist/elements/number.js delete mode 100644 node_modules/prompts/dist/elements/prompt.js delete mode 100644 node_modules/prompts/dist/elements/select.js delete mode 100644 node_modules/prompts/dist/elements/text.js delete mode 100644 node_modules/prompts/dist/elements/toggle.js delete mode 100644 node_modules/prompts/dist/index.js delete mode 100644 node_modules/prompts/dist/prompts.js delete mode 100644 node_modules/prompts/dist/util/action.js delete mode 100644 node_modules/prompts/dist/util/clear.js delete mode 100644 node_modules/prompts/dist/util/entriesToDisplay.js delete mode 100644 node_modules/prompts/dist/util/figures.js delete mode 100644 node_modules/prompts/dist/util/index.js delete mode 100644 node_modules/prompts/dist/util/lines.js delete mode 100644 node_modules/prompts/dist/util/strip.js delete mode 100644 node_modules/prompts/dist/util/style.js delete mode 100644 node_modules/prompts/dist/util/wrap.js delete mode 100644 node_modules/prompts/index.js delete mode 100644 node_modules/prompts/lib/dateparts/datepart.js delete mode 100644 node_modules/prompts/lib/dateparts/day.js delete mode 100644 node_modules/prompts/lib/dateparts/hours.js delete mode 100644 node_modules/prompts/lib/dateparts/index.js delete mode 100644 node_modules/prompts/lib/dateparts/meridiem.js delete mode 100644 node_modules/prompts/lib/dateparts/milliseconds.js delete mode 100644 node_modules/prompts/lib/dateparts/minutes.js delete mode 100644 node_modules/prompts/lib/dateparts/month.js delete mode 100644 node_modules/prompts/lib/dateparts/seconds.js delete mode 100644 node_modules/prompts/lib/dateparts/year.js delete mode 100644 node_modules/prompts/lib/elements/autocomplete.js delete mode 100644 node_modules/prompts/lib/elements/autocompleteMultiselect.js delete mode 100644 node_modules/prompts/lib/elements/confirm.js delete mode 100644 node_modules/prompts/lib/elements/date.js delete mode 100644 node_modules/prompts/lib/elements/index.js delete mode 100644 node_modules/prompts/lib/elements/multiselect.js delete mode 100644 node_modules/prompts/lib/elements/number.js delete mode 100644 node_modules/prompts/lib/elements/prompt.js delete mode 100644 node_modules/prompts/lib/elements/select.js delete mode 100644 node_modules/prompts/lib/elements/text.js delete mode 100644 node_modules/prompts/lib/elements/toggle.js delete mode 100644 node_modules/prompts/lib/index.js delete mode 100644 node_modules/prompts/lib/prompts.js delete mode 100644 node_modules/prompts/lib/util/action.js delete mode 100644 node_modules/prompts/lib/util/clear.js delete mode 100644 node_modules/prompts/lib/util/entriesToDisplay.js delete mode 100644 node_modules/prompts/lib/util/figures.js delete mode 100644 node_modules/prompts/lib/util/index.js delete mode 100644 node_modules/prompts/lib/util/lines.js delete mode 100644 node_modules/prompts/lib/util/strip.js delete mode 100644 node_modules/prompts/lib/util/style.js delete mode 100644 node_modules/prompts/lib/util/wrap.js delete mode 100644 node_modules/prompts/license delete mode 100644 node_modules/prompts/package.json delete mode 100644 node_modules/prompts/readme.md delete mode 100644 node_modules/psl/LICENSE delete mode 100644 node_modules/psl/README.md delete mode 100644 node_modules/psl/SECURITY.md delete mode 100644 node_modules/psl/browserstack-logo.svg delete mode 100644 node_modules/psl/data/rules.js delete mode 100644 node_modules/psl/dist/psl.cjs delete mode 100644 node_modules/psl/dist/psl.mjs delete mode 100644 node_modules/psl/dist/psl.umd.cjs delete mode 100644 node_modules/psl/index.js delete mode 100644 node_modules/psl/package.json delete mode 100644 node_modules/psl/types/index.d.ts delete mode 100644 node_modules/psl/types/test.ts delete mode 100644 node_modules/psl/types/tsconfig.json delete mode 100644 node_modules/psl/vite.config.js delete mode 100644 node_modules/pure-rand/lib/distribution/Distribution.js create mode 100644 node_modules/pure-rand/lib/distribution/GenerateN.js create mode 100644 node_modules/pure-rand/lib/distribution/SkipN.js create mode 100644 node_modules/pure-rand/lib/distribution/UnsafeGenerateN.js create mode 100644 node_modules/pure-rand/lib/distribution/UnsafeSkipN.js create mode 100644 node_modules/pure-rand/lib/distribution/internals/ArrayInt64.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/GenerateN.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/SkipN.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UnsafeGenerateN.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UnsafeSkipN.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt64.js delete mode 100644 node_modules/pure-rand/lib/esm/generator/RandomGenerator.js create mode 100644 node_modules/pure-rand/lib/esm/types/Distribution.js create mode 100644 node_modules/pure-rand/lib/esm/types/RandomGenerator.js delete mode 100644 node_modules/pure-rand/lib/esm/types/distribution/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/GenerateN.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/SkipN.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UnsafeGenerateN.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UnsafeSkipN.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt64.d.ts delete mode 100644 node_modules/pure-rand/lib/esm/types/generator/RandomGenerator.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/types/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/types/RandomGenerator.d.ts delete mode 100644 node_modules/pure-rand/lib/generator/RandomGenerator.js create mode 100644 node_modules/pure-rand/lib/types/Distribution.js create mode 100644 node_modules/pure-rand/lib/types/RandomGenerator.js delete mode 100644 node_modules/pure-rand/lib/types/distribution/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/GenerateN.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/SkipN.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UnsafeGenerateN.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UnsafeSkipN.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/internals/ArrayInt64.d.ts delete mode 100644 node_modules/pure-rand/lib/types/generator/RandomGenerator.d.ts create mode 100644 node_modules/pure-rand/lib/types/types/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/types/RandomGenerator.d.ts delete mode 100644 node_modules/querystringify/LICENSE delete mode 100644 node_modules/querystringify/README.md delete mode 100644 node_modules/querystringify/index.js delete mode 100644 node_modules/querystringify/package.json delete mode 100644 node_modules/requires-port/.npmignore delete mode 100644 node_modules/requires-port/.travis.yml delete mode 100644 node_modules/requires-port/LICENSE delete mode 100644 node_modules/requires-port/README.md delete mode 100644 node_modules/requires-port/index.js delete mode 100644 node_modules/requires-port/package.json delete mode 100644 node_modules/requires-port/test.js delete mode 100644 node_modules/resolve.exports/dist/index.js delete mode 100644 node_modules/resolve.exports/dist/index.mjs delete mode 100644 node_modules/resolve.exports/index.d.ts delete mode 100644 node_modules/resolve.exports/license delete mode 100644 node_modules/resolve.exports/package.json delete mode 100644 node_modules/resolve.exports/readme.md delete mode 100644 node_modules/resolve/.editorconfig delete mode 100644 node_modules/resolve/.eslintrc delete mode 100644 node_modules/resolve/.github/FUNDING.yml delete mode 100644 node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md delete mode 100644 node_modules/resolve/.github/THREAT_MODEL.md delete mode 100644 node_modules/resolve/LICENSE delete mode 100644 node_modules/resolve/SECURITY.md delete mode 100644 node_modules/resolve/async.js delete mode 100644 node_modules/resolve/bin/resolve delete mode 100644 node_modules/resolve/example/async.js delete mode 100644 node_modules/resolve/example/sync.js delete mode 100644 node_modules/resolve/index.js delete mode 100644 node_modules/resolve/lib/async.js delete mode 100644 node_modules/resolve/lib/caller.js delete mode 100644 node_modules/resolve/lib/core.js delete mode 100644 node_modules/resolve/lib/core.json delete mode 100644 node_modules/resolve/lib/homedir.js delete mode 100644 node_modules/resolve/lib/is-core.js delete mode 100644 node_modules/resolve/lib/node-modules-paths.js delete mode 100644 node_modules/resolve/lib/normalize-options.js delete mode 100644 node_modules/resolve/lib/sync.js delete mode 100644 node_modules/resolve/package.json delete mode 100644 node_modules/resolve/readme.markdown delete mode 100644 node_modules/resolve/sync.js delete mode 100644 node_modules/resolve/test/core.js delete mode 100644 node_modules/resolve/test/dotdot.js delete mode 100644 node_modules/resolve/test/dotdot/abc/index.js delete mode 100644 node_modules/resolve/test/dotdot/index.js delete mode 100644 node_modules/resolve/test/faulty_basedir.js delete mode 100644 node_modules/resolve/test/filter.js delete mode 100644 node_modules/resolve/test/filter_sync.js delete mode 100644 node_modules/resolve/test/home_paths.js delete mode 100644 node_modules/resolve/test/home_paths_sync.js delete mode 100644 node_modules/resolve/test/mock.js delete mode 100644 node_modules/resolve/test/mock_sync.js delete mode 100644 node_modules/resolve/test/module_dir.js delete mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json delete mode 100644 node_modules/resolve/test/node-modules-paths.js delete mode 100644 node_modules/resolve/test/node_path.js delete mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js delete mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js delete mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js delete mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js delete mode 100644 node_modules/resolve/test/nonstring.js delete mode 100644 node_modules/resolve/test/pathfilter.js delete mode 100644 node_modules/resolve/test/precedence.js delete mode 100644 node_modules/resolve/test/precedence/aaa.js delete mode 100644 node_modules/resolve/test/precedence/aaa/index.js delete mode 100644 node_modules/resolve/test/precedence/aaa/main.js delete mode 100644 node_modules/resolve/test/precedence/bbb.js delete mode 100644 node_modules/resolve/test/precedence/bbb/main.js delete mode 100644 node_modules/resolve/test/resolver.js delete mode 100644 node_modules/resolve/test/resolver/baz/doom.js delete mode 100644 node_modules/resolve/test/resolver/baz/package.json delete mode 100644 node_modules/resolve/test/resolver/baz/quux.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/a.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/b.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/package.json delete mode 100644 node_modules/resolve/test/resolver/cup.coffee delete mode 100644 node_modules/resolve/test/resolver/dot_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_main/package.json delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json delete mode 100644 node_modules/resolve/test/resolver/false_main/index.js delete mode 100644 node_modules/resolve/test/resolver/false_main/package.json delete mode 100644 node_modules/resolve/test/resolver/foo.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json delete mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json delete mode 100644 node_modules/resolve/test/resolver/mug.coffee delete mode 100644 node_modules/resolve/test/resolver/mug.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js delete mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js delete mode 100644 node_modules/resolve/test/resolver/other_path/root.js delete mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json delete mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js delete mode 100644 node_modules/resolve/test/resolver_sync.js delete mode 100644 node_modules/resolve/test/shadowed_core.js delete mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js delete mode 100644 node_modules/resolve/test/subdirs.js delete mode 100644 node_modules/resolve/test/symlinks.js rename node_modules/{cssom => rrweb-cssom}/LICENSE.txt (100%) create mode 100644 node_modules/rrweb-cssom/README.mdown create mode 100644 node_modules/rrweb-cssom/build/CSSOM.js rename node_modules/{cssom => rrweb-cssom}/lib/CSSConditionRule.js (100%) create mode 100644 node_modules/rrweb-cssom/lib/CSSContainerRule.js rename node_modules/{cssom => rrweb-cssom}/lib/CSSDocumentRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSFontFaceRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSGroupingRule.js (96%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSHostRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSImportRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSKeyframeRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSKeyframesRule.js (100%) create mode 100644 node_modules/rrweb-cssom/lib/CSSLayerBlockRule.js rename node_modules/{cssom => rrweb-cssom}/lib/CSSMediaRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSOM.js (100%) create mode 100644 node_modules/rrweb-cssom/lib/CSSRule.js create mode 100644 node_modules/rrweb-cssom/lib/CSSStartingStyleRule.js rename node_modules/{cssom => rrweb-cssom}/lib/CSSStyleDeclaration.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSStyleRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSStyleSheet.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSSupportsRule.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSValue.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/CSSValueExpression.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/MatcherList.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/MediaList.js (100%) rename node_modules/{cssom => rrweb-cssom}/lib/StyleSheet.js (100%) create mode 100644 node_modules/rrweb-cssom/lib/clone.js create mode 100644 node_modules/rrweb-cssom/lib/index.js create mode 100644 node_modules/rrweb-cssom/lib/parse.js create mode 100644 node_modules/rrweb-cssom/package.json create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/browser.js create mode 100644 node_modules/signal-exit/dist/cjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/index.js create mode 100644 node_modules/signal-exit/dist/cjs/index.js.map create mode 100644 node_modules/signal-exit/dist/cjs/package.json create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/signals.js create mode 100644 node_modules/signal-exit/dist/cjs/signals.js.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.js create mode 100644 node_modules/signal-exit/dist/mjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/index.js create mode 100644 node_modules/signal-exit/dist/mjs/index.js.map create mode 100644 node_modules/signal-exit/dist/mjs/package.json create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/signals.js create mode 100644 node_modules/signal-exit/dist/mjs/signals.js.map delete mode 100644 node_modules/sisteransi/license delete mode 100644 node_modules/sisteransi/package.json delete mode 100644 node_modules/sisteransi/readme.md delete mode 100644 node_modules/sisteransi/src/index.js delete mode 100644 node_modules/sisteransi/src/sisteransi.d.ts create mode 100644 node_modules/string-length/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/string-length/node_modules/ansi-regex/index.js create mode 100644 node_modules/string-length/node_modules/ansi-regex/license create mode 100644 node_modules/string-length/node_modules/ansi-regex/package.json create mode 100644 node_modules/string-length/node_modules/ansi-regex/readme.md create mode 100644 node_modules/string-length/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/string-length/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-length/node_modules/strip-ansi/license create mode 100644 node_modules/string-length/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-length/node_modules/strip-ansi/readme.md create mode 100644 node_modules/string-width-cjs/index.d.ts create mode 100644 node_modules/string-width-cjs/index.js create mode 100644 node_modules/string-width-cjs/license create mode 100644 node_modules/string-width-cjs/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/string-width-cjs/node_modules/ansi-regex/index.js create mode 100644 node_modules/string-width-cjs/node_modules/ansi-regex/license create mode 100644 node_modules/string-width-cjs/node_modules/ansi-regex/package.json create mode 100644 node_modules/string-width-cjs/node_modules/ansi-regex/readme.md create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/README.md create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/index.js create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/package.json create mode 100644 node_modules/string-width-cjs/node_modules/emoji-regex/text.js create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/readme.md create mode 100644 node_modules/string-width-cjs/package.json create mode 100644 node_modules/string-width-cjs/readme.md create mode 100644 node_modules/strip-ansi-cjs/index.d.ts create mode 100644 node_modules/strip-ansi-cjs/index.js create mode 100644 node_modules/strip-ansi-cjs/license create mode 100644 node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js create mode 100644 node_modules/strip-ansi-cjs/node_modules/ansi-regex/license create mode 100644 node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json create mode 100644 node_modules/strip-ansi-cjs/node_modules/ansi-regex/readme.md create mode 100644 node_modules/strip-ansi-cjs/package.json create mode 100644 node_modules/strip-ansi-cjs/readme.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc delete mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml delete mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc delete mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE delete mode 100644 node_modules/supports-preserve-symlinks-flag/README.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js delete mode 100644 node_modules/supports-preserve-symlinks-flag/index.js delete mode 100644 node_modules/supports-preserve-symlinks-flag/package.json delete mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 node_modules/synckit/LICENSE create mode 100644 node_modules/synckit/README.md create mode 100644 node_modules/synckit/lib/common.d.ts create mode 100644 node_modules/synckit/lib/common.js create mode 100644 node_modules/synckit/lib/common.js.map create mode 100644 node_modules/synckit/lib/constants.d.ts create mode 100644 node_modules/synckit/lib/constants.js create mode 100644 node_modules/synckit/lib/constants.js.map create mode 100644 node_modules/synckit/lib/helpers.d.ts create mode 100644 node_modules/synckit/lib/helpers.js create mode 100644 node_modules/synckit/lib/helpers.js.map create mode 100644 node_modules/synckit/lib/index.cjs create mode 100644 node_modules/synckit/lib/index.d.cts create mode 100644 node_modules/synckit/lib/index.d.ts create mode 100644 node_modules/synckit/lib/index.js create mode 100644 node_modules/synckit/lib/index.js.map create mode 100644 node_modules/synckit/lib/types.d.ts create mode 100644 node_modules/synckit/lib/types.js create mode 100644 node_modules/synckit/lib/types.js.map create mode 100644 node_modules/synckit/package.json create mode 100644 node_modules/test-exclude/node_modules/brace-expansion/LICENSE create mode 100644 node_modules/test-exclude/node_modules/brace-expansion/README.md create mode 100644 node_modules/test-exclude/node_modules/brace-expansion/index.js create mode 100644 node_modules/test-exclude/node_modules/brace-expansion/package.json create mode 100644 node_modules/test-exclude/node_modules/glob/LICENSE create mode 100644 node_modules/test-exclude/node_modules/glob/README.md rename node_modules/{ => test-exclude/node_modules}/glob/common.js (100%) rename node_modules/{ => test-exclude/node_modules}/glob/glob.js (100%) create mode 100644 node_modules/test-exclude/node_modules/glob/package.json rename node_modules/{ => test-exclude/node_modules}/glob/sync.js (100%) create mode 100644 node_modules/test-exclude/node_modules/minimatch/LICENSE create mode 100644 node_modules/test-exclude/node_modules/minimatch/README.md rename node_modules/{ => test-exclude/node_modules}/minimatch/minimatch.js (100%) create mode 100644 node_modules/test-exclude/node_modules/minimatch/package.json create mode 100644 node_modules/tldts-core/LICENSE create mode 100644 node_modules/tldts-core/README.md create mode 100644 node_modules/tldts-core/dist/cjs/index.js create mode 100644 node_modules/tldts-core/dist/cjs/index.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js create mode 100644 node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/domain.js create mode 100644 node_modules/tldts-core/dist/cjs/src/domain.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/extract-hostname.js create mode 100644 node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/factory.js create mode 100644 node_modules/tldts-core/dist/cjs/src/factory.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/is-ip.js create mode 100644 node_modules/tldts-core/dist/cjs/src/is-ip.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/is-valid.js create mode 100644 node_modules/tldts-core/dist/cjs/src/is-valid.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js create mode 100644 node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/lookup/interface.js create mode 100644 node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/options.js create mode 100644 node_modules/tldts-core/dist/cjs/src/options.js.map create mode 100644 node_modules/tldts-core/dist/cjs/src/subdomain.js create mode 100644 node_modules/tldts-core/dist/cjs/src/subdomain.js.map create mode 100644 node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo create mode 100644 node_modules/tldts-core/dist/es6/index.js create mode 100644 node_modules/tldts-core/dist/es6/index.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/domain-without-suffix.js create mode 100644 node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/domain.js create mode 100644 node_modules/tldts-core/dist/es6/src/domain.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/extract-hostname.js create mode 100644 node_modules/tldts-core/dist/es6/src/extract-hostname.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/factory.js create mode 100644 node_modules/tldts-core/dist/es6/src/factory.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/is-ip.js create mode 100644 node_modules/tldts-core/dist/es6/src/is-ip.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/is-valid.js create mode 100644 node_modules/tldts-core/dist/es6/src/is-valid.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/lookup/fast-path.js create mode 100644 node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/lookup/interface.js create mode 100644 node_modules/tldts-core/dist/es6/src/lookup/interface.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/options.js create mode 100644 node_modules/tldts-core/dist/es6/src/options.js.map create mode 100644 node_modules/tldts-core/dist/es6/src/subdomain.js create mode 100644 node_modules/tldts-core/dist/es6/src/subdomain.js.map create mode 100644 node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo create mode 100644 node_modules/tldts-core/dist/types/index.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/domain.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/extract-hostname.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/factory.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/is-ip.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/is-valid.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/lookup/interface.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/options.d.ts create mode 100644 node_modules/tldts-core/dist/types/src/subdomain.d.ts create mode 100644 node_modules/tldts-core/index.ts create mode 100644 node_modules/tldts-core/package.json create mode 100644 node_modules/tldts-core/src/domain-without-suffix.ts create mode 100644 node_modules/tldts-core/src/domain.ts create mode 100644 node_modules/tldts-core/src/extract-hostname.ts create mode 100644 node_modules/tldts-core/src/factory.ts create mode 100644 node_modules/tldts-core/src/is-ip.ts create mode 100644 node_modules/tldts-core/src/is-valid.ts create mode 100644 node_modules/tldts-core/src/lookup/fast-path.ts create mode 100644 node_modules/tldts-core/src/lookup/interface.ts create mode 100644 node_modules/tldts-core/src/options.ts create mode 100644 node_modules/tldts-core/src/subdomain.ts create mode 100644 node_modules/tldts/LICENSE create mode 100644 node_modules/tldts/README.md create mode 100755 node_modules/tldts/bin/cli.js create mode 100644 node_modules/tldts/dist/cjs/index.js create mode 100644 node_modules/tldts/dist/cjs/index.js.map create mode 100644 node_modules/tldts/dist/cjs/src/data/trie.js create mode 100644 node_modules/tldts/dist/cjs/src/data/trie.js.map create mode 100644 node_modules/tldts/dist/cjs/src/suffix-trie.js create mode 100644 node_modules/tldts/dist/cjs/src/suffix-trie.js.map create mode 100644 node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo create mode 100644 node_modules/tldts/dist/es6/index.js create mode 100644 node_modules/tldts/dist/es6/index.js.map create mode 100644 node_modules/tldts/dist/es6/src/data/trie.js create mode 100644 node_modules/tldts/dist/es6/src/data/trie.js.map create mode 100644 node_modules/tldts/dist/es6/src/suffix-trie.js create mode 100644 node_modules/tldts/dist/es6/src/suffix-trie.js.map create mode 100644 node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo create mode 100644 node_modules/tldts/dist/index.cjs.min.js create mode 100644 node_modules/tldts/dist/index.cjs.min.js.map create mode 100644 node_modules/tldts/dist/index.esm.min.js create mode 100644 node_modules/tldts/dist/index.esm.min.js.map create mode 100644 node_modules/tldts/dist/index.umd.min.js create mode 100644 node_modules/tldts/dist/index.umd.min.js.map create mode 100644 node_modules/tldts/dist/types/index.d.ts create mode 100644 node_modules/tldts/dist/types/src/data/trie.d.ts create mode 100644 node_modules/tldts/dist/types/src/suffix-trie.d.ts create mode 100644 node_modules/tldts/index.ts create mode 100644 node_modules/tldts/package.json create mode 100644 node_modules/tldts/src/data/trie.ts create mode 100644 node_modules/tldts/src/suffix-trie.ts create mode 100644 node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/canonicalDomain.js create mode 100644 node_modules/tough-cookie/dist/cookie/constants.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/constants.js create mode 100644 node_modules/tough-cookie/dist/cookie/cookie.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/cookie.js create mode 100644 node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/cookieCompare.js create mode 100644 node_modules/tough-cookie/dist/cookie/cookieJar.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/cookieJar.js create mode 100644 node_modules/tough-cookie/dist/cookie/defaultPath.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/defaultPath.js create mode 100644 node_modules/tough-cookie/dist/cookie/domainMatch.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/domainMatch.js create mode 100644 node_modules/tough-cookie/dist/cookie/formatDate.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/formatDate.js create mode 100644 node_modules/tough-cookie/dist/cookie/index.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/index.js create mode 100644 node_modules/tough-cookie/dist/cookie/parseDate.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/parseDate.js create mode 100644 node_modules/tough-cookie/dist/cookie/permutePath.d.ts create mode 100644 node_modules/tough-cookie/dist/cookie/permutePath.js create mode 100644 node_modules/tough-cookie/dist/getPublicSuffix.d.ts create mode 100644 node_modules/tough-cookie/dist/getPublicSuffix.js create mode 100644 node_modules/tough-cookie/dist/memstore.d.ts create mode 100644 node_modules/tough-cookie/dist/memstore.js create mode 100644 node_modules/tough-cookie/dist/pathMatch.d.ts create mode 100644 node_modules/tough-cookie/dist/pathMatch.js create mode 100644 node_modules/tough-cookie/dist/permuteDomain.d.ts create mode 100644 node_modules/tough-cookie/dist/permuteDomain.js create mode 100644 node_modules/tough-cookie/dist/store.d.ts create mode 100644 node_modules/tough-cookie/dist/store.js create mode 100644 node_modules/tough-cookie/dist/utils.d.ts create mode 100644 node_modules/tough-cookie/dist/utils.js create mode 100644 node_modules/tough-cookie/dist/validators.d.ts create mode 100644 node_modules/tough-cookie/dist/validators.js create mode 100644 node_modules/tough-cookie/dist/version.d.ts create mode 100644 node_modules/tough-cookie/dist/version.js delete mode 100644 node_modules/tough-cookie/lib/cookie.js delete mode 100644 node_modules/tough-cookie/lib/memstore.js delete mode 100644 node_modules/tough-cookie/lib/pathMatch.js delete mode 100644 node_modules/tough-cookie/lib/permuteDomain.js delete mode 100644 node_modules/tough-cookie/lib/pubsuffix-psl.js delete mode 100644 node_modules/tough-cookie/lib/store.js delete mode 100644 node_modules/tough-cookie/lib/utilHelper.js delete mode 100644 node_modules/tough-cookie/lib/validators.js delete mode 100644 node_modules/tough-cookie/lib/version.js delete mode 100644 node_modules/universalify/LICENSE delete mode 100644 node_modules/universalify/README.md delete mode 100644 node_modules/universalify/index.js delete mode 100644 node_modules/universalify/package.json create mode 100644 node_modules/unrs-resolver/README.md create mode 100644 node_modules/unrs-resolver/browser.js create mode 100644 node_modules/unrs-resolver/index.d.ts create mode 100644 node_modules/unrs-resolver/index.js create mode 100644 node_modules/unrs-resolver/package.json mode change 100644 => 100755 node_modules/update-browserslist-db/cli.js delete mode 100644 node_modules/url-parse/LICENSE delete mode 100644 node_modules/url-parse/README.md delete mode 100644 node_modules/url-parse/dist/url-parse.js delete mode 100644 node_modules/url-parse/dist/url-parse.min.js delete mode 100644 node_modules/url-parse/dist/url-parse.min.js.map delete mode 100644 node_modules/url-parse/index.js delete mode 100644 node_modules/url-parse/package.json create mode 100755 node_modules/wrap-ansi-cjs/index.js create mode 100644 node_modules/wrap-ansi-cjs/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/ansi-regex/readme.md create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/README.md create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/emoji-regex/text.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/readme.md create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/readme.md create mode 100644 node_modules/wrap-ansi-cjs/package.json create mode 100644 node_modules/wrap-ansi-cjs/readme.md create mode 100644 node_modules/wrap-ansi/index.d.ts mode change 100644 => 100755 node_modules/wrap-ansi/index.js create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.js create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/license create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/package.json create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/readme.md create mode 100644 node_modules/yargs/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/yargs/node_modules/ansi-regex/index.js create mode 100644 node_modules/yargs/node_modules/ansi-regex/license create mode 100644 node_modules/yargs/node_modules/ansi-regex/package.json create mode 100644 node_modules/yargs/node_modules/ansi-regex/readme.md create mode 100644 node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/yargs/node_modules/emoji-regex/README.md create mode 100644 node_modules/yargs/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/yargs/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/yargs/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/yargs/node_modules/emoji-regex/index.js create mode 100644 node_modules/yargs/node_modules/emoji-regex/package.json create mode 100644 node_modules/yargs/node_modules/emoji-regex/text.js create mode 100644 node_modules/yargs/node_modules/string-width/index.d.ts create mode 100644 node_modules/yargs/node_modules/string-width/index.js create mode 100644 node_modules/yargs/node_modules/string-width/license create mode 100644 node_modules/yargs/node_modules/string-width/package.json create mode 100644 node_modules/yargs/node_modules/string-width/readme.md create mode 100644 node_modules/yargs/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/yargs/node_modules/strip-ansi/index.js create mode 100644 node_modules/yargs/node_modules/strip-ansi/license create mode 100644 node_modules/yargs/node_modules/strip-ansi/package.json create mode 100644 node_modules/yargs/node_modules/strip-ansi/readme.md create mode 100644 tests/unit/systems/AchievementSystem.test.js create mode 100644 tests/unit/utils/SaveSystem.test.js diff --git a/framework/systems/AchievementSystem.js b/framework/systems/AchievementSystem.js new file mode 100644 index 00000000..a6064375 --- /dev/null +++ b/framework/systems/AchievementSystem.js @@ -0,0 +1,446 @@ +/** + * AchievementSystem - Framework system for tracking player accomplishments + * Supports multiple achievement types, progress tracking, and persistence + */ +export class AchievementSystem { + /** + * @param {Object} config - Achievement system configuration + * @param {string} config.gameId - Unique identifier for this game (required for persistence) + * @param {boolean} config.enableNotifications - Show achievement unlock notifications (default: true) + * @param {number} config.notificationDuration - Notification display duration in ms (default: 3000) + */ + constructor(config = {}) { + this.gameId = config.gameId; + this.enableNotifications = config.enableNotifications !== false; + this.notificationDuration = config.notificationDuration || 3000; + + // Achievement storage + this.achievements = new Map(); // id -> achievement definition + this.unlockedAchievements = new Set(); // Set of unlocked achievement IDs + this.progressData = new Map(); // id -> current progress value + + // Event callbacks + this.onUnlockCallbacks = []; + this.onProgressCallbacks = []; + + // Notification queue + this.notificationQueue = []; + this.activeNotification = null; + + // Check localStorage availability + this.storageAvailable = this._checkStorageAvailable(); + + // Load saved achievements + if (this.storageAvailable && this.gameId) { + this._loadFromStorage(); + } + } + + /** + * Check if localStorage is available + * @private + * @returns {boolean} True if localStorage is available + */ + _checkStorageAvailable() { + try { + const test = '__storage_test__'; + localStorage.setItem(test, test); + localStorage.removeItem(test); + return true; + } catch (e) { + return false; + } + } + + /** + * Get storage key + * @private + * @returns {string} Storage key + */ + _getStorageKey() { + return `${this.gameId}_achievements`; + } + + /** + * Load achievements from localStorage + * @private + */ + _loadFromStorage() { + try { + const key = this._getStorageKey(); + const data = localStorage.getItem(key); + if (data) { + const saved = JSON.parse(data); + this.unlockedAchievements = new Set(saved.unlocked || []); + this.progressData = new Map(Object.entries(saved.progress || {})); + } + } catch (error) { + console.error('Failed to load achievements from storage:', error); + } + } + + /** + * Save achievements to localStorage + * @private + */ + _saveToStorage() { + if (!this.storageAvailable || !this.gameId) { + return; + } + + try { + const key = this._getStorageKey(); + const data = { + unlocked: Array.from(this.unlockedAchievements), + progress: Object.fromEntries(this.progressData) + }; + localStorage.setItem(key, JSON.stringify(data)); + } catch (error) { + console.error('Failed to save achievements to storage:', error); + } + } + + /** + * Register an achievement + * @param {Object} achievement - Achievement definition + * @param {string} achievement.id - Unique achievement identifier + * @param {string} achievement.name - Display name + * @param {string} achievement.description - Achievement description + * @param {string} achievement.type - Achievement type: 'simple', 'progress', 'secret', 'challenge' + * @param {number} achievement.target - Target value for progress achievements + * @param {boolean} achievement.hidden - Hide achievement until unlocked (default: false) + * @param {Object} achievement.reward - Optional reward data + */ + registerAchievement(achievement) { + if (!achievement.id) { + throw new Error('Achievement must have an id'); + } + + if (!achievement.name) { + throw new Error('Achievement must have a name'); + } + + if (!achievement.type) { + achievement.type = 'simple'; + } + + // Validate achievement type + const validTypes = ['simple', 'progress', 'secret', 'challenge']; + if (!validTypes.includes(achievement.type)) { + throw new Error(`Invalid achievement type: ${achievement.type}`); + } + + // Validate progress achievement has target + if (achievement.type === 'progress' && !achievement.target) { + throw new Error('Progress achievements must have a target value'); + } + + this.achievements.set(achievement.id, { + ...achievement, + hidden: achievement.hidden || false, + reward: achievement.reward || null + }); + + // Initialize progress for progress achievements + if (achievement.type === 'progress' && !this.progressData.has(achievement.id)) { + this.progressData.set(achievement.id, 0); + } + } + + /** + * Unlock an achievement + * @param {string} id - Achievement ID + * @returns {boolean} True if achievement was newly unlocked + */ + unlock(id) { + if (!this.achievements.has(id)) { + console.warn(`Achievement ${id} not registered`); + return false; + } + + if (this.unlockedAchievements.has(id)) { + return false; // Already unlocked + } + + const achievement = this.achievements.get(id); + this.unlockedAchievements.add(id); + this._saveToStorage(); + + // Trigger callbacks + this.onUnlockCallbacks.forEach(callback => { + try { + callback(achievement); + } catch (error) { + console.error('Error in unlock callback:', error); + } + }); + + // Show notification + if (this.enableNotifications) { + this._queueNotification(achievement); + } + + return true; + } + + /** + * Update progress for a progress-type achievement + * @param {string} id - Achievement ID + * @param {number} value - New progress value + * @param {boolean} increment - If true, add to current progress instead of setting (default: false) + */ + updateProgress(id, value, increment = false) { + if (!this.achievements.has(id)) { + console.warn(`Achievement ${id} not registered`); + return; + } + + const achievement = this.achievements.get(id); + if (achievement.type !== 'progress') { + console.warn(`Achievement ${id} is not a progress achievement`); + return; + } + + if (this.unlockedAchievements.has(id)) { + return; // Already unlocked + } + + const currentProgress = this.progressData.get(id) || 0; + const newProgress = increment ? currentProgress + value : value; + const clampedProgress = Math.max(0, Math.min(newProgress, achievement.target)); + + this.progressData.set(id, clampedProgress); + this._saveToStorage(); + + // Trigger progress callbacks + this.onProgressCallbacks.forEach(callback => { + try { + callback(achievement, clampedProgress, achievement.target); + } catch (error) { + console.error('Error in progress callback:', error); + } + }); + + // Check if target reached + if (clampedProgress >= achievement.target) { + this.unlock(id); + } + } + + /** + * Increment progress for a progress-type achievement + * @param {string} id - Achievement ID + * @param {number} amount - Amount to increment (default: 1) + */ + incrementProgress(id, amount = 1) { + this.updateProgress(id, amount, true); + } + + /** + * Check if an achievement is unlocked + * @param {string} id - Achievement ID + * @returns {boolean} True if unlocked + */ + isUnlocked(id) { + return this.unlockedAchievements.has(id); + } + + /** + * Get achievement progress + * @param {string} id - Achievement ID + * @returns {Object|null} Object with current and target, or null + */ + getProgress(id) { + if (!this.achievements.has(id)) { + return null; + } + + const achievement = this.achievements.get(id); + if (achievement.type !== 'progress') { + return null; + } + + return { + current: this.progressData.get(id) || 0, + target: achievement.target, + percentage: ((this.progressData.get(id) || 0) / achievement.target) * 100 + }; + } + + /** + * Get all registered achievements + * @param {boolean} includeHidden - Include hidden/secret achievements (default: false) + * @returns {Array} Array of achievement objects with unlock status + */ + getAllAchievements(includeHidden = false) { + const achievements = []; + + for (const [id, achievement] of this.achievements) { + const isUnlocked = this.unlockedAchievements.has(id); + + // Skip hidden achievements unless unlocked or includeHidden is true + if (achievement.hidden && !isUnlocked && !includeHidden) { + continue; + } + + const achievementData = { + id, + name: achievement.name, + description: achievement.description, + type: achievement.type, + unlocked: isUnlocked, + reward: achievement.reward + }; + + // Add progress for progress achievements + if (achievement.type === 'progress') { + achievementData.progress = this.getProgress(id); + } + + achievements.push(achievementData); + } + + return achievements; + } + + /** + * Get unlocked achievements + * @returns {Array} Array of unlocked achievement objects + */ + getUnlockedAchievements() { + return this.getAllAchievements(true).filter(a => a.unlocked); + } + + /** + * Get locked achievements + * @param {boolean} includeHidden - Include hidden/secret achievements (default: false) + * @returns {Array} Array of locked achievement objects + */ + getLockedAchievements(includeHidden = false) { + return this.getAllAchievements(includeHidden).filter(a => !a.unlocked); + } + + /** + * Get achievement statistics + * @returns {Object} Statistics object + */ + getStats() { + const total = this.achievements.size; + const unlocked = this.unlockedAchievements.size; + const locked = total - unlocked; + const percentage = total > 0 ? (unlocked / total) * 100 : 0; + + return { + total, + unlocked, + locked, + percentage: Math.round(percentage * 100) / 100 + }; + } + + /** + * Reset all achievements + * @param {boolean} keepDefinitions - Keep achievement definitions (default: true) + */ + reset(keepDefinitions = true) { + this.unlockedAchievements.clear(); + this.progressData.clear(); + + if (!keepDefinitions) { + this.achievements.clear(); + } else { + // Reset progress for progress achievements + for (const [id, achievement] of this.achievements) { + if (achievement.type === 'progress') { + this.progressData.set(id, 0); + } + } + } + + this._saveToStorage(); + } + + /** + * Register callback for achievement unlock events + * @param {Function} callback - Callback function(achievement) + */ + onUnlock(callback) { + this.onUnlockCallbacks.push(callback); + } + + /** + * Register callback for achievement progress events + * @param {Function} callback - Callback function(achievement, current, target) + */ + onProgress(callback) { + this.onProgressCallbacks.push(callback); + } + + /** + * Queue achievement notification + * @private + * @param {Object} achievement - Achievement object + */ + _queueNotification(achievement) { + this.notificationQueue.push(achievement); + + if (!this.activeNotification) { + this._showNextNotification(); + } + } + + /** + * Show next notification in queue + * @private + */ + _showNextNotification() { + if (this.notificationQueue.length === 0) { + this.activeNotification = null; + return; + } + + const achievement = this.notificationQueue.shift(); + this.activeNotification = achievement; + + // Create notification element + this._displayNotification(achievement); + + // Auto-hide after duration + setTimeout(() => { + this._hideNotification(); + this._showNextNotification(); + }, this.notificationDuration); + } + + /** + * Display notification (can be overridden for custom UI) + * @private + * @param {Object} achievement - Achievement object + */ + _displayNotification(achievement) { + // Default implementation - log to console + console.log(`🏆 Achievement Unlocked: ${achievement.name}`); + console.log(` ${achievement.description}`); + + // Custom notification UI can be implemented by games + // This is just a fallback + } + + /** + * Hide notification (can be overridden for custom UI) + * @private + */ + _hideNotification() { + // Default implementation - no-op + // Custom notification UI can be implemented by games + } + + /** + * Update system (call each frame if using notification UI) + * @param {number} deltaTime - Time since last frame in seconds + */ + update(deltaTime) { + // Can be used for animating notifications + // Currently not needed for basic implementation + } +} diff --git a/framework/systems/AudioSystem.js b/framework/systems/AudioSystem.js index b2237f53..f59118d8 100644 --- a/framework/systems/AudioSystem.js +++ b/framework/systems/AudioSystem.js @@ -5,6 +5,8 @@ export class AudioSystem { /** * @param {Object} config - Configuration object (optional) + * @param {boolean} config.enableSpatialAudio - Enable distance-based volume (default: false) + * @param {number} config.maxDistance - Maximum audio distance for spatial audio (default: 1000) */ constructor(config = {}) { this.audioContext = null; @@ -12,6 +14,10 @@ export class AudioSystem { this.ambientSource = null; this.ambientGain = null; this.currentAmbientId = null; + this.enableSpatialAudio = config.enableSpatialAudio || false; + this.maxDistance = config.maxDistance || 1000; + this.activeFades = new Map(); // Track active fade operations + this.preloadQueue = []; // Queue for preloading sounds } /** @@ -210,4 +216,228 @@ export class AudioSystem { this.stopAmbient(); this.sounds.clear(); } + + /** + * Preload multiple sounds + * @param {Array} sounds - Array of {id, url} objects + * @returns {Promise} Object with success/failure counts and failed IDs + */ + async preloadSounds(sounds) { + if (!Array.isArray(sounds)) { + throw new Error('sounds must be an array'); + } + + const results = { + success: 0, + failed: 0, + failedIds: [] + }; + + const loadPromises = sounds.map(async ({ id, url }) => { + try { + const success = await this.loadSound(id, url); + if (success) { + results.success++; + } else { + results.failed++; + results.failedIds.push(id); + } + } catch (error) { + results.failed++; + results.failedIds.push(id); + } + }); + + await Promise.all(loadPromises); + return results; + } + + /** + * Fade in ambient music + * @param {string} id - Sound identifier + * @param {number} targetVolume - Target volume (0.0 to 1.0, default: 0.5) + * @param {number} duration - Fade duration in seconds (default: 2.0) + * @returns {boolean} True if fade started successfully + */ + fadeInAmbient(id, targetVolume = 0.5, duration = 2.0) { + if (!this.sounds.has(id)) { + console.warn(`Sound ${id} not loaded`); + return false; + } + + if (typeof targetVolume !== 'number' || targetVolume < 0 || targetVolume > 1) { + console.warn(`Invalid volume ${targetVolume}, must be between 0 and 1`); + return false; + } + + // Stop current ambient if playing + this.stopAmbient(); + + this.initializeContext(); + + const sound = this.sounds.get(id); + this.ambientSource = this.audioContext.createBufferSource(); + this.ambientGain = this.audioContext.createGain(); + + this.ambientSource.buffer = sound.buffer; + this.ambientSource.loop = true; + this.ambientGain.gain.value = 0; // Start at 0 + + this.ambientSource.connect(this.ambientGain); + this.ambientGain.connect(this.audioContext.destination); + + this.ambientSource.start(0); + this.currentAmbientId = id; + + // Fade in + const currentTime = this.audioContext.currentTime; + this.ambientGain.gain.linearRampToValueAtTime(targetVolume, currentTime + duration); + + return true; + } + + /** + * Fade out ambient music + * @param {number} duration - Fade duration in seconds (default: 2.0) + * @param {boolean} stopAfterFade - Stop playback after fade (default: true) + * @returns {boolean} True if fade started successfully + */ + fadeOutAmbient(duration = 2.0, stopAfterFade = true) { + if (!this.ambientGain) { + return false; + } + + const currentTime = this.audioContext.currentTime; + this.ambientGain.gain.linearRampToValueAtTime(0, currentTime + duration); + + if (stopAfterFade) { + setTimeout(() => { + this.stopAmbient(); + }, duration * 1000); + } + + return true; + } + + /** + * Fade ambient music to a new volume + * @param {number} targetVolume - Target volume (0.0 to 1.0) + * @param {number} duration - Fade duration in seconds (default: 1.0) + * @returns {boolean} True if fade started successfully + */ + fadeAmbientTo(targetVolume, duration = 1.0) { + if (!this.ambientGain) { + return false; + } + + if (typeof targetVolume !== 'number' || targetVolume < 0 || targetVolume > 1) { + console.warn(`Invalid volume ${targetVolume}, must be between 0 and 1`); + return false; + } + + const currentTime = this.audioContext.currentTime; + this.ambientGain.gain.linearRampToValueAtTime(targetVolume, currentTime + duration); + + return true; + } + + /** + * Play spatial audio (distance-based volume) + * @param {string} id - Sound identifier + * @param {Object} sourcePosition - Sound source position {x, y} + * @param {Object} listenerPosition - Listener position {x, y} + * @param {number} maxVolume - Maximum volume at distance 0 (default: 1.0) + * @param {boolean} loop - Whether to loop the sound (default: false) + * @returns {Object|null} Object with source and gainNode, or null if failed + */ + playSpatialSound(id, sourcePosition, listenerPosition, maxVolume = 1.0, loop = false) { + if (!this.sounds.has(id)) { + console.warn(`Sound ${id} not loaded`); + return null; + } + + if (!sourcePosition || !listenerPosition) { + console.warn('Source and listener positions are required for spatial audio'); + return null; + } + + this.initializeContext(); + + // Calculate distance + const dx = sourcePosition.x - listenerPosition.x; + const dy = sourcePosition.y - listenerPosition.y; + const distance = Math.sqrt(dx * dx + dy * dy); + + // Calculate volume based on distance + const volume = Math.max(0, Math.min(1, 1 - (distance / this.maxDistance))) * maxVolume; + + const sound = this.sounds.get(id); + const source = this.audioContext.createBufferSource(); + const gainNode = this.audioContext.createGain(); + + source.buffer = sound.buffer; + source.loop = loop; + gainNode.gain.value = volume; + + source.connect(gainNode); + gainNode.connect(this.audioContext.destination); + + source.start(0); + + return { source, gainNode }; + } + + /** + * Update spatial audio volume based on new positions + * @param {Object} audioObject - Object returned from playSpatialSound + * @param {Object} sourcePosition - Sound source position {x, y} + * @param {Object} listenerPosition - Listener position {x, y} + * @param {number} maxVolume - Maximum volume at distance 0 (default: 1.0) + */ + updateSpatialSound(audioObject, sourcePosition, listenerPosition, maxVolume = 1.0) { + if (!audioObject || !audioObject.gainNode) { + return; + } + + // Calculate distance + const dx = sourcePosition.x - listenerPosition.x; + const dy = sourcePosition.y - listenerPosition.y; + const distance = Math.sqrt(dx * dx + dy * dy); + + // Calculate volume based on distance + const volume = Math.max(0, Math.min(1, 1 - (distance / this.maxDistance))) * maxVolume; + + audioObject.gainNode.gain.value = volume; + } + + /** + * Set ambient volume + * @param {number} volume - Volume level (0.0 to 1.0) + * @returns {boolean} True if volume was set + */ + setAmbientVolume(volume) { + if (!this.ambientGain) { + return false; + } + + if (typeof volume !== 'number' || volume < 0 || volume > 1) { + console.warn(`Invalid volume ${volume}, must be between 0 and 1`); + return false; + } + + this.ambientGain.gain.value = volume; + return true; + } + + /** + * Get current ambient volume + * @returns {number|null} Current volume or null if no ambient playing + */ + getAmbientVolume() { + if (!this.ambientGain) { + return null; + } + + return this.ambientGain.gain.value; + } } diff --git a/framework/utils/SaveSystem.js b/framework/utils/SaveSystem.js new file mode 100644 index 00000000..ef5000a3 --- /dev/null +++ b/framework/utils/SaveSystem.js @@ -0,0 +1,317 @@ +/** + * SaveSystem - Framework utility for game state persistence + * Provides save/load functionality with localStorage backend + */ +export class SaveSystem { + /** + * @param {Object} config - Save system configuration + * @param {string} config.gameId - Unique identifier for this game (required) + * @param {number} config.maxSlots - Maximum number of save slots (default: 3) + * @param {boolean} config.autoSave - Enable auto-save (default: false) + * @param {number} config.autoSaveInterval - Auto-save interval in ms (default: 60000) + */ + constructor(config = {}) { + if (!config.gameId) { + throw new Error('gameId is required in SaveSystem config'); + } + + this.gameId = config.gameId; + this.maxSlots = config.maxSlots || 3; + this.autoSave = config.autoSave || false; + this.autoSaveInterval = config.autoSaveInterval || 60000; // 1 minute default + this.autoSaveTimer = null; + + // Check localStorage availability + this.storageAvailable = this._checkStorageAvailable(); + + if (!this.storageAvailable) { + console.warn('localStorage is not available. Save system will not persist data.'); + } + } + + /** + * Check if localStorage is available + * @private + * @returns {boolean} True if localStorage is available + */ + _checkStorageAvailable() { + try { + const test = '__storage_test__'; + localStorage.setItem(test, test); + localStorage.removeItem(test); + return true; + } catch (e) { + return false; + } + } + + /** + * Generate storage key for a save slot + * @private + * @param {number} slot - Save slot number + * @returns {string} Storage key + */ + _getStorageKey(slot) { + return `${this.gameId}_save_slot_${slot}`; + } + + /** + * Save game state to a slot + * @param {number} slot - Save slot number (0 to maxSlots-1) + * @param {Object} gameState - Game state to save + * @param {Object} metadata - Optional metadata (timestamp, level, etc.) + * @returns {boolean} True if save was successful + */ + save(slot, gameState, metadata = {}) { + if (!this.storageAvailable) { + return false; + } + + if (slot < 0 || slot >= this.maxSlots) { + console.error(`Invalid save slot ${slot}. Must be between 0 and ${this.maxSlots - 1}`); + return false; + } + + try { + const saveData = { + version: '1.0.0', + timestamp: Date.now(), + metadata: metadata, + gameState: gameState + }; + + const key = this._getStorageKey(slot); + localStorage.setItem(key, JSON.stringify(saveData)); + return true; + } catch (error) { + console.error(`Failed to save to slot ${slot}:`, error); + return false; + } + } + + /** + * Load game state from a slot + * @param {number} slot - Save slot number (0 to maxSlots-1) + * @returns {Object|null} Loaded save data or null if not found/error + */ + load(slot) { + if (!this.storageAvailable) { + return null; + } + + if (slot < 0 || slot >= this.maxSlots) { + console.error(`Invalid save slot ${slot}. Must be between 0 and ${this.maxSlots - 1}`); + return null; + } + + try { + const key = this._getStorageKey(slot); + const data = localStorage.getItem(key); + + if (!data) { + return null; + } + + return JSON.parse(data); + } catch (error) { + console.error(`Failed to load from slot ${slot}:`, error); + return null; + } + } + + /** + * Delete save data from a slot + * @param {number} slot - Save slot number (0 to maxSlots-1) + * @returns {boolean} True if deletion was successful + */ + deleteSave(slot) { + if (!this.storageAvailable) { + return false; + } + + if (slot < 0 || slot >= this.maxSlots) { + console.error(`Invalid save slot ${slot}. Must be between 0 and ${this.maxSlots - 1}`); + return false; + } + + try { + const key = this._getStorageKey(slot); + localStorage.removeItem(key); + return true; + } catch (error) { + console.error(`Failed to delete slot ${slot}:`, error); + return false; + } + } + + /** + * Check if a save exists in a slot + * @param {number} slot - Save slot number (0 to maxSlots-1) + * @returns {boolean} True if save exists + */ + hasSave(slot) { + if (!this.storageAvailable) { + return false; + } + + if (slot < 0 || slot >= this.maxSlots) { + return false; + } + + const key = this._getStorageKey(slot); + return localStorage.getItem(key) !== null; + } + + /** + * Get metadata for all save slots + * @returns {Array} Array of save metadata objects (null for empty slots) + */ + getAllSaveMetadata() { + if (!this.storageAvailable) { + return Array(this.maxSlots).fill(null); + } + + const metadata = []; + for (let i = 0; i < this.maxSlots; i++) { + if (this.hasSave(i)) { + const saveData = this.load(i); + metadata.push({ + slot: i, + timestamp: saveData.timestamp, + metadata: saveData.metadata + }); + } else { + metadata.push(null); + } + } + return metadata; + } + + /** + * Delete all saves for this game + * @returns {boolean} True if all deletions were successful + */ + deleteAllSaves() { + if (!this.storageAvailable) { + return false; + } + + let success = true; + for (let i = 0; i < this.maxSlots; i++) { + if (!this.deleteSave(i)) { + success = false; + } + } + return success; + } + + /** + * Start auto-save timer + * @param {Function} saveCallback - Callback to get current game state + * @param {number} slot - Save slot for auto-save (default: 0) + */ + startAutoSave(saveCallback, slot = 0) { + if (!this.autoSave) { + return; + } + + this.stopAutoSave(); + + this.autoSaveTimer = setInterval(() => { + try { + const gameState = saveCallback(); + this.save(slot, gameState, { autoSave: true }); + } catch (error) { + console.error('Auto-save failed:', error); + } + }, this.autoSaveInterval); + } + + /** + * Stop auto-save timer + */ + stopAutoSave() { + if (this.autoSaveTimer) { + clearInterval(this.autoSaveTimer); + this.autoSaveTimer = null; + } + } + + /** + * Export save data as JSON string for backup + * @param {number} slot - Save slot number + * @returns {string|null} JSON string of save data or null + */ + exportSave(slot) { + const saveData = this.load(slot); + if (!saveData) { + return null; + } + return JSON.stringify(saveData); + } + + /** + * Import save data from JSON string + * @param {number} slot - Target save slot number + * @param {string} jsonData - JSON string of save data + * @returns {boolean} True if import was successful + */ + importSave(slot, jsonData) { + if (!this.storageAvailable) { + return false; + } + + try { + const saveData = JSON.parse(jsonData); + + // Validate save data structure + if (!saveData.version || !saveData.gameState) { + console.error('Invalid save data format'); + return false; + } + + const key = this._getStorageKey(slot); + localStorage.setItem(key, jsonData); + return true; + } catch (error) { + console.error('Failed to import save:', error); + return false; + } + } + + /** + * Get storage usage statistics + * @returns {Object} Storage statistics + */ + getStorageStats() { + if (!this.storageAvailable) { + return { available: false }; + } + + try { + let totalSize = 0; + const saves = []; + + for (let i = 0; i < this.maxSlots; i++) { + const key = this._getStorageKey(i); + const data = localStorage.getItem(key); + if (data) { + const size = new Blob([data]).size; + totalSize += size; + saves.push({ slot: i, size }); + } + } + + return { + available: true, + totalSize, + saves, + slotsUsed: saves.length, + slotsAvailable: this.maxSlots - saves.length + }; + } catch (error) { + console.error('Failed to get storage stats:', error); + return { available: false }; + } + } +} diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 100644 index 679bd163..00000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" -else - exec node "$basedir/../acorn/bin/acorn" "$@" -fi diff --git a/node_modules/.bin/baseline-browser-mapping b/node_modules/.bin/baseline-browser-mapping deleted file mode 100644 index 1977474b..00000000 --- a/node_modules/.bin/baseline-browser-mapping +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../baseline-browser-mapping/dist/cli.js" "$@" -else - exec node "$basedir/../baseline-browser-mapping/dist/cli.js" "$@" -fi diff --git a/node_modules/.bin/baseline-browser-mapping b/node_modules/.bin/baseline-browser-mapping new file mode 120000 index 00000000..d2961883 --- /dev/null +++ b/node_modules/.bin/baseline-browser-mapping @@ -0,0 +1 @@ +../baseline-browser-mapping/dist/cli.js \ No newline at end of file diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist deleted file mode 100644 index 60e71ad8..00000000 --- a/node_modules/.bin/browserslist +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" -else - exec node "$basedir/../browserslist/cli.js" "$@" -fi diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 120000 index 00000000..3cd991b2 --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/node_modules/.bin/create-jest b/node_modules/.bin/create-jest deleted file mode 100644 index 162092d7..00000000 --- a/node_modules/.bin/create-jest +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../create-jest/bin/create-jest.js" "$@" -else - exec node "$basedir/../create-jest/bin/create-jest.js" "$@" -fi diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen deleted file mode 100644 index 1dbc1f02..00000000 --- a/node_modules/.bin/escodegen +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../escodegen/bin/escodegen.js" "$@" -else - exec node "$basedir/../escodegen/bin/escodegen.js" "$@" -fi diff --git a/node_modules/.bin/esgenerate b/node_modules/.bin/esgenerate deleted file mode 100644 index 8633c745..00000000 --- a/node_modules/.bin/esgenerate +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../escodegen/bin/esgenerate.js" "$@" -else - exec node "$basedir/../escodegen/bin/esgenerate.js" "$@" -fi diff --git a/node_modules/.bin/glob b/node_modules/.bin/glob new file mode 120000 index 00000000..85c9c1db --- /dev/null +++ b/node_modules/.bin/glob @@ -0,0 +1 @@ +../glob/dist/esm/bin.mjs \ No newline at end of file diff --git a/node_modules/.bin/jest b/node_modules/.bin/jest deleted file mode 100644 index 61b6f565..00000000 --- a/node_modules/.bin/jest +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../jest/bin/jest.js" "$@" -else - exec node "$basedir/../jest/bin/jest.js" "$@" -fi diff --git a/node_modules/.bin/jest b/node_modules/.bin/jest new file mode 120000 index 00000000..61c18615 --- /dev/null +++ b/node_modules/.bin/jest @@ -0,0 +1 @@ +../jest/bin/jest.js \ No newline at end of file diff --git a/node_modules/.bin/napi-postinstall b/node_modules/.bin/napi-postinstall new file mode 120000 index 00000000..8407c964 --- /dev/null +++ b/node_modules/.bin/napi-postinstall @@ -0,0 +1 @@ +../napi-postinstall/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve deleted file mode 100644 index c043cba0..00000000 --- a/node_modules/.bin/resolve +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" -else - exec node "$basedir/../resolve/bin/resolve" "$@" -fi diff --git a/node_modules/.bin/tldts b/node_modules/.bin/tldts new file mode 120000 index 00000000..85001241 --- /dev/null +++ b/node_modules/.bin/tldts @@ -0,0 +1 @@ +../tldts/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db deleted file mode 100644 index cced63c4..00000000 --- a/node_modules/.bin/update-browserslist-db +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" -else - exec node "$basedir/../update-browserslist-db/cli.js" "$@" -fi diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 120000 index 00000000..b11e16f3 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1 @@ +../update-browserslist-db/cli.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 2eb50177..a97854e8 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4,6 +4,27 @@ "lockfileVersion": 3, "requires": true, "packages": { + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -500,6 +521,139 @@ "dev": true, "license": "MIT" }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -528,61 +682,61 @@ } }, "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.2.0.tgz", + "integrity": "sha512-+O1ifRjkvYIkBqASKWgLxrpEhQAAE7hY77ALLUufSk5717KfOShg6IbqLmdsLMPdUiFvA2kTs0R7YZy+l0IzZQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.2.0", "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.2.0.tgz", + "integrity": "sha512-03W6IhuhjqTlpzh/ojut/pDB2LPRygyWX8ExpgHtQA8H/3K7+1vKmcINx5UzeOX1se6YEsBsOHQ1CRzf3fOwTQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.2.0", + "@jest/pattern": "30.0.1", + "@jest/reporters": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-changed-files": "30.2.0", + "jest-config": "30.2.0", + "jest-haste-map": "30.2.0", + "jest-message-util": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-resolve-dependencies": "30.2.0", + "jest-runner": "30.2.0", + "jest-runtime": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "jest-watcher": "30.2.0", + "micromatch": "^4.0.8", + "pretty-format": "30.2.0", + "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -593,117 +747,178 @@ } } }, + "node_modules/@jest/diff-sequences": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", + "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.2.0.tgz", + "integrity": "sha512-/QPTL7OBJQ5ac09UDRa3EQes4gt1FTEG/8jZ/4v5IVzx+Cv7dLxlVIvfvSVRiiX2drWyXeBjkMSR8hvOWSog5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "jest-mock": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/environment-jsdom-abstract/-/environment-jsdom-abstract-30.2.0.tgz", + "integrity": "sha512-kazxw2L9IPuZpQ0mEt9lu9Z98SqR74xcagANmMBU16X0lS23yPc0+S6hGLUz8kVRlomZEs/5S/Zlpqwf5yu6OQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.2.0", + "@jest/fake-timers": "30.2.0", + "@jest/types": "30.2.0", + "@types/jsdom": "^21.1.7", "@types/node": "*", - "jest-mock": "^29.7.0" + "jest-mock": "30.2.0", + "jest-util": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } } }, "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.2.0.tgz", + "integrity": "sha512-V9yxQK5erfzx99Sf+7LbhBwNWEZ9eZay8qQ9+JSC0TrMR1pMDHLMY+BnVPacWU6Jamrh252/IKo4F1Xn/zfiqA==", "dev": true, "license": "MIT", "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" + "expect": "30.2.0", + "jest-snapshot": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.2.0.tgz", + "integrity": "sha512-1JnRfhqpD8HGpOmQp180Fo9Zt69zNtC+9lR+kT7NVL05tNXIi+QC8Csz7lfidMoVLPD3FnOtcmp0CEFnxExGEA==", "dev": true, "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3" + "@jest/get-type": "30.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.2.0.tgz", + "integrity": "sha512-HI3tRLjRxAbBy0VO8dqqm7Hb2mIa8d5bg/NJkyQcOk7V118ObQML8RC5luTF/Zsg4474a+gDvhce7eTnP4GhYw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", + "@jest/types": "30.2.0", + "@sinonjs/fake-timers": "^13.0.0", "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-util": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.2.0.tgz", + "integrity": "sha512-b63wmnKPaK+6ZZfpYhz9K61oybvbI1aMcIs80++JI1O1rR1vaxHUCNqo3ITu6NU0d4V34yZFoHMn/uoKr/Rwfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.2.0", + "@jest/expect": "30.2.0", + "@jest/types": "30.2.0", + "jest-mock": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", + "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" + "@types/node": "*", + "jest-regex-util": "30.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.2.0.tgz", + "integrity": "sha512-DRyW6baWPqKMa9CzeiBjHwjd8XeAyco2Vt8XbcLFjiwCOEKOvy82GJ8QQnJE9ofsxCMPjH4MfH8fCWIHHDKpAQ==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", + "@jest/console": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "@jridgewell/trace-mapping": "^0.3.25", "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", + "chalk": "^4.1.2", + "collect-v8-coverage": "^1.0.2", + "exit-x": "^0.2.2", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", + "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", + "jest-worker": "30.2.0", "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", + "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -715,108 +930,125 @@ } }, "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/snapshot-utils": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.2.0.tgz", + "integrity": "sha512-0aVxM3RH6DaiLcjj/b0KrIBZhSX1373Xci4l3cW5xiUWPctZ59zQ7jj4rqcJQ/Z8JuN/4wX3FpJSa3RssVvCug==", "dev": true, "license": "MIT", "dependencies": { - "@sinclair/typebox": "^0.27.8" + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "natural-compare": "^1.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", + "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" + "@jridgewell/trace-mapping": "^0.3.25", + "callsites": "^3.1.0", + "graceful-fs": "^4.2.11" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.2.0.tgz", + "integrity": "sha512-RF+Z+0CCHkARz5HT9mcQCBulb1wgCP3FBvl9VFokMX27acKphwyQsNuWH3c+ojd1LeWBLoTYoxF0zm6S/66mjg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "@jest/console": "30.2.0", + "@jest/types": "30.2.0", + "@types/istanbul-lib-coverage": "^2.0.6", + "collect-v8-coverage": "^1.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.2.0.tgz", + "integrity": "sha512-wXKgU/lk8fKXMu/l5Hog1R61bL4q5GCdT6OJvdAFz1P+QrpoFuLU68eoKuVc4RbrTtNnTL5FByhWdLgOPSph+Q==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", + "@jest/test-result": "30.2.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.2.0.tgz", + "integrity": "sha512-XsauDV82o5qXbhalKxD7p4TZYYdwcaEXC77PPD2HixEFF+6YGppjrAAQurTl2ECWcEomHBMMNS9AH3kcCFx8jA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", + "@babel/core": "^7.27.4", + "@jest/types": "30.2.0", + "@jridgewell/trace-mapping": "^0.3.25", + "babel-plugin-istanbul": "^7.0.1", + "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-util": "30.2.0", + "micromatch": "^4.0.8", + "pirates": "^4.0.7", "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "write-file-atomic": "^5.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.2.0.tgz", + "integrity": "sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jridgewell/gen-mapping": { @@ -869,10 +1101,34 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.34.45", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.45.tgz", + "integrity": "sha512-qJcFVfCa5jxBFSuv7S5WYbA8XdeCPmhnaVVfX/2Y6L8WYg8sk3XY2+6W0zH+3mq1Cz+YC7Ki66HfqX6IHAwnkg==", "dev": true, "license": "MIT" }, @@ -887,23 +1143,13 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" + "@sinonjs/commons": "^3.0.1" } }, "node_modules/@types/babel__core": { @@ -951,16 +1197,6 @@ "@babel/types": "^7.28.2" } }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -989,9 +1225,9 @@ } }, "node_modules/@types/jsdom": { - "version": "20.0.1", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", - "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", "dev": true, "license": "MIT", "dependencies": { @@ -1001,9 +1237,9 @@ } }, "node_modules/@types/node": { - "version": "24.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", - "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "version": "25.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.3.tgz", + "integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==", "dev": true, "license": "MIT", "dependencies": { @@ -1041,62 +1277,49 @@ "dev": true, "license": "MIT" }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } + "license": "ISC" }, - "node_modules/acorn-globals": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", - "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", + "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", + "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } + "optional": true, + "os": [ + "linux" + ] }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "4" - }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ansi-escapes": { @@ -1116,13 +1339,16 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -1165,83 +1391,59 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" - }, "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.2.0.tgz", + "integrity": "sha512-0YiBEOxWqKkSQWL9nNGGEgndoeL0ZpWrbLMNL5u/Kaxrli3Eaxlt3ZtIDktEvXt4L/R9r3ODr2zKwGM/2BjxVw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", + "@jest/transform": "30.2.0", + "@types/babel__core": "^7.20.5", + "babel-plugin-istanbul": "^7.0.1", + "babel-preset-jest": "30.2.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.8.0" + "@babel/core": "^7.11.0 || ^8.0.0-0" } }, "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", "dev": true, "license": "BSD-3-Clause", + "workspaces": [ + "test/babel-8" + ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-instrument": "^6.0.2", "test-exclude": "^6.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.2.0.tgz", + "integrity": "sha512-ftzhzSGMUnOzcCXd6WHdBGMyuwy15Wnn0iyyWGKgBDLxf9/s5ABuraCSpBX2uG0jUg4rqJnxsLc5+oYBqoxVaA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" + "@types/babel__core": "^7.20.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/babel-preset-current-node-syntax": { @@ -1272,20 +1474,20 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.2.0.tgz", + "integrity": "sha512-US4Z3NOieAQumwFnYdUWKvUKh8+YSnS/gB3t6YBiz0bskpu7Pine8pPCheNxlPEW4wnUkma2a94YuW2q3guvCQ==", "dev": true, "license": "MIT", "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" + "babel-plugin-jest-hoist": "30.2.0", + "babel-preset-current-node-syntax": "^1.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.11.0 || ^8.0.0-beta.1" } }, "node_modules/balanced-match": { @@ -1296,9 +1498,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.32", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.32.tgz", - "integrity": "sha512-OPz5aBThlyLFgxyhdwf/s2+8ab3OvT7AdTNvKHBwpXomIYeXqpUUuT8LrdtxZSsWJ4R4CU1un4XGh5Ez3nlTpw==", + "version": "2.9.11", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz", + "integrity": "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -1306,14 +1508,13 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -1330,9 +1531,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", - "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", "dev": true, "funding": [ { @@ -1350,11 +1551,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.8.25", - "caniuse-lite": "^1.0.30001754", - "electron-to-chromium": "^1.5.249", + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", - "update-browserslist-db": "^1.1.4" + "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" @@ -1380,20 +1581,6 @@ "dev": true, "license": "MIT" }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1415,9 +1602,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001757", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001757.tgz", - "integrity": "sha512-r0nnL/I28Zi/yjk1el6ilj27tKcdjLsNqAOZr0yVjWPrSQyHgKI2INaEWw21bAQSv2LXRt1XuCS/GomNpWOxsQ==", + "version": "1.0.30001762", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz", + "integrity": "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==", "dev": true, "funding": [ { @@ -1463,9 +1650,9 @@ } }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", "dev": true, "funding": [ { @@ -1479,9 +1666,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.1.tgz", + "integrity": "sha512-+CmxIZ/L2vNcEfvNtLdU0ZQ6mbq3FZnwAP2PPTiKP+1QOoKwlKlPgb8UKV0Dds7QVaMnHm+FwSft2VB0s/SLjQ==", "dev": true, "license": "MIT" }, @@ -1500,57 +1687,107 @@ "node": ">=12" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": ">=8" } }, - "node_modules/collect-v8-coverage": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", - "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=7.0.0" + "node": ">=8" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", "dev": true, "license": "MIT" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { - "delayed-stream": "~1.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 0.8" + "node": ">=7.0.0" } }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1565,28 +1802,6 @@ "dev": true, "license": "MIT" }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1602,46 +1817,32 @@ "node": ">= 8" } }, - "node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", - "dev": true, - "license": "MIT" - }, "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", "dev": true, "license": "MIT", "dependencies": { - "cssom": "~0.3.6" + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true, - "license": "MIT" - }, "node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, "license": "MIT", "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/debug": { @@ -1670,9 +1871,9 @@ "license": "MIT" }, "node_modules/dedent": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", - "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz", + "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1694,16 +1895,6 @@ "node": ">=0.10.0" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -1714,49 +1905,17 @@ "node": ">=8" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "deprecated": "Use your platform's native DOMException instead", - "dev": true, - "license": "MIT", - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.262", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.262.tgz", - "integrity": "sha512-NlAsMteRHek05jRUxUR0a5jpjYq9ykk6+kO0yRaMi5moe7u0fVIOeQ3Y30A8dIiWFBNUoQGi1ljb1i5VtS9WQQ==", + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", "dev": true, "license": "ISC" }, @@ -1774,9 +1933,9 @@ } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, @@ -1803,55 +1962,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -1872,28 +1982,6 @@ "node": ">=8" } }, - "node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -1908,26 +1996,6 @@ "node": ">=4" } }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -1952,36 +2020,45 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/exit-x": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", + "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.2.0.tgz", + "integrity": "sha512-u/feCi0GPsI+988gU2FLcsHyAHTU0MX1Wg68NhAnN7z/+C5wqG+CY8J53N9ioe8RXgaoz0nBR/TYMf3AycUuPw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" + "@jest/expect-utils": "30.2.0", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-util": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/fast-check": { - "version": "3.23.2", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", - "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.5.2.tgz", + "integrity": "sha512-tOzL01LMrDIWPLfvMiGUMH0AjqnOelHQPmgvYkW/aRO4Yaw+pBQqWmyebNzAEbKOigoCN8HkRWUZXFkjmiaXMQ==", "dev": true, "funding": [ { @@ -1995,10 +2072,10 @@ ], "license": "MIT", "dependencies": { - "pure-rand": "^6.1.0" + "pure-rand": "^7.0.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=12.17.0" } }, "node_modules/fast-json-stable-stringify": { @@ -2045,21 +2122,21 @@ "node": ">=8" } }, - "node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">= 6" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/fs.realpath": { @@ -2069,16 +2146,6 @@ "dev": true, "license": "ISC" }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2099,31 +2166,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -2134,20 +2176,6 @@ "node": ">=8.0.0" } }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -2162,40 +2190,26 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2213,95 +2227,52 @@ "node": ">=8" } }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, "license": "MIT", "dependencies": { - "has-symbols": "^1.0.3" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=18" } }, - "node_modules/hasown": { + "node_modules/html-escaper": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.2" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 0.4" + "node": ">= 14" } }, - "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "whatwg-encoding": "^2.0.0" + "agent-base": "^7.1.2", + "debug": "4" }, "engines": { - "node": ">=12" - } - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/human-signals": { @@ -2383,22 +2354,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2512,15 +2467,15 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "istanbul-lib-coverage": "^3.0.0" }, "engines": { "node": ">=10" @@ -2540,23 +2495,39 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.2.0.tgz", + "integrity": "sha512-F26gjC0yWN8uAA5m5Ss8ZQf5nDHWGlN/xWZIh8S5SRbsEKBovwZhxGd6LJlbZYxBgCYOtreSUyb8hpXyGC5O4A==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "@jest/core": "30.2.0", + "@jest/types": "30.2.0", + "import-local": "^3.2.0", + "jest-cli": "30.2.0" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -2568,76 +2539,75 @@ } }, "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.2.0.tgz", + "integrity": "sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==", "dev": true, "license": "MIT", "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", + "execa": "^5.1.1", + "jest-util": "30.2.0", "p-limit": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.2.0.tgz", + "integrity": "sha512-Fh0096NC3ZkFx05EP2OXCxJAREVxj1BcW/i6EWqqymcgYKWjyyDpral3fMxVcHXg6oZM7iULer9wGRFvfpl+Tg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.2.0", + "@jest/expect": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "dedent": "^1.6.0", + "is-generator-fn": "^2.1.0", + "jest-each": "30.2.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-runtime": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", + "pretty-format": "30.2.0", + "pure-rand": "^7.0.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.2.0.tgz", + "integrity": "sha512-Os9ukIvADX/A9sLt6Zse3+nmHtHaE6hqOsjQtNiugFTbKRHYIYtZXNGNK9NChseXy7djFPjndX1tL0sCTlfpAA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" + "@jest/core": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "exit-x": "^0.2.2", + "import-local": "^3.2.0", + "jest-config": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "yargs": "^17.7.2" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -2649,118 +2619,121 @@ } }, "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.2.0.tgz", + "integrity": "sha512-g4WkyzFQVWHtu6uqGmQR4CQxz/CH3yDSlhzXMWzNjDx843gYjReZnMRanjRCq5XZFuQrGDxgUaiYWE8BRfVckA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/get-type": "30.1.0", + "@jest/pattern": "30.0.1", + "@jest/test-sequencer": "30.2.0", + "@jest/types": "30.2.0", + "babel-jest": "30.2.0", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "deepmerge": "^4.3.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "jest-circus": "30.2.0", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-runner": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "micromatch": "^4.0.8", "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", + "pretty-format": "30.2.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "@types/node": "*", + "esbuild-register": ">=3.4.0", "ts-node": ">=9.0.0" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "esbuild-register": { + "optional": true + }, "ts-node": { "optional": true } } }, "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.2.0.tgz", + "integrity": "sha512-dQHFo3Pt4/NLlG5z4PxZ/3yZTZ1C7s9hveiOj+GCN+uT109NC2QgsoVZsVOAvbJ3RgKkvyLGXZV9+piDpWbm6A==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "pretty-format": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.2.0.tgz", + "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==", "dev": true, "license": "MIT", "dependencies": { - "detect-newline": "^3.0.0" + "detect-newline": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.2.0.tgz", + "integrity": "sha512-lpWlJlM7bCUf1mfmuqTA8+j2lNURW9eNafOy99knBM01i5CQeY5UH1vZjgT9071nDJac1M4XsbyI44oNOdhlDQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "jest-util": "30.2.0", + "pretty-format": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-environment-jsdom": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", - "integrity": "sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-30.2.0.tgz", + "integrity": "sha512-zbBTiqr2Vl78pKp/laGBREYzbZx9ZtqPjOK4++lL4BNDhxRnahg51HtoDrk9/VjIy9IthNEWdKVd7H5bqBhiWQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/jsdom": "^20.0.0", + "@jest/environment": "30.2.0", + "@jest/environment-jsdom-abstract": "30.2.0", + "@types/jsdom": "^21.1.7", "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0", - "jsdom": "^20.0.0" + "jsdom": "^26.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^3.0.0" }, "peerDependenciesMeta": { "canvas": { @@ -2769,123 +2742,113 @@ } }, "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.2.0.tgz", + "integrity": "sha512-ElU8v92QJ9UrYsKrxDIKCxu6PfNj4Hdcktcn0JX12zqNdqWHB0N+hwOnnBBXvjLd2vApZtuLUGs1QSY+MsXoNA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.2.0", + "@jest/fake-timers": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-mock": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.2.0.tgz", + "integrity": "sha512-sQA/jCb9kNt+neM0anSj6eZhLZUIhQgwDt7cPGjumgLM4rXsfb9kpnlacmvZz3Q5tb80nS+oG/if+NBKrHC+Xw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", + "@jest/types": "30.2.0", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", + "anymatch": "^3.1.3", + "fb-watchman": "^2.0.2", + "graceful-fs": "^4.2.11", + "jest-regex-util": "30.0.1", + "jest-util": "30.2.0", + "jest-worker": "30.2.0", + "micromatch": "^4.0.8", "walker": "^1.0.8" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "optionalDependencies": { - "fsevents": "^2.3.2" + "fsevents": "^2.3.3" } }, "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.2.0.tgz", + "integrity": "sha512-M6jKAjyzjHG0SrQgwhgZGy9hFazcudwCNovY/9HPIicmNSBuockPSedAP9vlPK6ONFJ1zfyH/M2/YYJxOz5cdQ==", "dev": true, "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "pretty-format": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz", + "integrity": "sha512-dQ94Nq4dbzmUWkQ0ANAWS9tBRfqCrn0bV9AMYdOi/MHW726xn7eQmMeRTpX2ViC00bpNaWXq+7o4lIQ3AX13Hg==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "jest-diff": "30.2.0", + "pretty-format": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.2.0.tgz", + "integrity": "sha512-y4DKFLZ2y6DxTWD4cDe07RglV88ZiNEdlRfGtqahfbIjfsw1nMCPx49Uev4IA/hWn3sDKyAnSPwoYSsAEdcimw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.2.0", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.2.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.2.0.tgz", + "integrity": "sha512-JNNNl2rj4b5ICpmAcq+WbLH83XswjPbjH4T7yvGzfAGCPh1rw+xVNbtk+FnRslvt9lkCcdn9i1oAoKUuFsOxRw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.2.0", "@types/node": "*", - "jest-util": "^29.7.0" + "jest-util": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-pnp-resolver": { @@ -2907,147 +2870,148 @@ } }, "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", + "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", "dev": true, "license": "MIT", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.2.0.tgz", + "integrity": "sha512-TCrHSxPlx3tBY3hWNtRQKbtgLhsXa1WmbJEqBlTBrGafd5fiQFByy2GNCEoGR+Tns8d15GaL9cxEzKOO3GEb2A==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-pnp-resolver": "^1.2.3", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "slash": "^3.0.0", + "unrs-resolver": "^1.7.11" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.2.0.tgz", + "integrity": "sha512-xTOIGug/0RmIe3mmCqCT95yO0vj6JURrn1TKWlNbhiAefJRWINNPgwVkrVgt/YaerPzY3iItufd80v3lOrFJ2w==", "dev": true, "license": "MIT", "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" + "jest-regex-util": "30.0.1", + "jest-snapshot": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.2.0.tgz", + "integrity": "sha512-PqvZ2B2XEyPEbclp+gV6KO/F1FIFSbIwewRgmROCMBo/aZ6J1w8Qypoj2pEOcg3G2HzLlaP6VUtvwCI8dM3oqQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.2.0", + "@jest/environment": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.2.0", + "jest-haste-map": "30.2.0", + "jest-leak-detector": "30.2.0", + "jest-message-util": "30.2.0", + "jest-resolve": "30.2.0", + "jest-runtime": "30.2.0", + "jest-util": "30.2.0", + "jest-watcher": "30.2.0", + "jest-worker": "30.2.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.2.0.tgz", + "integrity": "sha512-p1+GVX/PJqTucvsmERPMgCPvQJpFt4hFbM+VN3n8TMo47decMUcJbt+rgzwrEme0MQUA/R+1de2axftTHkKckg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.2.0", + "@jest/fake-timers": "30.2.0", + "@jest/globals": "30.2.0", + "@jest/source-map": "30.0.1", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "cjs-module-lexer": "^2.1.0", + "collect-v8-coverage": "^1.0.2", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.2.0.tgz", + "integrity": "sha512-5WEtTy2jXPFypadKNpbNkZ72puZCa6UjSr/7djeecHWOu7iYhSXSnHScT8wBz3Rn8Ena5d5RYRcsyKIeqG1IyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@babel/generator": "^7.27.5", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1", + "@babel/types": "^7.27.3", + "@jest/expect-utils": "30.2.0", + "@jest/get-type": "30.1.0", + "@jest/snapshot-utils": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "babel-preset-current-node-syntax": "^1.2.0", + "chalk": "^4.1.2", + "expect": "30.2.0", + "graceful-fs": "^4.2.11", + "jest-diff": "30.2.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", + "pretty-format": "30.2.0", + "semver": "^7.7.2", + "synckit": "^0.11.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-snapshot/node_modules/semver": { @@ -3064,39 +3028,52 @@ } }, "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.2.0.tgz", + "integrity": "sha512-QKNsM0o3Xe6ISQU869e+DhG+4CK/48aHYdJZGlFQVTjnbvgpcKyxpzk29fGiO7i/J8VENZ+d2iGnSsvmuHywlA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.2.0", "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-util/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.2.0.tgz", + "integrity": "sha512-FBGWi7dP2hpdi8nBoWxSsLvBFewKAg0+uSQwBaof4Y4DPgBabXgpSYC5/lR7VmnIlSpASmCi/ntRWPbv7089Pw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", + "@jest/get-type": "30.1.0", + "@jest/types": "30.2.0", + "camelcase": "^6.3.0", + "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "pretty-format": "30.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-validate/node_modules/camelcase": { @@ -3113,39 +3090,40 @@ } }, "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.2.0.tgz", + "integrity": "sha512-PYxa28dxJ9g777pGm/7PrbnMeA0Jr7osHP9bS7eJy9DuAjMgdGtxgf0uKMyoIsTWAkIbUW5hSDdJ3urmgXBqxg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "jest-util": "30.2.0", + "string-length": "^4.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.2.0.tgz", + "integrity": "sha512-0Q4Uk8WF7BUwqXHuAjc23vmopWJw5WH7w2tqBoUOZpOjW/ZnR44GXXd1r82RvnmI2GZge3ivrYXk/BE2+VtW2g==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", - "jest-util": "^29.7.0", + "@ungap/structured-clone": "^1.3.0", + "jest-util": "30.2.0", "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "supports-color": "^8.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-worker/node_modules/supports-color": { @@ -3186,44 +3164,38 @@ } }, "node_modules/jsdom": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", - "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "abab": "^2.0.6", - "acorn": "^8.8.1", - "acorn-globals": "^7.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.4.2", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", - "parse5": "^7.1.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.11.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^3.0.0" }, "peerDependenciesMeta": { "canvas": { @@ -3264,16 +3236,6 @@ "node": ">=6" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -3353,16 +3315,6 @@ "tmpl": "1.0.5" } }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -3384,29 +3336,6 @@ "node": ">=8.6" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -3418,16 +3347,29 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/ms": { @@ -3437,6 +3379,22 @@ "dev": true, "license": "MIT" }, + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3482,9 +3440,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.22", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.22.tgz", - "integrity": "sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==", + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", + "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==", "dev": true, "license": "MIT" }, @@ -3569,6 +3527,13 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -3631,12 +3596,29 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "MIT" + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" }, "node_modules/picocolors": { "version": "1.1.1", @@ -3682,18 +3664,18 @@ } }, "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.2.0.tgz", + "integrity": "sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { @@ -3709,33 +3691,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/psl": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", - "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "funding": { - "url": "https://github.com/sponsors/lupomontero" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3747,9 +3702,9 @@ } }, "node_modules/pure-rand": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", "dev": true, "funding": [ { @@ -3763,13 +3718,6 @@ ], "license": "MIT" }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true, - "license": "MIT" - }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -3787,34 +3735,6 @@ "node": ">=0.10.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", @@ -3838,15 +3758,12 @@ "node": ">=8" } }, - "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -3902,18 +3819,17 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "MIT" + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/slash": { "version": "3.0.0", @@ -3980,7 +3896,49 @@ "node": ">=10" } }, + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -3995,7 +3953,54 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -4008,6 +4013,16 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -4054,19 +4069,6 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -4074,6 +4076,22 @@ "dev": true, "license": "MIT" }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -4089,6 +4107,72 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4110,32 +4194,29 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", "dev": true, "license": "MIT", "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/type-detect": { @@ -4168,20 +4249,45 @@ "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "node_modules/unrs-resolver": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", + "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", "dev": true, + "hasInstallScript": true, "license": "MIT", - "engines": { - "node": ">= 4.0.0" + "dependencies": { + "napi-postinstall": "^0.3.0" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.11.1", + "@unrs/resolver-binding-android-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-x64": "1.11.1", + "@unrs/resolver-binding-freebsd-x64": "1.11.1", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", + "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-musl": "1.11.1", + "@unrs/resolver-binding-wasm32-wasi": "1.11.1", + "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", + "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", + "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" } }, "node_modules/update-browserslist-db": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", - "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { @@ -4209,17 +4315,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -4236,16 +4331,16 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "license": "MIT", "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/walker": { @@ -4269,40 +4364,41 @@ } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", "dev": true, "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", "dev": true, "license": "MIT", "dependencies": { - "tr46": "^3.0.0", + "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/which": { @@ -4322,6 +4418,25 @@ } }, "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -4339,6 +4454,64 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4347,17 +4520,17 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/ws": { @@ -4383,13 +4556,13 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, "license": "Apache-2.0", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { @@ -4445,6 +4618,51 @@ "node": ">=12" } }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/node_modules/@asamuzakjp/css-color/LICENSE b/node_modules/@asamuzakjp/css-color/LICENSE new file mode 100644 index 00000000..5ed027bd --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 asamuzaK (Kazz) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@asamuzakjp/css-color/README.md b/node_modules/@asamuzakjp/css-color/README.md new file mode 100644 index 00000000..0f964019 --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/README.md @@ -0,0 +1,316 @@ +# CSS color + +[![build](https://github.com/asamuzaK/cssColor/actions/workflows/node.js.yml/badge.svg)](https://github.com/asamuzaK/cssColor/actions/workflows/node.js.yml) +[![CodeQL](https://github.com/asamuzaK/cssColor/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/asamuzaK/cssColor/actions/workflows/github-code-scanning/codeql) +[![npm (scoped)](https://img.shields.io/npm/v/@asamuzakjp/css-color)](https://www.npmjs.com/package/@asamuzakjp/css-color) + +Resolve and convert CSS colors. + +## Install + +```console +npm i @asamuzakjp/css-color +``` + +## Usage + +```javascript +import { convert, resolve, utils } from '@asamuzakjp/css-color'; + +const resolvedValue = resolve( + 'color-mix(in oklab, lch(67.5345 42.5 258.2), color(srgb 0 0.5 0))' +); +// 'oklab(0.620754 -0.0931934 -0.00374881)' + +const convertedValue = covert.colorToHex('lab(46.2775% -47.5621 48.5837)'); +// '#008000' + +const result = utils.isColor('green'); +// true +``` + + + +### resolve(color, opt) + +resolves CSS color + +#### Parameters + +- `color` **[string][133]** color value + - system colors are not supported +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.currentColor` **[string][133]?** + - color to use for `currentcolor` keyword + - if omitted, it will be treated as a missing color, + i.e. `rgb(none none none / none)` + - `opt.customProperty` **[object][135]?** + - custom properties + - pair of `--` prefixed property name as a key and it's value, + e.g. + ```javascript + const opt = { + customProperty: { + '--some-color': '#008000', + '--some-length': '16px' + } + }; + ``` + - and/or `callback` function to get the value of the custom property, + e.g. + ```javascript + const node = document.getElementById('foo'); + const opt = { + customProperty: { + callback: node.style.getPropertyValue + } + }; + ``` + - `opt.dimension` **[object][135]?** + - dimension, e.g. for converting relative length to pixels + - pair of unit as a key and number in pixels as it's value, + e.g. suppose `1em === 12px`, `1rem === 16px` and `100vw === 1024px`, then + ```javascript + const opt = { + dimension: { + em: 12, + rem: 16, + vw: 10.24 + } + }; + ``` + - and/or `callback` function to get the value as a number in pixels, + e.g. + ```javascript + const opt = { + dimension: { + callback: unit => { + switch (unit) { + case 'em': + return 12; + case 'rem': + return 16; + case 'vw': + return 10.24; + default: + return; + } + } + } + }; + ``` + - `opt.format` **[string][133]?** + - output format, one of below + - `computedValue` (default), [computed value][139] of the color + - `specifiedValue`, [specified value][140] of the color + - `hex`, hex color notation, i.e. `#rrggbb` + - `hexAlpha`, hex color notation with alpha channel, i.e. `#rrggbbaa` + +Returns **[string][133]?** one of `rgba?()`, `#rrggbb(aa)?`, `color-name`, `color(color-space r g b / alpha)`, `color(color-space x y z / alpha)`, `(ok)?lab(l a b / alpha)`, `(ok)?lch(l c h / alpha)`, `'(empty-string)'`, `null` + +- in `computedValue`, values are numbers, however `rgb()` values are integers +- in `specifiedValue`, returns `empty string` for unknown and/or invalid color +- in `hex`, returns `null` for `transparent`, and also returns `null` if any of `r`, `g`, `b`, `alpha` is not a number +- in `hexAlpha`, returns `#00000000` for `transparent`, however returns `null` if any of `r`, `g`, `b`, `alpha` is not a number + +### convert + +Contains various color conversion functions. + +### convert.numberToHex(value) + +convert number to hex string + +#### Parameters + +- `value` **[number][134]** color value + +Returns **[string][133]** hex string: 00..ff + +### convert.colorToHex(value, opt) + +convert color to hex + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.alpha` **[boolean][136]?** return in #rrggbbaa notation + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[string][133]** #rrggbb(aa)? + +### convert.colorToHsl(value, opt) + +convert color to hsl + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[h, s, l, alpha] + +### convert.colorToHwb(value, opt) + +convert color to hwb + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[h, w, b, alpha] + +### convert.colorToLab(value, opt) + +convert color to lab + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, a, b, alpha] + +### convert.colorToLch(value, opt) + +convert color to lch + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, c, h, alpha] + +### convert.colorToOklab(value, opt) + +convert color to oklab + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, a, b, alpha] + +### convert.colorToOklch(value, opt) + +convert color to oklch + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, c, h, alpha] + +### convert.colorToRgb(value, opt) + +convert color to rgb + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[r, g, b, alpha] + +### convert.colorToXyz(value, opt) + +convert color to xyz + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + - `opt.d50` **[boolean][136]?** xyz in d50 white point + +Returns **[Array][137]<[number][134]>** \[x, y, z, alpha] + +### convert.colorToXyzD50(value, opt) + +convert color to xyz-d50 + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[x, y, z, alpha] + +### utils + +Contains utility functions. + +### utils.isColor(color) + +is valid color type + +#### Parameters + +- `color` **[string][133]** color value + - system colors are not supported + +Returns **[boolean][136]** + +## Acknowledgments + +The following resources have been of great help in the development of the CSS color. + +- [csstools/postcss-plugins](https://github.com/csstools/postcss-plugins) +- [lru-cache](https://github.com/isaacs/node-lru-cache) + +--- + +Copyright (c) 2024 [asamuzaK (Kazz)](https://github.com/asamuzaK/) + +[133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[134]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[135]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[136]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[137]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[138]: https://w3c.github.io/csswg-drafts/css-color-4/#color-conversion-code +[139]: https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value +[140]: https://developer.mozilla.org/en-US/docs/Web/CSS/specified_value +[141]: https://www.npmjs.com/package/@csstools/css-calc diff --git a/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js b/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js new file mode 100644 index 00000000..10726cbf --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js @@ -0,0 +1,220 @@ +var al=Object.defineProperty,to=t=>{throw TypeError(t)},ol=(t,e,n)=>e in t?al(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K=(t,e,n)=>ol(t,typeof e!="symbol"?e+"":e,n),Hs=(t,e,n)=>e.has(t)||to("Cannot "+n),u=(t,e,n)=>(Hs(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?to("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),C=(t,e,n,r)=>(Hs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),I=(t,e,n)=>(Hs(t,e,"access private method"),n),Us=(t,e,n,r)=>({set _(s){C(t,e,s,n)},get _(){return u(t,e,r)}});class dr extends Error{constructor(e,n,r,s){super(e),K(this,"sourceStart"),K(this,"sourceEnd"),K(this,"parserState"),this.name="ParseError",this.sourceStart=n,this.sourceEnd=r,this.parserState=s}}class an extends dr{constructor(e,n,r,s,a){super(e,n,r,s),K(this,"token"),this.token=a}}const qe={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'};function Ve(...t){let e="";for(let n=0;n=48&&t<=57}function ll(t){return t>=65&&t<=90}function cl(t){return t>=97&&t<=122}function bn(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function ul(t){return cl(t)||ll(t)}function On(t){return ul(t)||hl(t)||t===95}function zs(t){return On(t)||ne(t)||t===St}function hl(t){return t===183||t===8204||t===8205||t===8255||t===8256||t===8204||192<=t&&t<=214||216<=t&&t<=246||248<=t&&t<=893||895<=t&&t<=8191||8304<=t&&t<=8591||11264<=t&&t<=12271||12289<=t&&t<=55295||63744<=t&&t<=64975||65008<=t&&t<=65533||t===0||!!Wn(t)||t>=65536}function Xr(t){return t===Dn||t===Mn||t===12}function wn(t){return t===32||t===Dn||t===9||t===Mn||t===12}function Wn(t){return t>=55296&&t<=57343}function Tn(t){return t.source.codePointAt(t.cursor)===92&&!Xr(t.source.codePointAt(t.cursor+1)??-1)}function Yr(t,e){return e.source.codePointAt(e.cursor)===St?e.source.codePointAt(e.cursor+1)===St||!!On(e.source.codePointAt(e.cursor+1)??-1)||e.source.codePointAt(e.cursor+1)===92&&!Xr(e.source.codePointAt(e.cursor+2)??-1):!!On(e.source.codePointAt(e.cursor)??-1)||Tn(e)}function eo(t){return t.source.codePointAt(t.cursor)===Bn||t.source.codePointAt(t.cursor)===St?!!ne(t.source.codePointAt(t.cursor+1)??-1)||t.source.codePointAt(t.cursor+1)===46&&ne(t.source.codePointAt(t.cursor+2)??-1):t.source.codePointAt(t.cursor)===46?ne(t.source.codePointAt(t.cursor+1)??-1):ne(t.source.codePointAt(t.cursor)??-1)}function fl(t){return t.source.codePointAt(t.cursor)===47&&t.source.codePointAt(t.cursor+1)===42}function pl(t){return t.source.codePointAt(t.cursor)===St&&t.source.codePointAt(t.cursor+1)===St&&t.source.codePointAt(t.cursor+2)===62}var v,x,Zr;function dl(t){switch(t){case v.OpenParen:return v.CloseParen;case v.CloseParen:return v.OpenParen;case v.OpenCurly:return v.CloseCurly;case v.CloseCurly:return v.OpenCurly;case v.OpenSquare:return v.CloseSquare;case v.CloseSquare:return v.OpenSquare;default:return null}}function ml(t){switch(t[0]){case v.OpenParen:return[v.CloseParen,")",-1,-1,void 0];case v.CloseParen:return[v.OpenParen,"(",-1,-1,void 0];case v.OpenCurly:return[v.CloseCurly,"}",-1,-1,void 0];case v.CloseCurly:return[v.OpenCurly,"{",-1,-1,void 0];case v.OpenSquare:return[v.CloseSquare,"]",-1,-1,void 0];case v.CloseSquare:return[v.OpenSquare,"[",-1,-1,void 0];default:return null}}function gl(t,e){for(e.advanceCodePoint(2);;){const n=e.readCodePoint();if(n===void 0){const r=[v.Comment,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedEOFInComment,e.representationStart,e.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],r)),r}if(n===42&&e.source.codePointAt(e.cursor)!==void 0&&e.source.codePointAt(e.cursor)===47){e.advanceCodePoint();break}}return[v.Comment,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function Jr(t,e){const n=e.readCodePoint();if(n===void 0)return t.onParseError(new dr(qe.UnexpectedEOFInEscapedCodePoint,e.representationStart,e.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),Rn;if(bn(n)){const r=[n];let s;for(;(s=e.source.codePointAt(e.cursor))!==void 0&&bn(s)&&r.length<6;)r.push(s),e.advanceCodePoint();wn(e.source.codePointAt(e.cursor)??-1)&&(e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn&&e.advanceCodePoint(),e.advanceCodePoint());const a=parseInt(String.fromCodePoint(...r),16);return a===0||Wn(a)||a>1114111?Rn:a}return n===0||Wn(n)?Rn:n}function Qr(t,e){const n=[];for(;;){const r=e.source.codePointAt(e.cursor)??-1;if(r===0||Wn(r))n.push(Rn),e.advanceCodePoint(+(r>65535)+1);else if(zs(r))n.push(r),e.advanceCodePoint(+(r>65535)+1);else{if(!Tn(e))return n;e.advanceCodePoint(),n.push(Jr(t,e))}}}function vl(t,e){e.advanceCodePoint();const n=e.source.codePointAt(e.cursor);if(n!==void 0&&(zs(n)||Tn(e))){let r=Zr.Unrestricted;Yr(0,e)&&(r=Zr.ID);const s=Qr(t,e);return[v.Hash,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...s),type:r}]}return[v.Delim,"#",e.representationStart,e.representationEnd,{value:"#"}]}function bl(t,e){let n=x.Integer;for(e.source.codePointAt(e.cursor)!==Bn&&e.source.codePointAt(e.cursor)!==St||e.advanceCodePoint();ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===46&&ne(e.source.codePointAt(e.cursor+1)??-1))for(e.advanceCodePoint(2),n=x.Number;ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===101||e.source.codePointAt(e.cursor)===69){if(ne(e.source.codePointAt(e.cursor+1)??-1))e.advanceCodePoint(2);else{if(e.source.codePointAt(e.cursor+1)!==St&&e.source.codePointAt(e.cursor+1)!==Bn||!ne(e.source.codePointAt(e.cursor+2)??-1))return n;e.advanceCodePoint(3)}for(n=x.Number;ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint()}return n}function js(t,e){let n;{const a=e.source.codePointAt(e.cursor);a===St?n="-":a===Bn&&(n="+")}const r=bl(0,e),s=parseFloat(e.source.slice(e.representationStart,e.representationEnd+1));if(Yr(0,e)){const a=Qr(t,e);return[v.Dimension,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n,type:r,unit:String.fromCodePoint(...a)}]}return e.source.codePointAt(e.cursor)===37?(e.advanceCodePoint(),[v.Percentage,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n}]):[v.Number,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n,type:r}]}function wl(t){for(;wn(t.source.codePointAt(t.cursor)??-1);)t.advanceCodePoint();return[v.Whitespace,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0]}(function(t){t.Comment="comment",t.AtKeyword="at-keyword-token",t.BadString="bad-string-token",t.BadURL="bad-url-token",t.CDC="CDC-token",t.CDO="CDO-token",t.Colon="colon-token",t.Comma="comma-token",t.Delim="delim-token",t.Dimension="dimension-token",t.EOF="EOF-token",t.Function="function-token",t.Hash="hash-token",t.Ident="ident-token",t.Number="number-token",t.Percentage="percentage-token",t.Semicolon="semicolon-token",t.String="string-token",t.URL="url-token",t.Whitespace="whitespace-token",t.OpenParen="(-token",t.CloseParen=")-token",t.OpenSquare="[-token",t.CloseSquare="]-token",t.OpenCurly="{-token",t.CloseCurly="}-token",t.UnicodeRange="unicode-range-token"})(v||(v={})),function(t){t.Integer="integer",t.Number="number"}(x||(x={})),function(t){t.Unrestricted="unrestricted",t.ID="id"}(Zr||(Zr={}));class $l{constructor(e){K(this,"cursor",0),K(this,"source",""),K(this,"representationStart",0),K(this,"representationEnd",-1),this.source=e}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.cursor-1}readCodePoint(){const e=this.source.codePointAt(this.cursor);if(e!==void 0)return this.cursor=this.cursor+1,this.representationEnd=this.cursor-1,e}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.cursor-1}resetRepresentation(){this.representationStart=this.cursor,this.representationEnd=-1}}function yl(t,e){let n="";const r=e.readCodePoint();for(;;){const s=e.readCodePoint();if(s===void 0){const a=[v.String,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInString,e.representationStart,e.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],a)),a}if(Xr(s)){e.unreadCodePoint();const a=[v.BadString,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedNewLineInString,e.representationStart,e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn?e.representationEnd+2:e.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],a)),a}if(s===r)return[v.String,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];if(s!==92)s===0||Wn(s)?n+=String.fromCodePoint(Rn):n+=String.fromCodePoint(s);else{if(e.source.codePointAt(e.cursor)===void 0)continue;if(Xr(e.source.codePointAt(e.cursor)??-1)){e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn&&e.advanceCodePoint(),e.advanceCodePoint();continue}n+=String.fromCodePoint(Jr(t,e))}}}function Nl(t){return!(t.length!==3||t[0]!==117&&t[0]!==85||t[1]!==114&&t[1]!==82||t[2]!==108&&t[2]!==76)}function Gs(t,e){for(;;){const n=e.source.codePointAt(e.cursor);if(n===void 0)return;if(n===41)return void e.advanceCodePoint();Tn(e)?(e.advanceCodePoint(),Jr(t,e)):e.advanceCodePoint()}}function El(t,e){for(;wn(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();let n="";for(;;){if(e.source.codePointAt(e.cursor)===void 0){const a=[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],a)),a}if(e.source.codePointAt(e.cursor)===41)return e.advanceCodePoint(),[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];if(wn(e.source.codePointAt(e.cursor)??-1)){for(e.advanceCodePoint();wn(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===void 0){const a=[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],a)),a}return e.source.codePointAt(e.cursor)===41?(e.advanceCodePoint(),[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}]):(Gs(t,e),[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0])}const s=e.source.codePointAt(e.cursor);if(s===34||s===39||s===40||(r=s??-1)===11||r===127||0<=r&&r<=8||14<=r&&r<=31){Gs(t,e);const a=[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedCharacterInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token",`Unexpected U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point`],a)),a}if(s===92){if(Tn(e)){e.advanceCodePoint(),n+=String.fromCodePoint(Jr(t,e));continue}Gs(t,e);const a=[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.InvalidEscapeSequenceInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],a)),a}e.source.codePointAt(e.cursor)===0||Wn(e.source.codePointAt(e.cursor)??-1)?(n+=String.fromCodePoint(Rn),e.advanceCodePoint()):(n+=e.source[e.cursor],e.advanceCodePoint())}var r}function qs(t,e){const n=Qr(t,e);if(e.source.codePointAt(e.cursor)!==40)return[v.Ident,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}];if(Nl(n)){e.advanceCodePoint();let r=0;for(;;){const s=wn(e.source.codePointAt(e.cursor)??-1),a=wn(e.source.codePointAt(e.cursor+1)??-1);if(s&&a){r+=1,e.advanceCodePoint(1);continue}const o=s?e.source.codePointAt(e.cursor+1):e.source.codePointAt(e.cursor);if(o===34||o===39)return r>0&&e.unreadCodePoint(r),[v.Function,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}];break}return El(t,e)}return e.advanceCodePoint(),[v.Function,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}]}function Cl(t){return!(t.source.codePointAt(t.cursor)!==117&&t.source.codePointAt(t.cursor)!==85||t.source.codePointAt(t.cursor+1)!==Bn||t.source.codePointAt(t.cursor+2)!==63&&!bn(t.source.codePointAt(t.cursor+2)??-1))}function kl(t,e){e.advanceCodePoint(2);const n=[],r=[];let s;for(;(s=e.source.codePointAt(e.cursor))!==void 0&&n.length<6&&bn(s);)n.push(s),e.advanceCodePoint();for(;(s=e.source.codePointAt(e.cursor))!==void 0&&n.length<6&&s===63;)r.length===0&&r.push(...n),n.push(48),r.push(70),e.advanceCodePoint();if(!r.length&&e.source.codePointAt(e.cursor)===St&&bn(e.source.codePointAt(e.cursor+1)??-1))for(e.advanceCodePoint();(s=e.source.codePointAt(e.cursor))!==void 0&&r.length<6&&bn(s);)r.push(s),e.advanceCodePoint();if(!r.length){const i=parseInt(String.fromCodePoint(...n),16);return[v.UnicodeRange,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{startOfRange:i,endOfRange:i}]}const a=parseInt(String.fromCodePoint(...n),16),o=parseInt(String.fromCodePoint(...r),16);return[v.UnicodeRange,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{startOfRange:a,endOfRange:o}]}function Ke(t,e){const n=no(t),r=[];for(;!n.endOfFile();)r.push(n.nextToken());return r.push(n.nextToken()),r}function no(t,e){const n=t.css.valueOf(),r=t.unicodeRangesAllowed??!1,s=new $l(n),a={onParseError:Fl};return{nextToken:function(){s.resetRepresentation();const o=s.source.codePointAt(s.cursor);if(o===void 0)return[v.EOF,"",-1,-1,void 0];if(o===47&&fl(s))return gl(a,s);if(r&&(o===117||o===85)&&Cl(s))return kl(0,s);if(On(o))return qs(a,s);if(ne(o))return js(a,s);switch(o){case 44:return s.advanceCodePoint(),[v.Comma,",",s.representationStart,s.representationEnd,void 0];case 58:return s.advanceCodePoint(),[v.Colon,":",s.representationStart,s.representationEnd,void 0];case 59:return s.advanceCodePoint(),[v.Semicolon,";",s.representationStart,s.representationEnd,void 0];case 40:return s.advanceCodePoint(),[v.OpenParen,"(",s.representationStart,s.representationEnd,void 0];case 41:return s.advanceCodePoint(),[v.CloseParen,")",s.representationStart,s.representationEnd,void 0];case 91:return s.advanceCodePoint(),[v.OpenSquare,"[",s.representationStart,s.representationEnd,void 0];case 93:return s.advanceCodePoint(),[v.CloseSquare,"]",s.representationStart,s.representationEnd,void 0];case 123:return s.advanceCodePoint(),[v.OpenCurly,"{",s.representationStart,s.representationEnd,void 0];case 125:return s.advanceCodePoint(),[v.CloseCurly,"}",s.representationStart,s.representationEnd,void 0];case 39:case 34:return yl(a,s);case 35:return vl(a,s);case Bn:case 46:return eo(s)?js(a,s):(s.advanceCodePoint(),[v.Delim,s.source[s.representationStart],s.representationStart,s.representationEnd,{value:s.source[s.representationStart]}]);case Dn:case Mn:case 12:case 9:case 32:return wl(s);case St:return eo(s)?js(a,s):pl(s)?(s.advanceCodePoint(3),[v.CDC,"-->",s.representationStart,s.representationEnd,void 0]):Yr(0,s)?qs(a,s):(s.advanceCodePoint(),[v.Delim,"-",s.representationStart,s.representationEnd,{value:"-"}]);case 60:return il(s)?(s.advanceCodePoint(4),[v.CDO," +# parseArgs + +[![Coverage][coverage-image]][coverage-url] + +Polyfill of `util.parseArgs()` + +## `util.parseArgs([config])` + + + +> Stability: 1 - Experimental + +* `config` {Object} Used to provide arguments for parsing and to configure + the parser. `config` supports the following properties: + * `args` {string\[]} array of argument strings. **Default:** `process.argv` + with `execPath` and `filename` removed. + * `options` {Object} Used to describe arguments known to the parser. + Keys of `options` are the long names of options and values are an + {Object} accepting the following properties: + * `type` {string} Type of argument, which must be either `boolean` or `string`. + * `multiple` {boolean} Whether this option can be provided multiple + times. If `true`, all values will be collected in an array. If + `false`, values for the option are last-wins. **Default:** `false`. + * `short` {string} A single character alias for the option. + * `default` {string | boolean | string\[] | boolean\[]} The default option + value when it is not set by args. It must be of the same type as the + the `type` property. When `multiple` is `true`, it must be an array. + * `strict` {boolean} Should an error be thrown when unknown arguments + are encountered, or when arguments are passed that do not match the + `type` configured in `options`. + **Default:** `true`. + * `allowPositionals` {boolean} Whether this command accepts positional + arguments. + **Default:** `false` if `strict` is `true`, otherwise `true`. + * `tokens` {boolean} Return the parsed tokens. This is useful for extending + the built-in behavior, from adding additional checks through to reprocessing + the tokens in different ways. + **Default:** `false`. + +* Returns: {Object} The parsed command line arguments: + * `values` {Object} A mapping of parsed option names with their {string} + or {boolean} values. + * `positionals` {string\[]} Positional arguments. + * `tokens` {Object\[] | undefined} See [parseArgs tokens](#parseargs-tokens) + section. Only returned if `config` includes `tokens: true`. + +Provides a higher level API for command-line argument parsing than interacting +with `process.argv` directly. Takes a specification for the expected arguments +and returns a structured object with the parsed options and positionals. + +```mjs +import { parseArgs } from 'node:util'; +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); +// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] +``` + +```cjs +const { parseArgs } = require('node:util'); +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); +// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] +``` + +`util.parseArgs` is experimental and behavior may change. Join the +conversation in [pkgjs/parseargs][] to contribute to the design. + +### `parseArgs` `tokens` + +Detailed parse information is available for adding custom behaviours by +specifying `tokens: true` in the configuration. +The returned tokens have properties describing: + +* all tokens + * `kind` {string} One of 'option', 'positional', or 'option-terminator'. + * `index` {number} Index of element in `args` containing token. So the + source argument for a token is `args[token.index]`. +* option tokens + * `name` {string} Long name of option. + * `rawName` {string} How option used in args, like `-f` of `--foo`. + * `value` {string | undefined} Option value specified in args. + Undefined for boolean options. + * `inlineValue` {boolean | undefined} Whether option value specified inline, + like `--foo=bar`. +* positional tokens + * `value` {string} The value of the positional argument in args (i.e. `args[index]`). +* option-terminator token + +The returned tokens are in the order encountered in the input args. Options +that appear more than once in args produce a token for each use. Short option +groups like `-xy` expand to a token for each option. So `-xxx` produces +three tokens. + +For example to use the returned tokens to add support for a negated option +like `--no-color`, the tokens can be reprocessed to change the value stored +for the negated option. + +```mjs +import { parseArgs } from 'node:util'; + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); +``` + +```cjs +const { parseArgs } = require('node:util'); + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); +``` + +Example usage showing negated options, and when an option is used +multiple ways then last one wins. + +```console +$ node negate.js +{ logfile: 'default.log', color: undefined } +$ node negate.js --no-logfile --no-color +{ logfile: false, color: false } +$ node negate.js --logfile=test.log --color +{ logfile: 'test.log', color: true } +$ node negate.js --no-logfile --logfile=test.log --color --no-color +{ logfile: 'test.log', color: false } +``` + +----- + + +## Table of Contents +- [`util.parseArgs([config])`](#utilparseargsconfig) +- [Scope](#scope) +- [Version Matchups](#version-matchups) +- [🚀 Getting Started](#-getting-started) +- [🙌 Contributing](#-contributing) +- [💡 `process.mainArgs` Proposal](#-processmainargs-proposal) + - [Implementation:](#implementation) +- [📃 Examples](#-examples) +- [F.A.Qs](#faqs) +- [Links & Resources](#links--resources) + +----- + +## Scope + +It is already possible to build great arg parsing modules on top of what Node.js provides; the prickly API is abstracted away by these modules. Thus, process.parseArgs() is not necessarily intended for library authors; it is intended for developers of simple CLI tools, ad-hoc scripts, deployed Node.js applications, and learning materials. + +It is exceedingly difficult to provide an API which would both be friendly to these Node.js users while being extensible enough for libraries to build upon. We chose to prioritize these use cases because these are currently not well-served by Node.js' API. + +---- + +## Version Matchups + +| Node.js | @pkgjs/parseArgs | +| -- | -- | +| [v18.3.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [v0.9.1](https://github.com/pkgjs/parseargs/tree/v0.9.1#utilparseargsconfig) | +| [v16.17.0](https://nodejs.org/dist/latest-v16.x/docs/api/util.html#utilparseargsconfig), [v18.7.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [0.10.0](https://github.com/pkgjs/parseargs/tree/v0.10.0#utilparseargsconfig) | + +---- + +## 🚀 Getting Started + +1. **Install dependencies.** + + ```bash + npm install + ``` + +2. **Open the index.js file and start editing!** + +3. **Test your code by calling parseArgs through our test file** + + ```bash + npm test + ``` + +---- + +## 🙌 Contributing + +Any person who wants to contribute to the initiative is welcome! Please first read the [Contributing Guide](CONTRIBUTING.md) + +Additionally, reading the [`Examples w/ Output`](#-examples-w-output) section of this document will be the best way to familiarize yourself with the target expected behavior for parseArgs() once it is fully implemented. + +This package was implemented using [tape](https://www.npmjs.com/package/tape) as its test harness. + +---- + +## 💡 `process.mainArgs` Proposal + +> Note: This can be moved forward independently of the `util.parseArgs()` proposal/work. + +### Implementation: + +```javascript +process.mainArgs = process.argv.slice(process._exec ? 1 : 2) +``` + +---- + +## 📃 Examples + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// specify the options that may be used +const options = { + foo: { type: 'string'}, + bar: { type: 'boolean' }, +}; +const args = ['--foo=a', '--bar']; +const { values, positionals } = parseArgs({ args, options }); +// values = { foo: 'a', bar: true } +// positionals = [] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// type:string & multiple +const options = { + foo: { + type: 'string', + multiple: true, + }, +}; +const args = ['--foo=a', '--foo', 'b']; +const { values, positionals } = parseArgs({ args, options }); +// values = { foo: [ 'a', 'b' ] } +// positionals = [] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// shorts +const options = { + foo: { + short: 'f', + type: 'boolean' + }, +}; +const args = ['-f', 'b']; +const { values, positionals } = parseArgs({ args, options, allowPositionals: true }); +// values = { foo: true } +// positionals = ['b'] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// unconfigured +const options = {}; +const args = ['-f', '--foo=a', '--bar', 'b']; +const { values, positionals } = parseArgs({ strict: false, args, options, allowPositionals: true }); +// values = { f: true, foo: 'a', bar: true } +// positionals = ['b'] +``` + +---- + +## F.A.Qs + +- Is `cmd --foo=bar baz` the same as `cmd baz --foo=bar`? + - yes +- Does the parser execute a function? + - no +- Does the parser execute one of several functions, depending on input? + - no +- Can subcommands take options that are distinct from the main command? + - no +- Does it output generated help when no options match? + - no +- Does it generated short usage? Like: `usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]` + - no (no usage/help at all) +- Does the user provide the long usage text? For each option? For the whole command? + - no +- Do subcommands (if implemented) have their own usage output? + - no +- Does usage print if the user runs `cmd --help`? + - no +- Does it set `process.exitCode`? + - no +- Does usage print to stderr or stdout? + - N/A +- Does it check types? (Say, specify that an option is a boolean, number, etc.) + - no +- Can an option have more than one type? (string or false, for example) + - no +- Can the user define a type? (Say, `type: path` to call `path.resolve()` on the argument.) + - no +- Does a `--foo=0o22` mean 0, 22, 18, or "0o22"? + - `"0o22"` +- Does it coerce types? + - no +- Does `--no-foo` coerce to `--foo=false`? For all options? Only boolean options? + - no, it sets `{values:{'no-foo': true}}` +- Is `--foo` the same as `--foo=true`? Only for known booleans? Only at the end? + - no, they are not the same. There is no special handling of `true` as a value so it is just another string. +- Does it read environment variables? Ie, is `FOO=1 cmd` the same as `cmd --foo=1`? + - no +- Do unknown arguments raise an error? Are they parsed? Are they treated as positional arguments? + - no, they are parsed, not treated as positionals +- Does `--` signal the end of options? + - yes +- Is `--` included as a positional? + - no +- Is `program -- foo` the same as `program foo`? + - yes, both store `{positionals:['foo']}` +- Does the API specify whether a `--` was present/relevant? + - no +- Is `-bar` the same as `--bar`? + - no, `-bar` is a short option or options, with expansion logic that follows the + [Utility Syntax Guidelines in POSIX.1-2017](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). `-bar` expands to `-b`, `-a`, `-r`. +- Is `---foo` the same as `--foo`? + - no + - the first is a long option named `'-foo'` + - the second is a long option named `'foo'` +- Is `-` a positional? ie, `bash some-test.sh | tap -` + - yes + +## Links & Resources + +* [Initial Tooling Issue](https://github.com/nodejs/tooling/issues/19) +* [Initial Proposal](https://github.com/nodejs/node/pull/35015) +* [parseArgs Proposal](https://github.com/nodejs/node/pull/42675) + +[coverage-image]: https://img.shields.io/nycrc/pkgjs/parseargs +[coverage-url]: https://github.com/pkgjs/parseargs/blob/main/.nycrc +[pkgjs/parseargs]: https://github.com/pkgjs/parseargs diff --git a/node_modules/@pkgjs/parseargs/examples/is-default-value.js b/node_modules/@pkgjs/parseargs/examples/is-default-value.js new file mode 100644 index 00000000..0a67972b --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/is-default-value.js @@ -0,0 +1,25 @@ +'use strict'; + +// This example shows how to understand if a default value is used or not. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + file: { short: 'f', type: 'string', default: 'FOO' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const isFileDefault = !tokens.some((token) => token.kind === 'option' && + token.name === 'file' +); + +console.log(values); +console.log(`Is the file option [${values.file}] the default value? ${isFileDefault}`); + +// Try the following: +// node is-default-value.js +// node is-default-value.js -f FILE +// node is-default-value.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js b/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js new file mode 100644 index 00000000..943e643e --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js @@ -0,0 +1,35 @@ +'use strict'; + +// This is an example of using tokens to add a custom behaviour. +// +// Require the use of `=` for long options and values by blocking +// the use of space separated values. +// So allow `--foo=bar`, and not allow `--foo bar`. +// +// Note: this is not a common behaviour, most CLIs allow both forms. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + file: { short: 'f', type: 'string' }, + log: { type: 'string' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const badToken = tokens.find((token) => token.kind === 'option' && + token.value != null && + token.rawName.startsWith('--') && + !token.inlineValue +); +if (badToken) { + throw new Error(`Option value for '${badToken.rawName}' must be inline, like '${badToken.rawName}=VALUE'`); +} + +console.log(values); + +// Try the following: +// node limit-long-syntax.js -f FILE --log=LOG +// node limit-long-syntax.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/negate.js b/node_modules/@pkgjs/parseargs/examples/negate.js new file mode 100644 index 00000000..b6634690 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/negate.js @@ -0,0 +1,43 @@ +'use strict'; + +// This example is used in the documentation. + +// How might I add my own support for --no-foo? + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); + +// Try the following: +// node negate.js +// node negate.js --no-logfile --no-color +// negate.js --logfile=test.log --color +// node negate.js --no-logfile --logfile=test.log --color --no-color diff --git a/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js b/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js new file mode 100644 index 00000000..0c324688 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js @@ -0,0 +1,31 @@ +'use strict'; + +// This is an example of using tokens to add a custom behaviour. +// +// Throw an error if an option is used more than once. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + ding: { type: 'boolean', short: 'd' }, + beep: { type: 'boolean', short: 'b' } +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +const seenBefore = new Set(); +tokens.forEach((token) => { + if (token.kind !== 'option') return; + if (seenBefore.has(token.name)) { + throw new Error(`option '${token.name}' used multiple times`); + } + seenBefore.add(token.name); +}); + +console.log(values); + +// Try the following: +// node no-repeated-options --ding --beep +// node no-repeated-options --beep -b +// node no-repeated-options -ddd diff --git a/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs b/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs new file mode 100644 index 00000000..8ab7367b --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs @@ -0,0 +1,41 @@ +// This is an example of using tokens to add a custom behaviour. +// +// This adds a option order check so that --some-unstable-option +// may only be used after --enable-experimental-options +// +// Note: this is not a common behaviour, the order of different options +// does not usually matter. + +import { parseArgs } from '../index.js'; + +function findTokenIndex(tokens, target) { + return tokens.findIndex((token) => token.kind === 'option' && + token.name === target + ); +} + +const experimentalName = 'enable-experimental-options'; +const unstableName = 'some-unstable-option'; + +const options = { + [experimentalName]: { type: 'boolean' }, + [unstableName]: { type: 'boolean' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const experimentalIndex = findTokenIndex(tokens, experimentalName); +const unstableIndex = findTokenIndex(tokens, unstableName); +if (unstableIndex !== -1 && + ((experimentalIndex === -1) || (unstableIndex < experimentalIndex))) { + throw new Error(`'--${experimentalName}' must be specified before '--${unstableName}'`); +} + +console.log(values); + +/* eslint-disable max-len */ +// Try the following: +// node ordered-options.mjs +// node ordered-options.mjs --some-unstable-option +// node ordered-options.mjs --some-unstable-option --enable-experimental-options +// node ordered-options.mjs --enable-experimental-options --some-unstable-option diff --git a/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js b/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js new file mode 100644 index 00000000..eff04c2a --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js @@ -0,0 +1,26 @@ +'use strict'; + +// This example is used in the documentation. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); + +// Try the following: +// node simple-hard-coded.js diff --git a/node_modules/@pkgjs/parseargs/index.js b/node_modules/@pkgjs/parseargs/index.js new file mode 100644 index 00000000..b1004c7b --- /dev/null +++ b/node_modules/@pkgjs/parseargs/index.js @@ -0,0 +1,396 @@ +'use strict'; + +const { + ArrayPrototypeForEach, + ArrayPrototypeIncludes, + ArrayPrototypeMap, + ArrayPrototypePush, + ArrayPrototypePushApply, + ArrayPrototypeShift, + ArrayPrototypeSlice, + ArrayPrototypeUnshiftApply, + ObjectEntries, + ObjectPrototypeHasOwnProperty: ObjectHasOwn, + StringPrototypeCharAt, + StringPrototypeIndexOf, + StringPrototypeSlice, + StringPrototypeStartsWith, +} = require('./internal/primordials'); + +const { + validateArray, + validateBoolean, + validateBooleanArray, + validateObject, + validateString, + validateStringArray, + validateUnion, +} = require('./internal/validators'); + +const { + kEmptyObject, +} = require('./internal/util'); + +const { + findLongOptionForShort, + isLoneLongOption, + isLoneShortOption, + isLongOptionAndValue, + isOptionValue, + isOptionLikeValue, + isShortOptionAndValue, + isShortOptionGroup, + useDefaultValueOption, + objectGetOwn, + optionsGetOwn, +} = require('./utils'); + +const { + codes: { + ERR_INVALID_ARG_VALUE, + ERR_PARSE_ARGS_INVALID_OPTION_VALUE, + ERR_PARSE_ARGS_UNKNOWN_OPTION, + ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, + }, +} = require('./internal/errors'); + +function getMainArgs() { + // Work out where to slice process.argv for user supplied arguments. + + // Check node options for scenarios where user CLI args follow executable. + const execArgv = process.execArgv; + if (ArrayPrototypeIncludes(execArgv, '-e') || + ArrayPrototypeIncludes(execArgv, '--eval') || + ArrayPrototypeIncludes(execArgv, '-p') || + ArrayPrototypeIncludes(execArgv, '--print')) { + return ArrayPrototypeSlice(process.argv, 1); + } + + // Normally first two arguments are executable and script, then CLI arguments + return ArrayPrototypeSlice(process.argv, 2); +} + +/** + * In strict mode, throw for possible usage errors like --foo --bar + * + * @param {object} token - from tokens as available from parseArgs + */ +function checkOptionLikeValue(token) { + if (!token.inlineValue && isOptionLikeValue(token.value)) { + // Only show short example if user used short option. + const example = StringPrototypeStartsWith(token.rawName, '--') ? + `'${token.rawName}=-XYZ'` : + `'--${token.name}=-XYZ' or '${token.rawName}-XYZ'`; + const errorMessage = `Option '${token.rawName}' argument is ambiguous. +Did you forget to specify the option argument for '${token.rawName}'? +To specify an option argument starting with a dash use ${example}.`; + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(errorMessage); + } +} + +/** + * In strict mode, throw for usage errors. + * + * @param {object} config - from config passed to parseArgs + * @param {object} token - from tokens as available from parseArgs + */ +function checkOptionUsage(config, token) { + if (!ObjectHasOwn(config.options, token.name)) { + throw new ERR_PARSE_ARGS_UNKNOWN_OPTION( + token.rawName, config.allowPositionals); + } + + const short = optionsGetOwn(config.options, token.name, 'short'); + const shortAndLong = `${short ? `-${short}, ` : ''}--${token.name}`; + const type = optionsGetOwn(config.options, token.name, 'type'); + if (type === 'string' && typeof token.value !== 'string') { + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong} ' argument missing`); + } + // (Idiomatic test for undefined||null, expecting undefined.) + if (type === 'boolean' && token.value != null) { + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong}' does not take an argument`); + } +} + + +/** + * Store the option value in `values`. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {string|undefined} optionValue - value from user args + * @param {object} options - option configs, from parseArgs({ options }) + * @param {object} values - option values returned in `values` by parseArgs + */ +function storeOption(longOption, optionValue, options, values) { + if (longOption === '__proto__') { + return; // No. Just no. + } + + // We store based on the option value rather than option type, + // preserving the users intent for author to deal with. + const newValue = optionValue ?? true; + if (optionsGetOwn(options, longOption, 'multiple')) { + // Always store value in array, including for boolean. + // values[longOption] starts out not present, + // first value is added as new array [newValue], + // subsequent values are pushed to existing array. + // (note: values has null prototype, so simpler usage) + if (values[longOption]) { + ArrayPrototypePush(values[longOption], newValue); + } else { + values[longOption] = [newValue]; + } + } else { + values[longOption] = newValue; + } +} + +/** + * Store the default option value in `values`. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {string + * | boolean + * | string[] + * | boolean[]} optionValue - default value from option config + * @param {object} values - option values returned in `values` by parseArgs + */ +function storeDefaultOption(longOption, optionValue, values) { + if (longOption === '__proto__') { + return; // No. Just no. + } + + values[longOption] = optionValue; +} + +/** + * Process args and turn into identified tokens: + * - option (along with value, if any) + * - positional + * - option-terminator + * + * @param {string[]} args - from parseArgs({ args }) or mainArgs + * @param {object} options - option configs, from parseArgs({ options }) + */ +function argsToTokens(args, options) { + const tokens = []; + let index = -1; + let groupCount = 0; + + const remainingArgs = ArrayPrototypeSlice(args); + while (remainingArgs.length > 0) { + const arg = ArrayPrototypeShift(remainingArgs); + const nextArg = remainingArgs[0]; + if (groupCount > 0) + groupCount--; + else + index++; + + // Check if `arg` is an options terminator. + // Guideline 10 in https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html + if (arg === '--') { + // Everything after a bare '--' is considered a positional argument. + ArrayPrototypePush(tokens, { kind: 'option-terminator', index }); + ArrayPrototypePushApply( + tokens, ArrayPrototypeMap(remainingArgs, (arg) => { + return { kind: 'positional', index: ++index, value: arg }; + }) + ); + break; // Finished processing args, leave while loop. + } + + if (isLoneShortOption(arg)) { + // e.g. '-f' + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + let value; + let inlineValue; + if (optionsGetOwn(options, longOption, 'type') === 'string' && + isOptionValue(nextArg)) { + // e.g. '-f', 'bar' + value = ArrayPrototypeShift(remainingArgs); + inlineValue = false; + } + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: arg, + index, value, inlineValue }); + if (value != null) ++index; + continue; + } + + if (isShortOptionGroup(arg, options)) { + // Expand -fXzy to -f -X -z -y + const expanded = []; + for (let index = 1; index < arg.length; index++) { + const shortOption = StringPrototypeCharAt(arg, index); + const longOption = findLongOptionForShort(shortOption, options); + if (optionsGetOwn(options, longOption, 'type') !== 'string' || + index === arg.length - 1) { + // Boolean option, or last short in group. Well formed. + ArrayPrototypePush(expanded, `-${shortOption}`); + } else { + // String option in middle. Yuck. + // Expand -abfFILE to -a -b -fFILE + ArrayPrototypePush(expanded, `-${StringPrototypeSlice(arg, index)}`); + break; // finished short group + } + } + ArrayPrototypeUnshiftApply(remainingArgs, expanded); + groupCount = expanded.length; + continue; + } + + if (isShortOptionAndValue(arg, options)) { + // e.g. -fFILE + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + const value = StringPrototypeSlice(arg, 2); + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: `-${shortOption}`, + index, value, inlineValue: true }); + continue; + } + + if (isLoneLongOption(arg)) { + // e.g. '--foo' + const longOption = StringPrototypeSlice(arg, 2); + let value; + let inlineValue; + if (optionsGetOwn(options, longOption, 'type') === 'string' && + isOptionValue(nextArg)) { + // e.g. '--foo', 'bar' + value = ArrayPrototypeShift(remainingArgs); + inlineValue = false; + } + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: arg, + index, value, inlineValue }); + if (value != null) ++index; + continue; + } + + if (isLongOptionAndValue(arg)) { + // e.g. --foo=bar + const equalIndex = StringPrototypeIndexOf(arg, '='); + const longOption = StringPrototypeSlice(arg, 2, equalIndex); + const value = StringPrototypeSlice(arg, equalIndex + 1); + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: `--${longOption}`, + index, value, inlineValue: true }); + continue; + } + + ArrayPrototypePush(tokens, { kind: 'positional', index, value: arg }); + } + + return tokens; +} + +const parseArgs = (config = kEmptyObject) => { + const args = objectGetOwn(config, 'args') ?? getMainArgs(); + const strict = objectGetOwn(config, 'strict') ?? true; + const allowPositionals = objectGetOwn(config, 'allowPositionals') ?? !strict; + const returnTokens = objectGetOwn(config, 'tokens') ?? false; + const options = objectGetOwn(config, 'options') ?? { __proto__: null }; + // Bundle these up for passing to strict-mode checks. + const parseConfig = { args, strict, options, allowPositionals }; + + // Validate input configuration. + validateArray(args, 'args'); + validateBoolean(strict, 'strict'); + validateBoolean(allowPositionals, 'allowPositionals'); + validateBoolean(returnTokens, 'tokens'); + validateObject(options, 'options'); + ArrayPrototypeForEach( + ObjectEntries(options), + ({ 0: longOption, 1: optionConfig }) => { + validateObject(optionConfig, `options.${longOption}`); + + // type is required + const optionType = objectGetOwn(optionConfig, 'type'); + validateUnion(optionType, `options.${longOption}.type`, ['string', 'boolean']); + + if (ObjectHasOwn(optionConfig, 'short')) { + const shortOption = optionConfig.short; + validateString(shortOption, `options.${longOption}.short`); + if (shortOption.length !== 1) { + throw new ERR_INVALID_ARG_VALUE( + `options.${longOption}.short`, + shortOption, + 'must be a single character' + ); + } + } + + const multipleOption = objectGetOwn(optionConfig, 'multiple'); + if (ObjectHasOwn(optionConfig, 'multiple')) { + validateBoolean(multipleOption, `options.${longOption}.multiple`); + } + + const defaultValue = objectGetOwn(optionConfig, 'default'); + if (defaultValue !== undefined) { + let validator; + switch (optionType) { + case 'string': + validator = multipleOption ? validateStringArray : validateString; + break; + + case 'boolean': + validator = multipleOption ? validateBooleanArray : validateBoolean; + break; + } + validator(defaultValue, `options.${longOption}.default`); + } + } + ); + + // Phase 1: identify tokens + const tokens = argsToTokens(args, options); + + // Phase 2: process tokens into parsed option values and positionals + const result = { + values: { __proto__: null }, + positionals: [], + }; + if (returnTokens) { + result.tokens = tokens; + } + ArrayPrototypeForEach(tokens, (token) => { + if (token.kind === 'option') { + if (strict) { + checkOptionUsage(parseConfig, token); + checkOptionLikeValue(token); + } + storeOption(token.name, token.value, options, result.values); + } else if (token.kind === 'positional') { + if (!allowPositionals) { + throw new ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL(token.value); + } + ArrayPrototypePush(result.positionals, token.value); + } + }); + + // Phase 3: fill in default values for missing args + ArrayPrototypeForEach(ObjectEntries(options), ({ 0: longOption, + 1: optionConfig }) => { + const mustSetDefault = useDefaultValueOption(longOption, + optionConfig, + result.values); + if (mustSetDefault) { + storeDefaultOption(longOption, + objectGetOwn(optionConfig, 'default'), + result.values); + } + }); + + + return result; +}; + +module.exports = { + parseArgs, +}; diff --git a/node_modules/@pkgjs/parseargs/internal/errors.js b/node_modules/@pkgjs/parseargs/internal/errors.js new file mode 100644 index 00000000..e1b237b5 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/errors.js @@ -0,0 +1,47 @@ +'use strict'; + +class ERR_INVALID_ARG_TYPE extends TypeError { + constructor(name, expected, actual) { + super(`${name} must be ${expected} got ${actual}`); + this.code = 'ERR_INVALID_ARG_TYPE'; + } +} + +class ERR_INVALID_ARG_VALUE extends TypeError { + constructor(arg1, arg2, expected) { + super(`The property ${arg1} ${expected}. Received '${arg2}'`); + this.code = 'ERR_INVALID_ARG_VALUE'; + } +} + +class ERR_PARSE_ARGS_INVALID_OPTION_VALUE extends Error { + constructor(message) { + super(message); + this.code = 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE'; + } +} + +class ERR_PARSE_ARGS_UNKNOWN_OPTION extends Error { + constructor(option, allowPositionals) { + const suggestDashDash = allowPositionals ? `. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${JSON.stringify(option)}` : ''; + super(`Unknown option '${option}'${suggestDashDash}`); + this.code = 'ERR_PARSE_ARGS_UNKNOWN_OPTION'; + } +} + +class ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL extends Error { + constructor(positional) { + super(`Unexpected argument '${positional}'. This command does not take positional arguments`); + this.code = 'ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL'; + } +} + +module.exports = { + codes: { + ERR_INVALID_ARG_TYPE, + ERR_INVALID_ARG_VALUE, + ERR_PARSE_ARGS_INVALID_OPTION_VALUE, + ERR_PARSE_ARGS_UNKNOWN_OPTION, + ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, + } +}; diff --git a/node_modules/@pkgjs/parseargs/internal/primordials.js b/node_modules/@pkgjs/parseargs/internal/primordials.js new file mode 100644 index 00000000..63e23ab1 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/primordials.js @@ -0,0 +1,393 @@ +/* +This file is copied from https://github.com/nodejs/node/blob/v14.19.3/lib/internal/per_context/primordials.js +under the following license: + +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +*/ + +'use strict'; + +/* eslint-disable node-core/prefer-primordials */ + +// This file subclasses and stores the JS builtins that come from the VM +// so that Node.js's builtin modules do not need to later look these up from +// the global proxy, which can be mutated by users. + +// Use of primordials have sometimes a dramatic impact on performance, please +// benchmark all changes made in performance-sensitive areas of the codebase. +// See: https://github.com/nodejs/node/pull/38248 + +const primordials = {}; + +const { + defineProperty: ReflectDefineProperty, + getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, + ownKeys: ReflectOwnKeys, +} = Reflect; + +// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`. +// It is using `bind.bind(call)` to avoid using `Function.prototype.bind` +// and `Function.prototype.call` after it may have been mutated by users. +const { apply, bind, call } = Function.prototype; +const uncurryThis = bind.bind(call); +primordials.uncurryThis = uncurryThis; + +// `applyBind` is equivalent to `func => Function.prototype.apply.bind(func)`. +// It is using `bind.bind(apply)` to avoid using `Function.prototype.bind` +// and `Function.prototype.apply` after it may have been mutated by users. +const applyBind = bind.bind(apply); +primordials.applyBind = applyBind; + +// Methods that accept a variable number of arguments, and thus it's useful to +// also create `${prefix}${key}Apply`, which uses `Function.prototype.apply`, +// instead of `Function.prototype.call`, and thus doesn't require iterator +// destructuring. +const varargsMethods = [ + // 'ArrayPrototypeConcat' is omitted, because it performs the spread + // on its own for arrays and array-likes with a truthy + // @@isConcatSpreadable symbol property. + 'ArrayOf', + 'ArrayPrototypePush', + 'ArrayPrototypeUnshift', + // 'FunctionPrototypeCall' is omitted, since there's 'ReflectApply' + // and 'FunctionPrototypeApply'. + 'MathHypot', + 'MathMax', + 'MathMin', + 'StringPrototypeConcat', + 'TypedArrayOf', +]; + +function getNewKey(key) { + return typeof key === 'symbol' ? + `Symbol${key.description[7].toUpperCase()}${key.description.slice(8)}` : + `${key[0].toUpperCase()}${key.slice(1)}`; +} + +function copyAccessor(dest, prefix, key, { enumerable, get, set }) { + ReflectDefineProperty(dest, `${prefix}Get${key}`, { + value: uncurryThis(get), + enumerable + }); + if (set !== undefined) { + ReflectDefineProperty(dest, `${prefix}Set${key}`, { + value: uncurryThis(set), + enumerable + }); + } +} + +function copyPropsRenamed(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + // `src` is bound as the `this` so that the static `this` points + // to the object it was defined on, + // e.g.: `ArrayOfApply` gets a `this` of `Array`: + value: applyBind(desc.value, src), + }); + } + } + } +} + +function copyPropsRenamedBound(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const { value } = desc; + if (typeof value === 'function') { + desc.value = value.bind(src); + } + + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + value: applyBind(value, src), + }); + } + } + } +} + +function copyPrototype(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const { value } = desc; + if (typeof value === 'function') { + desc.value = uncurryThis(value); + } + + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + value: applyBind(value), + }); + } + } + } +} + +// Create copies of configurable value properties of the global object +[ + 'Proxy', + 'globalThis', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + primordials[name] = globalThis[name]; +}); + +// Create copies of URI handling functions +[ + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, +].forEach((fn) => { + primordials[fn.name] = fn; +}); + +// Create copies of the namespace objects +[ + 'JSON', + 'Math', + 'Proxy', + 'Reflect', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + copyPropsRenamed(global[name], primordials, name); +}); + +// Create copies of intrinsic objects +[ + 'Array', + 'ArrayBuffer', + 'BigInt', + 'BigInt64Array', + 'BigUint64Array', + 'Boolean', + 'DataView', + 'Date', + 'Error', + 'EvalError', + 'Float32Array', + 'Float64Array', + 'Function', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Map', + 'Number', + 'Object', + 'RangeError', + 'ReferenceError', + 'RegExp', + 'Set', + 'String', + 'Symbol', + 'SyntaxError', + 'TypeError', + 'URIError', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'WeakMap', + 'WeakSet', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + const original = global[name]; + primordials[name] = original; + copyPropsRenamed(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +// Create copies of intrinsic objects that require a valid `this` to call +// static methods. +// Refs: https://www.ecma-international.org/ecma-262/#sec-promise.all +[ + 'Promise', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + const original = global[name]; + primordials[name] = original; + copyPropsRenamedBound(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +// Create copies of abstract intrinsic objects that are not directly exposed +// on the global object. +// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object +[ + { name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) }, + { name: 'ArrayIterator', original: { + prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()), + } }, + { name: 'StringIterator', original: { + prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), + } }, +].forEach(({ name, original }) => { + primordials[name] = original; + // The static %TypedArray% methods require a valid `this`, but can't be bound, + // as they need a subclass constructor as the receiver: + copyPrototype(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +/* eslint-enable node-core/prefer-primordials */ + +const { + ArrayPrototypeForEach, + FunctionPrototypeCall, + Map, + ObjectFreeze, + ObjectSetPrototypeOf, + Set, + SymbolIterator, + WeakMap, + WeakSet, +} = primordials; + +// Because these functions are used by `makeSafe`, which is exposed +// on the `primordials` object, it's important to use const references +// to the primordials that they use: +const createSafeIterator = (factory, next) => { + class SafeIterator { + constructor(iterable) { + this._iterator = factory(iterable); + } + next() { + return next(this._iterator); + } + [SymbolIterator]() { + return this; + } + } + ObjectSetPrototypeOf(SafeIterator.prototype, null); + ObjectFreeze(SafeIterator.prototype); + ObjectFreeze(SafeIterator); + return SafeIterator; +}; + +primordials.SafeArrayIterator = createSafeIterator( + primordials.ArrayPrototypeSymbolIterator, + primordials.ArrayIteratorPrototypeNext +); +primordials.SafeStringIterator = createSafeIterator( + primordials.StringPrototypeSymbolIterator, + primordials.StringIteratorPrototypeNext +); + +const copyProps = (src, dest) => { + ArrayPrototypeForEach(ReflectOwnKeys(src), (key) => { + if (!ReflectGetOwnPropertyDescriptor(dest, key)) { + ReflectDefineProperty( + dest, + key, + ReflectGetOwnPropertyDescriptor(src, key)); + } + }); +}; + +const makeSafe = (unsafe, safe) => { + if (SymbolIterator in unsafe.prototype) { + const dummy = new unsafe(); + let next; // We can reuse the same `next` method. + + ArrayPrototypeForEach(ReflectOwnKeys(unsafe.prototype), (key) => { + if (!ReflectGetOwnPropertyDescriptor(safe.prototype, key)) { + const desc = ReflectGetOwnPropertyDescriptor(unsafe.prototype, key); + if ( + typeof desc.value === 'function' && + desc.value.length === 0 && + SymbolIterator in (FunctionPrototypeCall(desc.value, dummy) ?? {}) + ) { + const createIterator = uncurryThis(desc.value); + next = next ?? uncurryThis(createIterator(dummy).next); + const SafeIterator = createSafeIterator(createIterator, next); + desc.value = function() { + return new SafeIterator(this); + }; + } + ReflectDefineProperty(safe.prototype, key, desc); + } + }); + } else { + copyProps(unsafe.prototype, safe.prototype); + } + copyProps(unsafe, safe); + + ObjectSetPrototypeOf(safe.prototype, null); + ObjectFreeze(safe.prototype); + ObjectFreeze(safe); + return safe; +}; +primordials.makeSafe = makeSafe; + +// Subclass the constructors because we need to use their prototype +// methods later. +// Defining the `constructor` is necessary here to avoid the default +// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`. +primordials.SafeMap = makeSafe( + Map, + class SafeMap extends Map { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeWeakMap = makeSafe( + WeakMap, + class SafeWeakMap extends WeakMap { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeSet = makeSafe( + Set, + class SafeSet extends Set { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeWeakSet = makeSafe( + WeakSet, + class SafeWeakSet extends WeakSet { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); + +ObjectSetPrototypeOf(primordials, null); +ObjectFreeze(primordials); + +module.exports = primordials; diff --git a/node_modules/@pkgjs/parseargs/internal/util.js b/node_modules/@pkgjs/parseargs/internal/util.js new file mode 100644 index 00000000..b9b8fe5b --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/util.js @@ -0,0 +1,14 @@ +'use strict'; + +// This is a placeholder for util.js in node.js land. + +const { + ObjectCreate, + ObjectFreeze, +} = require('./primordials'); + +const kEmptyObject = ObjectFreeze(ObjectCreate(null)); + +module.exports = { + kEmptyObject, +}; diff --git a/node_modules/@pkgjs/parseargs/internal/validators.js b/node_modules/@pkgjs/parseargs/internal/validators.js new file mode 100644 index 00000000..b5ac4fb5 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/validators.js @@ -0,0 +1,89 @@ +'use strict'; + +// This file is a proxy of the original file located at: +// https://github.com/nodejs/node/blob/main/lib/internal/validators.js +// Every addition or modification to this file must be evaluated +// during the PR review. + +const { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, +} = require('./primordials'); + +const { + codes: { + ERR_INVALID_ARG_TYPE + } +} = require('./errors'); + +function validateString(value, name) { + if (typeof value !== 'string') { + throw new ERR_INVALID_ARG_TYPE(name, 'String', value); + } +} + +function validateUnion(value, name, union) { + if (!ArrayPrototypeIncludes(union, value)) { + throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value); + } +} + +function validateBoolean(value, name) { + if (typeof value !== 'boolean') { + throw new ERR_INVALID_ARG_TYPE(name, 'Boolean', value); + } +} + +function validateArray(value, name) { + if (!ArrayIsArray(value)) { + throw new ERR_INVALID_ARG_TYPE(name, 'Array', value); + } +} + +function validateStringArray(value, name) { + validateArray(value, name); + for (let i = 0; i < value.length; i++) { + validateString(value[i], `${name}[${i}]`); + } +} + +function validateBooleanArray(value, name) { + validateArray(value, name); + for (let i = 0; i < value.length; i++) { + validateBoolean(value[i], `${name}[${i}]`); + } +} + +/** + * @param {unknown} value + * @param {string} name + * @param {{ + * allowArray?: boolean, + * allowFunction?: boolean, + * nullable?: boolean + * }} [options] + */ +function validateObject(value, name, options) { + const useDefaultOptions = options == null; + const allowArray = useDefaultOptions ? false : options.allowArray; + const allowFunction = useDefaultOptions ? false : options.allowFunction; + const nullable = useDefaultOptions ? false : options.nullable; + if ((!nullable && value === null) || + (!allowArray && ArrayIsArray(value)) || + (typeof value !== 'object' && ( + !allowFunction || typeof value !== 'function' + ))) { + throw new ERR_INVALID_ARG_TYPE(name, 'Object', value); + } +} + +module.exports = { + validateArray, + validateObject, + validateString, + validateStringArray, + validateUnion, + validateBoolean, + validateBooleanArray, +}; diff --git a/node_modules/@pkgjs/parseargs/package.json b/node_modules/@pkgjs/parseargs/package.json new file mode 100644 index 00000000..0bcc05c0 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/package.json @@ -0,0 +1,36 @@ +{ + "name": "@pkgjs/parseargs", + "version": "0.11.0", + "description": "Polyfill of future proposal for `util.parseArgs()`", + "engines": { + "node": ">=14" + }, + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "coverage": "c8 --check-coverage tape 'test/*.js'", + "test": "c8 tape 'test/*.js'", + "posttest": "eslint .", + "fix": "npm run posttest -- --fix" + }, + "repository": { + "type": "git", + "url": "git@github.com:pkgjs/parseargs.git" + }, + "keywords": [], + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/pkgjs/parseargs/issues" + }, + "homepage": "https://github.com/pkgjs/parseargs#readme", + "devDependencies": { + "c8": "^7.10.0", + "eslint": "^8.2.0", + "eslint-plugin-node-core": "iansu/eslint-plugin-node-core", + "tape": "^5.2.2" + } +} diff --git a/node_modules/@pkgjs/parseargs/utils.js b/node_modules/@pkgjs/parseargs/utils.js new file mode 100644 index 00000000..d7f420a2 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/utils.js @@ -0,0 +1,198 @@ +'use strict'; + +const { + ArrayPrototypeFind, + ObjectEntries, + ObjectPrototypeHasOwnProperty: ObjectHasOwn, + StringPrototypeCharAt, + StringPrototypeIncludes, + StringPrototypeStartsWith, +} = require('./internal/primordials'); + +const { + validateObject, +} = require('./internal/validators'); + +// These are internal utilities to make the parsing logic easier to read, and +// add lots of detail for the curious. They are in a separate file to allow +// unit testing, although that is not essential (this could be rolled into +// main file and just tested implicitly via API). +// +// These routines are for internal use, not for export to client. + +/** + * Return the named property, but only if it is an own property. + */ +function objectGetOwn(obj, prop) { + if (ObjectHasOwn(obj, prop)) + return obj[prop]; +} + +/** + * Return the named options property, but only if it is an own property. + */ +function optionsGetOwn(options, longOption, prop) { + if (ObjectHasOwn(options, longOption)) + return objectGetOwn(options[longOption], prop); +} + +/** + * Determines if the argument may be used as an option value. + * @example + * isOptionValue('V') // returns true + * isOptionValue('-v') // returns true (greedy) + * isOptionValue('--foo') // returns true (greedy) + * isOptionValue(undefined) // returns false + */ +function isOptionValue(value) { + if (value == null) return false; + + // Open Group Utility Conventions are that an option-argument + // is the argument after the option, and may start with a dash. + return true; // greedy! +} + +/** + * Detect whether there is possible confusion and user may have omitted + * the option argument, like `--port --verbose` when `port` of type:string. + * In strict mode we throw errors if value is option-like. + */ +function isOptionLikeValue(value) { + if (value == null) return false; + + return value.length > 1 && StringPrototypeCharAt(value, 0) === '-'; +} + +/** + * Determines if `arg` is just a short option. + * @example '-f' + */ +function isLoneShortOption(arg) { + return arg.length === 2 && + StringPrototypeCharAt(arg, 0) === '-' && + StringPrototypeCharAt(arg, 1) !== '-'; +} + +/** + * Determines if `arg` is a lone long option. + * @example + * isLoneLongOption('a') // returns false + * isLoneLongOption('-a') // returns false + * isLoneLongOption('--foo') // returns true + * isLoneLongOption('--foo=bar') // returns false + */ +function isLoneLongOption(arg) { + return arg.length > 2 && + StringPrototypeStartsWith(arg, '--') && + !StringPrototypeIncludes(arg, '=', 3); +} + +/** + * Determines if `arg` is a long option and value in the same argument. + * @example + * isLongOptionAndValue('--foo') // returns false + * isLongOptionAndValue('--foo=bar') // returns true + */ +function isLongOptionAndValue(arg) { + return arg.length > 2 && + StringPrototypeStartsWith(arg, '--') && + StringPrototypeIncludes(arg, '=', 3); +} + +/** + * Determines if `arg` is a short option group. + * + * See Guideline 5 of the [Open Group Utility Conventions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). + * One or more options without option-arguments, followed by at most one + * option that takes an option-argument, should be accepted when grouped + * behind one '-' delimiter. + * @example + * isShortOptionGroup('-a', {}) // returns false + * isShortOptionGroup('-ab', {}) // returns true + * // -fb is an option and a value, not a short option group + * isShortOptionGroup('-fb', { + * options: { f: { type: 'string' } } + * }) // returns false + * isShortOptionGroup('-bf', { + * options: { f: { type: 'string' } } + * }) // returns true + * // -bfb is an edge case, return true and caller sorts it out + * isShortOptionGroup('-bfb', { + * options: { f: { type: 'string' } } + * }) // returns true + */ +function isShortOptionGroup(arg, options) { + if (arg.length <= 2) return false; + if (StringPrototypeCharAt(arg, 0) !== '-') return false; + if (StringPrototypeCharAt(arg, 1) === '-') return false; + + const firstShort = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(firstShort, options); + return optionsGetOwn(options, longOption, 'type') !== 'string'; +} + +/** + * Determine if arg is a short string option followed by its value. + * @example + * isShortOptionAndValue('-a', {}); // returns false + * isShortOptionAndValue('-ab', {}); // returns false + * isShortOptionAndValue('-fFILE', { + * options: { foo: { short: 'f', type: 'string' }} + * }) // returns true + */ +function isShortOptionAndValue(arg, options) { + validateObject(options, 'options'); + + if (arg.length <= 2) return false; + if (StringPrototypeCharAt(arg, 0) !== '-') return false; + if (StringPrototypeCharAt(arg, 1) === '-') return false; + + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + return optionsGetOwn(options, longOption, 'type') === 'string'; +} + +/** + * Find the long option associated with a short option. Looks for a configured + * `short` and returns the short option itself if a long option is not found. + * @example + * findLongOptionForShort('a', {}) // returns 'a' + * findLongOptionForShort('b', { + * options: { bar: { short: 'b' } } + * }) // returns 'bar' + */ +function findLongOptionForShort(shortOption, options) { + validateObject(options, 'options'); + const longOptionEntry = ArrayPrototypeFind( + ObjectEntries(options), + ({ 1: optionConfig }) => objectGetOwn(optionConfig, 'short') === shortOption + ); + return longOptionEntry?.[0] ?? shortOption; +} + +/** + * Check if the given option includes a default value + * and that option has not been set by the input args. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {object} optionConfig - the option configuration properties + * @param {object} values - option values returned in `values` by parseArgs + */ +function useDefaultValueOption(longOption, optionConfig, values) { + return objectGetOwn(optionConfig, 'default') !== undefined && + values[longOption] === undefined; +} + +module.exports = { + findLongOptionForShort, + isLoneLongOption, + isLoneShortOption, + isLongOptionAndValue, + isOptionValue, + isOptionLikeValue, + isShortOptionAndValue, + isShortOptionGroup, + useDefaultValueOption, + objectGetOwn, + optionsGetOwn, +}; diff --git a/node_modules/@pkgr/core/index.d.cts b/node_modules/@pkgr/core/index.d.cts new file mode 100644 index 00000000..94b40185 --- /dev/null +++ b/node_modules/@pkgr/core/index.d.cts @@ -0,0 +1,3 @@ +import * as core from './lib/index.js' + +export = core diff --git a/node_modules/@pkgr/core/lib/constants.d.ts b/node_modules/@pkgr/core/lib/constants.d.ts new file mode 100644 index 00000000..28127a71 --- /dev/null +++ b/node_modules/@pkgr/core/lib/constants.d.ts @@ -0,0 +1,8 @@ +/// +export declare const CWD: string; +export interface CjsRequire extends NodeJS.Require { + (id: string): T; +} +export declare const cjsRequire: CjsRequire; +export declare const EVAL_FILENAMES: Set; +export declare const EXTENSIONS: string[]; diff --git a/node_modules/@pkgr/core/lib/constants.js b/node_modules/@pkgr/core/lib/constants.js new file mode 100644 index 00000000..cd480a13 --- /dev/null +++ b/node_modules/@pkgr/core/lib/constants.js @@ -0,0 +1,9 @@ +import { createRequire } from 'node:module'; +export const CWD = process.cwd(); +const importMetaUrl = import.meta.url; +export const cjsRequire = importMetaUrl + ? createRequire(importMetaUrl) + : require; +export const EVAL_FILENAMES = new Set(['[eval]', '[worker eval]']); +export const EXTENSIONS = ['.ts', '.tsx', ...Object.keys(cjsRequire.extensions)]; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/@pkgr/core/lib/constants.js.map b/node_modules/@pkgr/core/lib/constants.js.map new file mode 100644 index 00000000..4357e52d --- /dev/null +++ b/node_modules/@pkgr/core/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;AAMhC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAA;AAErC,MAAM,CAAC,MAAM,UAAU,GAAe,aAAa;IACjD,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC;IAC9B,CAAC,CAAC,OAAO,CAAA;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAA;AAGlE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@pkgr/core/lib/helpers.d.ts b/node_modules/@pkgr/core/lib/helpers.d.ts new file mode 100644 index 00000000..ffab659a --- /dev/null +++ b/node_modules/@pkgr/core/lib/helpers.d.ts @@ -0,0 +1,5 @@ +export declare const tryPkg: (pkg: string) => string | undefined; +export declare const isPkgAvailable: (pkg: string) => boolean; +export declare const tryFile: (filename?: string[] | string, includeDir?: boolean, base?: string) => string; +export declare const tryExtensions: (filepath: string, extensions?: string[]) => string; +export declare const findUp: (searchEntry: string, searchFileOrIncludeDir?: boolean | string, includeDir?: boolean) => string; diff --git a/node_modules/@pkgr/core/lib/helpers.js b/node_modules/@pkgr/core/lib/helpers.js new file mode 100644 index 00000000..5bbb3041 --- /dev/null +++ b/node_modules/@pkgr/core/lib/helpers.js @@ -0,0 +1,45 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { CWD, EXTENSIONS, cjsRequire } from './constants.js'; +export const tryPkg = (pkg) => { + try { + return cjsRequire.resolve(pkg); + } + catch { } +}; +export const isPkgAvailable = (pkg) => !!tryPkg(pkg); +export const tryFile = (filename, includeDir = false, base = CWD) => { + if (typeof filename === 'string') { + const filepath = path.resolve(base, filename); + return fs.existsSync(filepath) && + (includeDir || fs.statSync(filepath).isFile()) + ? filepath + : ''; + } + for (const file of filename ?? []) { + const filepath = tryFile(file, includeDir, base); + if (filepath) { + return filepath; + } + } + return ''; +}; +export const tryExtensions = (filepath, extensions = EXTENSIONS) => { + const ext = [...extensions, ''].find(ext => tryFile(filepath + ext)); + return ext == null ? '' : filepath + ext; +}; +export const findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => { + const isSearchFile = typeof searchFileOrIncludeDir === 'string'; + const searchFile = isSearchFile ? searchFileOrIncludeDir : 'package.json'; + let lastSearchEntry; + do { + const searched = tryFile(searchFile, isSearchFile && includeDir, searchEntry); + if (searched) { + return searched; + } + lastSearchEntry = searchEntry; + searchEntry = path.dirname(searchEntry); + } while (!lastSearchEntry || lastSearchEntry !== searchEntry); + return ''; +}; +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@pkgr/core/lib/helpers.js.map b/node_modules/@pkgr/core/lib/helpers.js.map new file mode 100644 index 00000000..970efc16 --- /dev/null +++ b/node_modules/@pkgr/core/lib/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE5D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAE5D,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,QAA4B,EAC5B,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,GAAG,EACF,EAAE;IACV,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7C,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5B,CAAC,UAAU,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;YAC9C,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;QAChD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAA;QACjB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,UAAU,GAAG,UAAU,EAAE,EAAE;IACzE,MAAM,GAAG,GAAG,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAA;IACpE,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,WAAmB,EACnB,sBAAyC,EACzC,UAAoB,EACpB,EAAE;IACF,MAAM,YAAY,GAAG,OAAO,sBAAsB,KAAK,QAAQ,CAAA;IAE/D,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,cAAc,CAAA;IAEzE,IAAI,eAAmC,CAAA;IAEvC,GAAG,CAAC;QACF,MAAM,QAAQ,GAAG,OAAO,CACtB,UAAU,EACV,YAAY,IAAI,UAAU,EAC1B,WAAW,CACZ,CAAA;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,eAAe,GAAG,WAAW,CAAA;QAC7B,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACzC,CAAC,QAAQ,CAAC,eAAe,IAAI,eAAe,KAAK,WAAW,EAAC;IAE7D,OAAO,EAAE,CAAA;AACX,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@pkgr/core/lib/index.cjs b/node_modules/@pkgr/core/lib/index.cjs new file mode 100644 index 00000000..e72227f2 --- /dev/null +++ b/node_modules/@pkgr/core/lib/index.cjs @@ -0,0 +1,65 @@ +'use strict'; + +var node_module = require('node:module'); +var fs = require('node:fs'); +var path = require('node:path'); + +const import_meta = {}; +const CWD = process.cwd(); +const importMetaUrl = import_meta.url; +const cjsRequire = importMetaUrl ? node_module.createRequire(importMetaUrl) : require; +const EVAL_FILENAMES = /* @__PURE__ */ new Set(["[eval]", "[worker eval]"]); +const EXTENSIONS = [".ts", ".tsx", ...Object.keys(cjsRequire.extensions)]; + +const tryPkg = (pkg) => { + try { + return cjsRequire.resolve(pkg); + } catch (e) { + } +}; +const isPkgAvailable = (pkg) => !!tryPkg(pkg); +const tryFile = (filename, includeDir = false, base = CWD) => { + if (typeof filename === "string") { + const filepath = path.resolve(base, filename); + return fs.existsSync(filepath) && (includeDir || fs.statSync(filepath).isFile()) ? filepath : ""; + } + for (const file of filename != null ? filename : []) { + const filepath = tryFile(file, includeDir, base); + if (filepath) { + return filepath; + } + } + return ""; +}; +const tryExtensions = (filepath, extensions = EXTENSIONS) => { + const ext = [...extensions, ""].find((ext2) => tryFile(filepath + ext2)); + return ext == null ? "" : filepath + ext; +}; +const findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => { + const isSearchFile = typeof searchFileOrIncludeDir === "string"; + const searchFile = isSearchFile ? searchFileOrIncludeDir : "package.json"; + let lastSearchEntry; + do { + const searched = tryFile( + searchFile, + isSearchFile && includeDir, + searchEntry + ); + if (searched) { + return searched; + } + lastSearchEntry = searchEntry; + searchEntry = path.dirname(searchEntry); + } while (!lastSearchEntry || lastSearchEntry !== searchEntry); + return ""; +}; + +exports.CWD = CWD; +exports.EVAL_FILENAMES = EVAL_FILENAMES; +exports.EXTENSIONS = EXTENSIONS; +exports.cjsRequire = cjsRequire; +exports.findUp = findUp; +exports.isPkgAvailable = isPkgAvailable; +exports.tryExtensions = tryExtensions; +exports.tryFile = tryFile; +exports.tryPkg = tryPkg; diff --git a/node_modules/@pkgr/core/lib/index.d.ts b/node_modules/@pkgr/core/lib/index.d.ts new file mode 100644 index 00000000..0d6045d9 --- /dev/null +++ b/node_modules/@pkgr/core/lib/index.d.ts @@ -0,0 +1,2 @@ +export * from './constants.js'; +export * from './helpers.js'; diff --git a/node_modules/@pkgr/core/lib/index.js b/node_modules/@pkgr/core/lib/index.js new file mode 100644 index 00000000..e5435532 --- /dev/null +++ b/node_modules/@pkgr/core/lib/index.js @@ -0,0 +1,3 @@ +export * from './constants.js'; +export * from './helpers.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@pkgr/core/lib/index.js.map b/node_modules/@pkgr/core/lib/index.js.map new file mode 100644 index 00000000..e7c22031 --- /dev/null +++ b/node_modules/@pkgr/core/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"} \ No newline at end of file diff --git a/node_modules/@pkgr/core/package.json b/node_modules/@pkgr/core/package.json new file mode 100644 index 00000000..adf3f187 --- /dev/null +++ b/node_modules/@pkgr/core/package.json @@ -0,0 +1,38 @@ +{ + "name": "@pkgr/core", + "version": "0.2.9", + "type": "module", + "description": "Shared core module for `@pkgr` packages or any package else", + "repository": "git+https://github.com/un-ts/pkgr.git", + "homepage": "https://github.com/un-ts/pkgr/blob/master/packages/core", + "author": "JounQin (https://www.1stG.me)", + "funding": "https://opencollective.com/pkgr", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "main": "./lib/index.cjs", + "types": "./index.d.cts", + "module": "./lib/index.js", + "exports": { + ".": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./index.d.cts", + "default": "./lib/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "files": [ + "index.d.cts", + "lib" + ], + "publishConfig": { + "access": "public" + }, + "sideEffects": false +} diff --git a/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.d.ts b/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.d.ts new file mode 100644 index 00000000..7e4474d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.d.ts @@ -0,0 +1,55 @@ +import { ValueErrorIterator } from '../errors/index'; +import { TypeBoxError } from '../type/error/index'; +import type { TSchema } from '../type/schema/index'; +import type { Static, StaticDecode, StaticEncode } from '../type/static/index'; +export type CheckFunction = (value: unknown) => boolean; +export declare class TypeCheck { + private readonly schema; + private readonly references; + private readonly checkFunc; + private readonly code; + private readonly hasTransform; + constructor(schema: T, references: TSchema[], checkFunc: CheckFunction, code: string); + /** Returns the generated assertion code used to validate this type. */ + Code(): string; + /** Returns the schema type used to validate */ + Schema(): T; + /** Returns reference types used to validate */ + References(): TSchema[]; + /** Returns an iterator for each error in this value. */ + Errors(value: unknown): ValueErrorIterator; + /** Returns true if the value matches the compiled type. */ + Check(value: unknown): value is Static; + /** Decodes a value or throws if error */ + Decode, Result extends Static = Static>(value: unknown): Result; + /** Encodes a value or throws if error */ + Encode, Result extends Static = Static>(value: unknown): Result; +} +export declare class TypeCompilerUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare class TypeCompilerTypeGuardError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare namespace Policy { + function IsExactOptionalProperty(value: string, key: string, expression: string): string; + function IsObjectLike(value: string): string; + function IsRecordLike(value: string): string; + function IsNumberLike(value: string): string; + function IsVoidLike(value: string): string; +} +export type TypeCompilerLanguageOption = 'typescript' | 'javascript'; +export interface TypeCompilerCodegenOptions { + language?: TypeCompilerLanguageOption; +} +/** Compiles Types for Runtime Type Checking */ +export declare namespace TypeCompiler { + /** Generates the code used to assert this type and returns it as a string */ + function Code(schema: T, references: TSchema[], options?: TypeCompilerCodegenOptions): string; + /** Generates the code used to assert this type and returns it as a string */ + function Code(schema: T, options?: TypeCompilerCodegenOptions): string; + /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */ + function Compile(schema: T, references?: TSchema[]): TypeCheck; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.js b/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.js new file mode 100644 index 00000000..503c156b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/compiler/compiler.js @@ -0,0 +1,669 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeCompiler = exports.Policy = exports.TypeCompilerTypeGuardError = exports.TypeCompilerUnknownTypeError = exports.TypeCheck = void 0; +const index_1 = require("../value/transform/index"); +const index_2 = require("../errors/index"); +const index_3 = require("../system/index"); +const index_4 = require("../type/error/index"); +const index_5 = require("../value/deref/index"); +const index_6 = require("../value/hash/index"); +const index_7 = require("../type/symbols/index"); +const index_8 = require("../type/registry/index"); +const index_9 = require("../type/keyof/index"); +const extends_undefined_1 = require("../type/extends/extends-undefined"); +const index_10 = require("../type/never/index"); +const index_11 = require("../type/ref/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_12 = require("../value/guard/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const type_1 = require("../type/guard/type"); +// ------------------------------------------------------------------ +// TypeCheck +// ------------------------------------------------------------------ +class TypeCheck { + constructor(schema, references, checkFunc, code) { + this.schema = schema; + this.references = references; + this.checkFunc = checkFunc; + this.code = code; + this.hasTransform = (0, index_1.HasTransform)(schema, references); + } + /** Returns the generated assertion code used to validate this type. */ + Code() { + return this.code; + } + /** Returns the schema type used to validate */ + Schema() { + return this.schema; + } + /** Returns reference types used to validate */ + References() { + return this.references; + } + /** Returns an iterator for each error in this value. */ + Errors(value) { + return (0, index_2.Errors)(this.schema, this.references, value); + } + /** Returns true if the value matches the compiled type. */ + Check(value) { + return this.checkFunc(value); + } + /** Decodes a value or throws if error */ + Decode(value) { + if (!this.checkFunc(value)) + throw new index_1.TransformDecodeCheckError(this.schema, value, this.Errors(value).First()); + return (this.hasTransform ? (0, index_1.TransformDecode)(this.schema, this.references, value) : value); + } + /** Encodes a value or throws if error */ + Encode(value) { + const encoded = this.hasTransform ? (0, index_1.TransformEncode)(this.schema, this.references, value) : value; + if (!this.checkFunc(encoded)) + throw new index_1.TransformEncodeCheckError(this.schema, value, this.Errors(value).First()); + return encoded; + } +} +exports.TypeCheck = TypeCheck; +// ------------------------------------------------------------------ +// Character +// ------------------------------------------------------------------ +var Character; +(function (Character) { + function DollarSign(code) { + return code === 36; + } + Character.DollarSign = DollarSign; + function IsUnderscore(code) { + return code === 95; + } + Character.IsUnderscore = IsUnderscore; + function IsAlpha(code) { + return (code >= 65 && code <= 90) || (code >= 97 && code <= 122); + } + Character.IsAlpha = IsAlpha; + function IsNumeric(code) { + return code >= 48 && code <= 57; + } + Character.IsNumeric = IsNumeric; +})(Character || (Character = {})); +// ------------------------------------------------------------------ +// MemberExpression +// ------------------------------------------------------------------ +var MemberExpression; +(function (MemberExpression) { + function IsFirstCharacterNumeric(value) { + if (value.length === 0) + return false; + return Character.IsNumeric(value.charCodeAt(0)); + } + function IsAccessor(value) { + if (IsFirstCharacterNumeric(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + const check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code); + if (!check) + return false; + } + return true; + } + function EscapeHyphen(key) { + return key.replace(/'/g, "\\'"); + } + function Encode(object, key) { + return IsAccessor(key) ? `${object}.${key}` : `${object}['${EscapeHyphen(key)}']`; + } + MemberExpression.Encode = Encode; +})(MemberExpression || (MemberExpression = {})); +// ------------------------------------------------------------------ +// Identifier +// ------------------------------------------------------------------ +var Identifier; +(function (Identifier) { + function Encode($id) { + const buffer = []; + for (let i = 0; i < $id.length; i++) { + const code = $id.charCodeAt(i); + if (Character.IsNumeric(code) || Character.IsAlpha(code)) { + buffer.push($id.charAt(i)); + } + else { + buffer.push(`_${code}_`); + } + } + return buffer.join('').replace(/__/g, '_'); + } + Identifier.Encode = Encode; +})(Identifier || (Identifier = {})); +// ------------------------------------------------------------------ +// LiteralString +// ------------------------------------------------------------------ +var LiteralString; +(function (LiteralString) { + function Escape(content) { + return content.replace(/'/g, "\\'"); + } + LiteralString.Escape = Escape; +})(LiteralString || (LiteralString = {})); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class TypeCompilerUnknownTypeError extends index_4.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.TypeCompilerUnknownTypeError = TypeCompilerUnknownTypeError; +class TypeCompilerTypeGuardError extends index_4.TypeBoxError { + constructor(schema) { + super('Preflight validation check failed to guard for the given schema'); + this.schema = schema; + } +} +exports.TypeCompilerTypeGuardError = TypeCompilerTypeGuardError; +// ------------------------------------------------------------------ +// Policy +// ------------------------------------------------------------------ +var Policy; +(function (Policy) { + function IsExactOptionalProperty(value, key, expression) { + return index_3.TypeSystemPolicy.ExactOptionalPropertyTypes ? `('${key}' in ${value} ? ${expression} : true)` : `(${MemberExpression.Encode(value, key)} !== undefined ? ${expression} : true)`; + } + Policy.IsExactOptionalProperty = IsExactOptionalProperty; + function IsObjectLike(value) { + return !index_3.TypeSystemPolicy.AllowArrayObject ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}))` : `(typeof ${value} === 'object' && ${value} !== null)`; + } + Policy.IsObjectLike = IsObjectLike; + function IsRecordLike(value) { + return !index_3.TypeSystemPolicy.AllowArrayObject + ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}) && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))` + : `(typeof ${value} === 'object' && ${value} !== null && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`; + } + Policy.IsRecordLike = IsRecordLike; + function IsNumberLike(value) { + return index_3.TypeSystemPolicy.AllowNaN ? `typeof ${value} === 'number'` : `Number.isFinite(${value})`; + } + Policy.IsNumberLike = IsNumberLike; + function IsVoidLike(value) { + return index_3.TypeSystemPolicy.AllowNullVoid ? `(${value} === undefined || ${value} === null)` : `${value} === undefined`; + } + Policy.IsVoidLike = IsVoidLike; +})(Policy || (exports.Policy = Policy = {})); +/** Compiles Types for Runtime Type Checking */ +var TypeCompiler; +(function (TypeCompiler) { + // ---------------------------------------------------------------- + // Guards + // ---------------------------------------------------------------- + function IsAnyOrUnknown(schema) { + return schema[index_7.Kind] === 'Any' || schema[index_7.Kind] === 'Unknown'; + } + // ---------------------------------------------------------------- + // Types + // ---------------------------------------------------------------- + function* FromAny(schema, references, value) { + yield 'true'; + } + function* FromArgument(schema, references, value) { + yield 'true'; + } + function* FromArray(schema, references, value) { + yield `Array.isArray(${value})`; + const [parameter, accumulator] = [CreateParameter('value', 'any'), CreateParameter('acc', 'number')]; + if ((0, index_12.IsNumber)(schema.maxItems)) + yield `${value}.length <= ${schema.maxItems}`; + if ((0, index_12.IsNumber)(schema.minItems)) + yield `${value}.length >= ${schema.minItems}`; + const elementExpression = CreateExpression(schema.items, references, 'value'); + yield `${value}.every((${parameter}) => ${elementExpression})`; + if ((0, type_1.IsSchema)(schema.contains) || (0, index_12.IsNumber)(schema.minContains) || (0, index_12.IsNumber)(schema.maxContains)) { + const containsSchema = (0, type_1.IsSchema)(schema.contains) ? schema.contains : (0, index_10.Never)(); + const checkExpression = CreateExpression(containsSchema, references, 'value'); + const checkMinContains = (0, index_12.IsNumber)(schema.minContains) ? [`(count >= ${schema.minContains})`] : []; + const checkMaxContains = (0, index_12.IsNumber)(schema.maxContains) ? [`(count <= ${schema.maxContains})`] : []; + const checkCount = `const count = value.reduce((${accumulator}, ${parameter}) => ${checkExpression} ? acc + 1 : acc, 0)`; + const check = [`(count > 0)`, ...checkMinContains, ...checkMaxContains].join(' && '); + yield `((${parameter}) => { ${checkCount}; return ${check}})(${value})`; + } + if (schema.uniqueItems === true) { + const check = `const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true`; + const block = `const set = new Set(); for(const element of value) { ${check} }`; + yield `((${parameter}) => { ${block} )(${value})`; + } + } + function* FromAsyncIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.asyncIterator in ${value})`; + } + function* FromBigInt(schema, references, value) { + yield `(typeof ${value} === 'bigint')`; + if ((0, index_12.IsBigInt)(schema.exclusiveMaximum)) + yield `${value} < BigInt(${schema.exclusiveMaximum})`; + if ((0, index_12.IsBigInt)(schema.exclusiveMinimum)) + yield `${value} > BigInt(${schema.exclusiveMinimum})`; + if ((0, index_12.IsBigInt)(schema.maximum)) + yield `${value} <= BigInt(${schema.maximum})`; + if ((0, index_12.IsBigInt)(schema.minimum)) + yield `${value} >= BigInt(${schema.minimum})`; + if ((0, index_12.IsBigInt)(schema.multipleOf)) + yield `(${value} % BigInt(${schema.multipleOf})) === 0`; + } + function* FromBoolean(schema, references, value) { + yield `(typeof ${value} === 'boolean')`; + } + function* FromConstructor(schema, references, value) { + yield* Visit(schema.returns, references, `${value}.prototype`); + } + function* FromDate(schema, references, value) { + yield `(${value} instanceof Date) && Number.isFinite(${value}.getTime())`; + if ((0, index_12.IsNumber)(schema.exclusiveMaximumTimestamp)) + yield `${value}.getTime() < ${schema.exclusiveMaximumTimestamp}`; + if ((0, index_12.IsNumber)(schema.exclusiveMinimumTimestamp)) + yield `${value}.getTime() > ${schema.exclusiveMinimumTimestamp}`; + if ((0, index_12.IsNumber)(schema.maximumTimestamp)) + yield `${value}.getTime() <= ${schema.maximumTimestamp}`; + if ((0, index_12.IsNumber)(schema.minimumTimestamp)) + yield `${value}.getTime() >= ${schema.minimumTimestamp}`; + if ((0, index_12.IsNumber)(schema.multipleOfTimestamp)) + yield `(${value}.getTime() % ${schema.multipleOfTimestamp}) === 0`; + } + function* FromFunction(schema, references, value) { + yield `(typeof ${value} === 'function')`; + } + function* FromImport(schema, references, value) { + const members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => { + return [...result, schema.$defs[key]]; + }, []); + yield* Visit((0, index_11.Ref)(schema.$ref), [...references, ...members], value); + } + function* FromInteger(schema, references, value) { + yield `Number.isInteger(${value})`; + if ((0, index_12.IsNumber)(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if ((0, index_12.IsNumber)(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if ((0, index_12.IsNumber)(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if ((0, index_12.IsNumber)(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if ((0, index_12.IsNumber)(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* FromIntersect(schema, references, value) { + const check1 = schema.allOf.map((schema) => CreateExpression(schema, references, value)).join(' && '); + if (schema.unevaluatedProperties === false) { + const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfPattern)(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key))`; + yield `(${check1} && ${check2})`; + } + else if ((0, type_1.IsSchema)(schema.unevaluatedProperties)) { + const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfPattern)(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key) || ${CreateExpression(schema.unevaluatedProperties, references, `${value}[key]`)})`; + yield `(${check1} && ${check2})`; + } + else { + yield `(${check1})`; + } + } + function* FromIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.iterator in ${value})`; + } + function* FromLiteral(schema, references, value) { + if (typeof schema.const === 'number' || typeof schema.const === 'boolean') { + yield `(${value} === ${schema.const})`; + } + else { + yield `(${value} === '${LiteralString.Escape(schema.const)}')`; + } + } + function* FromNever(schema, references, value) { + yield `false`; + } + function* FromNot(schema, references, value) { + const expression = CreateExpression(schema.not, references, value); + yield `(!${expression})`; + } + function* FromNull(schema, references, value) { + yield `(${value} === null)`; + } + function* FromNumber(schema, references, value) { + yield Policy.IsNumberLike(value); + if ((0, index_12.IsNumber)(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if ((0, index_12.IsNumber)(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if ((0, index_12.IsNumber)(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if ((0, index_12.IsNumber)(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if ((0, index_12.IsNumber)(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* FromObject(schema, references, value) { + yield Policy.IsObjectLike(value); + if ((0, index_12.IsNumber)(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if ((0, index_12.IsNumber)(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const memberExpression = MemberExpression.Encode(value, knownKey); + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, memberExpression); + if ((0, extends_undefined_1.ExtendsUndefinedCheck)(property) || IsAnyOrUnknown(property)) + yield `('${knownKey}' in ${value})`; + } + else { + const expression = CreateExpression(property, references, memberExpression); + yield Policy.IsExactOptionalProperty(value, knownKey, expression); + } + } + if (schema.additionalProperties === false) { + if (schema.required && schema.required.length === knownKeys.length) { + yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`; + } + else { + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`; + } + } + if (typeof schema.additionalProperties === 'object') { + const expression = CreateExpression(schema.additionalProperties, references, `${value}[key]`); + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`; + } + } + function* FromPromise(schema, references, value) { + yield `${value} instanceof Promise`; + } + function* FromRecord(schema, references, value) { + yield Policy.IsRecordLike(value); + if ((0, index_12.IsNumber)(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if ((0, index_12.IsNumber)(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const variable = CreateVariable(`${new RegExp(patternKey)}`); + const check1 = CreateExpression(patternSchema, references, 'value'); + const check2 = (0, type_1.IsSchema)(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true'; + const expression = `(${variable}.test(key) ? ${check1} : ${check2})`; + yield `(Object.entries(${value}).every(([key, value]) => ${expression}))`; + } + function* FromRef(schema, references, value) { + const target = (0, index_5.Deref)(schema, references); + // Reference: If we have seen this reference before we can just yield and return the function call. + // If this isn't the case we defer to visit to generate and set the function for subsequent passes. + if (state.functions.has(schema.$ref)) + return yield `${CreateFunctionName(schema.$ref)}(${value})`; + yield* Visit(target, references, value); + } + function* FromRegExp(schema, references, value) { + const variable = CreateVariable(`${new RegExp(schema.source, schema.flags)};`); + yield `(typeof ${value} === 'string')`; + if ((0, index_12.IsNumber)(schema.maxLength)) + yield `${value}.length <= ${schema.maxLength}`; + if ((0, index_12.IsNumber)(schema.minLength)) + yield `${value}.length >= ${schema.minLength}`; + yield `${variable}.test(${value})`; + } + function* FromString(schema, references, value) { + yield `(typeof ${value} === 'string')`; + if ((0, index_12.IsNumber)(schema.maxLength)) + yield `${value}.length <= ${schema.maxLength}`; + if ((0, index_12.IsNumber)(schema.minLength)) + yield `${value}.length >= ${schema.minLength}`; + if (schema.pattern !== undefined) { + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + if (schema.format !== undefined) { + yield `format('${schema.format}', ${value})`; + } + } + function* FromSymbol(schema, references, value) { + yield `(typeof ${value} === 'symbol')`; + } + function* FromTemplateLiteral(schema, references, value) { + yield `(typeof ${value} === 'string')`; + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + function* FromThis(schema, references, value) { + // Note: This types are assured to be hoisted prior to this call. Just yield the function. + yield `${CreateFunctionName(schema.$ref)}(${value})`; + } + function* FromTuple(schema, references, value) { + yield `Array.isArray(${value})`; + if (schema.items === undefined) + return yield `${value}.length === 0`; + yield `(${value}.length === ${schema.maxItems})`; + for (let i = 0; i < schema.items.length; i++) { + const expression = CreateExpression(schema.items[i], references, `${value}[${i}]`); + yield `${expression}`; + } + } + function* FromUndefined(schema, references, value) { + yield `${value} === undefined`; + } + function* FromUnion(schema, references, value) { + const expressions = schema.anyOf.map((schema) => CreateExpression(schema, references, value)); + yield `(${expressions.join(' || ')})`; + } + function* FromUint8Array(schema, references, value) { + yield `${value} instanceof Uint8Array`; + if ((0, index_12.IsNumber)(schema.maxByteLength)) + yield `(${value}.length <= ${schema.maxByteLength})`; + if ((0, index_12.IsNumber)(schema.minByteLength)) + yield `(${value}.length >= ${schema.minByteLength})`; + } + function* FromUnknown(schema, references, value) { + yield 'true'; + } + function* FromVoid(schema, references, value) { + yield Policy.IsVoidLike(value); + } + function* FromKind(schema, references, value) { + const instance = state.instances.size; + state.instances.set(instance, schema); + yield `kind('${schema[index_7.Kind]}', ${instance}, ${value})`; + } + function* Visit(schema, references, value, useHoisting = true) { + const references_ = (0, index_12.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + // -------------------------------------------------------------- + // Hoisting + // -------------------------------------------------------------- + if (useHoisting && (0, index_12.IsString)(schema.$id)) { + const functionName = CreateFunctionName(schema.$id); + if (state.functions.has(functionName)) { + return yield `${functionName}(${value})`; + } + else { + // Note: In the case of cyclic types, we need to create a 'functions' record + // to prevent infinitely re-visiting the CreateFunction. Subsequent attempts + // to visit will be caught by the above condition. + state.functions.set(functionName, ''); + const functionCode = CreateFunction(functionName, schema, references, 'value', false); + state.functions.set(functionName, functionCode); + return yield `${functionName}(${value})`; + } + } + switch (schema_[index_7.Kind]) { + case 'Any': + return yield* FromAny(schema_, references_, value); + case 'Argument': + return yield* FromArgument(schema_, references_, value); + case 'Array': + return yield* FromArray(schema_, references_, value); + case 'AsyncIterator': + return yield* FromAsyncIterator(schema_, references_, value); + case 'BigInt': + return yield* FromBigInt(schema_, references_, value); + case 'Boolean': + return yield* FromBoolean(schema_, references_, value); + case 'Constructor': + return yield* FromConstructor(schema_, references_, value); + case 'Date': + return yield* FromDate(schema_, references_, value); + case 'Function': + return yield* FromFunction(schema_, references_, value); + case 'Import': + return yield* FromImport(schema_, references_, value); + case 'Integer': + return yield* FromInteger(schema_, references_, value); + case 'Intersect': + return yield* FromIntersect(schema_, references_, value); + case 'Iterator': + return yield* FromIterator(schema_, references_, value); + case 'Literal': + return yield* FromLiteral(schema_, references_, value); + case 'Never': + return yield* FromNever(schema_, references_, value); + case 'Not': + return yield* FromNot(schema_, references_, value); + case 'Null': + return yield* FromNull(schema_, references_, value); + case 'Number': + return yield* FromNumber(schema_, references_, value); + case 'Object': + return yield* FromObject(schema_, references_, value); + case 'Promise': + return yield* FromPromise(schema_, references_, value); + case 'Record': + return yield* FromRecord(schema_, references_, value); + case 'Ref': + return yield* FromRef(schema_, references_, value); + case 'RegExp': + return yield* FromRegExp(schema_, references_, value); + case 'String': + return yield* FromString(schema_, references_, value); + case 'Symbol': + return yield* FromSymbol(schema_, references_, value); + case 'TemplateLiteral': + return yield* FromTemplateLiteral(schema_, references_, value); + case 'This': + return yield* FromThis(schema_, references_, value); + case 'Tuple': + return yield* FromTuple(schema_, references_, value); + case 'Undefined': + return yield* FromUndefined(schema_, references_, value); + case 'Union': + return yield* FromUnion(schema_, references_, value); + case 'Uint8Array': + return yield* FromUint8Array(schema_, references_, value); + case 'Unknown': + return yield* FromUnknown(schema_, references_, value); + case 'Void': + return yield* FromVoid(schema_, references_, value); + default: + if (!index_8.TypeRegistry.Has(schema_[index_7.Kind])) + throw new TypeCompilerUnknownTypeError(schema); + return yield* FromKind(schema_, references_, value); + } + } + // ---------------------------------------------------------------- + // Compiler State + // ---------------------------------------------------------------- + // prettier-ignore + const state = { + language: 'javascript', // target language + functions: new Map(), // local functions + variables: new Map(), // local variables + instances: new Map() // exterior kind instances + }; + // ---------------------------------------------------------------- + // Compiler Factory + // ---------------------------------------------------------------- + function CreateExpression(schema, references, value, useHoisting = true) { + return `(${[...Visit(schema, references, value, useHoisting)].join(' && ')})`; + } + function CreateFunctionName($id) { + return `check_${Identifier.Encode($id)}`; + } + function CreateVariable(expression) { + const variableName = `local_${state.variables.size}`; + state.variables.set(variableName, `const ${variableName} = ${expression}`); + return variableName; + } + function CreateFunction(name, schema, references, value, useHoisting = true) { + const [newline, pad] = ['\n', (length) => ''.padStart(length, ' ')]; + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const expression = [...Visit(schema, references, value, useHoisting)].map((expression) => `${pad(4)}${expression}`).join(` &&${newline}`); + return `function ${name}(${parameter})${returns} {${newline}${pad(2)}return (${newline}${expression}${newline}${pad(2)})\n}`; + } + function CreateParameter(name, type) { + const annotation = state.language === 'typescript' ? `: ${type}` : ''; + return `${name}${annotation}`; + } + function CreateReturns(type) { + return state.language === 'typescript' ? `: ${type}` : ''; + } + // ---------------------------------------------------------------- + // Compile + // ---------------------------------------------------------------- + function Build(schema, references, options) { + const functionCode = CreateFunction('check', schema, references, 'value'); // will populate functions and variables + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const functions = [...state.functions.values()]; + const variables = [...state.variables.values()]; + // prettier-ignore + const checkFunction = (0, index_12.IsString)(schema.$id) // ensure top level schemas with $id's are hoisted + ? `return function check(${parameter})${returns} {\n return ${CreateFunctionName(schema.$id)}(value)\n}` + : `return ${functionCode}`; + return [...variables, ...functions, checkFunction].join('\n'); + } + /** Generates the code used to assert this type and returns it as a string */ + function Code(...args) { + const defaults = { language: 'javascript' }; + // prettier-ignore + const [schema, references, options] = (args.length === 2 && (0, index_12.IsArray)(args[1]) ? [args[0], args[1], defaults] : + args.length === 2 && !(0, index_12.IsArray)(args[1]) ? [args[0], [], args[1]] : + args.length === 3 ? [args[0], args[1], args[2]] : + args.length === 1 ? [args[0], [], defaults] : + [null, [], defaults]); + // compiler-reset + state.language = options.language; + state.variables.clear(); + state.functions.clear(); + state.instances.clear(); + if (!(0, type_1.IsSchema)(schema)) + throw new TypeCompilerTypeGuardError(schema); + for (const schema of references) + if (!(0, type_1.IsSchema)(schema)) + throw new TypeCompilerTypeGuardError(schema); + return Build(schema, references, options); + } + TypeCompiler.Code = Code; + /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */ + function Compile(schema, references = []) { + const generatedCode = Code(schema, references, { language: 'javascript' }); + const compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode); + const instances = new Map(state.instances); + function typeRegistryFunction(kind, instance, value) { + if (!index_8.TypeRegistry.Has(kind) || !instances.has(instance)) + return false; + const checkFunc = index_8.TypeRegistry.Get(kind); + const schema = instances.get(instance); + return checkFunc(schema, value); + } + function formatRegistryFunction(format, value) { + if (!index_8.FormatRegistry.Has(format)) + return false; + const checkFunc = index_8.FormatRegistry.Get(format); + return checkFunc(value); + } + function hashFunction(value) { + return (0, index_6.Hash)(value); + } + const checkFunction = compiledFunction(typeRegistryFunction, formatRegistryFunction, hashFunction); + return new TypeCheck(schema, references, checkFunction, generatedCode); + } + TypeCompiler.Compile = Compile; +})(TypeCompiler || (exports.TypeCompiler = TypeCompiler = {})); diff --git a/node_modules/@sinclair/typebox/build/cjs/compiler/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/compiler/index.d.ts new file mode 100644 index 00000000..3da87a4f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/compiler/index.d.ts @@ -0,0 +1,2 @@ +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index'; +export * from './compiler'; diff --git a/node_modules/@sinclair/typebox/build/cjs/compiler/index.js b/node_modules/@sinclair/typebox/build/cjs/compiler/index.js new file mode 100644 index 00000000..73d726fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/compiler/index.js @@ -0,0 +1,22 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueErrorIterator = exports.ValueErrorType = void 0; +var index_1 = require("../errors/index"); +Object.defineProperty(exports, "ValueErrorType", { enumerable: true, get: function () { return index_1.ValueErrorType; } }); +Object.defineProperty(exports, "ValueErrorIterator", { enumerable: true, get: function () { return index_1.ValueErrorIterator; } }); +__exportStar(require("./compiler"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/errors.d.ts b/node_modules/@sinclair/typebox/build/cjs/errors/errors.d.ts new file mode 100644 index 00000000..2416b99a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/errors.d.ts @@ -0,0 +1,91 @@ +import { TypeBoxError } from '../type/error/index'; +import type { TSchema } from '../type/schema/index'; +export declare enum ValueErrorType { + ArrayContains = 0, + ArrayMaxContains = 1, + ArrayMaxItems = 2, + ArrayMinContains = 3, + ArrayMinItems = 4, + ArrayUniqueItems = 5, + Array = 6, + AsyncIterator = 7, + BigIntExclusiveMaximum = 8, + BigIntExclusiveMinimum = 9, + BigIntMaximum = 10, + BigIntMinimum = 11, + BigIntMultipleOf = 12, + BigInt = 13, + Boolean = 14, + DateExclusiveMaximumTimestamp = 15, + DateExclusiveMinimumTimestamp = 16, + DateMaximumTimestamp = 17, + DateMinimumTimestamp = 18, + DateMultipleOfTimestamp = 19, + Date = 20, + Function = 21, + IntegerExclusiveMaximum = 22, + IntegerExclusiveMinimum = 23, + IntegerMaximum = 24, + IntegerMinimum = 25, + IntegerMultipleOf = 26, + Integer = 27, + IntersectUnevaluatedProperties = 28, + Intersect = 29, + Iterator = 30, + Kind = 31, + Literal = 32, + Never = 33, + Not = 34, + Null = 35, + NumberExclusiveMaximum = 36, + NumberExclusiveMinimum = 37, + NumberMaximum = 38, + NumberMinimum = 39, + NumberMultipleOf = 40, + Number = 41, + ObjectAdditionalProperties = 42, + ObjectMaxProperties = 43, + ObjectMinProperties = 44, + ObjectRequiredProperty = 45, + Object = 46, + Promise = 47, + RegExp = 48, + StringFormatUnknown = 49, + StringFormat = 50, + StringMaxLength = 51, + StringMinLength = 52, + StringPattern = 53, + String = 54, + Symbol = 55, + TupleLength = 56, + Tuple = 57, + Uint8ArrayMaxByteLength = 58, + Uint8ArrayMinByteLength = 59, + Uint8Array = 60, + Undefined = 61, + Union = 62, + Void = 63 +} +export interface ValueError { + type: ValueErrorType; + schema: TSchema; + path: string; + value: unknown; + message: string; + errors: ValueErrorIterator[]; +} +export declare class ValueErrorsUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare class ValueErrorIterator { + private readonly iterator; + constructor(iterator: IterableIterator); + [Symbol.iterator](): IterableIterator; + /** Returns the first value error or undefined if no errors */ + First(): ValueError | undefined; +} +/** Returns an iterator for each error in this value. */ +export declare function Errors(schema: T, references: TSchema[], value: unknown): ValueErrorIterator; +/** Returns an iterator for each error in this value. */ +export declare function Errors(schema: T, value: unknown): ValueErrorIterator; diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/errors.js b/node_modules/@sinclair/typebox/build/cjs/errors/errors.js new file mode 100644 index 00000000..b42ef70b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/errors.js @@ -0,0 +1,599 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueErrorIterator = exports.ValueErrorsUnknownTypeError = exports.ValueErrorType = void 0; +exports.Errors = Errors; +const index_1 = require("../system/index"); +const index_2 = require("../type/keyof/index"); +const index_3 = require("../type/registry/index"); +const extends_undefined_1 = require("../type/extends/extends-undefined"); +const function_1 = require("./function"); +const index_4 = require("../type/error/index"); +const index_5 = require("../value/deref/index"); +const index_6 = require("../value/hash/index"); +const index_7 = require("../value/check/index"); +const index_8 = require("../type/symbols/index"); +const index_9 = require("../type/never/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +// prettier-ignore +const index_10 = require("../value/guard/index"); +// ------------------------------------------------------------------ +// ValueErrorType +// ------------------------------------------------------------------ +var ValueErrorType; +(function (ValueErrorType) { + ValueErrorType[ValueErrorType["ArrayContains"] = 0] = "ArrayContains"; + ValueErrorType[ValueErrorType["ArrayMaxContains"] = 1] = "ArrayMaxContains"; + ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems"; + ValueErrorType[ValueErrorType["ArrayMinContains"] = 3] = "ArrayMinContains"; + ValueErrorType[ValueErrorType["ArrayMinItems"] = 4] = "ArrayMinItems"; + ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 5] = "ArrayUniqueItems"; + ValueErrorType[ValueErrorType["Array"] = 6] = "Array"; + ValueErrorType[ValueErrorType["AsyncIterator"] = 7] = "AsyncIterator"; + ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 8] = "BigIntExclusiveMaximum"; + ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 9] = "BigIntExclusiveMinimum"; + ValueErrorType[ValueErrorType["BigIntMaximum"] = 10] = "BigIntMaximum"; + ValueErrorType[ValueErrorType["BigIntMinimum"] = 11] = "BigIntMinimum"; + ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 12] = "BigIntMultipleOf"; + ValueErrorType[ValueErrorType["BigInt"] = 13] = "BigInt"; + ValueErrorType[ValueErrorType["Boolean"] = 14] = "Boolean"; + ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 15] = "DateExclusiveMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 16] = "DateExclusiveMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 17] = "DateMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 18] = "DateMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMultipleOfTimestamp"] = 19] = "DateMultipleOfTimestamp"; + ValueErrorType[ValueErrorType["Date"] = 20] = "Date"; + ValueErrorType[ValueErrorType["Function"] = 21] = "Function"; + ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 22] = "IntegerExclusiveMaximum"; + ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 23] = "IntegerExclusiveMinimum"; + ValueErrorType[ValueErrorType["IntegerMaximum"] = 24] = "IntegerMaximum"; + ValueErrorType[ValueErrorType["IntegerMinimum"] = 25] = "IntegerMinimum"; + ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 26] = "IntegerMultipleOf"; + ValueErrorType[ValueErrorType["Integer"] = 27] = "Integer"; + ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 28] = "IntersectUnevaluatedProperties"; + ValueErrorType[ValueErrorType["Intersect"] = 29] = "Intersect"; + ValueErrorType[ValueErrorType["Iterator"] = 30] = "Iterator"; + ValueErrorType[ValueErrorType["Kind"] = 31] = "Kind"; + ValueErrorType[ValueErrorType["Literal"] = 32] = "Literal"; + ValueErrorType[ValueErrorType["Never"] = 33] = "Never"; + ValueErrorType[ValueErrorType["Not"] = 34] = "Not"; + ValueErrorType[ValueErrorType["Null"] = 35] = "Null"; + ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 36] = "NumberExclusiveMaximum"; + ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 37] = "NumberExclusiveMinimum"; + ValueErrorType[ValueErrorType["NumberMaximum"] = 38] = "NumberMaximum"; + ValueErrorType[ValueErrorType["NumberMinimum"] = 39] = "NumberMinimum"; + ValueErrorType[ValueErrorType["NumberMultipleOf"] = 40] = "NumberMultipleOf"; + ValueErrorType[ValueErrorType["Number"] = 41] = "Number"; + ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 42] = "ObjectAdditionalProperties"; + ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 43] = "ObjectMaxProperties"; + ValueErrorType[ValueErrorType["ObjectMinProperties"] = 44] = "ObjectMinProperties"; + ValueErrorType[ValueErrorType["ObjectRequiredProperty"] = 45] = "ObjectRequiredProperty"; + ValueErrorType[ValueErrorType["Object"] = 46] = "Object"; + ValueErrorType[ValueErrorType["Promise"] = 47] = "Promise"; + ValueErrorType[ValueErrorType["RegExp"] = 48] = "RegExp"; + ValueErrorType[ValueErrorType["StringFormatUnknown"] = 49] = "StringFormatUnknown"; + ValueErrorType[ValueErrorType["StringFormat"] = 50] = "StringFormat"; + ValueErrorType[ValueErrorType["StringMaxLength"] = 51] = "StringMaxLength"; + ValueErrorType[ValueErrorType["StringMinLength"] = 52] = "StringMinLength"; + ValueErrorType[ValueErrorType["StringPattern"] = 53] = "StringPattern"; + ValueErrorType[ValueErrorType["String"] = 54] = "String"; + ValueErrorType[ValueErrorType["Symbol"] = 55] = "Symbol"; + ValueErrorType[ValueErrorType["TupleLength"] = 56] = "TupleLength"; + ValueErrorType[ValueErrorType["Tuple"] = 57] = "Tuple"; + ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 58] = "Uint8ArrayMaxByteLength"; + ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 59] = "Uint8ArrayMinByteLength"; + ValueErrorType[ValueErrorType["Uint8Array"] = 60] = "Uint8Array"; + ValueErrorType[ValueErrorType["Undefined"] = 61] = "Undefined"; + ValueErrorType[ValueErrorType["Union"] = 62] = "Union"; + ValueErrorType[ValueErrorType["Void"] = 63] = "Void"; +})(ValueErrorType || (exports.ValueErrorType = ValueErrorType = {})); +// ------------------------------------------------------------------ +// ValueErrors +// ------------------------------------------------------------------ +class ValueErrorsUnknownTypeError extends index_4.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError; +// ------------------------------------------------------------------ +// EscapeKey +// ------------------------------------------------------------------ +function EscapeKey(key) { + return key.replace(/~/g, '~0').replace(/\//g, '~1'); // RFC6901 Path +} +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +function IsDefined(value) { + return value !== undefined; +} +// ------------------------------------------------------------------ +// ValueErrorIterator +// ------------------------------------------------------------------ +class ValueErrorIterator { + constructor(iterator) { + this.iterator = iterator; + } + [Symbol.iterator]() { + return this.iterator; + } + /** Returns the first value error or undefined if no errors */ + First() { + const next = this.iterator.next(); + return next.done ? undefined : next.value; + } +} +exports.ValueErrorIterator = ValueErrorIterator; +// -------------------------------------------------------------------------- +// Create +// -------------------------------------------------------------------------- +function Create(errorType, schema, path, value, errors = []) { + return { + type: errorType, + schema, + path, + value, + message: (0, function_1.GetErrorFunction)()({ errorType, path, schema, value, errors }), + errors, + }; +} +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- +function* FromAny(schema, references, path, value) { } +function* FromArgument(schema, references, path, value) { } +function* FromArray(schema, references, path, value) { + if (!(0, index_10.IsArray)(value)) { + return yield Create(ValueErrorType.Array, schema, path, value); + } + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + yield Create(ValueErrorType.ArrayMinItems, schema, path, value); + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + yield Create(ValueErrorType.ArrayMaxItems, schema, path, value); + } + for (let i = 0; i < value.length; i++) { + yield* Visit(schema.items, references, `${path}/${i}`, value[i]); + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = (0, index_6.Hash)(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value); + } + // contains + if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) { + return; + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : (0, index_9.Never)(); + const containsCount = value.reduce((acc, value, index) => (Visit(containsSchema, references, `${path}${index}`, value).next().done === true ? acc + 1 : acc), 0); + if (containsCount === 0) { + yield Create(ValueErrorType.ArrayContains, schema, path, value); + } + if ((0, index_10.IsNumber)(schema.minContains) && containsCount < schema.minContains) { + yield Create(ValueErrorType.ArrayMinContains, schema, path, value); + } + if ((0, index_10.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) { + yield Create(ValueErrorType.ArrayMaxContains, schema, path, value); + } +} +function* FromAsyncIterator(schema, references, path, value) { + if (!(0, index_10.IsAsyncIterator)(value)) + yield Create(ValueErrorType.AsyncIterator, schema, path, value); +} +function* FromBigInt(schema, references, path, value) { + if (!(0, index_10.IsBigInt)(value)) + return yield Create(ValueErrorType.BigInt, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.BigIntMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.BigIntMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value); + } +} +function* FromBoolean(schema, references, path, value) { + if (!(0, index_10.IsBoolean)(value)) + yield Create(ValueErrorType.Boolean, schema, path, value); +} +function* FromConstructor(schema, references, path, value) { + yield* Visit(schema.returns, references, path, value.prototype); +} +function* FromDate(schema, references, path, value) { + if (!(0, index_10.IsDate)(value)) + return yield Create(ValueErrorType.Date, schema, path, value); + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value); + } +} +function* FromFunction(schema, references, path, value) { + if (!(0, index_10.IsFunction)(value)) + yield Create(ValueErrorType.Function, schema, path, value); +} +function* FromImport(schema, references, path, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + yield* Visit(target, [...references, ...definitions], path, value); +} +function* FromInteger(schema, references, path, value) { + if (!(0, index_10.IsInteger)(value)) + return yield Create(ValueErrorType.Integer, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.IntegerMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.IntegerMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value); + } +} +function* FromIntersect(schema, references, path, value) { + let hasError = false; + for (const inner of schema.allOf) { + for (const error of Visit(inner, references, path, value)) { + hasError = true; + yield error; + } + } + if (hasError) { + return yield Create(ValueErrorType.Intersect, schema, path, value); + } + if (schema.unevaluatedProperties === false) { + const keyCheck = new RegExp((0, index_2.KeyOfPattern)(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value); + } + } + } + if (typeof schema.unevaluatedProperties === 'object') { + const keyCheck = new RegExp((0, index_2.KeyOfPattern)(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next(); + if (!next.done) + yield next.value; // yield interior + } + } + } +} +function* FromIterator(schema, references, path, value) { + if (!(0, index_10.IsIterator)(value)) + yield Create(ValueErrorType.Iterator, schema, path, value); +} +function* FromLiteral(schema, references, path, value) { + if (!(value === schema.const)) + yield Create(ValueErrorType.Literal, schema, path, value); +} +function* FromNever(schema, references, path, value) { + yield Create(ValueErrorType.Never, schema, path, value); +} +function* FromNot(schema, references, path, value) { + if (Visit(schema.not, references, path, value).next().done === true) + yield Create(ValueErrorType.Not, schema, path, value); +} +function* FromNull(schema, references, path, value) { + if (!(0, index_10.IsNull)(value)) + yield Create(ValueErrorType.Null, schema, path, value); +} +function* FromNumber(schema, references, path, value) { + if (!index_1.TypeSystemPolicy.IsNumberLike(value)) + return yield Create(ValueErrorType.Number, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.NumberMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.NumberMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.NumberMultipleOf, schema, path, value); + } +} +function* FromObject(schema, references, path, value) { + if (!index_1.TypeSystemPolicy.IsObjectLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const requiredKeys = Array.isArray(schema.required) ? schema.required : []; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + const unknownKeys = Object.getOwnPropertyNames(value); + for (const requiredKey of requiredKeys) { + if (unknownKeys.includes(requiredKey)) + continue; + yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${EscapeKey(requiredKey)}`, undefined); + } + if (schema.additionalProperties === false) { + for (const valueKey of unknownKeys) { + if (!knownKeys.includes(valueKey)) { + yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(valueKey)}`, value[valueKey]); + } + } + } + if (typeof schema.additionalProperties === 'object') { + for (const valueKey of unknownKeys) { + if (knownKeys.includes(valueKey)) + continue; + yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(valueKey)}`, value[valueKey]); + } + } + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]); + if ((0, extends_undefined_1.ExtendsUndefinedCheck)(schema) && !(knownKey in value)) { + yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${EscapeKey(knownKey)}`, undefined); + } + } + else { + if (index_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) { + yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]); + } + } + } +} +function* FromPromise(schema, references, path, value) { + if (!(0, index_10.IsPromise)(value)) + yield Create(ValueErrorType.Promise, schema, path, value); +} +function* FromRecord(schema, references, path, value) { + if (!index_1.TypeSystemPolicy.IsRecordLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + yield* Visit(patternSchema, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + if (typeof schema.additionalProperties === 'object') { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (!regex.test(propertyKey)) + yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + } + if (schema.additionalProperties === false) { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + continue; + return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + } +} +function* FromRef(schema, references, path, value) { + yield* Visit((0, index_5.Deref)(schema, references), references, path, value); +} +function* FromRegExp(schema, references, path, value) { + if (!(0, index_10.IsString)(value)) + return yield Create(ValueErrorType.String, schema, path, value); + if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { + yield Create(ValueErrorType.StringMinLength, schema, path, value); + } + if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { + yield Create(ValueErrorType.StringMaxLength, schema, path, value); + } + const regex = new RegExp(schema.source, schema.flags); + if (!regex.test(value)) { + return yield Create(ValueErrorType.RegExp, schema, path, value); + } +} +function* FromString(schema, references, path, value) { + if (!(0, index_10.IsString)(value)) + return yield Create(ValueErrorType.String, schema, path, value); + if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { + yield Create(ValueErrorType.StringMinLength, schema, path, value); + } + if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { + yield Create(ValueErrorType.StringMaxLength, schema, path, value); + } + if ((0, index_10.IsString)(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } + } + if ((0, index_10.IsString)(schema.format)) { + if (!index_3.FormatRegistry.Has(schema.format)) { + yield Create(ValueErrorType.StringFormatUnknown, schema, path, value); + } + else { + const format = index_3.FormatRegistry.Get(schema.format); + if (!format(value)) { + yield Create(ValueErrorType.StringFormat, schema, path, value); + } + } + } +} +function* FromSymbol(schema, references, path, value) { + if (!(0, index_10.IsSymbol)(value)) + yield Create(ValueErrorType.Symbol, schema, path, value); +} +function* FromTemplateLiteral(schema, references, path, value) { + if (!(0, index_10.IsString)(value)) + return yield Create(ValueErrorType.String, schema, path, value); + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } +} +function* FromThis(schema, references, path, value) { + yield* Visit((0, index_5.Deref)(schema, references), references, path, value); +} +function* FromTuple(schema, references, path, value) { + if (!(0, index_10.IsArray)(value)) + return yield Create(ValueErrorType.Tuple, schema, path, value); + if (schema.items === undefined && !(value.length === 0)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!(value.length === schema.maxItems)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!schema.items) { + return; + } + for (let i = 0; i < schema.items.length; i++) { + yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]); + } +} +function* FromUndefined(schema, references, path, value) { + if (!(0, index_10.IsUndefined)(value)) + yield Create(ValueErrorType.Undefined, schema, path, value); +} +function* FromUnion(schema, references, path, value) { + if ((0, index_7.Check)(schema, references, value)) + return; + const errors = schema.anyOf.map((variant) => new ValueErrorIterator(Visit(variant, references, path, value))); + yield Create(ValueErrorType.Union, schema, path, value, errors); +} +function* FromUint8Array(schema, references, path, value) { + if (!(0, index_10.IsUint8Array)(value)) + return yield Create(ValueErrorType.Uint8Array, schema, path, value); + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value); + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value); + } +} +function* FromUnknown(schema, references, path, value) { } +function* FromVoid(schema, references, path, value) { + if (!index_1.TypeSystemPolicy.IsVoidLike(value)) + yield Create(ValueErrorType.Void, schema, path, value); +} +function* FromKind(schema, references, path, value) { + const check = index_3.TypeRegistry.Get(schema[index_8.Kind]); + if (!check(schema, value)) + yield Create(ValueErrorType.Kind, schema, path, value); +} +function* Visit(schema, references, path, value) { + const references_ = IsDefined(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema_[index_8.Kind]) { + case 'Any': + return yield* FromAny(schema_, references_, path, value); + case 'Argument': + return yield* FromArgument(schema_, references_, path, value); + case 'Array': + return yield* FromArray(schema_, references_, path, value); + case 'AsyncIterator': + return yield* FromAsyncIterator(schema_, references_, path, value); + case 'BigInt': + return yield* FromBigInt(schema_, references_, path, value); + case 'Boolean': + return yield* FromBoolean(schema_, references_, path, value); + case 'Constructor': + return yield* FromConstructor(schema_, references_, path, value); + case 'Date': + return yield* FromDate(schema_, references_, path, value); + case 'Function': + return yield* FromFunction(schema_, references_, path, value); + case 'Import': + return yield* FromImport(schema_, references_, path, value); + case 'Integer': + return yield* FromInteger(schema_, references_, path, value); + case 'Intersect': + return yield* FromIntersect(schema_, references_, path, value); + case 'Iterator': + return yield* FromIterator(schema_, references_, path, value); + case 'Literal': + return yield* FromLiteral(schema_, references_, path, value); + case 'Never': + return yield* FromNever(schema_, references_, path, value); + case 'Not': + return yield* FromNot(schema_, references_, path, value); + case 'Null': + return yield* FromNull(schema_, references_, path, value); + case 'Number': + return yield* FromNumber(schema_, references_, path, value); + case 'Object': + return yield* FromObject(schema_, references_, path, value); + case 'Promise': + return yield* FromPromise(schema_, references_, path, value); + case 'Record': + return yield* FromRecord(schema_, references_, path, value); + case 'Ref': + return yield* FromRef(schema_, references_, path, value); + case 'RegExp': + return yield* FromRegExp(schema_, references_, path, value); + case 'String': + return yield* FromString(schema_, references_, path, value); + case 'Symbol': + return yield* FromSymbol(schema_, references_, path, value); + case 'TemplateLiteral': + return yield* FromTemplateLiteral(schema_, references_, path, value); + case 'This': + return yield* FromThis(schema_, references_, path, value); + case 'Tuple': + return yield* FromTuple(schema_, references_, path, value); + case 'Undefined': + return yield* FromUndefined(schema_, references_, path, value); + case 'Union': + return yield* FromUnion(schema_, references_, path, value); + case 'Uint8Array': + return yield* FromUint8Array(schema_, references_, path, value); + case 'Unknown': + return yield* FromUnknown(schema_, references_, path, value); + case 'Void': + return yield* FromVoid(schema_, references_, path, value); + default: + if (!index_3.TypeRegistry.Has(schema_[index_8.Kind])) + throw new ValueErrorsUnknownTypeError(schema); + return yield* FromKind(schema_, references_, path, value); + } +} +/** Returns an iterator for each error in this value. */ +function Errors(...args) { + const iterator = args.length === 3 ? Visit(args[0], args[1], '', args[2]) : Visit(args[0], [], '', args[1]); + return new ValueErrorIterator(iterator); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/function.d.ts b/node_modules/@sinclair/typebox/build/cjs/errors/function.d.ts new file mode 100644 index 00000000..bfe0c330 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/function.d.ts @@ -0,0 +1,21 @@ +import { TSchema } from '../type/schema/index'; +import { ValueErrorIterator, ValueErrorType } from './errors'; +/** Creates an error message using en-US as the default locale */ +export declare function DefaultErrorFunction(error: ErrorFunctionParameter): string; +export type ErrorFunctionParameter = { + /** The type of validation error */ + errorType: ValueErrorType; + /** The path of the error */ + path: string; + /** The schema associated with the error */ + schema: TSchema; + /** The value associated with the error */ + value: unknown; + /** Interior errors for this error */ + errors: ValueErrorIterator[]; +}; +export type ErrorFunction = (parameter: ErrorFunctionParameter) => string; +/** Sets the error function used to generate error messages. */ +export declare function SetErrorFunction(callback: ErrorFunction): void; +/** Gets the error function used to generate error messages */ +export declare function GetErrorFunction(): ErrorFunction; diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/function.js b/node_modules/@sinclair/typebox/build/cjs/errors/function.js new file mode 100644 index 00000000..8dee6aae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/function.js @@ -0,0 +1,153 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefaultErrorFunction = DefaultErrorFunction; +exports.SetErrorFunction = SetErrorFunction; +exports.GetErrorFunction = GetErrorFunction; +const index_1 = require("../type/symbols/index"); +const errors_1 = require("./errors"); +/** Creates an error message using en-US as the default locale */ +function DefaultErrorFunction(error) { + switch (error.errorType) { + case errors_1.ValueErrorType.ArrayContains: + return 'Expected array to contain at least one matching value'; + case errors_1.ValueErrorType.ArrayMaxContains: + return `Expected array to contain no more than ${error.schema.maxContains} matching values`; + case errors_1.ValueErrorType.ArrayMinContains: + return `Expected array to contain at least ${error.schema.minContains} matching values`; + case errors_1.ValueErrorType.ArrayMaxItems: + return `Expected array length to be less or equal to ${error.schema.maxItems}`; + case errors_1.ValueErrorType.ArrayMinItems: + return `Expected array length to be greater or equal to ${error.schema.minItems}`; + case errors_1.ValueErrorType.ArrayUniqueItems: + return 'Expected array elements to be unique'; + case errors_1.ValueErrorType.Array: + return 'Expected array'; + case errors_1.ValueErrorType.AsyncIterator: + return 'Expected AsyncIterator'; + case errors_1.ValueErrorType.BigIntExclusiveMaximum: + return `Expected bigint to be less than ${error.schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.BigIntExclusiveMinimum: + return `Expected bigint to be greater than ${error.schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.BigIntMaximum: + return `Expected bigint to be less or equal to ${error.schema.maximum}`; + case errors_1.ValueErrorType.BigIntMinimum: + return `Expected bigint to be greater or equal to ${error.schema.minimum}`; + case errors_1.ValueErrorType.BigIntMultipleOf: + return `Expected bigint to be a multiple of ${error.schema.multipleOf}`; + case errors_1.ValueErrorType.BigInt: + return 'Expected bigint'; + case errors_1.ValueErrorType.Boolean: + return 'Expected boolean'; + case errors_1.ValueErrorType.DateExclusiveMinimumTimestamp: + return `Expected Date timestamp to be greater than ${error.schema.exclusiveMinimumTimestamp}`; + case errors_1.ValueErrorType.DateExclusiveMaximumTimestamp: + return `Expected Date timestamp to be less than ${error.schema.exclusiveMaximumTimestamp}`; + case errors_1.ValueErrorType.DateMinimumTimestamp: + return `Expected Date timestamp to be greater or equal to ${error.schema.minimumTimestamp}`; + case errors_1.ValueErrorType.DateMaximumTimestamp: + return `Expected Date timestamp to be less or equal to ${error.schema.maximumTimestamp}`; + case errors_1.ValueErrorType.DateMultipleOfTimestamp: + return `Expected Date timestamp to be a multiple of ${error.schema.multipleOfTimestamp}`; + case errors_1.ValueErrorType.Date: + return 'Expected Date'; + case errors_1.ValueErrorType.Function: + return 'Expected function'; + case errors_1.ValueErrorType.IntegerExclusiveMaximum: + return `Expected integer to be less than ${error.schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.IntegerExclusiveMinimum: + return `Expected integer to be greater than ${error.schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.IntegerMaximum: + return `Expected integer to be less or equal to ${error.schema.maximum}`; + case errors_1.ValueErrorType.IntegerMinimum: + return `Expected integer to be greater or equal to ${error.schema.minimum}`; + case errors_1.ValueErrorType.IntegerMultipleOf: + return `Expected integer to be a multiple of ${error.schema.multipleOf}`; + case errors_1.ValueErrorType.Integer: + return 'Expected integer'; + case errors_1.ValueErrorType.IntersectUnevaluatedProperties: + return 'Unexpected property'; + case errors_1.ValueErrorType.Intersect: + return 'Expected all values to match'; + case errors_1.ValueErrorType.Iterator: + return 'Expected Iterator'; + case errors_1.ValueErrorType.Literal: + return `Expected ${typeof error.schema.const === 'string' ? `'${error.schema.const}'` : error.schema.const}`; + case errors_1.ValueErrorType.Never: + return 'Never'; + case errors_1.ValueErrorType.Not: + return 'Value should not match'; + case errors_1.ValueErrorType.Null: + return 'Expected null'; + case errors_1.ValueErrorType.NumberExclusiveMaximum: + return `Expected number to be less than ${error.schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.NumberExclusiveMinimum: + return `Expected number to be greater than ${error.schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.NumberMaximum: + return `Expected number to be less or equal to ${error.schema.maximum}`; + case errors_1.ValueErrorType.NumberMinimum: + return `Expected number to be greater or equal to ${error.schema.minimum}`; + case errors_1.ValueErrorType.NumberMultipleOf: + return `Expected number to be a multiple of ${error.schema.multipleOf}`; + case errors_1.ValueErrorType.Number: + return 'Expected number'; + case errors_1.ValueErrorType.Object: + return 'Expected object'; + case errors_1.ValueErrorType.ObjectAdditionalProperties: + return 'Unexpected property'; + case errors_1.ValueErrorType.ObjectMaxProperties: + return `Expected object to have no more than ${error.schema.maxProperties} properties`; + case errors_1.ValueErrorType.ObjectMinProperties: + return `Expected object to have at least ${error.schema.minProperties} properties`; + case errors_1.ValueErrorType.ObjectRequiredProperty: + return 'Expected required property'; + case errors_1.ValueErrorType.Promise: + return 'Expected Promise'; + case errors_1.ValueErrorType.RegExp: + return 'Expected string to match regular expression'; + case errors_1.ValueErrorType.StringFormatUnknown: + return `Unknown format '${error.schema.format}'`; + case errors_1.ValueErrorType.StringFormat: + return `Expected string to match '${error.schema.format}' format`; + case errors_1.ValueErrorType.StringMaxLength: + return `Expected string length less or equal to ${error.schema.maxLength}`; + case errors_1.ValueErrorType.StringMinLength: + return `Expected string length greater or equal to ${error.schema.minLength}`; + case errors_1.ValueErrorType.StringPattern: + return `Expected string to match '${error.schema.pattern}'`; + case errors_1.ValueErrorType.String: + return 'Expected string'; + case errors_1.ValueErrorType.Symbol: + return 'Expected symbol'; + case errors_1.ValueErrorType.TupleLength: + return `Expected tuple to have ${error.schema.maxItems || 0} elements`; + case errors_1.ValueErrorType.Tuple: + return 'Expected tuple'; + case errors_1.ValueErrorType.Uint8ArrayMaxByteLength: + return `Expected byte length less or equal to ${error.schema.maxByteLength}`; + case errors_1.ValueErrorType.Uint8ArrayMinByteLength: + return `Expected byte length greater or equal to ${error.schema.minByteLength}`; + case errors_1.ValueErrorType.Uint8Array: + return 'Expected Uint8Array'; + case errors_1.ValueErrorType.Undefined: + return 'Expected undefined'; + case errors_1.ValueErrorType.Union: + return 'Expected union value'; + case errors_1.ValueErrorType.Void: + return 'Expected void'; + case errors_1.ValueErrorType.Kind: + return `Expected kind '${error.schema[index_1.Kind]}'`; + default: + return 'Unknown error type'; + } +} +/** Manages error message providers */ +let errorFunction = DefaultErrorFunction; +/** Sets the error function used to generate error messages. */ +function SetErrorFunction(callback) { + errorFunction = callback; +} +/** Gets the error function used to generate error messages */ +function GetErrorFunction() { + return errorFunction; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/errors/index.d.ts new file mode 100644 index 00000000..9c36fce5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/index.d.ts @@ -0,0 +1,2 @@ +export * from './errors'; +export * from './function'; diff --git a/node_modules/@sinclair/typebox/build/cjs/errors/index.js b/node_modules/@sinclair/typebox/build/cjs/errors/index.js new file mode 100644 index 00000000..65d0c5aa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/errors/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./errors"), exports); +__exportStar(require("./function"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/index.d.ts new file mode 100644 index 00000000..46146e4b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/index.d.ts @@ -0,0 +1,71 @@ +export * from './type/clone/index'; +export * from './type/create/index'; +export * from './type/error/index'; +export * from './type/guard/index'; +export * from './type/helpers/index'; +export * from './type/patterns/index'; +export * from './type/registry/index'; +export * from './type/sets/index'; +export * from './type/symbols/index'; +export * from './type/any/index'; +export * from './type/array/index'; +export * from './type/argument/index'; +export * from './type/async-iterator/index'; +export * from './type/awaited/index'; +export * from './type/bigint/index'; +export * from './type/boolean/index'; +export * from './type/composite/index'; +export * from './type/const/index'; +export * from './type/constructor/index'; +export * from './type/constructor-parameters/index'; +export * from './type/date/index'; +export * from './type/enum/index'; +export * from './type/exclude/index'; +export * from './type/extends/index'; +export * from './type/extract/index'; +export * from './type/function/index'; +export * from './type/indexed/index'; +export * from './type/instance-type/index'; +export * from './type/instantiate/index'; +export * from './type/integer/index'; +export * from './type/intersect/index'; +export * from './type/iterator/index'; +export * from './type/intrinsic/index'; +export * from './type/keyof/index'; +export * from './type/literal/index'; +export * from './type/module/index'; +export * from './type/mapped/index'; +export * from './type/never/index'; +export * from './type/not/index'; +export * from './type/null/index'; +export * from './type/number/index'; +export * from './type/object/index'; +export * from './type/omit/index'; +export * from './type/optional/index'; +export * from './type/parameters/index'; +export * from './type/partial/index'; +export * from './type/pick/index'; +export * from './type/promise/index'; +export * from './type/readonly/index'; +export * from './type/readonly-optional/index'; +export * from './type/record/index'; +export * from './type/recursive/index'; +export * from './type/ref/index'; +export * from './type/regexp/index'; +export * from './type/required/index'; +export * from './type/rest/index'; +export * from './type/return-type/index'; +export * from './type/schema/index'; +export * from './type/static/index'; +export * from './type/string/index'; +export * from './type/symbol/index'; +export * from './type/template-literal/index'; +export * from './type/transform/index'; +export * from './type/tuple/index'; +export * from './type/uint8array/index'; +export * from './type/undefined/index'; +export * from './type/union/index'; +export * from './type/unknown/index'; +export * from './type/unsafe/index'; +export * from './type/void/index'; +export * from './type/type/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/index.js b/node_modules/@sinclair/typebox/build/cjs/index.js new file mode 100644 index 00000000..f278dec5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/index.js @@ -0,0 +1,97 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// ------------------------------------------------------------------ +// Infrastructure +// ------------------------------------------------------------------ +__exportStar(require("./type/clone/index"), exports); +__exportStar(require("./type/create/index"), exports); +__exportStar(require("./type/error/index"), exports); +__exportStar(require("./type/guard/index"), exports); +__exportStar(require("./type/helpers/index"), exports); +__exportStar(require("./type/patterns/index"), exports); +__exportStar(require("./type/registry/index"), exports); +__exportStar(require("./type/sets/index"), exports); +__exportStar(require("./type/symbols/index"), exports); +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +__exportStar(require("./type/any/index"), exports); +__exportStar(require("./type/array/index"), exports); +__exportStar(require("./type/argument/index"), exports); +__exportStar(require("./type/async-iterator/index"), exports); +__exportStar(require("./type/awaited/index"), exports); +__exportStar(require("./type/bigint/index"), exports); +__exportStar(require("./type/boolean/index"), exports); +__exportStar(require("./type/composite/index"), exports); +__exportStar(require("./type/const/index"), exports); +__exportStar(require("./type/constructor/index"), exports); +__exportStar(require("./type/constructor-parameters/index"), exports); +__exportStar(require("./type/date/index"), exports); +__exportStar(require("./type/enum/index"), exports); +__exportStar(require("./type/exclude/index"), exports); +__exportStar(require("./type/extends/index"), exports); +__exportStar(require("./type/extract/index"), exports); +__exportStar(require("./type/function/index"), exports); +__exportStar(require("./type/indexed/index"), exports); +__exportStar(require("./type/instance-type/index"), exports); +__exportStar(require("./type/instantiate/index"), exports); +__exportStar(require("./type/integer/index"), exports); +__exportStar(require("./type/intersect/index"), exports); +__exportStar(require("./type/iterator/index"), exports); +__exportStar(require("./type/intrinsic/index"), exports); +__exportStar(require("./type/keyof/index"), exports); +__exportStar(require("./type/literal/index"), exports); +__exportStar(require("./type/module/index"), exports); +__exportStar(require("./type/mapped/index"), exports); +__exportStar(require("./type/never/index"), exports); +__exportStar(require("./type/not/index"), exports); +__exportStar(require("./type/null/index"), exports); +__exportStar(require("./type/number/index"), exports); +__exportStar(require("./type/object/index"), exports); +__exportStar(require("./type/omit/index"), exports); +__exportStar(require("./type/optional/index"), exports); +__exportStar(require("./type/parameters/index"), exports); +__exportStar(require("./type/partial/index"), exports); +__exportStar(require("./type/pick/index"), exports); +__exportStar(require("./type/promise/index"), exports); +__exportStar(require("./type/readonly/index"), exports); +__exportStar(require("./type/readonly-optional/index"), exports); +__exportStar(require("./type/record/index"), exports); +__exportStar(require("./type/recursive/index"), exports); +__exportStar(require("./type/ref/index"), exports); +__exportStar(require("./type/regexp/index"), exports); +__exportStar(require("./type/required/index"), exports); +__exportStar(require("./type/rest/index"), exports); +__exportStar(require("./type/return-type/index"), exports); +__exportStar(require("./type/schema/index"), exports); +__exportStar(require("./type/static/index"), exports); +__exportStar(require("./type/string/index"), exports); +__exportStar(require("./type/symbol/index"), exports); +__exportStar(require("./type/template-literal/index"), exports); +__exportStar(require("./type/transform/index"), exports); +__exportStar(require("./type/tuple/index"), exports); +__exportStar(require("./type/uint8array/index"), exports); +__exportStar(require("./type/undefined/index"), exports); +__exportStar(require("./type/union/index"), exports); +__exportStar(require("./type/unknown/index"), exports); +__exportStar(require("./type/unsafe/index"), exports); +__exportStar(require("./type/void/index"), exports); +// ------------------------------------------------------------------ +// Type.* +// ------------------------------------------------------------------ +__exportStar(require("./type/type/index"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/index.d.ts new file mode 100644 index 00000000..2198e56d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/index.d.ts @@ -0,0 +1,2 @@ +export * as Runtime from './runtime/index'; +export * as Static from './static/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/index.js b/node_modules/@sinclair/typebox/build/cjs/parser/index.js new file mode 100644 index 00000000..1e0ad783 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/index.js @@ -0,0 +1,39 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Static = exports.Runtime = void 0; +exports.Runtime = __importStar(require("./runtime/index")); +exports.Static = __importStar(require("./static/index")); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.d.ts new file mode 100644 index 00000000..96989115 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.d.ts @@ -0,0 +1,23 @@ +import { IArray, IConst, IContext, IIdent, INumber, IOptional, IRef, IString, ITuple, IUnion } from './types'; +/** Returns true if the value is a Array Parser */ +export declare function IsArray(value: unknown): value is IArray; +/** Returns true if the value is a Const Parser */ +export declare function IsConst(value: unknown): value is IConst; +/** Returns true if the value is a Context Parser */ +export declare function IsContext(value: unknown): value is IContext; +/** Returns true if the value is a Ident Parser */ +export declare function IsIdent(value: unknown): value is IIdent; +/** Returns true if the value is a Number Parser */ +export declare function IsNumber(value: unknown): value is INumber; +/** Returns true if the value is a Optional Parser */ +export declare function IsOptional(value: unknown): value is IOptional; +/** Returns true if the value is a Ref Parser */ +export declare function IsRef(value: unknown): value is IRef; +/** Returns true if the value is a String Parser */ +export declare function IsString(value: unknown): value is IString; +/** Returns true if the value is a Tuple Parser */ +export declare function IsTuple(value: unknown): value is ITuple; +/** Returns true if the value is a Union Parser */ +export declare function IsUnion(value: unknown): value is IUnion; +/** Returns true if the value is a Parser */ +export declare function IsParser(value: unknown): value is IContext | IUnion | IArray | IConst | IIdent | INumber | IOptional | IRef | IString | ITuple; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.js new file mode 100644 index 00000000..30b06736 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/guard.js @@ -0,0 +1,86 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IsArray = IsArray; +exports.IsConst = IsConst; +exports.IsContext = IsContext; +exports.IsIdent = IsIdent; +exports.IsNumber = IsNumber; +exports.IsOptional = IsOptional; +exports.IsRef = IsRef; +exports.IsString = IsString; +exports.IsTuple = IsTuple; +exports.IsUnion = IsUnion; +exports.IsParser = IsParser; +// ------------------------------------------------------------------ +// Value Guard +// ------------------------------------------------------------------ +// prettier-ignore +function HasPropertyKey(value, key) { + return key in value; +} +// prettier-ignore +function IsObjectValue(value) { + return typeof value === 'object' && value !== null; +} +// prettier-ignore +function IsArrayValue(value) { + return globalThis.Array.isArray(value); +} +// ------------------------------------------------------------------ +// Parser Guard +// ------------------------------------------------------------------ +/** Returns true if the value is a Array Parser */ +function IsArray(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Array' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser); +} +/** Returns true if the value is a Const Parser */ +function IsConst(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Const' && HasPropertyKey(value, 'value') && typeof value.value === 'string'; +} +/** Returns true if the value is a Context Parser */ +function IsContext(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Context' && HasPropertyKey(value, 'left') && IsParser(value.left) && HasPropertyKey(value, 'right') && IsParser(value.right); +} +/** Returns true if the value is a Ident Parser */ +function IsIdent(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ident'; +} +/** Returns true if the value is a Number Parser */ +function IsNumber(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Number'; +} +/** Returns true if the value is a Optional Parser */ +function IsOptional(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Optional' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser); +} +/** Returns true if the value is a Ref Parser */ +function IsRef(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ref' && HasPropertyKey(value, 'ref') && typeof value.ref === 'string'; +} +/** Returns true if the value is a String Parser */ +function IsString(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'String' && HasPropertyKey(value, 'options') && IsArrayValue(value.options); +} +/** Returns true if the value is a Tuple Parser */ +function IsTuple(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Tuple' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers); +} +/** Returns true if the value is a Union Parser */ +function IsUnion(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Union' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers); +} +/** Returns true if the value is a Parser */ +function IsParser(value) { + // prettier-ignore + return (IsArray(value) || + IsConst(value) || + IsContext(value) || + IsIdent(value) || + IsNumber(value) || + IsOptional(value) || + IsRef(value) || + IsString(value) || + IsTuple(value) || + IsUnion(value)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.d.ts new file mode 100644 index 00000000..1f149edf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.d.ts @@ -0,0 +1,5 @@ +export * as Guard from './guard'; +export * as Token from './token'; +export * from './types'; +export * from './module'; +export * from './parse'; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.js new file mode 100644 index 00000000..cb90e008 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/index.js @@ -0,0 +1,45 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Token = exports.Guard = void 0; +exports.Guard = __importStar(require("./guard")); +exports.Token = __importStar(require("./token")); +__exportStar(require("./types"), exports); +__exportStar(require("./module"), exports); +__exportStar(require("./parse"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.d.ts new file mode 100644 index 00000000..747a12bc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.d.ts @@ -0,0 +1,9 @@ +import * as Types from './types'; +export declare class Module { + private readonly properties; + constructor(properties: Properties); + /** Parses using one of the parsers defined on this instance */ + Parse(key: Key, content: string, context: unknown): [] | [Types.StaticParser, string]; + /** Parses using one of the parsers defined on this instance */ + Parse(key: Key, content: string): [] | [Types.StaticParser, string]; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.js new file mode 100644 index 00000000..ca8d6639 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/module.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Module = void 0; +const parse_1 = require("./parse"); +// ------------------------------------------------------------------ +// Module +// ------------------------------------------------------------------ +class Module { + constructor(properties) { + this.properties = properties; + } + /** Parses using one of the parsers defined on this instance */ + Parse(...args) { + // prettier-ignore + const [key, content, context] = (args.length === 3 ? [args[0], args[1], args[2]] : + args.length === 2 ? [args[0], args[1], undefined] : + (() => { throw Error('Invalid parse arguments'); })()); + return (0, parse_1.Parse)(this.properties, this.properties[key], content, context); + } +} +exports.Module = Module; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.d.ts new file mode 100644 index 00000000..90cb3119 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.d.ts @@ -0,0 +1,9 @@ +import * as Types from './types'; +/** Parses content using the given Parser */ +export declare function Parse(moduleProperties: Types.IModuleProperties, parser: Parser, code: string, context: unknown): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(moduleProperties: Types.IModuleProperties, parser: Parser, code: string): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(parser: Parser, content: string, context: unknown): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(parser: Parser, content: string): [] | [Types.StaticParser, string]; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.js new file mode 100644 index 00000000..e692e69c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/parse.js @@ -0,0 +1,160 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parse = Parse; +const Guard = __importStar(require("./guard")); +const Token = __importStar(require("./token")); +// ------------------------------------------------------------------ +// Context +// ------------------------------------------------------------------ +function ParseContext(moduleProperties, left, right, code, context) { + const result = ParseParser(moduleProperties, left, code, context); + return result.length === 2 ? ParseParser(moduleProperties, right, result[1], result[0]) : []; +} +// ------------------------------------------------------------------ +// Array +// ------------------------------------------------------------------ +function ParseArray(moduleProperties, parser, code, context) { + const buffer = []; + let rest = code; + while (rest.length > 0) { + const result = ParseParser(moduleProperties, parser, rest, context); + if (result.length === 0) + return [buffer, rest]; + buffer.push(result[0]); + rest = result[1]; + } + return [buffer, rest]; +} +// ------------------------------------------------------------------ +// Const +// ------------------------------------------------------------------ +function ParseConst(value, code, context) { + return Token.Const(value, code); +} +// ------------------------------------------------------------------ +// Ident +// ------------------------------------------------------------------ +function ParseIdent(code, _context) { + return Token.Ident(code); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +// prettier-ignore +function ParseNumber(code, _context) { + return Token.Number(code); +} +// ------------------------------------------------------------------ +// Optional +// ------------------------------------------------------------------ +function ParseOptional(moduleProperties, parser, code, context) { + const result = ParseParser(moduleProperties, parser, code, context); + return (result.length === 2 ? [[result[0]], result[1]] : [[], code]); +} +// ------------------------------------------------------------------ +// Ref +// ------------------------------------------------------------------ +function ParseRef(moduleProperties, ref, code, context) { + const parser = moduleProperties[ref]; + if (!Guard.IsParser(parser)) + throw Error(`Cannot dereference Parser '${ref}'`); + return ParseParser(moduleProperties, parser, code, context); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function ParseString(options, code, _context) { + return Token.String(options, code); +} +// ------------------------------------------------------------------ +// Tuple +// ------------------------------------------------------------------ +function ParseTuple(moduleProperties, parsers, code, context) { + const buffer = []; + let rest = code; + for (const parser of parsers) { + const result = ParseParser(moduleProperties, parser, rest, context); + if (result.length === 0) + return []; + buffer.push(result[0]); + rest = result[1]; + } + return [buffer, rest]; +} +// ------------------------------------------------------------------ +// Union +// ------------------------------------------------------------------ +// prettier-ignore +function ParseUnion(moduleProperties, parsers, code, context) { + for (const parser of parsers) { + const result = ParseParser(moduleProperties, parser, code, context); + if (result.length === 0) + continue; + return result; + } + return []; +} +// ------------------------------------------------------------------ +// Parser +// ------------------------------------------------------------------ +// prettier-ignore +function ParseParser(moduleProperties, parser, code, context) { + const result = (Guard.IsContext(parser) ? ParseContext(moduleProperties, parser.left, parser.right, code, context) : + Guard.IsArray(parser) ? ParseArray(moduleProperties, parser.parser, code, context) : + Guard.IsConst(parser) ? ParseConst(parser.value, code, context) : + Guard.IsIdent(parser) ? ParseIdent(code, context) : + Guard.IsNumber(parser) ? ParseNumber(code, context) : + Guard.IsOptional(parser) ? ParseOptional(moduleProperties, parser.parser, code, context) : + Guard.IsRef(parser) ? ParseRef(moduleProperties, parser.ref, code, context) : + Guard.IsString(parser) ? ParseString(parser.options, code, context) : + Guard.IsTuple(parser) ? ParseTuple(moduleProperties, parser.parsers, code, context) : + Guard.IsUnion(parser) ? ParseUnion(moduleProperties, parser.parsers, code, context) : + []); + return (result.length === 2 + ? [parser.mapping(result[0], context), result[1]] + : result); +} +/** Parses content using the given parser */ +// prettier-ignore +function Parse(...args) { + const withModuleProperties = typeof args[1] === 'string' ? false : true; + const [moduleProperties, parser, content, context] = withModuleProperties + ? [args[0], args[1], args[2], args[3]] + : [{}, args[0], args[1], args[2]]; + return ParseParser(moduleProperties, parser, content, context); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.d.ts new file mode 100644 index 00000000..47a2d4ce --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.d.ts @@ -0,0 +1,8 @@ +/** Takes the next constant string value skipping any whitespace */ +export declare function Const(value: string, code: string): [] | [string, string]; +/** Scans for the next Ident token */ +export declare function Ident(code: string): [] | [string, string]; +/** Scans for the next number token */ +export declare function Number(code: string): [string, string] | []; +/** Scans the next Literal String value */ +export declare function String(options: string[], code: string): [string, string] | []; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.js new file mode 100644 index 00000000..daece39c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/token.js @@ -0,0 +1,230 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Const = Const; +exports.Ident = Ident; +exports.Number = Number; +exports.String = String; +// ------------------------------------------------------------------ +// Chars +// ------------------------------------------------------------------ +// prettier-ignore +var Chars; +(function (Chars) { + /** Returns true if the char code is a whitespace */ + function IsWhitespace(value) { + return value === 32; + } + Chars.IsWhitespace = IsWhitespace; + /** Returns true if the char code is a newline */ + function IsNewline(value) { + return value === 10; + } + Chars.IsNewline = IsNewline; + /** Returns true if the char code is a alpha */ + function IsAlpha(value) { + return ((value >= 65 && value <= 90) || // A-Z + (value >= 97 && value <= 122) // a-z + ); + } + Chars.IsAlpha = IsAlpha; + /** Returns true if the char code is zero */ + function IsZero(value) { + return value === 48; + } + Chars.IsZero = IsZero; + /** Returns true if the char code is non-zero */ + function IsNonZero(value) { + return value >= 49 && value <= 57; + } + Chars.IsNonZero = IsNonZero; + /** Returns true if the char code is a digit */ + function IsDigit(value) { + return (IsNonZero(value) || + IsZero(value)); + } + Chars.IsDigit = IsDigit; + /** Returns true if the char code is a dot */ + function IsDot(value) { + return value === 46; + } + Chars.IsDot = IsDot; + /** Returns true if this char code is a underscore */ + function IsUnderscore(value) { + return value === 95; + } + Chars.IsUnderscore = IsUnderscore; + /** Returns true if this char code is a dollar sign */ + function IsDollarSign(value) { + return value === 36; + } + Chars.IsDollarSign = IsDollarSign; +})(Chars || (Chars = {})); +// ------------------------------------------------------------------ +// Trim +// ------------------------------------------------------------------ +// prettier-ignore +var Trim; +(function (Trim) { + /** Trims Whitespace and retains Newline, Tabspaces, etc. */ + function TrimWhitespaceOnly(code) { + for (let i = 0; i < code.length; i++) { + if (Chars.IsWhitespace(code.charCodeAt(i))) + continue; + return code.slice(i); + } + return code; + } + Trim.TrimWhitespaceOnly = TrimWhitespaceOnly; + /** Trims Whitespace including Newline, Tabspaces, etc. */ + function TrimAll(code) { + return code.trimStart(); + } + Trim.TrimAll = TrimAll; +})(Trim || (Trim = {})); +// ------------------------------------------------------------------ +// Const +// ------------------------------------------------------------------ +/** Checks the value matches the next string */ +// prettier-ignore +function NextTokenCheck(value, code) { + if (value.length > code.length) + return false; + for (let i = 0; i < value.length; i++) { + if (value.charCodeAt(i) !== code.charCodeAt(i)) + return false; + } + return true; +} +/** Gets the next constant string value or empty if no match */ +// prettier-ignore +function NextConst(value, code) { + return NextTokenCheck(value, code) + ? [code.slice(0, value.length), code.slice(value.length)] + : []; +} +/** Takes the next constant string value skipping any whitespace */ +// prettier-ignore +function Const(value, code) { + if (value.length === 0) + return ['', code]; + const char_0 = value.charCodeAt(0); + return (Chars.IsNewline(char_0) ? NextConst(value, Trim.TrimWhitespaceOnly(code)) : + Chars.IsWhitespace(char_0) ? NextConst(value, code) : + NextConst(value, Trim.TrimAll(code))); +} +// ------------------------------------------------------------------ +// Ident +// ------------------------------------------------------------------ +// prettier-ignore +function IdentIsFirst(char) { + return (Chars.IsAlpha(char) || + Chars.IsDollarSign(char) || + Chars.IsUnderscore(char)); +} +// prettier-ignore +function IdentIsRest(char) { + return (Chars.IsAlpha(char) || + Chars.IsDigit(char) || + Chars.IsDollarSign(char) || + Chars.IsUnderscore(char)); +} +// prettier-ignore +function NextIdent(code) { + if (!IdentIsFirst(code.charCodeAt(0))) + return []; + for (let i = 1; i < code.length; i++) { + const char = code.charCodeAt(i); + if (IdentIsRest(char)) + continue; + const slice = code.slice(0, i); + const rest = code.slice(i); + return [slice, rest]; + } + return [code, '']; +} +/** Scans for the next Ident token */ +// prettier-ignore +function Ident(code) { + return NextIdent(Trim.TrimAll(code)); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +/** Checks that the next number is not a leading zero */ +// prettier-ignore +function NumberLeadingZeroCheck(code, index) { + const char_0 = code.charCodeAt(index + 0); + const char_1 = code.charCodeAt(index + 1); + return (( + // 1-9 + Chars.IsNonZero(char_0)) || ( + // 0 + Chars.IsZero(char_0) && + !Chars.IsDigit(char_1)) || ( + // 0. + Chars.IsZero(char_0) && + Chars.IsDot(char_1)) || ( + // .0 + Chars.IsDot(char_0) && + Chars.IsDigit(char_1))); +} +/** Gets the next number token */ +// prettier-ignore +function NextNumber(code) { + const negated = code.charAt(0) === '-'; + const index = negated ? 1 : 0; + if (!NumberLeadingZeroCheck(code, index)) { + return []; + } + const dash = negated ? '-' : ''; + let hasDot = false; + for (let i = index; i < code.length; i++) { + const char_i = code.charCodeAt(i); + if (Chars.IsDigit(char_i)) { + continue; + } + if (Chars.IsDot(char_i)) { + if (hasDot) { + const slice = code.slice(index, i); + const rest = code.slice(i); + return [`${dash}${slice}`, rest]; + } + hasDot = true; + continue; + } + const slice = code.slice(index, i); + const rest = code.slice(i); + return [`${dash}${slice}`, rest]; + } + return [code, '']; +} +/** Scans for the next number token */ +// prettier-ignore +function Number(code) { + return NextNumber(Trim.TrimAll(code)); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function NextString(options, code) { + const first = code.charAt(0); + if (!options.includes(first)) + return []; + const quote = first; + for (let i = 1; i < code.length; i++) { + const char = code.charAt(i); + if (char === quote) { + const slice = code.slice(1, i); + const rest = code.slice(i + 1); + return [slice, rest]; + } + } + return []; +} +/** Scans the next Literal String value */ +// prettier-ignore +function String(options, code) { + return NextString(options, Trim.TrimAll(code)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.d.ts new file mode 100644 index 00000000..42009627 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.d.ts @@ -0,0 +1,98 @@ +export type IModuleProperties = Record; +/** Force output static type evaluation for Arrays */ +export type StaticEnsure = T extends infer R ? R : never; +/** Infers the Output Parameter for a Parser */ +export type StaticParser = Parser extends IParser ? Output : unknown; +export type IMapping = (input: Input, context: any) => Output; +/** Maps input to output. This is the default Mapping */ +export declare const Identity: (value: unknown) => unknown; +/** Maps the output as the given parameter T */ +export declare const As: (mapping: T) => ((value: unknown) => T); +export interface IParser { + type: string; + mapping: IMapping; +} +export type ContextParameter<_Left extends IParser, Right extends IParser> = (StaticParser); +export interface IContext extends IParser { + type: 'Context'; + left: IParser; + right: IParser; +} +/** `[Context]` Creates a Context Parser */ +export declare function Context>>(left: Left, right: Right, mapping: Mapping): IContext>; +/** `[Context]` Creates a Context Parser */ +export declare function Context(left: Left, right: Right): IContext>; +export type ArrayParameter = StaticEnsure[]>; +export interface IArray extends IParser { + type: 'Array'; + parser: IParser; +} +/** `[EBNF]` Creates an Array Parser */ +export declare function Array>>(parser: Parser, mapping: Mapping): IArray>; +/** `[EBNF]` Creates an Array Parser */ +export declare function Array(parser: Parser): IArray>; +export interface IConst extends IParser { + type: 'Const'; + value: string; +} +/** `[TERM]` Creates a Const Parser */ +export declare function Const>(value: Value, mapping: Mapping): IConst>; +/** `[TERM]` Creates a Const Parser */ +export declare function Const(value: Value): IConst; +export interface IRef extends IParser { + type: 'Ref'; + ref: string; +} +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +export declare function Ref>(ref: string, mapping: Mapping): IRef>; +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +export declare function Ref(ref: string): IRef; +export interface IString extends IParser { + type: 'String'; + options: string[]; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export declare function String>(options: string[], mapping: Mapping): IString>; +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export declare function String(options: string[]): IString; +export interface IIdent extends IParser { + type: 'Ident'; +} +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +export declare function Ident>(mapping: Mapping): IIdent>; +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +export declare function Ident(): IIdent; +export interface INumber extends IParser { + type: 'Number'; +} +/** `[TERM]` Creates an Number Parser */ +export declare function Number>(mapping: Mapping): INumber>; +/** `[TERM]` Creates an Number Parser */ +export declare function Number(): INumber; +export type OptionalParameter] | []> = (Result); +export interface IOptional extends IParser { + type: 'Optional'; + parser: IParser; +} +/** `[EBNF]` Creates an Optional Parser */ +export declare function Optional>>(parser: Parser, mapping: Mapping): IOptional>; +/** `[EBNF]` Creates an Optional Parser */ +export declare function Optional(parser: Parser): IOptional>; +export type TupleParameter = StaticEnsure>]> : Result>; +export interface ITuple extends IParser { + type: 'Tuple'; + parsers: IParser[]; +} +/** `[BNF]` Creates a Tuple Parser */ +export declare function Tuple>>(parsers: [...Parsers], mapping: Mapping): ITuple>; +/** `[BNF]` Creates a Tuple Parser */ +export declare function Tuple(parsers: [...Parsers]): ITuple>; +export type UnionParameter = StaticEnsure> : Result>; +export interface IUnion extends IParser { + type: 'Union'; + parsers: IParser[]; +} +/** `[BNF]` Creates a Union parser */ +export declare function Union>>(parsers: [...Parsers], mapping: Mapping): IUnion>; +/** `[BNF]` Creates a Union parser */ +export declare function Union(parsers: [...Parsers]): IUnion>; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.js b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.js new file mode 100644 index 00000000..488775de --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/runtime/types.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.As = exports.Identity = void 0; +exports.Context = Context; +exports.Array = Array; +exports.Const = Const; +exports.Ref = Ref; +exports.String = String; +exports.Ident = Ident; +exports.Number = Number; +exports.Optional = Optional; +exports.Tuple = Tuple; +exports.Union = Union; +/** Maps input to output. This is the default Mapping */ +const Identity = (value) => value; +exports.Identity = Identity; +/** Maps the output as the given parameter T */ +// prettier-ignore +const As = (mapping) => (_) => mapping; +exports.As = As; +/** `[Context]` Creates a Context Parser */ +function Context(...args) { + const [left, right, mapping] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], args[1], exports.Identity]; + return { type: 'Context', left, right, mapping }; +} +/** `[EBNF]` Creates an Array Parser */ +function Array(...args) { + const [parser, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Array', parser, mapping }; +} +/** `[TERM]` Creates a Const Parser */ +function Const(...args) { + const [value, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Const', value, mapping }; +} +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +function Ref(...args) { + const [ref, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Ref', ref, mapping }; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +function String(...params) { + const [options, mapping] = params.length === 2 ? [params[0], params[1]] : [params[0], exports.Identity]; + return { type: 'String', options, mapping }; +} +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +function Ident(...params) { + const mapping = params.length === 1 ? params[0] : exports.Identity; + return { type: 'Ident', mapping }; +} +/** `[TERM]` Creates an Number Parser */ +function Number(...params) { + const mapping = params.length === 1 ? params[0] : exports.Identity; + return { type: 'Number', mapping }; +} +/** `[EBNF]` Creates an Optional Parser */ +function Optional(...args) { + const [parser, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Optional', parser, mapping }; +} +/** `[BNF]` Creates a Tuple Parser */ +function Tuple(...args) { + const [parsers, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Tuple', parsers, mapping }; +} +/** `[BNF]` Creates a Union parser */ +function Union(...args) { + const [parsers, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], exports.Identity]; + return { type: 'Union', parsers, mapping }; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/static/index.d.ts new file mode 100644 index 00000000..05bf7e2b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/index.d.ts @@ -0,0 +1,3 @@ +export * as Token from './token'; +export * from './parse'; +export * from './types'; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/index.js b/node_modules/@sinclair/typebox/build/cjs/parser/static/index.js new file mode 100644 index 00000000..28c2927b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/index.js @@ -0,0 +1,43 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Token = void 0; +exports.Token = __importStar(require("./token")); +__exportStar(require("./parse"), exports); +__exportStar(require("./types"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.d.ts new file mode 100644 index 00000000..75a3d9b9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.d.ts @@ -0,0 +1,20 @@ +import * as Tokens from './token'; +import * as Types from './types'; +type ContextParser = (Parse extends [infer Context extends unknown, infer Rest extends string] ? Parse : []); +type ArrayParser = (Parse extends [infer Value1 extends unknown, infer Rest extends string] ? ArrayParser : [Result, Code]); +type ConstParser = (Tokens.Const extends [infer Match extends Value, infer Rest extends string] ? [Match, Rest] : []); +type IdentParser = (Tokens.Ident extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type NumberParser = (Tokens.Number extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type OptionalParser = (Parse extends [infer Value extends unknown, infer Rest extends string] ? [[Value], Rest] : [[], Code]); +type StringParser = (Tokens.String extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type TupleParser = (Parsers extends [infer Left extends Types.IParser, ...infer Right extends Types.IParser[]] ? Parse extends [infer Value extends unknown, infer Rest extends string] ? TupleParser : [] : [Result, Code]); +type UnionParser = (Parsers extends [infer Left extends Types.IParser, ...infer Right extends Types.IParser[]] ? Parse extends [infer Value extends unknown, infer Rest extends string] ? [Value, Rest] : UnionParser : []); +type ParseCode = (Type extends Types.Context ? ContextParser : Type extends Types.Array ? ArrayParser : Type extends Types.Const ? ConstParser : Type extends Types.Ident ? IdentParser : Type extends Types.Number ? NumberParser : Type extends Types.Optional ? OptionalParser : Type extends Types.String ? StringParser : Type extends Types.Tuple ? TupleParser : Type extends Types.Union ? UnionParser : [ +]); +type ParseMapping = ((Parser['mapping'] & { + input: Result; + context: Context; +})['output']); +/** Parses code with the given parser */ +export type Parse = (ParseCode extends [infer L extends unknown, infer R extends string] ? [ParseMapping, R] : []); +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.js b/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/parse.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/token.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/static/token.d.ts new file mode 100644 index 00000000..003f854e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/token.d.ts @@ -0,0 +1,108 @@ +declare namespace Chars { + type Empty = ''; + type Space = ' '; + type Newline = '\n'; + type Dot = '.'; + type Hyphen = '-'; + type Digit = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9' + ]; + type Alpha = [ + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z' + ]; +} +declare namespace Trim { + type W4 = `${W3}${W3}`; + type W3 = `${W2}${W2}`; + type W2 = `${W1}${W1}`; + type W1 = `${W0}${W0}`; + type W0 = ` `; + /** Trims whitespace only */ + export type TrimWhitespace = (Code extends `${W4}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W3}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W1}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W0}${infer Rest extends string}` ? TrimWhitespace : Code); + /** Trims Whitespace and Newline */ + export type TrimAll = (Code extends `${W4}${infer Rest extends string}` ? TrimAll : Code extends `${W3}${infer Rest extends string}` ? TrimAll : Code extends `${W1}${infer Rest extends string}` ? TrimAll : Code extends `${W0}${infer Rest extends string}` ? TrimAll : Code extends `${Chars.Newline}${infer Rest extends string}` ? TrimAll : Code); + export {}; +} +/** Scans for the next match union */ +type NextUnion = (Variants extends [infer Variant extends string, ...infer Rest1 extends string[]] ? NextConst extends [infer Match extends string, infer Rest2 extends string] ? [Match, Rest2] : NextUnion : []); +type NextConst = (Code extends `${Value}${infer Rest extends string}` ? [Value, Rest] : []); +/** Scans for the next constant value */ +export type Const = (Value extends '' ? ['', Code] : Value extends `${infer First extends string}${string}` ? (First extends Chars.Newline ? NextConst> : First extends Chars.Space ? NextConst : NextConst>) : never); +type NextNumberNegate = (Code extends `${Chars.Hyphen}${infer Rest extends string}` ? [Chars.Hyphen, Rest] : [Chars.Empty, Code]); +type NextNumberZeroCheck = (Code extends `0${infer Rest}` ? NextUnion extends [string, string] ? false : true : true); +type NextNumberScan = (NextUnion<[...Chars.Digit, Chars.Dot], Code> extends [infer Char extends string, infer Rest extends string] ? Char extends Chars.Dot ? HasDecimal extends false ? NextNumberScan : [Result, `.${Rest}`] : NextNumberScan : [Result, Code]); +export type NextNumber = (NextNumberNegate extends [infer Negate extends string, infer Rest extends string] ? NextNumberZeroCheck extends true ? NextNumberScan extends [infer Number extends string, infer Rest2 extends string] ? Number extends Chars.Empty ? [] : [`${Negate}${Number}`, Rest2] : [] : [] : []); +/** Scans for the next literal number */ +export type Number = NextNumber>; +type NextStringQuote = NextUnion; +type NextStringBody = (Code extends `${infer Char extends string}${infer Rest extends string}` ? Char extends Quote ? [Result, Rest] : NextStringBody : []); +type NextString = (NextStringQuote extends [infer Quote extends string, infer Rest extends string] ? NextStringBody extends [infer String extends string, infer Rest extends string] ? [String, Rest] : [] : []); +/** Scans for the next literal string */ +export type String = NextString>; +type IdentLeft = [...Chars.Alpha, '_', '$']; +type IdentRight = [...Chars.Digit, ...IdentLeft]; +type NextIdentScan = (NextUnion extends [infer Char extends string, infer Rest extends string] ? NextIdentScan : [Result, Code]); +type NextIdent = (NextUnion extends [infer Left extends string, infer Rest1 extends string] ? NextIdentScan extends [infer Right extends string, infer Rest2 extends string] ? [`${Left}${Right}`, Rest2] : [] : []); +/** Scans for the next Ident */ +export type Ident = NextIdent>; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/token.js b/node_modules/@sinclair/typebox/build/cjs/parser/static/token.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/token.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/types.d.ts b/node_modules/@sinclair/typebox/build/cjs/parser/static/types.d.ts new file mode 100644 index 00000000..ec60c9b6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/types.d.ts @@ -0,0 +1,69 @@ +/** + * `[ACTION]` Inference mapping base type. Used to specify semantic actions for + * Parser productions. This type is implemented as a higher-kinded type where + * productions are received on the `input` property with mapping assigned + * the `output` property. The parsing context is available on the `context` + * property. + */ +export interface IMapping { + context: unknown; + input: unknown; + output: unknown; +} +/** `[ACTION]` Default inference mapping. */ +export interface Identity extends IMapping { + output: this['input']; +} +/** `[ACTION]` Maps the given argument `T` as the mapping output */ +export interface As extends IMapping { + output: T; +} +/** Base type Parser implemented by all other parsers */ +export interface IParser { + type: string; + mapping: Mapping; +} +/** `[Context]` Creates a Context Parser */ +export interface Context extends IParser { + type: 'Context'; + left: Left; + right: Right; +} +/** `[EBNF]` Creates an Array Parser */ +export interface Array extends IParser { + type: 'Array'; + parser: Parser; +} +/** `[TERM]` Creates a Const Parser */ +export interface Const extends IParser { + type: 'Const'; + value: Value; +} +/** `[TERM]` Creates an Ident Parser. */ +export interface Ident extends IParser { + type: 'Ident'; +} +/** `[TERM]` Creates a Number Parser. */ +export interface Number extends IParser { + type: 'Number'; +} +/** `[EBNF]` Creates a Optional Parser */ +export interface Optional extends IParser { + type: 'Optional'; + parser: Parser; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export interface String extends IParser { + type: 'String'; + quote: Options; +} +/** `[BNF]` Creates a Tuple Parser */ +export interface Tuple extends IParser { + type: 'Tuple'; + parsers: [...Parsers]; +} +/** `[BNF]` Creates a Union Parser */ +export interface Union extends IParser { + type: 'Union'; + parsers: [...Parsers]; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/parser/static/types.js b/node_modules/@sinclair/typebox/build/cjs/parser/static/types.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/parser/static/types.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/syntax/index.d.ts new file mode 100644 index 00000000..61085521 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/index.d.ts @@ -0,0 +1 @@ +export * from './syntax'; diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/index.js b/node_modules/@sinclair/typebox/build/cjs/syntax/index.js new file mode 100644 index 00000000..7a05b205 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./syntax"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.d.ts b/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.d.ts new file mode 100644 index 00000000..a250640b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.d.ts @@ -0,0 +1,167 @@ +import * as T from '../type/index'; +type TDereference = (Key extends keyof Context ? Context[Key] : T.TRef); +type TDelimitedDecode = (Input extends [infer Left, ...infer Right] ? Left extends [infer Item, infer _] ? TDelimitedDecode : TDelimitedDecode : Result); +type TDelimited = Input extends [infer Left extends unknown[], infer Right extends unknown[]] ? TDelimitedDecode<[...Left, ...Right]> : []; +export type TGenericReferenceParameterListMapping = TDelimited; +export declare function GenericReferenceParameterListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TGenericReferenceMapping'] ? T.TInstantiate, Args> : never : never> = Result; +export declare function GenericReferenceMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TGenericArgumentsListMapping = TDelimited; +export declare function GenericArgumentsListMapping(input: [unknown, unknown], context: unknown): unknown[]; +type GenericArgumentsContext = (Arguments extends [...infer Left extends string[], infer Right extends string] ? GenericArgumentsContext; +}> : T.Evaluate); +export type TGenericArgumentsMapping = Input extends ['<', infer Arguments extends string[], '>'] ? Context extends infer Context extends T.TProperties ? GenericArgumentsContext : never : never; +declare const GenericArgumentsContext: (_arguments: string[], context: T.TProperties) => T.TProperties; +export declare function GenericArgumentsMapping(input: [unknown, unknown, unknown], context: unknown): T.TProperties; +export type TKeywordStringMapping = T.TString; +export declare function KeywordStringMapping(input: 'string', context: unknown): T.TString; +export type TKeywordNumberMapping = T.TNumber; +export declare function KeywordNumberMapping(input: 'number', context: unknown): T.TNumber; +export type TKeywordBooleanMapping = T.TBoolean; +export declare function KeywordBooleanMapping(input: 'boolean', context: unknown): T.TBoolean; +export type TKeywordUndefinedMapping = T.TUndefined; +export declare function KeywordUndefinedMapping(input: 'undefined', context: unknown): T.TUndefined; +export type TKeywordNullMapping = T.TNull; +export declare function KeywordNullMapping(input: 'null', context: unknown): T.TNull; +export type TKeywordIntegerMapping = T.TInteger; +export declare function KeywordIntegerMapping(input: 'integer', context: unknown): T.TInteger; +export type TKeywordBigIntMapping = T.TBigInt; +export declare function KeywordBigIntMapping(input: 'bigint', context: unknown): T.TBigInt; +export type TKeywordUnknownMapping = T.TUnknown; +export declare function KeywordUnknownMapping(input: 'unknown', context: unknown): T.TUnknown; +export type TKeywordAnyMapping = T.TAny; +export declare function KeywordAnyMapping(input: 'any', context: unknown): T.TAny; +export type TKeywordNeverMapping = T.TNever; +export declare function KeywordNeverMapping(input: 'never', context: unknown): T.TNever; +export type TKeywordSymbolMapping = T.TSymbol; +export declare function KeywordSymbolMapping(input: 'symbol', context: unknown): T.TSymbol; +export type TKeywordVoidMapping = T.TVoid; +export declare function KeywordVoidMapping(input: 'void', context: unknown): T.TVoid; +export type TKeywordMapping = Input; +export declare function KeywordMapping(input: unknown, context: unknown): unknown; +export type TLiteralStringMapping = Input extends T.TLiteralValue ? T.TLiteral : never; +export declare function LiteralStringMapping(input: string, context: unknown): T.TLiteral; +export type TLiteralNumberMapping = Input extends `${infer Value extends number}` ? T.TLiteral : never; +export declare function LiteralNumberMapping(input: string, context: unknown): T.TLiteral; +export type TLiteralBooleanMapping = Input extends 'true' ? T.TLiteral : T.TLiteral; +export declare function LiteralBooleanMapping(input: 'true' | 'false', context: unknown): T.TLiteral; +export type TLiteralMapping = Input; +export declare function LiteralMapping(input: unknown, context: unknown): unknown; +export type TKeyOfMapping = Input extends [unknown] ? true : false; +export declare function KeyOfMapping(input: [unknown] | [], context: unknown): boolean; +type TIndexArrayMappingReduce = (Input extends [infer Left extends unknown, ...infer Right extends unknown[]] ? Left extends ['[', infer Type extends T.TSchema, ']'] ? TIndexArrayMappingReduce : TIndexArrayMappingReduce : Result); +export type TIndexArrayMapping = Input extends unknown[] ? TIndexArrayMappingReduce : []; +export declare function IndexArrayMapping(input: ([unknown, unknown, unknown] | [unknown, unknown])[], context: unknown): unknown[]; +export type TExtendsMapping = Input extends ['extends', infer Type extends T.TSchema, '?', infer True extends T.TSchema, ':', infer False extends T.TSchema] ? [Type, True, False] : []; +export declare function ExtendsMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | [], context: unknown): unknown[]; +export type TBaseMapping = (Input extends ['(', infer Type extends T.TSchema, ')'] ? Type : Input extends infer Type extends T.TSchema ? Type : never); +export declare function BaseMapping(input: [unknown, unknown, unknown] | unknown, context: unknown): unknown; +type TFactorIndexArray = (IndexArray extends [...infer Left extends unknown[], infer Right extends T.TSchema[]] ? (Right extends [infer Indexer extends T.TSchema] ? T.TIndex, T.TIndexPropertyKeys> : Right extends [] ? T.TArray> : T.TNever) : Type); +type TFactorExtends = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ? T.TExtends : Type); +export type TFactorMapping = Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extends extends unknown[]] ? KeyOf extends true ? TFactorExtends>, Extends> : TFactorExtends, Extends> : never; +export declare function FactorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +type TExprBinaryMapping = (Rest extends [infer Operator extends unknown, infer Right extends T.TSchema, infer Next extends unknown[]] ? (TExprBinaryMapping extends infer Schema extends T.TSchema ? (Operator extends '&' ? (Schema extends T.TIntersect ? T.TIntersect<[Left, ...Types]> : T.TIntersect<[Left, Schema]>) : Operator extends '|' ? (Schema extends T.TUnion ? T.TUnion<[Left, ...Types]> : T.TUnion<[Left, Schema]>) : never) : never) : Left); +export type TExprTermTailMapping = Input; +export declare function ExprTermTailMapping(input: [unknown, unknown, unknown] | [], context: unknown): [] | [unknown, unknown, unknown]; +export type TExprTermMapping = (Input extends [infer Left extends T.TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping : []); +export declare function ExprTermMapping(input: [unknown, unknown], context: unknown): T.TSchema; +export type TExprTailMapping = Input; +export declare function ExprTailMapping(input: [unknown, unknown, unknown] | [], context: unknown): [] | [unknown, unknown, unknown]; +export type TExprMapping = Input extends [infer Left extends T.TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping : []; +export declare function ExprMapping(input: [unknown, unknown], context: unknown): T.TSchema; +export type TTypeMapping = Input; +export declare function TypeMapping(input: unknown, context: unknown): unknown; +export type TPropertyKeyMapping = Input; +export declare function PropertyKeyMapping(input: string, context: unknown): string; +export type TReadonlyMapping = Input extends [unknown] ? true : false; +export declare function ReadonlyMapping(input: [unknown] | [], context: unknown): boolean; +export type TOptionalMapping = Input extends [unknown] ? true : false; +export declare function OptionalMapping(input: [unknown] | [], context: unknown): boolean; +export type TPropertyMapping = Input extends [infer IsReadonly extends boolean, infer Key extends string, infer IsOptional extends boolean, string, infer Type extends T.TSchema] ? { + [_ in Key]: ([ + IsReadonly, + IsOptional + ] extends [true, true] ? T.TReadonlyOptional : [ + IsReadonly, + IsOptional + ] extends [true, false] ? T.TReadonly : [ + IsReadonly, + IsOptional + ] extends [false, true] ? T.TOptional : Type); +} : never; +export declare function PropertyMapping(input: [unknown, unknown, unknown, unknown, unknown], context: unknown): { + [x: string]: T.TSchema; +}; +export type TPropertyDelimiterMapping = Input; +export declare function PropertyDelimiterMapping(input: [unknown, unknown] | [unknown], context: unknown): [unknown] | [unknown, unknown]; +export type TPropertyListMapping = TDelimited; +export declare function PropertyListMapping(input: [unknown, unknown], context: unknown): unknown[]; +type TObjectMappingReduce = (PropertiesList extends [infer Left extends T.TProperties, ...infer Right extends T.TProperties[]] ? TObjectMappingReduce : { + [Key in keyof Result]: Result[Key]; +}); +export type TObjectMapping = Input extends ['{', infer PropertyList extends T.TProperties[], '}'] ? T.TObject> : never; +export declare function ObjectMapping(input: [unknown, unknown, unknown], context: unknown): T.TObject; +export type TElementListMapping = TDelimited; +export declare function ElementListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TTupleMapping = Input extends ['[', infer Types extends T.TSchema[], ']'] ? T.TTuple : never; +export declare function TupleMapping(input: [unknown, unknown, unknown], context: unknown): T.TTuple; +export type TParameterMapping = Input extends [string, ':', infer Type extends T.TSchema] ? Type : never; +export declare function ParameterMapping(input: [unknown, unknown, unknown], context: unknown): T.TSchema; +export type TParameterListMapping = TDelimited; +export declare function ParameterListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TFunctionMapping = Input extends ['(', infer ParameterList extends T.TSchema[], ')', '=>', infer ReturnType extends T.TSchema] ? T.TFunction : never; +export declare function FunctionMapping(input: [unknown, unknown, unknown, unknown, unknown], context: unknown): T.TFunction; +export type TConstructorMapping = Input extends ['new', '(', infer ParameterList extends T.TSchema[], ')', '=>', infer InstanceType extends T.TSchema] ? T.TConstructor : never; +export declare function ConstructorMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TConstructor; +export type TMappedMapping = Input extends ['{', '[', infer _Key extends string, 'in', infer _Right extends T.TSchema, ']', ':', infer _Type extends T.TSchema, '}'] ? T.TLiteral<'Mapped types not supported'> : never; +export declare function MappedMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TLiteral<"Mapped types not supported">; +export type TAsyncIteratorMapping = Input extends ['AsyncIterator', '<', infer Type extends T.TSchema, '>'] ? T.TAsyncIterator : never; +export declare function AsyncIteratorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TAsyncIterator; +export type TIteratorMapping = Input extends ['Iterator', '<', infer Type extends T.TSchema, '>'] ? T.TIterator : never; +export declare function IteratorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TIterator; +export type TArgumentMapping = Input extends ['Argument', '<', infer Type extends T.TSchema, '>'] ? Type extends T.TLiteral ? T.TArgument : T.TNever : never; +export declare function ArgumentMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever | T.TArgument; +export type TAwaitedMapping = Input extends ['Awaited', '<', infer Type extends T.TSchema, '>'] ? T.TAwaited : never; +export declare function AwaitedMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TArrayMapping = Input extends ['Array', '<', infer Type extends T.TSchema, '>'] ? T.TArray : never; +export declare function ArrayMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TArray; +export type TRecordMapping = Input extends ['Record', '<', infer Key extends T.TSchema, ',', infer Type extends T.TSchema, '>'] ? T.TRecordOrObject : never; +export declare function RecordMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TPromiseMapping = Input extends ['Promise', '<', infer Type extends T.TSchema, '>'] ? T.TPromise : never; +export declare function PromiseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TPromise; +export type TConstructorParametersMapping = Input extends ['ConstructorParameters', '<', infer Type extends T.TSchema, '>'] ? T.TConstructorParameters : never; +export declare function ConstructorParametersMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TFunctionParametersMapping = Input extends ['Parameters', '<', infer Type extends T.TSchema, '>'] ? T.TParameters : never; +export declare function FunctionParametersMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TInstanceTypeMapping = Input extends ['InstanceType', '<', infer Type extends T.TSchema, '>'] ? T.TInstanceType : never; +export declare function InstanceTypeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TReturnTypeMapping = Input extends ['ReturnType', '<', infer Type extends T.TSchema, '>'] ? T.TReturnType : never; +export declare function ReturnTypeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TPartialMapping = Input extends ['Partial', '<', infer Type extends T.TSchema, '>'] ? T.TPartial : never; +export declare function PartialMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TRequiredMapping = Input extends ['Required', '<', infer Type extends T.TSchema, '>'] ? T.TRequired : never; +export declare function RequiredMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TPickMapping = Input extends ['Pick', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TPick : never; +export declare function PickMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TOmitMapping = Input extends ['Omit', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TOmit : never; +export declare function OmitMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TExcludeMapping = Input extends ['Exclude', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TExclude : never; +export declare function ExcludeMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TExtractMapping = Input extends ['Extract', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TExtract : never; +export declare function ExtractMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TUppercaseMapping = Input extends ['Uppercase', '<', infer Type extends T.TSchema, '>'] ? T.TUppercase : never; +export declare function UppercaseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TLowercaseMapping = Input extends ['Lowercase', '<', infer Type extends T.TSchema, '>'] ? T.TLowercase : never; +export declare function LowercaseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TCapitalizeMapping = Input extends ['Capitalize', '<', infer Type extends T.TSchema, '>'] ? T.TCapitalize : never; +export declare function CapitalizeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TUncapitalizeMapping = Input extends ['Uncapitalize', '<', infer Type extends T.TSchema, '>'] ? T.TUncapitalize : never; +export declare function UncapitalizeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TDateMapping = T.TDate; +export declare function DateMapping(input: 'Date', context: unknown): T.TDate; +export type TUint8ArrayMapping = T.TUint8Array; +export declare function Uint8ArrayMapping(input: 'Uint8Array', context: unknown): T.TUint8Array; +export type TReferenceMapping = Context extends T.TProperties ? Input extends string ? TDereference : never : never; +export declare function ReferenceMapping(input: string, context: unknown): T.TSchema; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.js b/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.js new file mode 100644 index 00000000..4bf0dfa4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/mapping.js @@ -0,0 +1,491 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GenericReferenceParameterListMapping = GenericReferenceParameterListMapping; +exports.GenericReferenceMapping = GenericReferenceMapping; +exports.GenericArgumentsListMapping = GenericArgumentsListMapping; +exports.GenericArgumentsMapping = GenericArgumentsMapping; +exports.KeywordStringMapping = KeywordStringMapping; +exports.KeywordNumberMapping = KeywordNumberMapping; +exports.KeywordBooleanMapping = KeywordBooleanMapping; +exports.KeywordUndefinedMapping = KeywordUndefinedMapping; +exports.KeywordNullMapping = KeywordNullMapping; +exports.KeywordIntegerMapping = KeywordIntegerMapping; +exports.KeywordBigIntMapping = KeywordBigIntMapping; +exports.KeywordUnknownMapping = KeywordUnknownMapping; +exports.KeywordAnyMapping = KeywordAnyMapping; +exports.KeywordNeverMapping = KeywordNeverMapping; +exports.KeywordSymbolMapping = KeywordSymbolMapping; +exports.KeywordVoidMapping = KeywordVoidMapping; +exports.KeywordMapping = KeywordMapping; +exports.LiteralStringMapping = LiteralStringMapping; +exports.LiteralNumberMapping = LiteralNumberMapping; +exports.LiteralBooleanMapping = LiteralBooleanMapping; +exports.LiteralMapping = LiteralMapping; +exports.KeyOfMapping = KeyOfMapping; +exports.IndexArrayMapping = IndexArrayMapping; +exports.ExtendsMapping = ExtendsMapping; +exports.BaseMapping = BaseMapping; +exports.FactorMapping = FactorMapping; +exports.ExprTermTailMapping = ExprTermTailMapping; +exports.ExprTermMapping = ExprTermMapping; +exports.ExprTailMapping = ExprTailMapping; +exports.ExprMapping = ExprMapping; +exports.TypeMapping = TypeMapping; +exports.PropertyKeyMapping = PropertyKeyMapping; +exports.ReadonlyMapping = ReadonlyMapping; +exports.OptionalMapping = OptionalMapping; +exports.PropertyMapping = PropertyMapping; +exports.PropertyDelimiterMapping = PropertyDelimiterMapping; +exports.PropertyListMapping = PropertyListMapping; +exports.ObjectMapping = ObjectMapping; +exports.ElementListMapping = ElementListMapping; +exports.TupleMapping = TupleMapping; +exports.ParameterMapping = ParameterMapping; +exports.ParameterListMapping = ParameterListMapping; +exports.FunctionMapping = FunctionMapping; +exports.ConstructorMapping = ConstructorMapping; +exports.MappedMapping = MappedMapping; +exports.AsyncIteratorMapping = AsyncIteratorMapping; +exports.IteratorMapping = IteratorMapping; +exports.ArgumentMapping = ArgumentMapping; +exports.AwaitedMapping = AwaitedMapping; +exports.ArrayMapping = ArrayMapping; +exports.RecordMapping = RecordMapping; +exports.PromiseMapping = PromiseMapping; +exports.ConstructorParametersMapping = ConstructorParametersMapping; +exports.FunctionParametersMapping = FunctionParametersMapping; +exports.InstanceTypeMapping = InstanceTypeMapping; +exports.ReturnTypeMapping = ReturnTypeMapping; +exports.PartialMapping = PartialMapping; +exports.RequiredMapping = RequiredMapping; +exports.PickMapping = PickMapping; +exports.OmitMapping = OmitMapping; +exports.ExcludeMapping = ExcludeMapping; +exports.ExtractMapping = ExtractMapping; +exports.UppercaseMapping = UppercaseMapping; +exports.LowercaseMapping = LowercaseMapping; +exports.CapitalizeMapping = CapitalizeMapping; +exports.UncapitalizeMapping = UncapitalizeMapping; +exports.DateMapping = DateMapping; +exports.Uint8ArrayMapping = Uint8ArrayMapping; +exports.ReferenceMapping = ReferenceMapping; +const T = __importStar(require("../type/index")); +// prettier-ignore +const Dereference = (context, key) => { + return key in context ? context[key] : T.Ref(key); +}; +// prettier-ignore +const DelimitedDecode = (input, result = []) => { + return input.reduce((result, left) => { + return T.ValueGuard.IsArray(left) && left.length === 2 + ? [...result, left[0]] + : [...result, left]; + }, []); +}; +// prettier-ignore +const Delimited = (input) => { + const [left, right] = input; + return DelimitedDecode([...left, ...right]); +}; +// prettier-ignore +function GenericReferenceParameterListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +function GenericReferenceMapping(input, context) { + const type = Dereference(context, input[0]); + const args = input[2]; + return T.Instantiate(type, args); +} +// prettier-ignore +function GenericArgumentsListMapping(input, context) { + return Delimited(input); +} +// ... +// prettier-ignore +const GenericArgumentsContext = (_arguments, context) => { + return _arguments.reduce((result, arg, index) => { + return { ...result, [arg]: T.Argument(index) }; + }, context); +}; +// prettier-ignore +function GenericArgumentsMapping(input, context) { + return input.length === 3 + ? GenericArgumentsContext(input[1], context) + : {}; +} +// prettier-ignore +function KeywordStringMapping(input, context) { + return T.String(); +} +// prettier-ignore +function KeywordNumberMapping(input, context) { + return T.Number(); +} +// prettier-ignore +function KeywordBooleanMapping(input, context) { + return T.Boolean(); +} +// prettier-ignore +function KeywordUndefinedMapping(input, context) { + return T.Undefined(); +} +// prettier-ignore +function KeywordNullMapping(input, context) { + return T.Null(); +} +// prettier-ignore +function KeywordIntegerMapping(input, context) { + return T.Integer(); +} +// prettier-ignore +function KeywordBigIntMapping(input, context) { + return T.BigInt(); +} +// prettier-ignore +function KeywordUnknownMapping(input, context) { + return T.Unknown(); +} +// prettier-ignore +function KeywordAnyMapping(input, context) { + return T.Any(); +} +// prettier-ignore +function KeywordNeverMapping(input, context) { + return T.Never(); +} +// prettier-ignore +function KeywordSymbolMapping(input, context) { + return T.Symbol(); +} +// prettier-ignore +function KeywordVoidMapping(input, context) { + return T.Void(); +} +// prettier-ignore +function KeywordMapping(input, context) { + return input; +} +// prettier-ignore +function LiteralStringMapping(input, context) { + return T.Literal(input); +} +// prettier-ignore +function LiteralNumberMapping(input, context) { + return T.Literal(parseFloat(input)); +} +// prettier-ignore +function LiteralBooleanMapping(input, context) { + return T.Literal(input === 'true'); +} +// prettier-ignore +function LiteralMapping(input, context) { + return input; +} +// prettier-ignore +function KeyOfMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +function IndexArrayMapping(input, context) { + return input.reduce((result, current) => { + return current.length === 3 + ? [...result, [current[1]]] + : [...result, []]; + }, []); +} +// prettier-ignore +function ExtendsMapping(input, context) { + return input.length === 6 + ? [input[1], input[3], input[5]] + : []; +} +// prettier-ignore +function BaseMapping(input, context) { + return T.ValueGuard.IsArray(input) && input.length === 3 ? input[1] : input; +} +// ... +// prettier-ignore +const FactorIndexArray = (Type, indexArray) => { + return indexArray.reduceRight((result, right) => { + const _right = right; + return (_right.length === 1 ? T.Index(result, _right[0]) : + _right.length === 0 ? T.Array(result, _right[0]) : + T.Never()); + }, Type); +}; +// prettier-ignore +const FactorExtends = (Type, Extends) => { + return Extends.length === 3 + ? T.Extends(Type, Extends[0], Extends[1], Extends[2]) + : Type; +}; +// prettier-ignore +function FactorMapping(input, context) { + const [KeyOf, Type, IndexArray, Extends] = input; + return KeyOf + ? FactorExtends(T.KeyOf(FactorIndexArray(Type, IndexArray)), Extends) + : FactorExtends(FactorIndexArray(Type, IndexArray), Extends); +} +// prettier-ignore +function ExprBinaryMapping(Left, Rest) { + return (Rest.length === 3 ? (() => { + const [Operator, Right, Next] = Rest; + const Schema = ExprBinaryMapping(Right, Next); + if (Operator === '&') { + return T.TypeGuard.IsIntersect(Schema) + ? T.Intersect([Left, ...Schema.allOf]) + : T.Intersect([Left, Schema]); + } + if (Operator === '|') { + return T.TypeGuard.IsUnion(Schema) + ? T.Union([Left, ...Schema.anyOf]) + : T.Union([Left, Schema]); + } + throw 1; + })() : Left); +} +// prettier-ignore +function ExprTermTailMapping(input, context) { + return input; +} +// prettier-ignore +function ExprTermMapping(input, context) { + const [left, rest] = input; + return ExprBinaryMapping(left, rest); +} +// prettier-ignore +function ExprTailMapping(input, context) { + return input; +} +// prettier-ignore +function ExprMapping(input, context) { + const [left, rest] = input; + return ExprBinaryMapping(left, rest); +} +// prettier-ignore +function TypeMapping(input, context) { + return input; +} +// prettier-ignore +function PropertyKeyMapping(input, context) { + return input; +} +// prettier-ignore +function ReadonlyMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +function OptionalMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +function PropertyMapping(input, context) { + const [isReadonly, key, isOptional, _colon, type] = input; + return { + [key]: (isReadonly && isOptional ? T.ReadonlyOptional(type) : + isReadonly && !isOptional ? T.Readonly(type) : + !isReadonly && isOptional ? T.Optional(type) : + type) + }; +} +// prettier-ignore +function PropertyDelimiterMapping(input, context) { + return input; +} +// prettier-ignore +function PropertyListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +function ObjectMapping(input, context) { + const propertyList = input[1]; + return T.Object(propertyList.reduce((result, property) => { + return { ...result, ...property }; + }, {})); +} +// prettier-ignore +function ElementListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +function TupleMapping(input, context) { + return T.Tuple(input[1]); +} +// prettier-ignore +function ParameterMapping(input, context) { + const [_ident, _colon, type] = input; + return type; +} +// prettier-ignore +function ParameterListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +function FunctionMapping(input, context) { + const [_lparan, parameterList, _rparan, _arrow, returnType] = input; + return T.Function(parameterList, returnType); +} +// prettier-ignore +function ConstructorMapping(input, context) { + const [_new, _lparan, parameterList, _rparan, _arrow, instanceType] = input; + return T.Constructor(parameterList, instanceType); +} +// prettier-ignore +function MappedMapping(input, context) { + const [_lbrace, _lbracket, _key, _in, _right, _rbracket, _colon, _type] = input; + return T.Literal('Mapped types not supported'); +} +// prettier-ignore +function AsyncIteratorMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.AsyncIterator(type); +} +// prettier-ignore +function IteratorMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Iterator(type); +} +// prettier-ignore +function ArgumentMapping(input, context) { + return T.KindGuard.IsLiteralNumber(input[2]) + ? T.Argument(Math.trunc(input[2].const)) + : T.Never(); +} +// prettier-ignore +function AwaitedMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Awaited(type); +} +// prettier-ignore +function ArrayMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Array(type); +} +// prettier-ignore +function RecordMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Record(key, type); +} +// prettier-ignore +function PromiseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Promise(type); +} +// prettier-ignore +function ConstructorParametersMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.ConstructorParameters(type); +} +// prettier-ignore +function FunctionParametersMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Parameters(type); +} +// prettier-ignore +function InstanceTypeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.InstanceType(type); +} +// prettier-ignore +function ReturnTypeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.ReturnType(type); +} +// prettier-ignore +function PartialMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Partial(type); +} +// prettier-ignore +function RequiredMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Required(type); +} +// prettier-ignore +function PickMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Pick(key, type); +} +// prettier-ignore +function OmitMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Omit(key, type); +} +// prettier-ignore +function ExcludeMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Exclude(key, type); +} +// prettier-ignore +function ExtractMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Extract(key, type); +} +// prettier-ignore +function UppercaseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Uppercase(type); +} +// prettier-ignore +function LowercaseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Lowercase(type); +} +// prettier-ignore +function CapitalizeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Capitalize(type); +} +// prettier-ignore +function UncapitalizeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Uncapitalize(type); +} +// prettier-ignore +function DateMapping(input, context) { + return T.Date(); +} +// prettier-ignore +function Uint8ArrayMapping(input, context) { + return T.Uint8Array(); +} +// prettier-ignore +function ReferenceMapping(input, context) { + const target = Dereference(context, input); + return target; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/parser.d.ts b/node_modules/@sinclair/typebox/build/cjs/syntax/parser.d.ts new file mode 100644 index 00000000..a9315133 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/parser.d.ts @@ -0,0 +1,162 @@ +import { Static } from '../parser/index'; +import * as T from '../type/index'; +import * as S from './mapping'; +export type TGenericReferenceParameterList_0 = (TType extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericReferenceParameterList_0 : [Result, Input]; +export type TGenericReferenceParameterList = (TGenericReferenceParameterList_0 extends [infer _0, infer Input extends string] ? ((TType extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericReferenceParameterListMapping<_0, Context>, Input] : []; +export type TGenericReference = (Static.Token.Ident extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TGenericReferenceParameterList extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TGenericReferenceMapping<_0, Context>, Input] : []; +export type TGenericArgumentsList_0 = (Static.Token.Ident extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericArgumentsList_0 : [Result, Input]; +export type TGenericArgumentsList = (TGenericArgumentsList_0 extends [infer _0, infer Input extends string] ? ((Static.Token.Ident extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsListMapping<_0, Context>, Input] : []; +export type TGenericArguments = (Static.Token.Const<'<', Input> extends [infer _0, infer Input extends string] ? TGenericArgumentsList extends [infer _1, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsMapping<_0, Context>, Input] : []; +export type TKeywordString = Static.Token.Const<'string', Input> extends [infer _0 extends 'string', infer Input extends string] ? [S.TKeywordStringMapping<_0, Context>, Input] : []; +export type TKeywordNumber = Static.Token.Const<'number', Input> extends [infer _0 extends 'number', infer Input extends string] ? [S.TKeywordNumberMapping<_0, Context>, Input] : []; +export type TKeywordBoolean = Static.Token.Const<'boolean', Input> extends [infer _0 extends 'boolean', infer Input extends string] ? [S.TKeywordBooleanMapping<_0, Context>, Input] : []; +export type TKeywordUndefined = Static.Token.Const<'undefined', Input> extends [infer _0 extends 'undefined', infer Input extends string] ? [S.TKeywordUndefinedMapping<_0, Context>, Input] : []; +export type TKeywordNull = Static.Token.Const<'null', Input> extends [infer _0 extends 'null', infer Input extends string] ? [S.TKeywordNullMapping<_0, Context>, Input] : []; +export type TKeywordInteger = Static.Token.Const<'integer', Input> extends [infer _0 extends 'integer', infer Input extends string] ? [S.TKeywordIntegerMapping<_0, Context>, Input] : []; +export type TKeywordBigInt = Static.Token.Const<'bigint', Input> extends [infer _0 extends 'bigint', infer Input extends string] ? [S.TKeywordBigIntMapping<_0, Context>, Input] : []; +export type TKeywordUnknown = Static.Token.Const<'unknown', Input> extends [infer _0 extends 'unknown', infer Input extends string] ? [S.TKeywordUnknownMapping<_0, Context>, Input] : []; +export type TKeywordAny = Static.Token.Const<'any', Input> extends [infer _0 extends 'any', infer Input extends string] ? [S.TKeywordAnyMapping<_0, Context>, Input] : []; +export type TKeywordNever = Static.Token.Const<'never', Input> extends [infer _0 extends 'never', infer Input extends string] ? [S.TKeywordNeverMapping<_0, Context>, Input] : []; +export type TKeywordSymbol = Static.Token.Const<'symbol', Input> extends [infer _0 extends 'symbol', infer Input extends string] ? [S.TKeywordSymbolMapping<_0, Context>, Input] : []; +export type TKeywordVoid = Static.Token.Const<'void', Input> extends [infer _0 extends 'void', infer Input extends string] ? [S.TKeywordVoidMapping<_0, Context>, Input] : []; +export type TKeyword = (TKeywordString extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNumber extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBoolean extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUndefined extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNull extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordInteger extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBigInt extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUnknown extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordAny extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNever extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordSymbol extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordVoid extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TKeywordMapping<_0, Context>, Input] : []; +export type TLiteralString = Static.Token.String<["'", '"', '`'], Input> extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralStringMapping<_0, Context>, Input] : []; +export type TLiteralNumber = Static.Token.Number extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralNumberMapping<_0, Context>, Input] : []; +export type TLiteralBoolean = (Static.Token.Const<'true', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.Const<'false', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends 'true' | 'false', infer Input extends string] ? [S.TLiteralBooleanMapping<_0, Context>, Input] : []; +export type TLiteral = (TLiteralBoolean extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralNumber extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralString extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TLiteralMapping<_0, Context>, Input] : []; +export type TKeyOf = ((Static.Token.Const<'keyof', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TKeyOfMapping<_0, Context>, Input] : []; +export type TIndexArray_0 = ((Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<']', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : []) extends [infer _0, infer Input extends string] ? TIndexArray_0 : [Result, Input]; +export type TIndexArray = TIndexArray_0 extends [infer _0 extends ([unknown, unknown, unknown] | [unknown, unknown])[], infer Input extends string] ? [S.TIndexArrayMapping<_0, Context>, Input] : []; +export type TExtends = ((Static.Token.Const<'extends', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<'?', Input> extends [infer _2, infer Input extends string] ? TType extends [infer _3, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _4, infer Input extends string] ? TType extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExtendsMapping<_0, Context>, Input] : []; +export type TBase = ((Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : TKeyword extends [infer _0, infer Input extends string] ? [_0, Input] : TObject extends [infer _0, infer Input extends string] ? [_0, Input] : TTuple extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteral extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructor extends [infer _0, infer Input extends string] ? [_0, Input] : TFunction extends [infer _0, infer Input extends string] ? [_0, Input] : TMapped extends [infer _0, infer Input extends string] ? [_0, Input] : TAsyncIterator extends [infer _0, infer Input extends string] ? [_0, Input] : TIterator extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructorParameters extends [infer _0, infer Input extends string] ? [_0, Input] : TFunctionParameters extends [infer _0, infer Input extends string] ? [_0, Input] : TInstanceType extends [infer _0, infer Input extends string] ? [_0, Input] : TReturnType extends [infer _0, infer Input extends string] ? [_0, Input] : TArgument extends [infer _0, infer Input extends string] ? [_0, Input] : TAwaited extends [infer _0, infer Input extends string] ? [_0, Input] : TArray extends [infer _0, infer Input extends string] ? [_0, Input] : TRecord extends [infer _0, infer Input extends string] ? [_0, Input] : TPromise extends [infer _0, infer Input extends string] ? [_0, Input] : TPartial extends [infer _0, infer Input extends string] ? [_0, Input] : TRequired extends [infer _0, infer Input extends string] ? [_0, Input] : TPick extends [infer _0, infer Input extends string] ? [_0, Input] : TOmit extends [infer _0, infer Input extends string] ? [_0, Input] : TExclude extends [infer _0, infer Input extends string] ? [_0, Input] : TExtract extends [infer _0, infer Input extends string] ? [_0, Input] : TUppercase extends [infer _0, infer Input extends string] ? [_0, Input] : TLowercase extends [infer _0, infer Input extends string] ? [_0, Input] : TCapitalize extends [infer _0, infer Input extends string] ? [_0, Input] : TUncapitalize extends [infer _0, infer Input extends string] ? [_0, Input] : TDate extends [infer _0, infer Input extends string] ? [_0, Input] : TUint8Array extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericReference extends [infer _0, infer Input extends string] ? [_0, Input] : TReference extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | unknown, infer Input extends string] ? [S.TBaseMapping<_0, Context>, Input] : []; +export type TFactor = (TKeyOf extends [infer _0, infer Input extends string] ? TBase extends [infer _1, infer Input extends string] ? TIndexArray extends [infer _2, infer Input extends string] ? TExtends extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0, Context>, Input] : []; +export type TExprTermTail = ((Static.Token.Const<'&', Input> extends [infer _0, infer Input extends string] ? TFactor extends [infer _1, infer Input extends string] ? TExprTermTail extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTermTailMapping<_0, Context>, Input] : []; +export type TExprTerm = (TFactor extends [infer _0, infer Input extends string] ? (TExprTermTail extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprTermMapping<_0, Context>, Input] : []; +export type TExprTail = ((Static.Token.Const<'|', Input> extends [infer _0, infer Input extends string] ? TExprTerm extends [infer _1, infer Input extends string] ? TExprTail extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTailMapping<_0, Context>, Input] : []; +export type TExpr = (TExprTerm extends [infer _0, infer Input extends string] ? (TExprTail extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprMapping<_0, Context>, Input] : []; +export type TType = (TGenericArguments extends [infer _0 extends T.TProperties, infer Input extends string] ? TExpr : [] extends [infer _0, infer Input extends string] ? [_0, Input] : TExpr extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TTypeMapping<_0, Context>, Input] : []; +export type TPropertyKey = (Static.Token.Ident extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.String<["'", '"'], Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends string, infer Input extends string] ? [S.TPropertyKeyMapping<_0, Context>, Input] : []; +export type TReadonly = ((Static.Token.Const<'readonly', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TReadonlyMapping<_0, Context>, Input] : []; +export type TOptional = ((Static.Token.Const<'?', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TOptionalMapping<_0, Context>, Input] : []; +export type TProperty = (TReadonly extends [infer _0, infer Input extends string] ? TPropertyKey extends [infer _1, infer Input extends string] ? TOptional extends [infer _2, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPropertyMapping<_0, Context>, Input] : []; +export type TPropertyDelimiter = ((Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : (Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'\n', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [unknown], infer Input extends string] ? [S.TPropertyDelimiterMapping<_0, Context>, Input] : []; +export type TPropertyList_0 = (TProperty extends [infer _0, infer Input extends string] ? (TPropertyDelimiter extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TPropertyList_0 : [Result, Input]; +export type TPropertyList = (TPropertyList_0 extends [infer _0, infer Input extends string] ? ((TProperty extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TPropertyListMapping<_0, Context>, Input] : []; +export type TObject = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? TPropertyList extends [infer _1, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TObjectMapping<_0, Context>, Input] : []; +export type TElementList_0 = (TType extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TElementList_0 : [Result, Input]; +export type TElementList = (TElementList_0 extends [infer _0, infer Input extends string] ? ((TType extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TElementListMapping<_0, Context>, Input] : []; +export type TTuple = (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TElementList extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TTupleMapping<_0, Context>, Input] : []; +export type TParameter = (Static.Token.Ident extends [infer _0, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TParameterMapping<_0, Context>, Input] : []; +export type TParameterList_0 = (TParameter extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TParameterList_0 : [Result, Input]; +export type TParameterList = (TParameterList_0 extends [infer _0, infer Input extends string] ? ((TParameter extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TParameterListMapping<_0, Context>, Input] : []; +export type TFunction = (Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TParameterList extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionMapping<_0, Context>, Input] : []; +export type TConstructor = (Static.Token.Const<'new', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'(', Input> extends [infer _1, infer Input extends string] ? TParameterList extends [infer _2, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _3, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _4, infer Input extends string] ? TType extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorMapping<_0, Context>, Input] : []; +export type TMapped = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'[', Input> extends [infer _1, infer Input extends string] ? Static.Token.Ident extends [infer _2, infer Input extends string] ? Static.Token.Const<'in', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _5, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _6, infer Input extends string] ? TType extends [infer _7, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _8, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8], Input] : [] : [] : [] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TMappedMapping<_0, Context>, Input] : []; +export type TAsyncIterator = (Static.Token.Const<'AsyncIterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAsyncIteratorMapping<_0, Context>, Input] : []; +export type TIterator = (Static.Token.Const<'Iterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TIteratorMapping<_0, Context>, Input] : []; +export type TArgument = (Static.Token.Const<'Argument', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArgumentMapping<_0, Context>, Input] : []; +export type TAwaited = (Static.Token.Const<'Awaited', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAwaitedMapping<_0, Context>, Input] : []; +export type TArray = (Static.Token.Const<'Array', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArrayMapping<_0, Context>, Input] : []; +export type TRecord = (Static.Token.Const<'Record', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRecordMapping<_0, Context>, Input] : []; +export type TPromise = (Static.Token.Const<'Promise', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPromiseMapping<_0, Context>, Input] : []; +export type TConstructorParameters = (Static.Token.Const<'ConstructorParameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorParametersMapping<_0, Context>, Input] : []; +export type TFunctionParameters = (Static.Token.Const<'Parameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionParametersMapping<_0, Context>, Input] : []; +export type TInstanceType = (Static.Token.Const<'InstanceType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TInstanceTypeMapping<_0, Context>, Input] : []; +export type TReturnType = (Static.Token.Const<'ReturnType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TReturnTypeMapping<_0, Context>, Input] : []; +export type TPartial = (Static.Token.Const<'Partial', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPartialMapping<_0, Context>, Input] : []; +export type TRequired = (Static.Token.Const<'Required', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRequiredMapping<_0, Context>, Input] : []; +export type TPick = (Static.Token.Const<'Pick', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPickMapping<_0, Context>, Input] : []; +export type TOmit = (Static.Token.Const<'Omit', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TOmitMapping<_0, Context>, Input] : []; +export type TExclude = (Static.Token.Const<'Exclude', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExcludeMapping<_0, Context>, Input] : []; +export type TExtract = (Static.Token.Const<'Extract', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExtractMapping<_0, Context>, Input] : []; +export type TUppercase = (Static.Token.Const<'Uppercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUppercaseMapping<_0, Context>, Input] : []; +export type TLowercase = (Static.Token.Const<'Lowercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TLowercaseMapping<_0, Context>, Input] : []; +export type TCapitalize = (Static.Token.Const<'Capitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TCapitalizeMapping<_0, Context>, Input] : []; +export type TUncapitalize = (Static.Token.Const<'Uncapitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUncapitalizeMapping<_0, Context>, Input] : []; +export type TDate = Static.Token.Const<'Date', Input> extends [infer _0 extends 'Date', infer Input extends string] ? [S.TDateMapping<_0, Context>, Input] : []; +export type TUint8Array = Static.Token.Const<'Uint8Array', Input> extends [infer _0 extends 'Uint8Array', infer Input extends string] ? [S.TUint8ArrayMapping<_0, Context>, Input] : []; +export type TReference = Static.Token.Ident extends [infer _0 extends string, infer Input extends string] ? [S.TReferenceMapping<_0, Context>, Input] : []; +export declare const GenericReferenceParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const GenericReferenceParameterList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericReference: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericArgumentsList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const GenericArgumentsList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericArguments: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordString: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNumber: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordBoolean: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordUndefined: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNull: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordInteger: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordBigInt: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordUnknown: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordAny: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNever: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordSymbol: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordVoid: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Keyword: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralString: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralNumber: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralBoolean: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Literal: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeyOf: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const IndexArray_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const IndexArray: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Extends: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Base: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Factor: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTermTail: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTerm: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTail: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Expr: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Type: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyKey: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Readonly: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Optional: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Property: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyDelimiter: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const PropertyList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const _Object: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ElementList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const ElementList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Tuple: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Parameter: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const ParameterList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Function: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Constructor: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Mapped: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const AsyncIterator: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Iterator: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Argument: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Awaited: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Array: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Record: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Promise: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ConstructorParameters: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const FunctionParameters: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const InstanceType: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ReturnType: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Partial: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Required: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Pick: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Omit: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Exclude: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Extract: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uppercase: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Lowercase: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Capitalize: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uncapitalize: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Date: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uint8Array: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Reference: (input: string, context?: T.TProperties) => [unknown, string] | []; diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/parser.js b/node_modules/@sinclair/typebox/build/cjs/syntax/parser.js new file mode 100644 index 00000000..fafe2207 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/parser.js @@ -0,0 +1,191 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Constructor = exports.Function = exports.ParameterList = exports.ParameterList_0 = exports.Parameter = exports.Tuple = exports.ElementList = exports.ElementList_0 = exports._Object = exports.PropertyList = exports.PropertyList_0 = exports.PropertyDelimiter = exports.Property = exports.Optional = exports.Readonly = exports.PropertyKey = exports.Type = exports.Expr = exports.ExprTail = exports.ExprTerm = exports.ExprTermTail = exports.Factor = exports.Base = exports.Extends = exports.IndexArray = exports.IndexArray_0 = exports.KeyOf = exports.Literal = exports.LiteralBoolean = exports.LiteralNumber = exports.LiteralString = exports.Keyword = exports.KeywordVoid = exports.KeywordSymbol = exports.KeywordNever = exports.KeywordAny = exports.KeywordUnknown = exports.KeywordBigInt = exports.KeywordInteger = exports.KeywordNull = exports.KeywordUndefined = exports.KeywordBoolean = exports.KeywordNumber = exports.KeywordString = exports.GenericArguments = exports.GenericArgumentsList = exports.GenericArgumentsList_0 = exports.GenericReference = exports.GenericReferenceParameterList = exports.GenericReferenceParameterList_0 = void 0; +exports.Reference = exports.Uint8Array = exports.Date = exports.Uncapitalize = exports.Capitalize = exports.Lowercase = exports.Uppercase = exports.Extract = exports.Exclude = exports.Omit = exports.Pick = exports.Required = exports.Partial = exports.ReturnType = exports.InstanceType = exports.FunctionParameters = exports.ConstructorParameters = exports.Promise = exports.Record = exports.Array = exports.Awaited = exports.Argument = exports.Iterator = exports.AsyncIterator = exports.Mapped = void 0; +const index_1 = require("../parser/index"); +const S = __importStar(require("./mapping")); +const If = (result, left, right = () => []) => (result.length === 2 ? left(result) : right()); +const GenericReferenceParameterList_0 = (input, context, result = []) => If(If((0, exports.Type)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.GenericReferenceParameterList_0)(input, context, [...result, _0]), () => [result, input]); +exports.GenericReferenceParameterList_0 = GenericReferenceParameterList_0; +const GenericReferenceParameterList = (input, context = {}) => If(If((0, exports.GenericReferenceParameterList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Type)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericReferenceParameterListMapping(_0, context), input]); +exports.GenericReferenceParameterList = GenericReferenceParameterList; +const GenericReference = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.GenericReferenceParameterList)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.GenericReferenceMapping(_0, context), input]); +exports.GenericReference = GenericReference; +const GenericArgumentsList_0 = (input, context, result = []) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.GenericArgumentsList_0)(input, context, [...result, _0]), () => [result, input]); +exports.GenericArgumentsList_0 = GenericArgumentsList_0; +const GenericArgumentsList = (input, context = {}) => If(If((0, exports.GenericArgumentsList_0)(input, context), ([_0, input]) => If(If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericArgumentsListMapping(_0, context), input]); +exports.GenericArgumentsList = GenericArgumentsList; +const GenericArguments = (input, context = {}) => If(If(index_1.Runtime.Token.Const('<', input), ([_0, input]) => If((0, exports.GenericArgumentsList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericArgumentsMapping(_0, context), input]); +exports.GenericArguments = GenericArguments; +const KeywordString = (input, context = {}) => If(index_1.Runtime.Token.Const('string', input), ([_0, input]) => [S.KeywordStringMapping(_0, context), input]); +exports.KeywordString = KeywordString; +const KeywordNumber = (input, context = {}) => If(index_1.Runtime.Token.Const('number', input), ([_0, input]) => [S.KeywordNumberMapping(_0, context), input]); +exports.KeywordNumber = KeywordNumber; +const KeywordBoolean = (input, context = {}) => If(index_1.Runtime.Token.Const('boolean', input), ([_0, input]) => [S.KeywordBooleanMapping(_0, context), input]); +exports.KeywordBoolean = KeywordBoolean; +const KeywordUndefined = (input, context = {}) => If(index_1.Runtime.Token.Const('undefined', input), ([_0, input]) => [S.KeywordUndefinedMapping(_0, context), input]); +exports.KeywordUndefined = KeywordUndefined; +const KeywordNull = (input, context = {}) => If(index_1.Runtime.Token.Const('null', input), ([_0, input]) => [S.KeywordNullMapping(_0, context), input]); +exports.KeywordNull = KeywordNull; +const KeywordInteger = (input, context = {}) => If(index_1.Runtime.Token.Const('integer', input), ([_0, input]) => [S.KeywordIntegerMapping(_0, context), input]); +exports.KeywordInteger = KeywordInteger; +const KeywordBigInt = (input, context = {}) => If(index_1.Runtime.Token.Const('bigint', input), ([_0, input]) => [S.KeywordBigIntMapping(_0, context), input]); +exports.KeywordBigInt = KeywordBigInt; +const KeywordUnknown = (input, context = {}) => If(index_1.Runtime.Token.Const('unknown', input), ([_0, input]) => [S.KeywordUnknownMapping(_0, context), input]); +exports.KeywordUnknown = KeywordUnknown; +const KeywordAny = (input, context = {}) => If(index_1.Runtime.Token.Const('any', input), ([_0, input]) => [S.KeywordAnyMapping(_0, context), input]); +exports.KeywordAny = KeywordAny; +const KeywordNever = (input, context = {}) => If(index_1.Runtime.Token.Const('never', input), ([_0, input]) => [S.KeywordNeverMapping(_0, context), input]); +exports.KeywordNever = KeywordNever; +const KeywordSymbol = (input, context = {}) => If(index_1.Runtime.Token.Const('symbol', input), ([_0, input]) => [S.KeywordSymbolMapping(_0, context), input]); +exports.KeywordSymbol = KeywordSymbol; +const KeywordVoid = (input, context = {}) => If(index_1.Runtime.Token.Const('void', input), ([_0, input]) => [S.KeywordVoidMapping(_0, context), input]); +exports.KeywordVoid = KeywordVoid; +const Keyword = (input, context = {}) => If(If((0, exports.KeywordString)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNumber)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordBoolean)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordUndefined)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNull)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordInteger)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordBigInt)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordUnknown)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordAny)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNever)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordSymbol)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordVoid)(input, context), ([_0, input]) => [_0, input], () => [])))))))))))), ([_0, input]) => [S.KeywordMapping(_0, context), input]); +exports.Keyword = Keyword; +const LiteralString = (input, context = {}) => If(index_1.Runtime.Token.String(["'", '"', '`'], input), ([_0, input]) => [S.LiteralStringMapping(_0, context), input]); +exports.LiteralString = LiteralString; +const LiteralNumber = (input, context = {}) => If(index_1.Runtime.Token.Number(input), ([_0, input]) => [S.LiteralNumberMapping(_0, context), input]); +exports.LiteralNumber = LiteralNumber; +const LiteralBoolean = (input, context = {}) => If(If(index_1.Runtime.Token.Const('true', input), ([_0, input]) => [_0, input], () => If(index_1.Runtime.Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.LiteralBooleanMapping(_0, context), input]); +exports.LiteralBoolean = LiteralBoolean; +const Literal = (input, context = {}) => If(If((0, exports.LiteralBoolean)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.LiteralNumber)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.LiteralString)(input, context), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.LiteralMapping(_0, context), input]); +exports.Literal = Literal; +const KeyOf = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('keyof', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.KeyOfMapping(_0, context), input]); +exports.KeyOf = KeyOf; +const IndexArray_0 = (input, context, result = []) => If(If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If(index_1.Runtime.Token.Const(']', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => (0, exports.IndexArray_0)(input, context, [...result, _0]), () => [result, input]); +exports.IndexArray_0 = IndexArray_0; +const IndexArray = (input, context = {}) => If((0, exports.IndexArray_0)(input, context), ([_0, input]) => [S.IndexArrayMapping(_0, context), input]); +exports.IndexArray = IndexArray; +const Extends = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('extends', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('?', input), ([_2, input]) => If((0, exports.Type)(input, context), ([_3, input]) => If(index_1.Runtime.Token.Const(':', input), ([_4, input]) => If((0, exports.Type)(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0, context), input]); +exports.Extends = Extends; +const Base = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('(', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If((0, exports.Keyword)(input, context), ([_0, input]) => [_0, input], () => If((0, exports._Object)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Tuple)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Literal)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Constructor)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Function)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Mapped)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.AsyncIterator)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Iterator)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.ConstructorParameters)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.FunctionParameters)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.InstanceType)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.ReturnType)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Argument)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Awaited)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Array)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Record)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Promise)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Partial)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Required)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Pick)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Omit)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Exclude)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Extract)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uppercase)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Lowercase)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Capitalize)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uncapitalize)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Date)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uint8Array)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.GenericReference)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Reference)(input, context), ([_0, input]) => [_0, input], () => []))))))))))))))))))))))))))))))))), ([_0, input]) => [S.BaseMapping(_0, context), input]); +exports.Base = Base; +const Factor = (input, context = {}) => If(If((0, exports.KeyOf)(input, context), ([_0, input]) => If((0, exports.Base)(input, context), ([_1, input]) => If((0, exports.IndexArray)(input, context), ([_2, input]) => If((0, exports.Extends)(input, context), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FactorMapping(_0, context), input]); +exports.Factor = Factor; +const ExprTermTail = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('&', input), ([_0, input]) => If((0, exports.Factor)(input, context), ([_1, input]) => If((0, exports.ExprTermTail)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0, context), input]); +exports.ExprTermTail = ExprTermTail; +const ExprTerm = (input, context = {}) => If(If((0, exports.Factor)(input, context), ([_0, input]) => If((0, exports.ExprTermTail)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0, context), input]); +exports.ExprTerm = ExprTerm; +const ExprTail = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('|', input), ([_0, input]) => If((0, exports.ExprTerm)(input, context), ([_1, input]) => If((0, exports.ExprTail)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTailMapping(_0, context), input]); +exports.ExprTail = ExprTail; +const Expr = (input, context = {}) => If(If((0, exports.ExprTerm)(input, context), ([_0, input]) => If((0, exports.ExprTail)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprMapping(_0, context), input]); +exports.Expr = Expr; +const Type = (input, context = {}) => If(If(If((0, exports.GenericArguments)(input, context), ([_0, input]) => (0, exports.Expr)(input, _0), () => []), ([_0, input]) => [_0, input], () => If((0, exports.Expr)(input, context), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.TypeMapping(_0, context), input]); +exports.Type = Type; +const PropertyKey = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [_0, input], () => If(index_1.Runtime.Token.String(["'", '"'], input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PropertyKeyMapping(_0, context), input]); +exports.PropertyKey = PropertyKey; +const Readonly = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ReadonlyMapping(_0, context), input]); +exports.Readonly = Readonly; +const Optional = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalMapping(_0, context), input]); +exports.Optional = Optional; +const Property = (input, context = {}) => If(If((0, exports.Readonly)(input, context), ([_0, input]) => If((0, exports.PropertyKey)(input, context), ([_1, input]) => If((0, exports.Optional)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(':', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.PropertyMapping(_0, context), input]); +exports.Property = Property; +const PropertyDelimiter = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const(',', input), ([_0, input]) => If(index_1.Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(';', input), ([_0, input]) => If(index_1.Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(',', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.PropertyDelimiterMapping(_0, context), input]); +exports.PropertyDelimiter = PropertyDelimiter; +const PropertyList_0 = (input, context, result = []) => If(If((0, exports.Property)(input, context), ([_0, input]) => If((0, exports.PropertyDelimiter)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.PropertyList_0)(input, context, [...result, _0]), () => [result, input]); +exports.PropertyList_0 = PropertyList_0; +const PropertyList = (input, context = {}) => If(If((0, exports.PropertyList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Property)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.PropertyListMapping(_0, context), input]); +exports.PropertyList = PropertyList; +const _Object = (input, context = {}) => If(If(index_1.Runtime.Token.Const('{', input), ([_0, input]) => If((0, exports.PropertyList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ObjectMapping(_0, context), input]); +exports._Object = _Object; +const ElementList_0 = (input, context, result = []) => If(If((0, exports.Type)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.ElementList_0)(input, context, [...result, _0]), () => [result, input]); +exports.ElementList_0 = ElementList_0; +const ElementList = (input, context = {}) => If(If((0, exports.ElementList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Type)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementListMapping(_0, context), input]); +exports.ElementList = ElementList; +const Tuple = (input, context = {}) => If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If((0, exports.ElementList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.TupleMapping(_0, context), input]); +exports.Tuple = Tuple; +const Parameter = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const(':', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ParameterMapping(_0, context), input]); +exports.Parameter = Parameter; +const ParameterList_0 = (input, context, result = []) => If(If((0, exports.Parameter)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.ParameterList_0)(input, context, [...result, _0]), () => [result, input]); +exports.ParameterList_0 = ParameterList_0; +const ParameterList = (input, context = {}) => If(If((0, exports.ParameterList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Parameter)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ParameterListMapping(_0, context), input]); +exports.ParameterList = ParameterList; +const Function = (input, context = {}) => If(If(index_1.Runtime.Token.Const('(', input), ([_0, input]) => If((0, exports.ParameterList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(')', input), ([_2, input]) => If(index_1.Runtime.Token.Const('=>', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FunctionMapping(_0, context), input]); +exports.Function = Function; +const Constructor = (input, context = {}) => If(If(index_1.Runtime.Token.Const('new', input), ([_0, input]) => If(index_1.Runtime.Token.Const('(', input), ([_1, input]) => If((0, exports.ParameterList)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(')', input), ([_3, input]) => If(index_1.Runtime.Token.Const('=>', input), ([_4, input]) => If((0, exports.Type)(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ConstructorMapping(_0, context), input]); +exports.Constructor = Constructor; +const Mapped = (input, context = {}) => If(If(index_1.Runtime.Token.Const('{', input), ([_0, input]) => If(index_1.Runtime.Token.Const('[', input), ([_1, input]) => If(index_1.Runtime.Token.Ident(input), ([_2, input]) => If(index_1.Runtime.Token.Const('in', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const(']', input), ([_5, input]) => If(index_1.Runtime.Token.Const(':', input), ([_6, input]) => If((0, exports.Type)(input, context), ([_7, input]) => If(index_1.Runtime.Token.Const('}', input), ([_8, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8], input]))))))))), ([_0, input]) => [S.MappedMapping(_0, context), input]); +exports.Mapped = Mapped; +const AsyncIterator = (input, context = {}) => If(If(index_1.Runtime.Token.Const('AsyncIterator', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AsyncIteratorMapping(_0, context), input]); +exports.AsyncIterator = AsyncIterator; +const Iterator = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Iterator', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.IteratorMapping(_0, context), input]); +exports.Iterator = Iterator; +const Argument = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Argument', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArgumentMapping(_0, context), input]); +exports.Argument = Argument; +const Awaited = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Awaited', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AwaitedMapping(_0, context), input]); +exports.Awaited = Awaited; +const Array = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Array', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArrayMapping(_0, context), input]); +exports.Array = Array; +const Record = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Record', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.RecordMapping(_0, context), input]); +exports.Record = Record; +const Promise = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Promise', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PromiseMapping(_0, context), input]); +exports.Promise = Promise; +const ConstructorParameters = (input, context = {}) => If(If(index_1.Runtime.Token.Const('ConstructorParameters', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ConstructorParametersMapping(_0, context), input]); +exports.ConstructorParameters = ConstructorParameters; +const FunctionParameters = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Parameters', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FunctionParametersMapping(_0, context), input]); +exports.FunctionParameters = FunctionParameters; +const InstanceType = (input, context = {}) => If(If(index_1.Runtime.Token.Const('InstanceType', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.InstanceTypeMapping(_0, context), input]); +exports.InstanceType = InstanceType; +const ReturnType = (input, context = {}) => If(If(index_1.Runtime.Token.Const('ReturnType', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ReturnTypeMapping(_0, context), input]); +exports.ReturnType = ReturnType; +const Partial = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Partial', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PartialMapping(_0, context), input]); +exports.Partial = Partial; +const Required = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Required', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.RequiredMapping(_0, context), input]); +exports.Required = Required; +const Pick = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Pick', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.PickMapping(_0, context), input]); +exports.Pick = Pick; +const Omit = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Omit', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.OmitMapping(_0, context), input]); +exports.Omit = Omit; +const Exclude = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Exclude', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExcludeMapping(_0, context), input]); +exports.Exclude = Exclude; +const Extract = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Extract', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExtractMapping(_0, context), input]); +exports.Extract = Extract; +const Uppercase = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Uppercase', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UppercaseMapping(_0, context), input]); +exports.Uppercase = Uppercase; +const Lowercase = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Lowercase', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.LowercaseMapping(_0, context), input]); +exports.Lowercase = Lowercase; +const Capitalize = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Capitalize', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.CapitalizeMapping(_0, context), input]); +exports.Capitalize = Capitalize; +const Uncapitalize = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Uncapitalize', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UncapitalizeMapping(_0, context), input]); +exports.Uncapitalize = Uncapitalize; +const Date = (input, context = {}) => If(index_1.Runtime.Token.Const('Date', input), ([_0, input]) => [S.DateMapping(_0, context), input]); +exports.Date = Date; +const Uint8Array = (input, context = {}) => If(index_1.Runtime.Token.Const('Uint8Array', input), ([_0, input]) => [S.Uint8ArrayMapping(_0, context), input]); +exports.Uint8Array = Uint8Array; +const Reference = (input, context = {}) => If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0, context), input]); +exports.Reference = Reference; diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.d.ts b/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.d.ts new file mode 100644 index 00000000..98df91ee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.d.ts @@ -0,0 +1,12 @@ +import * as t from '../type/index'; +import { TType } from './parser'; +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +export declare function NoInfer, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): t.TSchema; +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +export declare function NoInfer(input: Input, options?: t.SchemaOptions): t.TSchema; +/** `[Experimental]` Parses type expressions into TypeBox types */ +export type TSyntax, Code extends string> = (TType extends [infer Type extends t.TSchema, string] ? Type : t.TNever); +/** `[Experimental]` Parses type expressions into TypeBox types */ +export declare function Syntax, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): TSyntax; +/** `[Experimental]` Parses type expressions into TypeBox types */ +export declare function Syntax(annotation: Input, options?: t.SchemaOptions): TSyntax<{}, Input>; diff --git a/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.js b/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.js new file mode 100644 index 00000000..315e7865 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/syntax/syntax.js @@ -0,0 +1,54 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoInfer = NoInfer; +exports.Syntax = Syntax; +const t = __importStar(require("../type/index")); +const parser_1 = require("./parser"); +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +// prettier-ignore +function NoInfer(...args) { + const withContext = typeof args[0] === 'string' ? false : true; + const [context, code, options] = withContext ? [args[0], args[1], args[2] || {}] : [{}, args[0], args[1] || {}]; + const result = (0, parser_1.Type)(code, context)[0]; + return t.KindGuard.IsSchema(result) + ? t.CloneType(result, options) + : t.Never(options); +} +/** `[Experimental]` Parses type expressions into TypeBox types */ +function Syntax(...args) { + return NoInfer.apply(null, args); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/system/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/system/index.d.ts new file mode 100644 index 00000000..c6ef9f1c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/index.d.ts @@ -0,0 +1,2 @@ +export * from './policy'; +export * from './system'; diff --git a/node_modules/@sinclair/typebox/build/cjs/system/index.js b/node_modules/@sinclair/typebox/build/cjs/system/index.js new file mode 100644 index 00000000..4c56b5b9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./policy"), exports); +__exportStar(require("./system"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/system/policy.d.ts b/node_modules/@sinclair/typebox/build/cjs/system/policy.d.ts new file mode 100644 index 00000000..bb6307f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/policy.d.ts @@ -0,0 +1,29 @@ +export declare namespace TypeSystemPolicy { + /** + * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript + * references for embedded types, which may cause side effects if type properties are explicitly updated + * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation, + * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making + * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the + * fastest way to instantiate types. The default setting is `default`. + */ + let InstanceMode: 'default' | 'clone' | 'freeze'; + /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ + let ExactOptionalPropertyTypes: boolean; + /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ + let AllowArrayObject: boolean; + /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ + let AllowNaN: boolean; + /** Sets whether `null` should validate for void types. The default is `false` */ + let AllowNullVoid: boolean; + /** Checks this value using the ExactOptionalPropertyTypes policy */ + function IsExactOptionalProperty(value: Record, key: string): boolean; + /** Checks this value using the AllowArrayObjects policy */ + function IsObjectLike(value: unknown): value is Record; + /** Checks this value as a record using the AllowArrayObjects policy */ + function IsRecordLike(value: unknown): value is Record; + /** Checks this value using the AllowNaN policy */ + function IsNumberLike(value: unknown): value is number; + /** Checks this value using the AllowVoidNull policy */ + function IsVoidLike(value: unknown): value is void; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/system/policy.js b/node_modules/@sinclair/typebox/build/cjs/system/policy.js new file mode 100644 index 00000000..78c1651a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/policy.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeSystemPolicy = void 0; +const index_1 = require("../value/guard/index"); +var TypeSystemPolicy; +(function (TypeSystemPolicy) { + // ------------------------------------------------------------------ + // TypeSystemPolicy: Instancing + // ------------------------------------------------------------------ + /** + * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript + * references for embedded types, which may cause side effects if type properties are explicitly updated + * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation, + * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making + * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the + * fastest way to instantiate types. The default setting is `default`. + */ + TypeSystemPolicy.InstanceMode = 'default'; + // ------------------------------------------------------------------ + // TypeSystemPolicy: Checking + // ------------------------------------------------------------------ + /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ + TypeSystemPolicy.ExactOptionalPropertyTypes = false; + /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ + TypeSystemPolicy.AllowArrayObject = false; + /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ + TypeSystemPolicy.AllowNaN = false; + /** Sets whether `null` should validate for void types. The default is `false` */ + TypeSystemPolicy.AllowNullVoid = false; + /** Checks this value using the ExactOptionalPropertyTypes policy */ + function IsExactOptionalProperty(value, key) { + return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined; + } + TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty; + /** Checks this value using the AllowArrayObjects policy */ + function IsObjectLike(value) { + const isObject = (0, index_1.IsObject)(value); + return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !(0, index_1.IsArray)(value); + } + TypeSystemPolicy.IsObjectLike = IsObjectLike; + /** Checks this value as a record using the AllowArrayObjects policy */ + function IsRecordLike(value) { + return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array); + } + TypeSystemPolicy.IsRecordLike = IsRecordLike; + /** Checks this value using the AllowNaN policy */ + function IsNumberLike(value) { + return TypeSystemPolicy.AllowNaN ? (0, index_1.IsNumber)(value) : Number.isFinite(value); + } + TypeSystemPolicy.IsNumberLike = IsNumberLike; + /** Checks this value using the AllowVoidNull policy */ + function IsVoidLike(value) { + const isUndefined = (0, index_1.IsUndefined)(value); + return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined; + } + TypeSystemPolicy.IsVoidLike = IsVoidLike; +})(TypeSystemPolicy || (exports.TypeSystemPolicy = TypeSystemPolicy = {})); diff --git a/node_modules/@sinclair/typebox/build/cjs/system/system.d.ts b/node_modules/@sinclair/typebox/build/cjs/system/system.d.ts new file mode 100644 index 00000000..924cae75 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/system.d.ts @@ -0,0 +1,16 @@ +import { type TUnsafe } from '../type/unsafe/index'; +import { TypeBoxError } from '../type/error/index'; +export declare class TypeSystemDuplicateTypeKind extends TypeBoxError { + constructor(kind: string); +} +export declare class TypeSystemDuplicateFormat extends TypeBoxError { + constructor(kind: string); +} +export type TypeFactoryFunction> = (options?: Partial) => TUnsafe; +/** Creates user defined types and formats and provides overrides for value checking behaviours */ +export declare namespace TypeSystem { + /** Creates a new type */ + function Type>(kind: string, check: (options: Options, value: unknown) => boolean): TypeFactoryFunction; + /** Creates a new string format */ + function Format(format: F, check: (value: string) => boolean): F; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/system/system.js b/node_modules/@sinclair/typebox/build/cjs/system/system.js new file mode 100644 index 00000000..d23cec68 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/system/system.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeSystem = exports.TypeSystemDuplicateFormat = exports.TypeSystemDuplicateTypeKind = void 0; +const index_1 = require("../type/registry/index"); +const index_2 = require("../type/unsafe/index"); +const index_3 = require("../type/symbols/index"); +const index_4 = require("../type/error/index"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class TypeSystemDuplicateTypeKind extends index_4.TypeBoxError { + constructor(kind) { + super(`Duplicate type kind '${kind}' detected`); + } +} +exports.TypeSystemDuplicateTypeKind = TypeSystemDuplicateTypeKind; +class TypeSystemDuplicateFormat extends index_4.TypeBoxError { + constructor(kind) { + super(`Duplicate string format '${kind}' detected`); + } +} +exports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat; +/** Creates user defined types and formats and provides overrides for value checking behaviours */ +var TypeSystem; +(function (TypeSystem) { + /** Creates a new type */ + function Type(kind, check) { + if (index_1.TypeRegistry.Has(kind)) + throw new TypeSystemDuplicateTypeKind(kind); + index_1.TypeRegistry.Set(kind, check); + return (options = {}) => (0, index_2.Unsafe)({ ...options, [index_3.Kind]: kind }); + } + TypeSystem.Type = Type; + /** Creates a new string format */ + function Format(format, check) { + if (index_1.FormatRegistry.Has(format)) + throw new TypeSystemDuplicateFormat(format); + index_1.FormatRegistry.Set(format, check); + return format; + } + TypeSystem.Format = Format; +})(TypeSystem || (exports.TypeSystem = TypeSystem = {})); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/any/any.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/any/any.d.ts new file mode 100644 index 00000000..b89a13b0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/any/any.d.ts @@ -0,0 +1,8 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TAny extends TSchema { + [Kind]: 'Any'; + static: any; +} +/** `[Json]` Creates an Any type */ +export declare function Any(options?: SchemaOptions): TAny; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/any/any.js b/node_modules/@sinclair/typebox/build/cjs/type/any/any.js new file mode 100644 index 00000000..6467f041 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/any/any.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Any = Any; +const index_1 = require("../create/index"); +const index_2 = require("../symbols/index"); +/** `[Json]` Creates an Any type */ +function Any(options) { + return (0, index_1.CreateType)({ [index_2.Kind]: 'Any' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/any/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/any/index.d.ts new file mode 100644 index 00000000..a89969cc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/any/index.d.ts @@ -0,0 +1 @@ +export * from './any'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/any/index.js b/node_modules/@sinclair/typebox/build/cjs/type/any/index.js new file mode 100644 index 00000000..8fccabe7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/any/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./any"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.d.ts new file mode 100644 index 00000000..bff6979d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.d.ts @@ -0,0 +1,9 @@ +import type { TSchema } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TArgument extends TSchema { + [Kind]: 'Argument'; + static: unknown; + index: Index; +} +/** `[JavaScript]` Creates an Argument Type. */ +export declare function Argument(index: Index): TArgument; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.js b/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.js new file mode 100644 index 00000000..b2aac9ca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/argument/argument.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Argument = Argument; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates an Argument Type. */ +function Argument(index) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Argument', index }); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/argument/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/argument/index.d.ts new file mode 100644 index 00000000..3f58c3ee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/argument/index.d.ts @@ -0,0 +1 @@ +export * from './argument'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/argument/index.js b/node_modules/@sinclair/typebox/build/cjs/type/argument/index.js new file mode 100644 index 00000000..1eec3676 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/argument/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./argument"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/array/array.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/array/array.d.ts new file mode 100644 index 00000000..1b0e49b7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/array/array.d.ts @@ -0,0 +1,28 @@ +import { Ensure } from '../helpers/index'; +import type { SchemaOptions, TSchema } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +export interface ArrayOptions extends SchemaOptions { + /** The minimum number of items in this array */ + minItems?: number; + /** The maximum number of items in this array */ + maxItems?: number; + /** Should this schema contain unique items */ + uniqueItems?: boolean; + /** A schema for which some elements should match */ + contains?: TSchema; + /** A minimum number of contains schema matches */ + minContains?: number; + /** A maximum number of contains schema matches */ + maxContains?: number; +} +type ArrayStatic = Ensure[]>; +export interface TArray extends TSchema, ArrayOptions { + [Kind]: 'Array'; + static: ArrayStatic; + type: 'array'; + items: T; +} +/** `[Json]` Creates an Array type */ +export declare function Array(items: Type, options?: ArrayOptions): TArray; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/array/array.js b/node_modules/@sinclair/typebox/build/cjs/type/array/array.js new file mode 100644 index 00000000..ffbac938 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/array/array.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Array = Array; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates an Array type */ +function Array(items, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Array', type: 'array', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/array/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/array/index.d.ts new file mode 100644 index 00000000..bd9a11d9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/array/index.d.ts @@ -0,0 +1 @@ +export * from './array'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/array/index.js b/node_modules/@sinclair/typebox/build/cjs/type/array/index.js new file mode 100644 index 00000000..50527d7c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/array/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./array"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.d.ts new file mode 100644 index 00000000..217a44bc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.d.ts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +export interface TAsyncIterator extends TSchema { + [Kind]: 'AsyncIterator'; + static: AsyncIterableIterator>; + type: 'AsyncIterator'; + items: T; +} +/** `[JavaScript]` Creates a AsyncIterator type */ +export declare function AsyncIterator(items: T, options?: SchemaOptions): TAsyncIterator; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.js b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.js new file mode 100644 index 00000000..a307b151 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/async-iterator.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AsyncIterator = AsyncIterator; +const index_1 = require("../symbols/index"); +const type_1 = require("../create/type"); +/** `[JavaScript]` Creates a AsyncIterator type */ +function AsyncIterator(items, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'AsyncIterator', type: 'AsyncIterator', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.d.ts new file mode 100644 index 00000000..4003a171 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.d.ts @@ -0,0 +1 @@ +export * from './async-iterator'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.js b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.js new file mode 100644 index 00000000..c90dcb3f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/async-iterator/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./async-iterator"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.d.ts new file mode 100644 index 00000000..61e3696a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.d.ts @@ -0,0 +1,14 @@ +import { Ensure } from '../helpers/index'; +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TComputed } from '../computed/index'; +import { type TIntersect } from '../intersect/index'; +import { type TUnion } from '../union/index'; +import { type TPromise } from '../promise/index'; +import { type TRef } from '../ref/index'; +type TFromComputed = Ensure<(TComputed<'Awaited', [TComputed]>)>; +type TFromRef = Ensure]>>; +type TFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest]> : Result); +export type TAwaited = (Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TPromise ? TAwaited : Type); +/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ +export declare function Awaited(type: T, options?: SchemaOptions): TAwaited; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.js b/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.js new file mode 100644 index 00000000..1010eb76 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/awaited/awaited.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Awaited = Awaited; +const type_1 = require("../create/type"); +const index_1 = require("../computed/index"); +const index_2 = require("../intersect/index"); +const index_3 = require("../union/index"); +const index_4 = require("../ref/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromComputed(target, parameters) { + return (0, index_1.Computed)('Awaited', [(0, index_1.Computed)(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return (0, index_1.Computed)('Awaited', [(0, index_4.Ref)($ref)]); +} +// prettier-ignore +function FromIntersect(types) { + return (0, index_2.Intersect)(FromRest(types)); +} +// prettier-ignore +function FromUnion(types) { + return (0, index_3.Union)(FromRest(types)); +} +// prettier-ignore +function FromPromise(type) { + return Awaited(type); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => Awaited(type)); +} +/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ +function Awaited(type, options) { + return (0, type_1.CreateType)((0, kind_1.IsComputed)(type) ? FromComputed(type.target, type.parameters) : (0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf) : (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : (0, kind_1.IsPromise)(type) ? FromPromise(type.item) : (0, kind_1.IsRef)(type) ? FromRef(type.$ref) : type, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.d.ts new file mode 100644 index 00000000..57e41638 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.d.ts @@ -0,0 +1 @@ +export * from './awaited'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.js b/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.js new file mode 100644 index 00000000..7537d673 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/awaited/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./awaited"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.d.ts new file mode 100644 index 00000000..f9b30d02 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface BigIntOptions extends SchemaOptions { + exclusiveMaximum?: bigint; + exclusiveMinimum?: bigint; + maximum?: bigint; + minimum?: bigint; + multipleOf?: bigint; +} +export interface TBigInt extends TSchema, BigIntOptions { + [Kind]: 'BigInt'; + static: bigint; + type: 'bigint'; +} +/** `[JavaScript]` Creates a BigInt type */ +export declare function BigInt(options?: BigIntOptions): TBigInt; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.js b/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.js new file mode 100644 index 00000000..d99a8de0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/bigint/bigint.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BigInt = BigInt; +const index_1 = require("../symbols/index"); +const index_2 = require("../create/index"); +/** `[JavaScript]` Creates a BigInt type */ +function BigInt(options) { + return (0, index_2.CreateType)({ [index_1.Kind]: 'BigInt', type: 'bigint' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.d.ts new file mode 100644 index 00000000..b5bcf27c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.d.ts @@ -0,0 +1 @@ +export * from './bigint'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.js b/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.js new file mode 100644 index 00000000..ab93382e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/bigint/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./bigint"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts new file mode 100644 index 00000000..208b70d2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TBoolean extends TSchema { + [Kind]: 'Boolean'; + static: boolean; + type: 'boolean'; +} +/** `[Json]` Creates a Boolean type */ +export declare function Boolean(options?: SchemaOptions): TBoolean; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.js b/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.js new file mode 100644 index 00000000..9956ad10 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Boolean = Boolean; +const index_1 = require("../symbols/index"); +const index_2 = require("../create/index"); +/** `[Json]` Creates a Boolean type */ +function Boolean(options) { + return (0, index_2.CreateType)({ [index_1.Kind]: 'Boolean', type: 'boolean' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.d.ts new file mode 100644 index 00000000..01af61bf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.d.ts @@ -0,0 +1 @@ +export * from './boolean'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.js b/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.js new file mode 100644 index 00000000..64f51d29 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/boolean/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./boolean"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/clone/index.d.ts new file mode 100644 index 00000000..5f14d558 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/index.d.ts @@ -0,0 +1,2 @@ +export * from './type'; +export * from './value'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/index.js b/node_modules/@sinclair/typebox/build/cjs/type/clone/index.js new file mode 100644 index 00000000..02d86c75 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./type"), exports); +__exportStar(require("./value"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/clone/type.d.ts new file mode 100644 index 00000000..e423dea8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/type.d.ts @@ -0,0 +1,5 @@ +import { TSchema, SchemaOptions } from '../schema/index'; +/** Clones a Rest */ +export declare function CloneRest(schemas: T): T; +/** Clones a Type */ +export declare function CloneType(schema: T, options?: SchemaOptions): T; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/type.js b/node_modules/@sinclair/typebox/build/cjs/type/clone/type.js new file mode 100644 index 00000000..8338bf10 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/type.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CloneRest = CloneRest; +exports.CloneType = CloneType; +const value_1 = require("./value"); +/** Clones a Rest */ +function CloneRest(schemas) { + return schemas.map((schema) => CloneType(schema)); +} +/** Clones a Type */ +function CloneType(schema, options) { + return options === undefined ? (0, value_1.Clone)(schema) : (0, value_1.Clone)({ ...options, ...schema }); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/value.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/clone/value.d.ts new file mode 100644 index 00000000..30aa085a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/value.d.ts @@ -0,0 +1,2 @@ +/** Clones a value */ +export declare function Clone(value: T): T; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/clone/value.js b/node_modules/@sinclair/typebox/build/cjs/type/clone/value.js new file mode 100644 index 00000000..bd06b7c3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/clone/value.js @@ -0,0 +1,73 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Clone = Clone; +const ValueGuard = __importStar(require("../guard/value")); +function ArrayType(value) { + return value.map((value) => Visit(value)); +} +function DateType(value) { + return new Date(value.getTime()); +} +function Uint8ArrayType(value) { + return new Uint8Array(value); +} +function RegExpType(value) { + return new RegExp(value.source, value.flags); +} +function ObjectType(value) { + const result = {}; + for (const key of Object.getOwnPropertyNames(value)) { + result[key] = Visit(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + result[key] = Visit(value[key]); + } + return result; +} +// prettier-ignore +function Visit(value) { + return (ValueGuard.IsArray(value) ? ArrayType(value) : + ValueGuard.IsDate(value) ? DateType(value) : + ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) : + ValueGuard.IsRegExp(value) ? RegExpType(value) : + ValueGuard.IsObject(value) ? ObjectType(value) : + value); +} +/** Clones a value */ +function Clone(value) { + return Visit(value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.d.ts new file mode 100644 index 00000000..7b3d6f24 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.d.ts @@ -0,0 +1,18 @@ +import type { TSchema } from '../schema/index'; +import type { Evaluate } from '../helpers/index'; +import { type TIntersectEvaluated } from '../intersect/index'; +import { type TIndexFromPropertyKeys } from '../indexed/index'; +import { type TKeyOfPropertyKeys } from '../keyof/index'; +import { type TNever } from '../never/index'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index'; +import { TSetDistinct } from '../sets/index'; +type TCompositeKeys = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeKeys]> : TSetDistinct); +type TFilterNever = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? TFilterNever : TFilterNever : Acc); +type TCompositeProperty = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeProperty]> : TFilterNever); +type TCompositeProperties = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TCompositeProperties>; +}> : Acc); +type TCompositeEvaluate, P extends TProperties = Evaluate>, R extends TSchema = TObject

> = R; +export type TComposite = TCompositeEvaluate; +export declare function Composite(T: [...T], options?: ObjectOptions): TComposite; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.js b/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.js new file mode 100644 index 00000000..74b1d66c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/composite/composite.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Composite = Composite; +const index_1 = require("../intersect/index"); +const index_2 = require("../indexed/index"); +const index_3 = require("../keyof/index"); +const index_4 = require("../object/index"); +const index_5 = require("../sets/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function CompositeKeys(T) { + const Acc = []; + for (const L of T) + Acc.push(...(0, index_3.KeyOfPropertyKeys)(L)); + return (0, index_5.SetDistinct)(Acc); +} +// prettier-ignore +function FilterNever(T) { + return T.filter(L => !(0, kind_1.IsNever)(L)); +} +// prettier-ignore +function CompositeProperty(T, K) { + const Acc = []; + for (const L of T) + Acc.push(...(0, index_2.IndexFromPropertyKeys)(L, [K])); + return FilterNever(Acc); +} +// prettier-ignore +function CompositeProperties(T, K) { + const Acc = {}; + for (const L of K) { + Acc[L] = (0, index_1.IntersectEvaluated)(CompositeProperty(T, L)); + } + return Acc; +} +// prettier-ignore +function Composite(T, options) { + const K = CompositeKeys(T); + const P = CompositeProperties(T, K); + const R = (0, index_4.Object)(P, options); + return R; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/composite/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/composite/index.d.ts new file mode 100644 index 00000000..30dfb133 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/composite/index.d.ts @@ -0,0 +1 @@ +export * from './composite'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/composite/index.js b/node_modules/@sinclair/typebox/build/cjs/type/composite/index.js new file mode 100644 index 00000000..bf3a8eee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/composite/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./composite"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.d.ts new file mode 100644 index 00000000..51e8c18c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/symbols'; +export interface TComputed extends TSchema { + [Kind]: 'Computed'; + target: Target; + parameters: Parameters; +} +/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */ +export declare function Computed(target: Target, parameters: [...Parameters], options?: SchemaOptions): TComputed; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.js b/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.js new file mode 100644 index 00000000..a299e82e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/computed/computed.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Computed = Computed; +const index_1 = require("../create/index"); +const symbols_1 = require("../symbols/symbols"); +/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */ +function Computed(target, parameters, options) { + return (0, index_1.CreateType)({ [symbols_1.Kind]: 'Computed', target, parameters }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/computed/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/computed/index.d.ts new file mode 100644 index 00000000..ca21f6d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/computed/index.d.ts @@ -0,0 +1 @@ +export * from './computed'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/computed/index.js b/node_modules/@sinclair/typebox/build/cjs/type/computed/index.js new file mode 100644 index 00000000..e060d11b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/computed/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./computed"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/const/const.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/const/const.d.ts new file mode 100644 index 00000000..62deab2b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/const/const.d.ts @@ -0,0 +1,27 @@ +import type { AssertRest, Evaluate } from '../helpers/index'; +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TAny } from '../any/index'; +import { type TBigInt } from '../bigint/index'; +import { type TDate } from '../date/index'; +import { type TFunction } from '../function/index'; +import { type TLiteral } from '../literal/index'; +import { type TNever } from '../never/index'; +import { type TNull } from '../null/index'; +import { type TObject } from '../object/index'; +import { type TSymbol } from '../symbol/index'; +import { type TTuple } from '../tuple/index'; +import { type TReadonly } from '../readonly/index'; +import { type TUndefined } from '../undefined/index'; +import { type TUint8Array } from '../uint8array/index'; +import { type TUnknown } from '../unknown/index'; +type TFromArray = T extends readonly [infer L extends unknown, ...infer R extends unknown[]] ? [FromValue, ...TFromArray] : T; +type TFromProperties> = { + -readonly [K in keyof T]: FromValue extends infer R extends TSchema ? TReadonly : TReadonly; +}; +type TConditionalReadonly = Root extends true ? T : TReadonly; +type FromValue = T extends AsyncIterableIterator ? TConditionalReadonly : T extends IterableIterator ? TConditionalReadonly : T extends readonly unknown[] ? TReadonly>>> : T extends Uint8Array ? TUint8Array : T extends Date ? TDate : T extends Record ? TConditionalReadonly>>, Root> : T extends Function ? TConditionalReadonly, Root> : T extends undefined ? TUndefined : T extends null ? TNull : T extends symbol ? TSymbol : T extends number ? TLiteral : T extends boolean ? TLiteral : T extends string ? TLiteral : T extends bigint ? TBigInt : TObject<{}>; +declare function FromValue(value: T, root: Root): FromValue; +export type TConst = FromValue; +/** `[JavaScript]` Creates a readonly const type from the given value. */ +export declare function Const(T: T, options?: SchemaOptions): TConst; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/const/const.js b/node_modules/@sinclair/typebox/build/cjs/type/const/const.js new file mode 100644 index 00000000..83dbff60 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/const/const.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Const = Const; +const index_1 = require("../any/index"); +const index_2 = require("../bigint/index"); +const index_3 = require("../date/index"); +const index_4 = require("../function/index"); +const index_5 = require("../literal/index"); +const index_6 = require("../null/index"); +const index_7 = require("../object/index"); +const index_8 = require("../symbol/index"); +const index_9 = require("../tuple/index"); +const index_10 = require("../readonly/index"); +const index_11 = require("../undefined/index"); +const index_12 = require("../uint8array/index"); +const index_13 = require("../unknown/index"); +const index_14 = require("../create/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const value_1 = require("../guard/value"); +// prettier-ignore +function FromArray(T) { + return T.map(L => FromValue(L, false)); +} +// prettier-ignore +function FromProperties(value) { + const Acc = {}; + for (const K of globalThis.Object.getOwnPropertyNames(value)) + Acc[K] = (0, index_10.Readonly)(FromValue(value[K], false)); + return Acc; +} +function ConditionalReadonly(T, root) { + return (root === true ? T : (0, index_10.Readonly)(T)); +} +// prettier-ignore +function FromValue(value, root) { + return ((0, value_1.IsAsyncIterator)(value) ? ConditionalReadonly((0, index_1.Any)(), root) : + (0, value_1.IsIterator)(value) ? ConditionalReadonly((0, index_1.Any)(), root) : + (0, value_1.IsArray)(value) ? (0, index_10.Readonly)((0, index_9.Tuple)(FromArray(value))) : + (0, value_1.IsUint8Array)(value) ? (0, index_12.Uint8Array)() : + (0, value_1.IsDate)(value) ? (0, index_3.Date)() : + (0, value_1.IsObject)(value) ? ConditionalReadonly((0, index_7.Object)(FromProperties(value)), root) : + (0, value_1.IsFunction)(value) ? ConditionalReadonly((0, index_4.Function)([], (0, index_13.Unknown)()), root) : + (0, value_1.IsUndefined)(value) ? (0, index_11.Undefined)() : + (0, value_1.IsNull)(value) ? (0, index_6.Null)() : + (0, value_1.IsSymbol)(value) ? (0, index_8.Symbol)() : + (0, value_1.IsBigInt)(value) ? (0, index_2.BigInt)() : + (0, value_1.IsNumber)(value) ? (0, index_5.Literal)(value) : + (0, value_1.IsBoolean)(value) ? (0, index_5.Literal)(value) : + (0, value_1.IsString)(value) ? (0, index_5.Literal)(value) : + (0, index_7.Object)({})); +} +/** `[JavaScript]` Creates a readonly const type from the given value. */ +function Const(T, options) { + return (0, index_14.CreateType)(FromValue(T, true), options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/const/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/const/index.d.ts new file mode 100644 index 00000000..e47ea3a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/const/index.d.ts @@ -0,0 +1 @@ +export * from './const'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/const/index.js b/node_modules/@sinclair/typebox/build/cjs/type/const/index.js new file mode 100644 index 00000000..1865e8e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/const/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./const"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.d.ts new file mode 100644 index 00000000..5de851e8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.d.ts @@ -0,0 +1,7 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TConstructor } from '../constructor/index'; +import { type TTuple } from '../tuple/index'; +import { type TNever } from '../never/index'; +export type TConstructorParameters = (Type extends TConstructor ? TTuple : TNever); +/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ +export declare function ConstructorParameters(schema: Type, options?: SchemaOptions): TConstructorParameters; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.js b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.js new file mode 100644 index 00000000..fbc152d6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/constructor-parameters.js @@ -0,0 +1,44 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConstructorParameters = ConstructorParameters; +const index_1 = require("../tuple/index"); +const index_2 = require("../never/index"); +const KindGuard = __importStar(require("../guard/kind")); +/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ +function ConstructorParameters(schema, options) { + return (KindGuard.IsConstructor(schema) ? (0, index_1.Tuple)(schema.parameters, options) : (0, index_2.Never)(options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.d.ts new file mode 100644 index 00000000..3bd3d115 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.d.ts @@ -0,0 +1 @@ +export * from './constructor-parameters'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.js b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.js new file mode 100644 index 00000000..3b964037 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor-parameters/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./constructor-parameters"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.d.ts new file mode 100644 index 00000000..b13b768a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.d.ts @@ -0,0 +1,23 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import type { Ensure } from '../helpers/index'; +import type { TReadonlyOptional } from '../readonly-optional/index'; +import type { TReadonly } from '../readonly/index'; +import type { TOptional } from '../optional/index'; +import { Kind } from '../symbols/index'; +type StaticReturnType = Static; +type StaticParameter = T extends TReadonlyOptional ? [Readonly>?] : T extends TReadonly ? [Readonly>] : T extends TOptional ? [Static?] : [ + Static +]; +type StaticParameters = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters]> : Acc); +type StaticConstructor = Ensure) => StaticReturnType>; +export interface TConstructor extends TSchema { + [Kind]: 'Constructor'; + static: StaticConstructor; + type: 'Constructor'; + parameters: T; + returns: U; +} +/** `[JavaScript]` Creates a Constructor type */ +export declare function Constructor(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.js b/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.js new file mode 100644 index 00000000..83527364 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor/constructor.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Constructor = Constructor; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Constructor type */ +function Constructor(parameters, returns, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Constructor', type: 'Constructor', parameters, returns }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.d.ts new file mode 100644 index 00000000..077273db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.d.ts @@ -0,0 +1 @@ +export * from './constructor'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.js b/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.js new file mode 100644 index 00000000..42eb80eb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/constructor/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./constructor"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.d.ts new file mode 100644 index 00000000..8b90d402 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.d.ts @@ -0,0 +1,2 @@ +/** Specialized deep immutable value. Applies freeze recursively to the given value */ +export declare function Immutable(value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.js b/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.js new file mode 100644 index 00000000..92ee1f54 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/immutable.js @@ -0,0 +1,70 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Immutable = Immutable; +const ValueGuard = __importStar(require("../guard/value")); +function ImmutableArray(value) { + return globalThis.Object.freeze(value).map((value) => Immutable(value)); +} +function ImmutableDate(value) { + return value; +} +function ImmutableUint8Array(value) { + return value; +} +function ImmutableRegExp(value) { + return value; +} +function ImmutableObject(value) { + const result = {}; + for (const key of Object.getOwnPropertyNames(value)) { + result[key] = Immutable(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + result[key] = Immutable(value[key]); + } + return globalThis.Object.freeze(result); +} +/** Specialized deep immutable value. Applies freeze recursively to the given value */ +// prettier-ignore +function Immutable(value) { + return (ValueGuard.IsArray(value) ? ImmutableArray(value) : + ValueGuard.IsDate(value) ? ImmutableDate(value) : + ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) : + ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) : + ValueGuard.IsObject(value) ? ImmutableObject(value) : + value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/create/index.d.ts new file mode 100644 index 00000000..b38ebc9a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/index.d.ts @@ -0,0 +1 @@ +export * from './type'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/index.js b/node_modules/@sinclair/typebox/build/cjs/type/create/index.js new file mode 100644 index 00000000..cc3f825b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./type"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/create/type.d.ts new file mode 100644 index 00000000..b965697d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/type.d.ts @@ -0,0 +1,3 @@ +import { SchemaOptions } from '../schema/schema'; +/** Creates TypeBox schematics using the configured InstanceMode */ +export declare function CreateType(schema: Record, options?: SchemaOptions): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/create/type.js b/node_modules/@sinclair/typebox/build/cjs/type/create/type.js new file mode 100644 index 00000000..2df07dc9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/create/type.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateType = CreateType; +const policy_1 = require("../../system/policy"); +const immutable_1 = require("./immutable"); +const value_1 = require("../clone/value"); +/** Creates TypeBox schematics using the configured InstanceMode */ +function CreateType(schema, options) { + const result = options !== undefined ? { ...options, ...schema } : schema; + switch (policy_1.TypeSystemPolicy.InstanceMode) { + case 'freeze': + return (0, immutable_1.Immutable)(result); + case 'clone': + return (0, value_1.Clone)(result); + default: + return result; + } +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/date/date.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/date/date.d.ts new file mode 100644 index 00000000..0bcd5824 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/date/date.d.ts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface DateOptions extends SchemaOptions { + /** The exclusive maximum timestamp value */ + exclusiveMaximumTimestamp?: number; + /** The exclusive minimum timestamp value */ + exclusiveMinimumTimestamp?: number; + /** The maximum timestamp value */ + maximumTimestamp?: number; + /** The minimum timestamp value */ + minimumTimestamp?: number; + /** The multiple of timestamp value */ + multipleOfTimestamp?: number; +} +export interface TDate extends TSchema, DateOptions { + [Kind]: 'Date'; + static: Date; + type: 'date'; +} +/** `[JavaScript]` Creates a Date type */ +export declare function Date(options?: DateOptions): TDate; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/date/date.js b/node_modules/@sinclair/typebox/build/cjs/type/date/date.js new file mode 100644 index 00000000..7151e7ed --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/date/date.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Date = Date; +const index_1 = require("../symbols/index"); +const type_1 = require("../create/type"); +/** `[JavaScript]` Creates a Date type */ +function Date(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Date', type: 'Date' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/date/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/date/index.d.ts new file mode 100644 index 00000000..05b562fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/date/index.d.ts @@ -0,0 +1 @@ +export * from './date'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/date/index.js b/node_modules/@sinclair/typebox/build/cjs/type/date/index.js new file mode 100644 index 00000000..02f66fd3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/date/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./date"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.d.ts new file mode 100644 index 00000000..77e1c9ad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.d.ts @@ -0,0 +1,2 @@ +/** Discards property keys from the given value. This function returns a shallow Clone. */ +export declare function Discard(value: Record, keys: PropertyKey[]): Record; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.js b/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.js new file mode 100644 index 00000000..b21690ce --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/discard/discard.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Discard = Discard; +function DiscardKey(value, key) { + const { [key]: _, ...rest } = value; + return rest; +} +/** Discards property keys from the given value. This function returns a shallow Clone. */ +function Discard(value, keys) { + return keys.reduce((acc, key) => DiscardKey(acc, key), value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/discard/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/discard/index.d.ts new file mode 100644 index 00000000..d4764d3d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/discard/index.d.ts @@ -0,0 +1 @@ +export * from './discard'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/discard/index.js b/node_modules/@sinclair/typebox/build/cjs/type/discard/index.js new file mode 100644 index 00000000..9b8e357b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/discard/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./discard"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.d.ts new file mode 100644 index 00000000..b23354e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.d.ts @@ -0,0 +1,14 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TLiteral } from '../literal/index'; +import { Kind, Hint } from '../symbols/index'; +export type TEnumRecord = Record; +export type TEnumValue = string | number; +export type TEnumKey = string; +export interface TEnum = Record> extends TSchema { + [Kind]: 'Union'; + [Hint]: 'Enum'; + static: T[keyof T]; + anyOf: TLiteral[]; +} +/** `[Json]` Creates a Enum type */ +export declare function Enum>(item: T, options?: SchemaOptions): TEnum; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.js b/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.js new file mode 100644 index 00000000..810dc811 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/enum/enum.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Enum = Enum; +const index_1 = require("../literal/index"); +const index_2 = require("../symbols/index"); +const index_3 = require("../union/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const value_1 = require("../guard/value"); +/** `[Json]` Creates a Enum type */ +function Enum(item, options) { + if ((0, value_1.IsUndefined)(item)) + throw new Error('Enum undefined or empty'); + const values1 = globalThis.Object.getOwnPropertyNames(item) + .filter((key) => isNaN(key)) + .map((key) => item[key]); + const values2 = [...new Set(values1)]; + const anyOf = values2.map((value) => (0, index_1.Literal)(value)); + return (0, index_3.Union)(anyOf, { ...options, [index_2.Hint]: 'Enum' }); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/enum/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/enum/index.d.ts new file mode 100644 index 00000000..bdd505d9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/enum/index.d.ts @@ -0,0 +1 @@ +export * from './enum'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/enum/index.js b/node_modules/@sinclair/typebox/build/cjs/type/enum/index.js new file mode 100644 index 00000000..f25d13a3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/enum/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./enum"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/error/error.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/error/error.d.ts new file mode 100644 index 00000000..45605323 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/error/error.d.ts @@ -0,0 +1,4 @@ +/** The base Error type thrown for all TypeBox exceptions */ +export declare class TypeBoxError extends Error { + constructor(message: string); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/error/error.js b/node_modules/@sinclair/typebox/build/cjs/type/error/error.js new file mode 100644 index 00000000..1859431b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/error/error.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeBoxError = void 0; +/** The base Error type thrown for all TypeBox exceptions */ +class TypeBoxError extends Error { + constructor(message) { + super(message); + } +} +exports.TypeBoxError = TypeBoxError; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/error/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/error/index.d.ts new file mode 100644 index 00000000..93ae819e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/error/index.d.ts @@ -0,0 +1 @@ +export * from './error'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/error/index.js b/node_modules/@sinclair/typebox/build/cjs/type/error/index.js new file mode 100644 index 00000000..b2b930a8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/error/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./error"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.d.ts new file mode 100644 index 00000000..e2f10561 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.d.ts @@ -0,0 +1,11 @@ +import type { TSchema } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TExclude } from './exclude'; +type TFromProperties = ({ + [K2 in keyof K]: TExclude; +}); +type TFromMappedResult = (TFromProperties); +export type TExcludeFromMappedResult> = (TMappedResult

); +export declare function ExcludeFromMappedResult>(R: R, T: T): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.js new file mode 100644 index 00000000..1a22a03c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-mapped-result.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExcludeFromMappedResult = ExcludeFromMappedResult; +const index_1 = require("../mapped/index"); +const exclude_1 = require("./exclude"); +// prettier-ignore +function FromProperties(P, U) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = (0, exclude_1.Exclude)(P[K2], U); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, T) { + return FromProperties(R.properties, T); +} +// prettier-ignore +function ExcludeFromMappedResult(R, T) { + const P = FromMappedResult(R, T); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.d.ts new file mode 100644 index 00000000..af7b4676 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.d.ts @@ -0,0 +1,5 @@ +import type { TSchema } from '../schema/index'; +import { TExclude } from './exclude'; +import { type TTemplateLiteral, type TTemplateLiteralToUnion } from '../template-literal/index'; +export type TExcludeFromTemplateLiteral = (TExclude, R>); +export declare function ExcludeFromTemplateLiteral(L: L, R: R): TExcludeFromTemplateLiteral; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.js b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.js new file mode 100644 index 00000000..1f1767e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude-from-template-literal.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExcludeFromTemplateLiteral = ExcludeFromTemplateLiteral; +const exclude_1 = require("./exclude"); +const index_1 = require("../template-literal/index"); +function ExcludeFromTemplateLiteral(L, R) { + return (0, exclude_1.Exclude)((0, index_1.TemplateLiteralToUnion)(L), R); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.d.ts new file mode 100644 index 00000000..6cd7b4cb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.d.ts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { UnionToTuple, AssertRest, AssertType } from '../helpers/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TTemplateLiteral } from '../template-literal/index'; +import { type TUnion } from '../union/index'; +import { type TNever } from '../never/index'; +import { type Static } from '../static/index'; +import { type TUnionEvaluated } from '../union/index'; +import { type TExcludeFromMappedResult } from './exclude-from-mapped-result'; +import { type TExcludeFromTemplateLiteral } from './exclude-from-template-literal'; +type TExcludeRest = AssertRest> extends Static ? never : L[K]; +}[number]>> extends infer R extends TSchema[] ? TUnionEvaluated : never; +export type TExclude = (L extends TUnion ? TExcludeRest : L extends R ? TNever : L); +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromMappedResult; +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromTemplateLiteral; +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.js b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.js new file mode 100644 index 00000000..b3213038 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/exclude.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Exclude = Exclude; +const type_1 = require("../create/type"); +const index_1 = require("../union/index"); +const index_2 = require("../never/index"); +const index_3 = require("../extends/index"); +const exclude_from_mapped_result_1 = require("./exclude-from-mapped-result"); +const exclude_from_template_literal_1 = require("./exclude-from-template-literal"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +function ExcludeRest(L, R) { + const excluded = L.filter((inner) => (0, index_3.ExtendsCheck)(inner, R) === index_3.ExtendsResult.False); + return excluded.length === 1 ? excluded[0] : (0, index_1.Union)(excluded); +} +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +function Exclude(L, R, options = {}) { + // overloads + if ((0, kind_1.IsTemplateLiteral)(L)) + return (0, type_1.CreateType)((0, exclude_from_template_literal_1.ExcludeFromTemplateLiteral)(L, R), options); + if ((0, kind_1.IsMappedResult)(L)) + return (0, type_1.CreateType)((0, exclude_from_mapped_result_1.ExcludeFromMappedResult)(L, R), options); + // prettier-ignore + return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExcludeRest(L.anyOf, R) : + (0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? (0, index_2.Never)() : L, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.d.ts new file mode 100644 index 00000000..5b18ece8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.d.ts @@ -0,0 +1,3 @@ +export * from './exclude-from-mapped-result'; +export * from './exclude-from-template-literal'; +export * from './exclude'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.js b/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.js new file mode 100644 index 00000000..8d14ca66 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/exclude/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./exclude-from-mapped-result"), exports); +__exportStar(require("./exclude-from-template-literal"), exports); +__exportStar(require("./exclude"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.d.ts new file mode 100644 index 00000000..6fbcbd53 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.d.ts @@ -0,0 +1,10 @@ +import { type TSchema } from '../schema/index'; +import { TypeBoxError } from '../error/index'; +export declare class ExtendsResolverError extends TypeBoxError { +} +export declare enum ExtendsResult { + Union = 0, + True = 1, + False = 2 +} +export declare function ExtendsCheck(left: TSchema, right: TSchema): ExtendsResult; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.js new file mode 100644 index 00000000..dd08f044 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-check.js @@ -0,0 +1,641 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtendsResult = exports.ExtendsResolverError = void 0; +exports.ExtendsCheck = ExtendsCheck; +const index_1 = require("../any/index"); +const index_2 = require("../function/index"); +const index_3 = require("../number/index"); +const index_4 = require("../string/index"); +const index_5 = require("../unknown/index"); +const index_6 = require("../template-literal/index"); +const index_7 = require("../patterns/index"); +const index_8 = require("../symbols/index"); +const index_9 = require("../error/index"); +const index_10 = require("../guard/index"); +class ExtendsResolverError extends index_9.TypeBoxError { +} +exports.ExtendsResolverError = ExtendsResolverError; +var ExtendsResult; +(function (ExtendsResult) { + ExtendsResult[ExtendsResult["Union"] = 0] = "Union"; + ExtendsResult[ExtendsResult["True"] = 1] = "True"; + ExtendsResult[ExtendsResult["False"] = 2] = "False"; +})(ExtendsResult || (exports.ExtendsResult = ExtendsResult = {})); +// ------------------------------------------------------------------ +// IntoBooleanResult +// ------------------------------------------------------------------ +// prettier-ignore +function IntoBooleanResult(result) { + return result === ExtendsResult.False ? result : ExtendsResult.True; +} +// ------------------------------------------------------------------ +// Throw +// ------------------------------------------------------------------ +// prettier-ignore +function Throw(message) { + throw new ExtendsResolverError(message); +} +// ------------------------------------------------------------------ +// StructuralRight +// ------------------------------------------------------------------ +// prettier-ignore +function IsStructuralRight(right) { + return (index_10.TypeGuard.IsNever(right) || + index_10.TypeGuard.IsIntersect(right) || + index_10.TypeGuard.IsUnion(right) || + index_10.TypeGuard.IsUnknown(right) || + index_10.TypeGuard.IsAny(right)); +} +// prettier-ignore +function StructuralRight(left, right) { + return (index_10.TypeGuard.IsNever(right) ? FromNeverRight(left, right) : + index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + index_10.TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : + index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + Throw('StructuralRight')); +} +// ------------------------------------------------------------------ +// Any +// ------------------------------------------------------------------ +// prettier-ignore +function FromAnyRight(left, right) { + return ExtendsResult.True; +} +// prettier-ignore +function FromAny(left, right) { + return (index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + (index_10.TypeGuard.IsUnion(right) && right.anyOf.some((schema) => index_10.TypeGuard.IsAny(schema) || index_10.TypeGuard.IsUnknown(schema))) ? ExtendsResult.True : + index_10.TypeGuard.IsUnion(right) ? ExtendsResult.Union : + index_10.TypeGuard.IsUnknown(right) ? ExtendsResult.True : + index_10.TypeGuard.IsAny(right) ? ExtendsResult.True : + ExtendsResult.Union); +} +// ------------------------------------------------------------------ +// Array +// ------------------------------------------------------------------ +// prettier-ignore +function FromArrayRight(left, right) { + return (index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : + index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : + index_10.TypeGuard.IsNever(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromArray(left, right) { + return (index_10.TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + !index_10.TypeGuard.IsArray(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// AsyncIterator +// ------------------------------------------------------------------ +// prettier-ignore +function FromAsyncIterator(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !index_10.TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// BigInt +// ------------------------------------------------------------------ +// prettier-ignore +function FromBigInt(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsBigInt(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Boolean +// ------------------------------------------------------------------ +// prettier-ignore +function FromBooleanRight(left, right) { + return (index_10.TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True : + index_10.TypeGuard.IsBoolean(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromBoolean(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsBoolean(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Constructor +// ------------------------------------------------------------------ +// prettier-ignore +function FromConstructor(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !index_10.TypeGuard.IsConstructor(right) ? ExtendsResult.False : + left.parameters.length > right.parameters.length ? ExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); +} +// ------------------------------------------------------------------ +// Date +// ------------------------------------------------------------------ +// prettier-ignore +function FromDate(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsDate(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Function +// ------------------------------------------------------------------ +// prettier-ignore +function FromFunction(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !index_10.TypeGuard.IsFunction(right) ? ExtendsResult.False : + left.parameters.length > right.parameters.length ? ExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); +} +// ------------------------------------------------------------------ +// Integer +// ------------------------------------------------------------------ +// prettier-ignore +function FromIntegerRight(left, right) { + return (index_10.TypeGuard.IsLiteral(left) && index_10.ValueGuard.IsNumber(left.const) ? ExtendsResult.True : + index_10.TypeGuard.IsNumber(left) || index_10.TypeGuard.IsInteger(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromInteger(left, right) { + return (index_10.TypeGuard.IsInteger(right) || index_10.TypeGuard.IsNumber(right) ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Intersect +// ------------------------------------------------------------------ +// prettier-ignore +function FromIntersectRight(left, right) { + return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// prettier-ignore +function FromIntersect(left, right) { + return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// ------------------------------------------------------------------ +// Iterator +// ------------------------------------------------------------------ +// prettier-ignore +function FromIterator(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !index_10.TypeGuard.IsIterator(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// Literal +// ------------------------------------------------------------------ +// prettier-ignore +function FromLiteral(left, right) { + return (index_10.TypeGuard.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsString(right) ? FromStringRight(left, right) : + index_10.TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : + index_10.TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : + index_10.TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Never +// ------------------------------------------------------------------ +// prettier-ignore +function FromNeverRight(left, right) { + return ExtendsResult.False; +} +// prettier-ignore +function FromNever(left, right) { + return ExtendsResult.True; +} +// ------------------------------------------------------------------ +// Not +// ------------------------------------------------------------------ +// prettier-ignore +function UnwrapTNot(schema) { + let [current, depth] = [schema, 0]; + while (true) { + if (!index_10.TypeGuard.IsNot(current)) + break; + current = current.not; + depth += 1; + } + return depth % 2 === 0 ? current : (0, index_5.Unknown)(); +} +// prettier-ignore +function FromNot(left, right) { + // TypeScript has no concept of negated types, and attempts to correctly check the negated + // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer + // the type. Instead we unwrap to either unknown or T and continue evaluating. + // prettier-ignore + return (index_10.TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) : + index_10.TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) : + Throw('Invalid fallthrough for Not')); +} +// ------------------------------------------------------------------ +// Null +// ------------------------------------------------------------------ +// prettier-ignore +function FromNull(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsNull(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +// prettier-ignore +function FromNumberRight(left, right) { + return (index_10.TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True : + index_10.TypeGuard.IsNumber(left) || index_10.TypeGuard.IsInteger(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromNumber(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsInteger(right) || index_10.TypeGuard.IsNumber(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Object +// ------------------------------------------------------------------ +// prettier-ignore +function IsObjectPropertyCount(schema, count) { + return Object.getOwnPropertyNames(schema.properties).length === count; +} +// prettier-ignore +function IsObjectStringLike(schema) { + return IsObjectArrayLike(schema); +} +// prettier-ignore +function IsObjectSymbolLike(schema) { + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && index_10.TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((index_10.TypeGuard.IsString(schema.properties.description.anyOf[0]) && + index_10.TypeGuard.IsUndefined(schema.properties.description.anyOf[1])) || (index_10.TypeGuard.IsString(schema.properties.description.anyOf[1]) && + index_10.TypeGuard.IsUndefined(schema.properties.description.anyOf[0])))); +} +// prettier-ignore +function IsObjectNumberLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectBooleanLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectBigIntLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectDateLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectUint8ArrayLike(schema) { + return IsObjectArrayLike(schema); +} +// prettier-ignore +function IsObjectFunctionLike(schema) { + const length = (0, index_3.Number)(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True); +} +// prettier-ignore +function IsObjectConstructorLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectArrayLike(schema) { + const length = (0, index_3.Number)(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True); +} +// prettier-ignore +function IsObjectPromiseLike(schema) { + const then = (0, index_2.Function)([(0, index_1.Any)()], (0, index_1.Any)()); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True); +} +// ------------------------------------------------------------------ +// Property +// ------------------------------------------------------------------ +// prettier-ignore +function Property(left, right) { + return (Visit(left, right) === ExtendsResult.False ? ExtendsResult.False : + index_10.TypeGuard.IsOptional(left) && !index_10.TypeGuard.IsOptional(right) ? ExtendsResult.False : + ExtendsResult.True); +} +// prettier-ignore +function FromObjectRight(left, right) { + return (index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : + index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : (index_10.TypeGuard.IsNever(left) || + (index_10.TypeGuard.IsLiteralString(left) && IsObjectStringLike(right)) || + (index_10.TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right)) || + (index_10.TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right)) || + (index_10.TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) || + (index_10.TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right)) || + (index_10.TypeGuard.IsString(left) && IsObjectStringLike(right)) || + (index_10.TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) || + (index_10.TypeGuard.IsNumber(left) && IsObjectNumberLike(right)) || + (index_10.TypeGuard.IsInteger(left) && IsObjectNumberLike(right)) || + (index_10.TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right)) || + (index_10.TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right)) || + (index_10.TypeGuard.IsDate(left) && IsObjectDateLike(right)) || + (index_10.TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right)) || + (index_10.TypeGuard.IsFunction(left) && IsObjectFunctionLike(right))) ? ExtendsResult.True : + (index_10.TypeGuard.IsRecord(left) && index_10.TypeGuard.IsString(RecordKey(left))) ? (() => { + // When expressing a Record with literal key values, the Record is converted into a Object with + // the Hint assigned as `Record`. This is used to invert the extends logic. + return right[index_8.Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False; + })() : + (index_10.TypeGuard.IsRecord(left) && index_10.TypeGuard.IsNumber(RecordKey(left))) ? (() => { + return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False; + })() : + ExtendsResult.False); +} +// prettier-ignore +function FromObject(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + !index_10.TypeGuard.IsObject(right) ? ExtendsResult.False : + (() => { + for (const key of Object.getOwnPropertyNames(right.properties)) { + if (!(key in left.properties) && !index_10.TypeGuard.IsOptional(right.properties[key])) { + return ExtendsResult.False; + } + if (index_10.TypeGuard.IsOptional(right.properties[key])) { + return ExtendsResult.True; + } + if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) { + return ExtendsResult.False; + } + } + return ExtendsResult.True; + })()); +} +// ------------------------------------------------------------------ +// Promise +// ------------------------------------------------------------------ +// prettier-ignore +function FromPromise(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : + !index_10.TypeGuard.IsPromise(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.item, right.item))); +} +// ------------------------------------------------------------------ +// Record +// ------------------------------------------------------------------ +// prettier-ignore +function RecordKey(schema) { + return (index_7.PatternNumberExact in schema.patternProperties ? (0, index_3.Number)() : + index_7.PatternStringExact in schema.patternProperties ? (0, index_4.String)() : + Throw('Unknown record key pattern')); +} +// prettier-ignore +function RecordValue(schema) { + return (index_7.PatternNumberExact in schema.patternProperties ? schema.patternProperties[index_7.PatternNumberExact] : + index_7.PatternStringExact in schema.patternProperties ? schema.patternProperties[index_7.PatternStringExact] : + Throw('Unable to get record value schema')); +} +// prettier-ignore +function FromRecordRight(left, right) { + const [Key, Value] = [RecordKey(right), RecordValue(right)]; + return ((index_10.TypeGuard.IsLiteralString(left) && index_10.TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True) ? ExtendsResult.True : + index_10.TypeGuard.IsUint8Array(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : + index_10.TypeGuard.IsString(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : + index_10.TypeGuard.IsArray(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : + index_10.TypeGuard.IsObject(left) ? (() => { + for (const key of Object.getOwnPropertyNames(left.properties)) { + if (Property(Value, left.properties[key]) === ExtendsResult.False) { + return ExtendsResult.False; + } + } + return ExtendsResult.True; + })() : + ExtendsResult.False); +} +// prettier-ignore +function FromRecord(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !index_10.TypeGuard.IsRecord(right) ? ExtendsResult.False : + Visit(RecordValue(left), RecordValue(right))); +} +// ------------------------------------------------------------------ +// RegExp +// ------------------------------------------------------------------ +// prettier-ignore +function FromRegExp(left, right) { + // Note: RegExp types evaluate as strings, not RegExp objects. + // Here we remap either into string and continue evaluating. + const L = index_10.TypeGuard.IsRegExp(left) ? (0, index_4.String)() : left; + const R = index_10.TypeGuard.IsRegExp(right) ? (0, index_4.String)() : right; + return Visit(L, R); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function FromStringRight(left, right) { + return (index_10.TypeGuard.IsLiteral(left) && index_10.ValueGuard.IsString(left.const) ? ExtendsResult.True : + index_10.TypeGuard.IsString(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromString(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsString(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Symbol +// ------------------------------------------------------------------ +// prettier-ignore +function FromSymbol(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsSymbol(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// TemplateLiteral +// ------------------------------------------------------------------ +// prettier-ignore +function FromTemplateLiteral(left, right) { + // TemplateLiteral types are resolved to either unions for finite expressions or string + // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for + // either type and continue evaluating. + return (index_10.TypeGuard.IsTemplateLiteral(left) ? Visit((0, index_6.TemplateLiteralToUnion)(left), right) : + index_10.TypeGuard.IsTemplateLiteral(right) ? Visit(left, (0, index_6.TemplateLiteralToUnion)(right)) : + Throw('Invalid fallthrough for TemplateLiteral')); +} +// ------------------------------------------------------------------ +// Tuple +// ------------------------------------------------------------------ +// prettier-ignore +function IsArrayOfTuple(left, right) { + return (index_10.TypeGuard.IsArray(right) && + left.items !== undefined && + left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True)); +} +// prettier-ignore +function FromTupleRight(left, right) { + return (index_10.TypeGuard.IsNever(left) ? ExtendsResult.True : + index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : + index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : + ExtendsResult.False); +} +// prettier-ignore +function FromTuple(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : + index_10.TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : + !index_10.TypeGuard.IsTuple(right) ? ExtendsResult.False : + (index_10.ValueGuard.IsUndefined(left.items) && !index_10.ValueGuard.IsUndefined(right.items)) || (!index_10.ValueGuard.IsUndefined(left.items) && index_10.ValueGuard.IsUndefined(right.items)) ? ExtendsResult.False : + (index_10.ValueGuard.IsUndefined(left.items) && !index_10.ValueGuard.IsUndefined(right.items)) ? ExtendsResult.True : + left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Uint8Array +// ------------------------------------------------------------------ +// prettier-ignore +function FromUint8Array(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsUint8Array(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Undefined +// ------------------------------------------------------------------ +// prettier-ignore +function FromUndefined(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + index_10.TypeGuard.IsVoid(right) ? FromVoidRight(left, right) : + index_10.TypeGuard.IsUndefined(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Union +// ------------------------------------------------------------------ +// prettier-ignore +function FromUnionRight(left, right) { + return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// prettier-ignore +function FromUnion(left, right) { + return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// ------------------------------------------------------------------ +// Unknown +// ------------------------------------------------------------------ +// prettier-ignore +function FromUnknownRight(left, right) { + return ExtendsResult.True; +} +// prettier-ignore +function FromUnknown(left, right) { + return (index_10.TypeGuard.IsNever(right) ? FromNeverRight(left, right) : + index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + index_10.TypeGuard.IsString(right) ? FromStringRight(left, right) : + index_10.TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : + index_10.TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : + index_10.TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : + index_10.TypeGuard.IsArray(right) ? FromArrayRight(left, right) : + index_10.TypeGuard.IsTuple(right) ? FromTupleRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsUnknown(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Void +// ------------------------------------------------------------------ +// prettier-ignore +function FromVoidRight(left, right) { + return (index_10.TypeGuard.IsUndefined(left) ? ExtendsResult.True : + index_10.TypeGuard.IsUndefined(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromVoid(left, right) { + return (index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + index_10.TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : + index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + index_10.TypeGuard.IsVoid(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function Visit(left, right) { + return ( + // resolvable + (index_10.TypeGuard.IsTemplateLiteral(left) || index_10.TypeGuard.IsTemplateLiteral(right)) ? FromTemplateLiteral(left, right) : + (index_10.TypeGuard.IsRegExp(left) || index_10.TypeGuard.IsRegExp(right)) ? FromRegExp(left, right) : + (index_10.TypeGuard.IsNot(left) || index_10.TypeGuard.IsNot(right)) ? FromNot(left, right) : + // standard + index_10.TypeGuard.IsAny(left) ? FromAny(left, right) : + index_10.TypeGuard.IsArray(left) ? FromArray(left, right) : + index_10.TypeGuard.IsBigInt(left) ? FromBigInt(left, right) : + index_10.TypeGuard.IsBoolean(left) ? FromBoolean(left, right) : + index_10.TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : + index_10.TypeGuard.IsConstructor(left) ? FromConstructor(left, right) : + index_10.TypeGuard.IsDate(left) ? FromDate(left, right) : + index_10.TypeGuard.IsFunction(left) ? FromFunction(left, right) : + index_10.TypeGuard.IsInteger(left) ? FromInteger(left, right) : + index_10.TypeGuard.IsIntersect(left) ? FromIntersect(left, right) : + index_10.TypeGuard.IsIterator(left) ? FromIterator(left, right) : + index_10.TypeGuard.IsLiteral(left) ? FromLiteral(left, right) : + index_10.TypeGuard.IsNever(left) ? FromNever(left, right) : + index_10.TypeGuard.IsNull(left) ? FromNull(left, right) : + index_10.TypeGuard.IsNumber(left) ? FromNumber(left, right) : + index_10.TypeGuard.IsObject(left) ? FromObject(left, right) : + index_10.TypeGuard.IsRecord(left) ? FromRecord(left, right) : + index_10.TypeGuard.IsString(left) ? FromString(left, right) : + index_10.TypeGuard.IsSymbol(left) ? FromSymbol(left, right) : + index_10.TypeGuard.IsTuple(left) ? FromTuple(left, right) : + index_10.TypeGuard.IsPromise(left) ? FromPromise(left, right) : + index_10.TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) : + index_10.TypeGuard.IsUndefined(left) ? FromUndefined(left, right) : + index_10.TypeGuard.IsUnion(left) ? FromUnion(left, right) : + index_10.TypeGuard.IsUnknown(left) ? FromUnknown(left, right) : + index_10.TypeGuard.IsVoid(left) ? FromVoid(left, right) : + Throw(`Unknown left type operand '${left[index_8.Kind]}'`)); +} +function ExtendsCheck(left, right) { + return Visit(left, right); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.d.ts new file mode 100644 index 00000000..fd13786d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.d.ts @@ -0,0 +1,14 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import type { Assert } from '../helpers/index'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TExtends } from './extends'; +type TFromPropertyKey = { + [_ in K]: TExtends>, U, L, R>; +}; +type TFromPropertyKeys = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys> : Acc); +type TFromMappedKey = (TFromPropertyKeys); +export type TExtendsFromMappedKey> = (TMappedResult

); +export declare function ExtendsFromMappedKey>(T: T, U: U, L: L, R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.js new file mode 100644 index 00000000..8c388f9d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-key.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtendsFromMappedKey = ExtendsFromMappedKey; +const index_1 = require("../mapped/index"); +const index_2 = require("../literal/index"); +const extends_1 = require("./extends"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromPropertyKey(K, U, L, R, options) { + return { + [K]: (0, extends_1.Extends)((0, index_2.Literal)(K), U, L, R, (0, value_1.Clone)(options)) + }; +} +// prettier-ignore +function FromPropertyKeys(K, U, L, R, options) { + return K.reduce((Acc, LK) => { + return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(K, U, L, R, options) { + return FromPropertyKeys(K.keys, U, L, R, options); +} +// prettier-ignore +function ExtendsFromMappedKey(T, U, L, R, options) { + const P = FromMappedKey(T, U, L, R, options); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.d.ts new file mode 100644 index 00000000..5c68a2fb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.d.ts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TExtends } from './extends'; +type TFromProperties

= ({ + [K2 in keyof P]: TExtends; +}); +type TFromMappedResult = (TFromProperties); +export type TExtendsFromMappedResult> = (TMappedResult

); +export declare function ExtendsFromMappedResult>(Left: Left, Right: Right, True: True, False: False, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.js new file mode 100644 index 00000000..1585c110 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-from-mapped-result.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtendsFromMappedResult = ExtendsFromMappedResult; +const index_1 = require("../mapped/index"); +const extends_1 = require("./extends"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromProperties(P, Right, True, False, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = (0, extends_1.Extends)(P[K2], Right, True, False, (0, value_1.Clone)(options)); + return Acc; +} +// prettier-ignore +function FromMappedResult(Left, Right, True, False, options) { + return FromProperties(Left.properties, Right, True, False, options); +} +// prettier-ignore +function ExtendsFromMappedResult(Left, Right, True, False, options) { + const P = FromMappedResult(Left, Right, True, False, options); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.d.ts new file mode 100644 index 00000000..e6416ffc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.d.ts @@ -0,0 +1,3 @@ +import type { TSchema } from '../schema/index'; +/** Fast undefined check used for properties of type undefined */ +export declare function ExtendsUndefinedCheck(schema: TSchema): boolean; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.js new file mode 100644 index 00000000..f8f55db7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends-undefined.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtendsUndefinedCheck = ExtendsUndefinedCheck; +const index_1 = require("../symbols/index"); +/** Fast undefined check used for properties of type undefined */ +function Intersect(schema) { + return schema.allOf.every((schema) => ExtendsUndefinedCheck(schema)); +} +function Union(schema) { + return schema.anyOf.some((schema) => ExtendsUndefinedCheck(schema)); +} +function Not(schema) { + return !ExtendsUndefinedCheck(schema.not); +} +/** Fast undefined check used for properties of type undefined */ +// prettier-ignore +function ExtendsUndefinedCheck(schema) { + return (schema[index_1.Kind] === 'Intersect' ? Intersect(schema) : + schema[index_1.Kind] === 'Union' ? Union(schema) : + schema[index_1.Kind] === 'Not' ? Not(schema) : + schema[index_1.Kind] === 'Undefined' ? true : + false); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.d.ts new file mode 100644 index 00000000..6f05d9f5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { type TUnion } from '../union/index'; +import { TMappedKey, TMappedResult } from '../mapped/index'; +import { UnionToTuple } from '../helpers/index'; +import { type TExtendsFromMappedKey } from './extends-from-mapped-key'; +import { type TExtendsFromMappedResult } from './extends-from-mapped-result'; +type TExtendsResolve = ((Static extends Static ? T : U) extends infer O extends TSchema ? UnionToTuple extends [infer X extends TSchema, infer Y extends TSchema] ? TUnion<[X, Y]> : O : never); +export type TExtends = TExtendsResolve; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.js new file mode 100644 index 00000000..089bdbf0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/extends.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Extends = Extends; +const type_1 = require("../create/type"); +const index_1 = require("../union/index"); +const extends_check_1 = require("./extends-check"); +const extends_from_mapped_key_1 = require("./extends-from-mapped-key"); +const extends_from_mapped_result_1 = require("./extends-from-mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function ExtendsResolve(left, right, trueType, falseType) { + const R = (0, extends_check_1.ExtendsCheck)(left, right); + return (R === extends_check_1.ExtendsResult.Union ? (0, index_1.Union)([trueType, falseType]) : + R === extends_check_1.ExtendsResult.True ? trueType : + falseType); +} +/** `[Json]` Creates a Conditional type */ +function Extends(L, R, T, F, options) { + // prettier-ignore + return ((0, kind_1.IsMappedResult)(L) ? (0, extends_from_mapped_result_1.ExtendsFromMappedResult)(L, R, T, F, options) : + (0, kind_1.IsMappedKey)(L) ? (0, type_1.CreateType)((0, extends_from_mapped_key_1.ExtendsFromMappedKey)(L, R, T, F, options)) : + (0, type_1.CreateType)(ExtendsResolve(L, R, T, F), options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extends/index.d.ts new file mode 100644 index 00000000..47fd51dc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/index.d.ts @@ -0,0 +1,5 @@ +export * from './extends-check'; +export * from './extends-from-mapped-key'; +export * from './extends-from-mapped-result'; +export * from './extends-undefined'; +export * from './extends'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extends/index.js b/node_modules/@sinclair/typebox/build/cjs/type/extends/index.js new file mode 100644 index 00000000..515be08b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extends/index.js @@ -0,0 +1,22 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./extends-check"), exports); +__exportStar(require("./extends-from-mapped-key"), exports); +__exportStar(require("./extends-from-mapped-result"), exports); +__exportStar(require("./extends-undefined"), exports); +__exportStar(require("./extends"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.d.ts new file mode 100644 index 00000000..47feabbd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.d.ts @@ -0,0 +1,11 @@ +import type { TSchema } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TExtract } from './extract'; +type TFromProperties

= ({ + [K2 in keyof P]: TExtract; +}); +type TFromMappedResult = (TFromProperties); +export type TExtractFromMappedResult> = (TMappedResult

); +export declare function ExtractFromMappedResult>(R: R, T: T): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.js new file mode 100644 index 00000000..797d9f9b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-mapped-result.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtractFromMappedResult = ExtractFromMappedResult; +const index_1 = require("../mapped/index"); +const extract_1 = require("./extract"); +// prettier-ignore +function FromProperties(P, T) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = (0, extract_1.Extract)(P[K2], T); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, T) { + return FromProperties(R.properties, T); +} +// prettier-ignore +function ExtractFromMappedResult(R, T) { + const P = FromMappedResult(R, T); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.d.ts new file mode 100644 index 00000000..1711ebc3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.d.ts @@ -0,0 +1,5 @@ +import type { TSchema } from '../schema/index'; +import { type TExtract } from './extract'; +import { type TTemplateLiteral, type TTemplateLiteralToUnion } from '../template-literal/index'; +export type TExtractFromTemplateLiteral = (TExtract, R>); +export declare function ExtractFromTemplateLiteral(L: L, R: R): TExtractFromTemplateLiteral; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.js b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.js new file mode 100644 index 00000000..e1a840e7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract-from-template-literal.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtractFromTemplateLiteral = ExtractFromTemplateLiteral; +const extract_1 = require("./extract"); +const index_1 = require("../template-literal/index"); +function ExtractFromTemplateLiteral(L, R) { + return (0, extract_1.Extract)((0, index_1.TemplateLiteralToUnion)(L), R); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.d.ts new file mode 100644 index 00000000..dc0e24b5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.d.ts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { AssertRest, AssertType, UnionToTuple } from '../helpers/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TUnion } from '../union/index'; +import { type Static } from '../static/index'; +import { type TNever } from '../never/index'; +import { type TUnionEvaluated } from '../union/index'; +import { type TTemplateLiteral } from '../template-literal/index'; +import { type TExtractFromMappedResult } from './extract-from-mapped-result'; +import { type TExtractFromTemplateLiteral } from './extract-from-template-literal'; +type TExtractRest = AssertRest> extends Static ? L[K] : never; +}[number]>> extends infer R extends TSchema[] ? TUnionEvaluated : never; +export type TExtract = (L extends TUnion ? TExtractRest : L extends U ? L : TNever); +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult; +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtractFromTemplateLiteral; +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtract; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.js b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.js new file mode 100644 index 00000000..bf8359aa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/extract.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Extract = Extract; +const type_1 = require("../create/type"); +const index_1 = require("../union/index"); +const index_2 = require("../never/index"); +const index_3 = require("../extends/index"); +const extract_from_mapped_result_1 = require("./extract-from-mapped-result"); +const extract_from_template_literal_1 = require("./extract-from-template-literal"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +function ExtractRest(L, R) { + const extracted = L.filter((inner) => (0, index_3.ExtendsCheck)(inner, R) !== index_3.ExtendsResult.False); + return extracted.length === 1 ? extracted[0] : (0, index_1.Union)(extracted); +} +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +function Extract(L, R, options) { + // overloads + if ((0, kind_1.IsTemplateLiteral)(L)) + return (0, type_1.CreateType)((0, extract_from_template_literal_1.ExtractFromTemplateLiteral)(L, R), options); + if ((0, kind_1.IsMappedResult)(L)) + return (0, type_1.CreateType)((0, extract_from_mapped_result_1.ExtractFromMappedResult)(L, R), options); + // prettier-ignore + return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExtractRest(L.anyOf, R) : + (0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? L : (0, index_2.Never)(), options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/extract/index.d.ts new file mode 100644 index 00000000..4ab04641 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/index.d.ts @@ -0,0 +1,3 @@ +export * from './extract-from-mapped-result'; +export * from './extract-from-template-literal'; +export * from './extract'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/extract/index.js b/node_modules/@sinclair/typebox/build/cjs/type/extract/index.js new file mode 100644 index 00000000..00b6395c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/extract/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./extract-from-mapped-result"), exports); +__exportStar(require("./extract-from-template-literal"), exports); +__exportStar(require("./extract"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/function/function.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/function/function.d.ts new file mode 100644 index 00000000..8b7ef9b8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/function/function.d.ts @@ -0,0 +1,23 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import type { Ensure } from '../helpers/index'; +import type { TReadonlyOptional } from '../readonly-optional/index'; +import type { TReadonly } from '../readonly/index'; +import type { TOptional } from '../optional/index'; +import { Kind } from '../symbols/index'; +type StaticReturnType = Static; +type StaticParameter = T extends TReadonlyOptional ? [Readonly>?] : T extends TReadonly ? [Readonly>] : T extends TOptional ? [Static?] : [ + Static +]; +type StaticParameters = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters]> : Acc); +type StaticFunction = Ensure<(...param: StaticParameters) => StaticReturnType>; +export interface TFunction extends TSchema { + [Kind]: 'Function'; + static: StaticFunction; + type: 'Function'; + parameters: T; + returns: U; +} +/** `[JavaScript]` Creates a Function type */ +export declare function Function(parameters: [...T], returns: U, options?: SchemaOptions): TFunction; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/function/function.js b/node_modules/@sinclair/typebox/build/cjs/type/function/function.js new file mode 100644 index 00000000..3e9a1266 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/function/function.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Function = Function; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Function type */ +function Function(parameters, returns, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Function', type: 'Function', parameters, returns }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/function/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/function/index.d.ts new file mode 100644 index 00000000..2653adb2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/function/index.d.ts @@ -0,0 +1 @@ +export * from './function'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/function/index.js b/node_modules/@sinclair/typebox/build/cjs/type/function/index.js new file mode 100644 index 00000000..f822c4cf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/function/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./function"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/guard/index.d.ts new file mode 100644 index 00000000..8e914a27 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/index.d.ts @@ -0,0 +1,3 @@ +export * as KindGuard from './kind'; +export * as TypeGuard from './type'; +export * as ValueGuard from './value'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/index.js b/node_modules/@sinclair/typebox/build/cjs/type/guard/index.js new file mode 100644 index 00000000..d327b4fb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/index.js @@ -0,0 +1,40 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueGuard = exports.TypeGuard = exports.KindGuard = void 0; +exports.KindGuard = __importStar(require("./kind")); +exports.TypeGuard = __importStar(require("./type")); +exports.ValueGuard = __importStar(require("./value")); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.d.ts new file mode 100644 index 00000000..aa5b6add --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.d.ts @@ -0,0 +1,147 @@ +import { Kind, Hint, TransformKind } from '../symbols/index'; +import { TransformOptions } from '../transform/index'; +import type { TAny } from '../any/index'; +import type { TArgument } from '../argument/index'; +import type { TArray } from '../array/index'; +import type { TAsyncIterator } from '../async-iterator/index'; +import type { TBoolean } from '../boolean/index'; +import type { TComputed } from '../computed/index'; +import type { TBigInt } from '../bigint/index'; +import type { TConstructor } from '../constructor/index'; +import type { TFunction } from '../function/index'; +import type { TImport } from '../module/index'; +import type { TInteger } from '../integer/index'; +import type { TIntersect } from '../intersect/index'; +import type { TIterator } from '../iterator/index'; +import type { TLiteral, TLiteralValue } from '../literal/index'; +import type { TMappedKey, TMappedResult } from '../mapped/index'; +import type { TNever } from '../never/index'; +import type { TNot } from '../not/index'; +import type { TNull } from '../null/index'; +import type { TNumber } from '../number/index'; +import type { TObject, TProperties } from '../object/index'; +import type { TOptional } from '../optional/index'; +import type { TPromise } from '../promise/index'; +import type { TReadonly } from '../readonly/index'; +import type { TRecord } from '../record/index'; +import type { TRef } from '../ref/index'; +import type { TRegExp } from '../regexp/index'; +import type { TSchema } from '../schema/index'; +import type { TString } from '../string/index'; +import type { TSymbol } from '../symbol/index'; +import type { TTemplateLiteral } from '../template-literal/index'; +import type { TTuple } from '../tuple/index'; +import type { TUint8Array } from '../uint8array/index'; +import type { TUndefined } from '../undefined/index'; +import type { TUnknown } from '../unknown/index'; +import type { TUnion } from '../union/index'; +import type { TUnsafe } from '../unsafe/index'; +import type { TVoid } from '../void/index'; +import type { TDate } from '../date/index'; +import type { TThis } from '../recursive/index'; +/** `[Kind-Only]` Returns true if this value has a Readonly symbol */ +export declare function IsReadonly(value: T): value is TReadonly; +/** `[Kind-Only]` Returns true if this value has a Optional symbol */ +export declare function IsOptional(value: T): value is TOptional; +/** `[Kind-Only]` Returns true if the given value is TAny */ +export declare function IsAny(value: unknown): value is TAny; +/** `[Kind-Only]` Returns true if the given value is TArgument */ +export declare function IsArgument(value: unknown): value is TArgument; +/** `[Kind-Only]` Returns true if the given value is TArray */ +export declare function IsArray(value: unknown): value is TArray; +/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */ +export declare function IsAsyncIterator(value: unknown): value is TAsyncIterator; +/** `[Kind-Only]` Returns true if the given value is TBigInt */ +export declare function IsBigInt(value: unknown): value is TBigInt; +/** `[Kind-Only]` Returns true if the given value is TBoolean */ +export declare function IsBoolean(value: unknown): value is TBoolean; +/** `[Kind-Only]` Returns true if the given value is TComputed */ +export declare function IsComputed(value: unknown): value is TComputed; +/** `[Kind-Only]` Returns true if the given value is TConstructor */ +export declare function IsConstructor(value: unknown): value is TConstructor; +/** `[Kind-Only]` Returns true if the given value is TDate */ +export declare function IsDate(value: unknown): value is TDate; +/** `[Kind-Only]` Returns true if the given value is TFunction */ +export declare function IsFunction(value: unknown): value is TFunction; +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export declare function IsImport(value: unknown): value is TImport; +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export declare function IsInteger(value: unknown): value is TInteger; +/** `[Kind-Only]` Returns true if the given schema is TProperties */ +export declare function IsProperties(value: unknown): value is TProperties; +/** `[Kind-Only]` Returns true if the given value is TIntersect */ +export declare function IsIntersect(value: unknown): value is TIntersect; +/** `[Kind-Only]` Returns true if the given value is TIterator */ +export declare function IsIterator(value: unknown): value is TIterator; +/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */ +export declare function IsKindOf(value: unknown, kind: T): value is Record & { + [Kind]: T; +}; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralString(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralNumber(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralBoolean(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteralValue */ +export declare function IsLiteralValue(value: unknown): value is TLiteralValue; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteral(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is a TMappedKey */ +export declare function IsMappedKey(value: unknown): value is TMappedKey; +/** `[Kind-Only]` Returns true if the given value is TMappedResult */ +export declare function IsMappedResult(value: unknown): value is TMappedResult; +/** `[Kind-Only]` Returns true if the given value is TNever */ +export declare function IsNever(value: unknown): value is TNever; +/** `[Kind-Only]` Returns true if the given value is TNot */ +export declare function IsNot(value: unknown): value is TNot; +/** `[Kind-Only]` Returns true if the given value is TNull */ +export declare function IsNull(value: unknown): value is TNull; +/** `[Kind-Only]` Returns true if the given value is TNumber */ +export declare function IsNumber(value: unknown): value is TNumber; +/** `[Kind-Only]` Returns true if the given value is TObject */ +export declare function IsObject(value: unknown): value is TObject; +/** `[Kind-Only]` Returns true if the given value is TPromise */ +export declare function IsPromise(value: unknown): value is TPromise; +/** `[Kind-Only]` Returns true if the given value is TRecord */ +export declare function IsRecord(value: unknown): value is TRecord; +/** `[Kind-Only]` Returns true if this value is TRecursive */ +export declare function IsRecursive(value: unknown): value is { + [Hint]: 'Recursive'; +}; +/** `[Kind-Only]` Returns true if the given value is TRef */ +export declare function IsRef(value: unknown): value is TRef; +/** `[Kind-Only]` Returns true if the given value is TRegExp */ +export declare function IsRegExp(value: unknown): value is TRegExp; +/** `[Kind-Only]` Returns true if the given value is TString */ +export declare function IsString(value: unknown): value is TString; +/** `[Kind-Only]` Returns true if the given value is TSymbol */ +export declare function IsSymbol(value: unknown): value is TSymbol; +/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */ +export declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral; +/** `[Kind-Only]` Returns true if the given value is TThis */ +export declare function IsThis(value: unknown): value is TThis; +/** `[Kind-Only]` Returns true of this value is TTransform */ +export declare function IsTransform(value: unknown): value is { + [TransformKind]: TransformOptions; +}; +/** `[Kind-Only]` Returns true if the given value is TTuple */ +export declare function IsTuple(value: unknown): value is TTuple; +/** `[Kind-Only]` Returns true if the given value is TUndefined */ +export declare function IsUndefined(value: unknown): value is TUndefined; +/** `[Kind-Only]` Returns true if the given value is TUnion */ +export declare function IsUnion(value: unknown): value is TUnion; +/** `[Kind-Only]` Returns true if the given value is TUint8Array */ +export declare function IsUint8Array(value: unknown): value is TUint8Array; +/** `[Kind-Only]` Returns true if the given value is TUnknown */ +export declare function IsUnknown(value: unknown): value is TUnknown; +/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */ +export declare function IsUnsafe(value: unknown): value is TUnsafe; +/** `[Kind-Only]` Returns true if the given value is TVoid */ +export declare function IsVoid(value: unknown): value is TVoid; +/** `[Kind-Only]` Returns true if the given value is TKind */ +export declare function IsKind(value: unknown): value is Record & { + [Kind]: string; +}; +/** `[Kind-Only]` Returns true if the given value is TSchema */ +export declare function IsSchema(value: unknown): value is TSchema; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.js b/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.js new file mode 100644 index 00000000..ec65509b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/kind.js @@ -0,0 +1,320 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IsReadonly = IsReadonly; +exports.IsOptional = IsOptional; +exports.IsAny = IsAny; +exports.IsArgument = IsArgument; +exports.IsArray = IsArray; +exports.IsAsyncIterator = IsAsyncIterator; +exports.IsBigInt = IsBigInt; +exports.IsBoolean = IsBoolean; +exports.IsComputed = IsComputed; +exports.IsConstructor = IsConstructor; +exports.IsDate = IsDate; +exports.IsFunction = IsFunction; +exports.IsImport = IsImport; +exports.IsInteger = IsInteger; +exports.IsProperties = IsProperties; +exports.IsIntersect = IsIntersect; +exports.IsIterator = IsIterator; +exports.IsKindOf = IsKindOf; +exports.IsLiteralString = IsLiteralString; +exports.IsLiteralNumber = IsLiteralNumber; +exports.IsLiteralBoolean = IsLiteralBoolean; +exports.IsLiteralValue = IsLiteralValue; +exports.IsLiteral = IsLiteral; +exports.IsMappedKey = IsMappedKey; +exports.IsMappedResult = IsMappedResult; +exports.IsNever = IsNever; +exports.IsNot = IsNot; +exports.IsNull = IsNull; +exports.IsNumber = IsNumber; +exports.IsObject = IsObject; +exports.IsPromise = IsPromise; +exports.IsRecord = IsRecord; +exports.IsRecursive = IsRecursive; +exports.IsRef = IsRef; +exports.IsRegExp = IsRegExp; +exports.IsString = IsString; +exports.IsSymbol = IsSymbol; +exports.IsTemplateLiteral = IsTemplateLiteral; +exports.IsThis = IsThis; +exports.IsTransform = IsTransform; +exports.IsTuple = IsTuple; +exports.IsUndefined = IsUndefined; +exports.IsUnion = IsUnion; +exports.IsUint8Array = IsUint8Array; +exports.IsUnknown = IsUnknown; +exports.IsUnsafe = IsUnsafe; +exports.IsVoid = IsVoid; +exports.IsKind = IsKind; +exports.IsSchema = IsSchema; +const ValueGuard = __importStar(require("./value")); +const index_1 = require("../symbols/index"); +/** `[Kind-Only]` Returns true if this value has a Readonly symbol */ +function IsReadonly(value) { + return ValueGuard.IsObject(value) && value[index_1.ReadonlyKind] === 'Readonly'; +} +/** `[Kind-Only]` Returns true if this value has a Optional symbol */ +function IsOptional(value) { + return ValueGuard.IsObject(value) && value[index_1.OptionalKind] === 'Optional'; +} +/** `[Kind-Only]` Returns true if the given value is TAny */ +function IsAny(value) { + return IsKindOf(value, 'Any'); +} +/** `[Kind-Only]` Returns true if the given value is TArgument */ +function IsArgument(value) { + return IsKindOf(value, 'Argument'); +} +/** `[Kind-Only]` Returns true if the given value is TArray */ +function IsArray(value) { + return IsKindOf(value, 'Array'); +} +/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */ +function IsAsyncIterator(value) { + return IsKindOf(value, 'AsyncIterator'); +} +/** `[Kind-Only]` Returns true if the given value is TBigInt */ +function IsBigInt(value) { + return IsKindOf(value, 'BigInt'); +} +/** `[Kind-Only]` Returns true if the given value is TBoolean */ +function IsBoolean(value) { + return IsKindOf(value, 'Boolean'); +} +/** `[Kind-Only]` Returns true if the given value is TComputed */ +function IsComputed(value) { + return IsKindOf(value, 'Computed'); +} +/** `[Kind-Only]` Returns true if the given value is TConstructor */ +function IsConstructor(value) { + return IsKindOf(value, 'Constructor'); +} +/** `[Kind-Only]` Returns true if the given value is TDate */ +function IsDate(value) { + return IsKindOf(value, 'Date'); +} +/** `[Kind-Only]` Returns true if the given value is TFunction */ +function IsFunction(value) { + return IsKindOf(value, 'Function'); +} +/** `[Kind-Only]` Returns true if the given value is TInteger */ +function IsImport(value) { + return IsKindOf(value, 'Import'); +} +/** `[Kind-Only]` Returns true if the given value is TInteger */ +function IsInteger(value) { + return IsKindOf(value, 'Integer'); +} +/** `[Kind-Only]` Returns true if the given schema is TProperties */ +function IsProperties(value) { + return ValueGuard.IsObject(value); +} +/** `[Kind-Only]` Returns true if the given value is TIntersect */ +function IsIntersect(value) { + return IsKindOf(value, 'Intersect'); +} +/** `[Kind-Only]` Returns true if the given value is TIterator */ +function IsIterator(value) { + return IsKindOf(value, 'Iterator'); +} +/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */ +function IsKindOf(value, kind) { + return ValueGuard.IsObject(value) && index_1.Kind in value && value[index_1.Kind] === kind; +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +function IsLiteralString(value) { + return IsLiteral(value) && ValueGuard.IsString(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +function IsLiteralNumber(value) { + return IsLiteral(value) && ValueGuard.IsNumber(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +function IsLiteralBoolean(value) { + return IsLiteral(value) && ValueGuard.IsBoolean(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteralValue */ +function IsLiteralValue(value) { + return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +function IsLiteral(value) { + return IsKindOf(value, 'Literal'); +} +/** `[Kind-Only]` Returns true if the given value is a TMappedKey */ +function IsMappedKey(value) { + return IsKindOf(value, 'MappedKey'); +} +/** `[Kind-Only]` Returns true if the given value is TMappedResult */ +function IsMappedResult(value) { + return IsKindOf(value, 'MappedResult'); +} +/** `[Kind-Only]` Returns true if the given value is TNever */ +function IsNever(value) { + return IsKindOf(value, 'Never'); +} +/** `[Kind-Only]` Returns true if the given value is TNot */ +function IsNot(value) { + return IsKindOf(value, 'Not'); +} +/** `[Kind-Only]` Returns true if the given value is TNull */ +function IsNull(value) { + return IsKindOf(value, 'Null'); +} +/** `[Kind-Only]` Returns true if the given value is TNumber */ +function IsNumber(value) { + return IsKindOf(value, 'Number'); +} +/** `[Kind-Only]` Returns true if the given value is TObject */ +function IsObject(value) { + return IsKindOf(value, 'Object'); +} +/** `[Kind-Only]` Returns true if the given value is TPromise */ +function IsPromise(value) { + return IsKindOf(value, 'Promise'); +} +/** `[Kind-Only]` Returns true if the given value is TRecord */ +function IsRecord(value) { + return IsKindOf(value, 'Record'); +} +/** `[Kind-Only]` Returns true if this value is TRecursive */ +function IsRecursive(value) { + return ValueGuard.IsObject(value) && index_1.Hint in value && value[index_1.Hint] === 'Recursive'; +} +/** `[Kind-Only]` Returns true if the given value is TRef */ +function IsRef(value) { + return IsKindOf(value, 'Ref'); +} +/** `[Kind-Only]` Returns true if the given value is TRegExp */ +function IsRegExp(value) { + return IsKindOf(value, 'RegExp'); +} +/** `[Kind-Only]` Returns true if the given value is TString */ +function IsString(value) { + return IsKindOf(value, 'String'); +} +/** `[Kind-Only]` Returns true if the given value is TSymbol */ +function IsSymbol(value) { + return IsKindOf(value, 'Symbol'); +} +/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */ +function IsTemplateLiteral(value) { + return IsKindOf(value, 'TemplateLiteral'); +} +/** `[Kind-Only]` Returns true if the given value is TThis */ +function IsThis(value) { + return IsKindOf(value, 'This'); +} +/** `[Kind-Only]` Returns true of this value is TTransform */ +function IsTransform(value) { + return ValueGuard.IsObject(value) && index_1.TransformKind in value; +} +/** `[Kind-Only]` Returns true if the given value is TTuple */ +function IsTuple(value) { + return IsKindOf(value, 'Tuple'); +} +/** `[Kind-Only]` Returns true if the given value is TUndefined */ +function IsUndefined(value) { + return IsKindOf(value, 'Undefined'); +} +/** `[Kind-Only]` Returns true if the given value is TUnion */ +function IsUnion(value) { + return IsKindOf(value, 'Union'); +} +/** `[Kind-Only]` Returns true if the given value is TUint8Array */ +function IsUint8Array(value) { + return IsKindOf(value, 'Uint8Array'); +} +/** `[Kind-Only]` Returns true if the given value is TUnknown */ +function IsUnknown(value) { + return IsKindOf(value, 'Unknown'); +} +/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */ +function IsUnsafe(value) { + return IsKindOf(value, 'Unsafe'); +} +/** `[Kind-Only]` Returns true if the given value is TVoid */ +function IsVoid(value) { + return IsKindOf(value, 'Void'); +} +/** `[Kind-Only]` Returns true if the given value is TKind */ +function IsKind(value) { + return ValueGuard.IsObject(value) && index_1.Kind in value && ValueGuard.IsString(value[index_1.Kind]); +} +/** `[Kind-Only]` Returns true if the given value is TSchema */ +function IsSchema(value) { + // prettier-ignore + return (IsAny(value) || + IsArgument(value) || + IsArray(value) || + IsBoolean(value) || + IsBigInt(value) || + IsAsyncIterator(value) || + IsComputed(value) || + IsConstructor(value) || + IsDate(value) || + IsFunction(value) || + IsInteger(value) || + IsIntersect(value) || + IsIterator(value) || + IsLiteral(value) || + IsMappedKey(value) || + IsMappedResult(value) || + IsNever(value) || + IsNot(value) || + IsNull(value) || + IsNumber(value) || + IsObject(value) || + IsPromise(value) || + IsRecord(value) || + IsRef(value) || + IsRegExp(value) || + IsString(value) || + IsSymbol(value) || + IsTemplateLiteral(value) || + IsThis(value) || + IsTuple(value) || + IsUndefined(value) || + IsUnion(value) || + IsUint8Array(value) || + IsUnknown(value) || + IsUnsafe(value) || + IsVoid(value) || + IsKind(value)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/guard/type.d.ts new file mode 100644 index 00000000..74bc3132 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/type.d.ts @@ -0,0 +1,152 @@ +import { Kind, Hint, TransformKind } from '../symbols/index'; +import { TypeBoxError } from '../error/index'; +import { TransformOptions } from '../transform/index'; +import type { TAny } from '../any/index'; +import type { TArgument } from '../argument/index'; +import type { TArray } from '../array/index'; +import type { TAsyncIterator } from '../async-iterator/index'; +import type { TBoolean } from '../boolean/index'; +import type { TComputed } from '../computed/index'; +import type { TBigInt } from '../bigint/index'; +import type { TConstructor } from '../constructor/index'; +import type { TFunction } from '../function/index'; +import type { TImport } from '../module/index'; +import type { TInteger } from '../integer/index'; +import type { TIntersect } from '../intersect/index'; +import type { TIterator } from '../iterator/index'; +import type { TLiteral, TLiteralValue } from '../literal/index'; +import type { TMappedKey, TMappedResult } from '../mapped/index'; +import type { TNever } from '../never/index'; +import type { TNot } from '../not/index'; +import type { TNull } from '../null/index'; +import type { TNumber } from '../number/index'; +import type { TObject, TProperties } from '../object/index'; +import type { TOptional } from '../optional/index'; +import type { TPromise } from '../promise/index'; +import type { TReadonly } from '../readonly/index'; +import type { TRecord } from '../record/index'; +import type { TRef } from '../ref/index'; +import type { TRegExp } from '../regexp/index'; +import type { TSchema } from '../schema/index'; +import type { TString } from '../string/index'; +import type { TSymbol } from '../symbol/index'; +import type { TTemplateLiteral } from '../template-literal/index'; +import type { TTuple } from '../tuple/index'; +import type { TUint8Array } from '../uint8array/index'; +import type { TUndefined } from '../undefined/index'; +import type { TUnion } from '../union/index'; +import type { TUnknown } from '../unknown/index'; +import type { TUnsafe } from '../unsafe/index'; +import type { TVoid } from '../void/index'; +import type { TDate } from '../date/index'; +import type { TThis } from '../recursive/index'; +export declare class TypeGuardUnknownTypeError extends TypeBoxError { +} +/** Returns true if this value has a Readonly symbol */ +export declare function IsReadonly(value: T): value is TReadonly; +/** Returns true if this value has a Optional symbol */ +export declare function IsOptional(value: T): value is TOptional; +/** Returns true if the given value is TAny */ +export declare function IsAny(value: unknown): value is TAny; +/** Returns true if the given value is TArgument */ +export declare function IsArgument(value: unknown): value is TArgument; +/** Returns true if the given value is TArray */ +export declare function IsArray(value: unknown): value is TArray; +/** Returns true if the given value is TAsyncIterator */ +export declare function IsAsyncIterator(value: unknown): value is TAsyncIterator; +/** Returns true if the given value is TBigInt */ +export declare function IsBigInt(value: unknown): value is TBigInt; +/** Returns true if the given value is TBoolean */ +export declare function IsBoolean(value: unknown): value is TBoolean; +/** Returns true if the given value is TComputed */ +export declare function IsComputed(value: unknown): value is TComputed; +/** Returns true if the given value is TConstructor */ +export declare function IsConstructor(value: unknown): value is TConstructor; +/** Returns true if the given value is TDate */ +export declare function IsDate(value: unknown): value is TDate; +/** Returns true if the given value is TFunction */ +export declare function IsFunction(value: unknown): value is TFunction; +/** Returns true if the given value is TImport */ +export declare function IsImport(value: unknown): value is TImport; +/** Returns true if the given value is TInteger */ +export declare function IsInteger(value: unknown): value is TInteger; +/** Returns true if the given schema is TProperties */ +export declare function IsProperties(value: unknown): value is TProperties; +/** Returns true if the given value is TIntersect */ +export declare function IsIntersect(value: unknown): value is TIntersect; +/** Returns true if the given value is TIterator */ +export declare function IsIterator(value: unknown): value is TIterator; +/** Returns true if the given value is a TKind with the given name. */ +export declare function IsKindOf(value: unknown, kind: T): value is Record & { + [Kind]: T; +}; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralString(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralNumber(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralBoolean(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteral(value: unknown): value is TLiteral; +/** Returns true if the given value is a TLiteralValue */ +export declare function IsLiteralValue(value: unknown): value is TLiteralValue; +/** Returns true if the given value is a TMappedKey */ +export declare function IsMappedKey(value: unknown): value is TMappedKey; +/** Returns true if the given value is TMappedResult */ +export declare function IsMappedResult(value: unknown): value is TMappedResult; +/** Returns true if the given value is TNever */ +export declare function IsNever(value: unknown): value is TNever; +/** Returns true if the given value is TNot */ +export declare function IsNot(value: unknown): value is TNot; +/** Returns true if the given value is TNull */ +export declare function IsNull(value: unknown): value is TNull; +/** Returns true if the given value is TNumber */ +export declare function IsNumber(value: unknown): value is TNumber; +/** Returns true if the given value is TObject */ +export declare function IsObject(value: unknown): value is TObject; +/** Returns true if the given value is TPromise */ +export declare function IsPromise(value: unknown): value is TPromise; +/** Returns true if the given value is TRecord */ +export declare function IsRecord(value: unknown): value is TRecord; +/** Returns true if this value is TRecursive */ +export declare function IsRecursive(value: unknown): value is { + [Hint]: 'Recursive'; +}; +/** Returns true if the given value is TRef */ +export declare function IsRef(value: unknown): value is TRef; +/** Returns true if the given value is TRegExp */ +export declare function IsRegExp(value: unknown): value is TRegExp; +/** Returns true if the given value is TString */ +export declare function IsString(value: unknown): value is TString; +/** Returns true if the given value is TSymbol */ +export declare function IsSymbol(value: unknown): value is TSymbol; +/** Returns true if the given value is TTemplateLiteral */ +export declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral; +/** Returns true if the given value is TThis */ +export declare function IsThis(value: unknown): value is TThis; +/** Returns true of this value is TTransform */ +export declare function IsTransform(value: unknown): value is { + [TransformKind]: TransformOptions; +}; +/** Returns true if the given value is TTuple */ +export declare function IsTuple(value: unknown): value is TTuple; +/** Returns true if the given value is TUndefined */ +export declare function IsUndefined(value: unknown): value is TUndefined; +/** Returns true if the given value is TUnion[]> */ +export declare function IsUnionLiteral(value: unknown): value is TUnion; +/** Returns true if the given value is TUnion */ +export declare function IsUnion(value: unknown): value is TUnion; +/** Returns true if the given value is TUint8Array */ +export declare function IsUint8Array(value: unknown): value is TUint8Array; +/** Returns true if the given value is TUnknown */ +export declare function IsUnknown(value: unknown): value is TUnknown; +/** Returns true if the given value is a raw TUnsafe */ +export declare function IsUnsafe(value: unknown): value is TUnsafe; +/** Returns true if the given value is TVoid */ +export declare function IsVoid(value: unknown): value is TVoid; +/** Returns true if the given value is TKind */ +export declare function IsKind(value: unknown): value is Record & { + [Kind]: string; +}; +/** Returns true if the given value is TSchema */ +export declare function IsSchema(value: unknown): value is TSchema; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/type.js b/node_modules/@sinclair/typebox/build/cjs/type/guard/type.js new file mode 100644 index 00000000..b01182a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/type.js @@ -0,0 +1,597 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeGuardUnknownTypeError = void 0; +exports.IsReadonly = IsReadonly; +exports.IsOptional = IsOptional; +exports.IsAny = IsAny; +exports.IsArgument = IsArgument; +exports.IsArray = IsArray; +exports.IsAsyncIterator = IsAsyncIterator; +exports.IsBigInt = IsBigInt; +exports.IsBoolean = IsBoolean; +exports.IsComputed = IsComputed; +exports.IsConstructor = IsConstructor; +exports.IsDate = IsDate; +exports.IsFunction = IsFunction; +exports.IsImport = IsImport; +exports.IsInteger = IsInteger; +exports.IsProperties = IsProperties; +exports.IsIntersect = IsIntersect; +exports.IsIterator = IsIterator; +exports.IsKindOf = IsKindOf; +exports.IsLiteralString = IsLiteralString; +exports.IsLiteralNumber = IsLiteralNumber; +exports.IsLiteralBoolean = IsLiteralBoolean; +exports.IsLiteral = IsLiteral; +exports.IsLiteralValue = IsLiteralValue; +exports.IsMappedKey = IsMappedKey; +exports.IsMappedResult = IsMappedResult; +exports.IsNever = IsNever; +exports.IsNot = IsNot; +exports.IsNull = IsNull; +exports.IsNumber = IsNumber; +exports.IsObject = IsObject; +exports.IsPromise = IsPromise; +exports.IsRecord = IsRecord; +exports.IsRecursive = IsRecursive; +exports.IsRef = IsRef; +exports.IsRegExp = IsRegExp; +exports.IsString = IsString; +exports.IsSymbol = IsSymbol; +exports.IsTemplateLiteral = IsTemplateLiteral; +exports.IsThis = IsThis; +exports.IsTransform = IsTransform; +exports.IsTuple = IsTuple; +exports.IsUndefined = IsUndefined; +exports.IsUnionLiteral = IsUnionLiteral; +exports.IsUnion = IsUnion; +exports.IsUint8Array = IsUint8Array; +exports.IsUnknown = IsUnknown; +exports.IsUnsafe = IsUnsafe; +exports.IsVoid = IsVoid; +exports.IsKind = IsKind; +exports.IsSchema = IsSchema; +const ValueGuard = __importStar(require("./value")); +const index_1 = require("../symbols/index"); +const index_2 = require("../error/index"); +class TypeGuardUnknownTypeError extends index_2.TypeBoxError { +} +exports.TypeGuardUnknownTypeError = TypeGuardUnknownTypeError; +const KnownTypes = [ + 'Argument', + 'Any', + 'Array', + 'AsyncIterator', + 'BigInt', + 'Boolean', + 'Computed', + 'Constructor', + 'Date', + 'Enum', + 'Function', + 'Integer', + 'Intersect', + 'Iterator', + 'Literal', + 'MappedKey', + 'MappedResult', + 'Not', + 'Null', + 'Number', + 'Object', + 'Promise', + 'Record', + 'Ref', + 'RegExp', + 'String', + 'Symbol', + 'TemplateLiteral', + 'This', + 'Tuple', + 'Undefined', + 'Union', + 'Uint8Array', + 'Unknown', + 'Void', +]; +function IsPattern(value) { + try { + new RegExp(value); + return true; + } + catch { + return false; + } +} +function IsControlCharacterFree(value) { + if (!ValueGuard.IsString(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + if ((code >= 7 && code <= 13) || code === 27 || code === 127) { + return false; + } + } + return true; +} +function IsAdditionalProperties(value) { + return IsOptionalBoolean(value) || IsSchema(value); +} +function IsOptionalBigInt(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBigInt(value); +} +function IsOptionalNumber(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsNumber(value); +} +function IsOptionalBoolean(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBoolean(value); +} +function IsOptionalString(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value); +} +function IsOptionalPattern(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value) && IsPattern(value)); +} +function IsOptionalFormat(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value)); +} +function IsOptionalSchema(value) { + return ValueGuard.IsUndefined(value) || IsSchema(value); +} +// ------------------------------------------------------------------ +// Modifiers +// ------------------------------------------------------------------ +/** Returns true if this value has a Readonly symbol */ +function IsReadonly(value) { + return ValueGuard.IsObject(value) && value[index_1.ReadonlyKind] === 'Readonly'; +} +/** Returns true if this value has a Optional symbol */ +function IsOptional(value) { + return ValueGuard.IsObject(value) && value[index_1.OptionalKind] === 'Optional'; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +/** Returns true if the given value is TAny */ +function IsAny(value) { + // prettier-ignore + return (IsKindOf(value, 'Any') && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TArgument */ +function IsArgument(value) { + // prettier-ignore + return (IsKindOf(value, 'Argument') && + ValueGuard.IsNumber(value.index)); +} +/** Returns true if the given value is TArray */ +function IsArray(value) { + return (IsKindOf(value, 'Array') && + value.type === 'array' && + IsOptionalString(value.$id) && + IsSchema(value.items) && + IsOptionalNumber(value.minItems) && + IsOptionalNumber(value.maxItems) && + IsOptionalBoolean(value.uniqueItems) && + IsOptionalSchema(value.contains) && + IsOptionalNumber(value.minContains) && + IsOptionalNumber(value.maxContains)); +} +/** Returns true if the given value is TAsyncIterator */ +function IsAsyncIterator(value) { + // prettier-ignore + return (IsKindOf(value, 'AsyncIterator') && + value.type === 'AsyncIterator' && + IsOptionalString(value.$id) && + IsSchema(value.items)); +} +/** Returns true if the given value is TBigInt */ +function IsBigInt(value) { + // prettier-ignore + return (IsKindOf(value, 'BigInt') && + value.type === 'bigint' && + IsOptionalString(value.$id) && + IsOptionalBigInt(value.exclusiveMaximum) && + IsOptionalBigInt(value.exclusiveMinimum) && + IsOptionalBigInt(value.maximum) && + IsOptionalBigInt(value.minimum) && + IsOptionalBigInt(value.multipleOf)); +} +/** Returns true if the given value is TBoolean */ +function IsBoolean(value) { + // prettier-ignore + return (IsKindOf(value, 'Boolean') && + value.type === 'boolean' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TComputed */ +function IsComputed(value) { + // prettier-ignore + return (IsKindOf(value, 'Computed') && + ValueGuard.IsString(value.target) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every((schema) => IsSchema(schema))); +} +/** Returns true if the given value is TConstructor */ +function IsConstructor(value) { + // prettier-ignore + return (IsKindOf(value, 'Constructor') && + value.type === 'Constructor' && + IsOptionalString(value.$id) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every(schema => IsSchema(schema)) && + IsSchema(value.returns)); +} +/** Returns true if the given value is TDate */ +function IsDate(value) { + return (IsKindOf(value, 'Date') && + value.type === 'Date' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximumTimestamp) && + IsOptionalNumber(value.exclusiveMinimumTimestamp) && + IsOptionalNumber(value.maximumTimestamp) && + IsOptionalNumber(value.minimumTimestamp) && + IsOptionalNumber(value.multipleOfTimestamp)); +} +/** Returns true if the given value is TFunction */ +function IsFunction(value) { + // prettier-ignore + return (IsKindOf(value, 'Function') && + value.type === 'Function' && + IsOptionalString(value.$id) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every(schema => IsSchema(schema)) && + IsSchema(value.returns)); +} +/** Returns true if the given value is TImport */ +function IsImport(value) { + // prettier-ignore + return (IsKindOf(value, 'Import') && + ValueGuard.HasPropertyKey(value, '$defs') && + ValueGuard.IsObject(value.$defs) && + IsProperties(value.$defs) && + ValueGuard.HasPropertyKey(value, '$ref') && + ValueGuard.IsString(value.$ref) && + value.$ref in value.$defs // required + ); +} +/** Returns true if the given value is TInteger */ +function IsInteger(value) { + return (IsKindOf(value, 'Integer') && + value.type === 'integer' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximum) && + IsOptionalNumber(value.exclusiveMinimum) && + IsOptionalNumber(value.maximum) && + IsOptionalNumber(value.minimum) && + IsOptionalNumber(value.multipleOf)); +} +/** Returns true if the given schema is TProperties */ +function IsProperties(value) { + // prettier-ignore + return (ValueGuard.IsObject(value) && + Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema(schema))); +} +/** Returns true if the given value is TIntersect */ +function IsIntersect(value) { + // prettier-ignore + return (IsKindOf(value, 'Intersect') && + (ValueGuard.IsString(value.type) && value.type !== 'object' ? false : true) && + ValueGuard.IsArray(value.allOf) && + value.allOf.every(schema => IsSchema(schema) && !IsTransform(schema)) && + IsOptionalString(value.type) && + (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TIterator */ +function IsIterator(value) { + // prettier-ignore + return (IsKindOf(value, 'Iterator') && + value.type === 'Iterator' && + IsOptionalString(value.$id) && + IsSchema(value.items)); +} +/** Returns true if the given value is a TKind with the given name. */ +function IsKindOf(value, kind) { + return ValueGuard.IsObject(value) && index_1.Kind in value && value[index_1.Kind] === kind; +} +/** Returns true if the given value is TLiteral */ +function IsLiteralString(value) { + return IsLiteral(value) && ValueGuard.IsString(value.const); +} +/** Returns true if the given value is TLiteral */ +function IsLiteralNumber(value) { + return IsLiteral(value) && ValueGuard.IsNumber(value.const); +} +/** Returns true if the given value is TLiteral */ +function IsLiteralBoolean(value) { + return IsLiteral(value) && ValueGuard.IsBoolean(value.const); +} +/** Returns true if the given value is TLiteral */ +function IsLiteral(value) { + // prettier-ignore + return (IsKindOf(value, 'Literal') && + IsOptionalString(value.$id) && IsLiteralValue(value.const)); +} +/** Returns true if the given value is a TLiteralValue */ +function IsLiteralValue(value) { + return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value); +} +/** Returns true if the given value is a TMappedKey */ +function IsMappedKey(value) { + // prettier-ignore + return (IsKindOf(value, 'MappedKey') && + ValueGuard.IsArray(value.keys) && + value.keys.every(key => ValueGuard.IsNumber(key) || ValueGuard.IsString(key))); +} +/** Returns true if the given value is TMappedResult */ +function IsMappedResult(value) { + // prettier-ignore + return (IsKindOf(value, 'MappedResult') && + IsProperties(value.properties)); +} +/** Returns true if the given value is TNever */ +function IsNever(value) { + // prettier-ignore + return (IsKindOf(value, 'Never') && + ValueGuard.IsObject(value.not) && + Object.getOwnPropertyNames(value.not).length === 0); +} +/** Returns true if the given value is TNot */ +function IsNot(value) { + // prettier-ignore + return (IsKindOf(value, 'Not') && + IsSchema(value.not)); +} +/** Returns true if the given value is TNull */ +function IsNull(value) { + // prettier-ignore + return (IsKindOf(value, 'Null') && + value.type === 'null' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TNumber */ +function IsNumber(value) { + return (IsKindOf(value, 'Number') && + value.type === 'number' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximum) && + IsOptionalNumber(value.exclusiveMinimum) && + IsOptionalNumber(value.maximum) && + IsOptionalNumber(value.minimum) && + IsOptionalNumber(value.multipleOf)); +} +/** Returns true if the given value is TObject */ +function IsObject(value) { + // prettier-ignore + return (IsKindOf(value, 'Object') && + value.type === 'object' && + IsOptionalString(value.$id) && + IsProperties(value.properties) && + IsAdditionalProperties(value.additionalProperties) && + IsOptionalNumber(value.minProperties) && + IsOptionalNumber(value.maxProperties)); +} +/** Returns true if the given value is TPromise */ +function IsPromise(value) { + // prettier-ignore + return (IsKindOf(value, 'Promise') && + value.type === 'Promise' && + IsOptionalString(value.$id) && + IsSchema(value.item)); +} +/** Returns true if the given value is TRecord */ +function IsRecord(value) { + // prettier-ignore + return (IsKindOf(value, 'Record') && + value.type === 'object' && + IsOptionalString(value.$id) && + IsAdditionalProperties(value.additionalProperties) && + ValueGuard.IsObject(value.patternProperties) && + ((schema) => { + const keys = Object.getOwnPropertyNames(schema.patternProperties); + return (keys.length === 1 && + IsPattern(keys[0]) && + ValueGuard.IsObject(schema.patternProperties) && + IsSchema(schema.patternProperties[keys[0]])); + })(value)); +} +/** Returns true if this value is TRecursive */ +function IsRecursive(value) { + return ValueGuard.IsObject(value) && index_1.Hint in value && value[index_1.Hint] === 'Recursive'; +} +/** Returns true if the given value is TRef */ +function IsRef(value) { + // prettier-ignore + return (IsKindOf(value, 'Ref') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.$ref)); +} +/** Returns true if the given value is TRegExp */ +function IsRegExp(value) { + // prettier-ignore + return (IsKindOf(value, 'RegExp') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.source) && + ValueGuard.IsString(value.flags) && + IsOptionalNumber(value.maxLength) && + IsOptionalNumber(value.minLength)); +} +/** Returns true if the given value is TString */ +function IsString(value) { + // prettier-ignore + return (IsKindOf(value, 'String') && + value.type === 'string' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.minLength) && + IsOptionalNumber(value.maxLength) && + IsOptionalPattern(value.pattern) && + IsOptionalFormat(value.format)); +} +/** Returns true if the given value is TSymbol */ +function IsSymbol(value) { + // prettier-ignore + return (IsKindOf(value, 'Symbol') && + value.type === 'symbol' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TTemplateLiteral */ +function IsTemplateLiteral(value) { + // prettier-ignore + return (IsKindOf(value, 'TemplateLiteral') && + value.type === 'string' && + ValueGuard.IsString(value.pattern) && + value.pattern[0] === '^' && + value.pattern[value.pattern.length - 1] === '$'); +} +/** Returns true if the given value is TThis */ +function IsThis(value) { + // prettier-ignore + return (IsKindOf(value, 'This') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.$ref)); +} +/** Returns true of this value is TTransform */ +function IsTransform(value) { + return ValueGuard.IsObject(value) && index_1.TransformKind in value; +} +/** Returns true if the given value is TTuple */ +function IsTuple(value) { + // prettier-ignore + return (IsKindOf(value, 'Tuple') && + value.type === 'array' && + IsOptionalString(value.$id) && + ValueGuard.IsNumber(value.minItems) && + ValueGuard.IsNumber(value.maxItems) && + value.minItems === value.maxItems && + (( // empty + ValueGuard.IsUndefined(value.items) && + ValueGuard.IsUndefined(value.additionalItems) && + value.minItems === 0) || (ValueGuard.IsArray(value.items) && + value.items.every(schema => IsSchema(schema))))); +} +/** Returns true if the given value is TUndefined */ +function IsUndefined(value) { + // prettier-ignore + return (IsKindOf(value, 'Undefined') && + value.type === 'undefined' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TUnion[]> */ +function IsUnionLiteral(value) { + return IsUnion(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema)); +} +/** Returns true if the given value is TUnion */ +function IsUnion(value) { + // prettier-ignore + return (IsKindOf(value, 'Union') && + IsOptionalString(value.$id) && + ValueGuard.IsObject(value) && + ValueGuard.IsArray(value.anyOf) && + value.anyOf.every(schema => IsSchema(schema))); +} +/** Returns true if the given value is TUint8Array */ +function IsUint8Array(value) { + // prettier-ignore + return (IsKindOf(value, 'Uint8Array') && + value.type === 'Uint8Array' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.minByteLength) && + IsOptionalNumber(value.maxByteLength)); +} +/** Returns true if the given value is TUnknown */ +function IsUnknown(value) { + // prettier-ignore + return (IsKindOf(value, 'Unknown') && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is a raw TUnsafe */ +function IsUnsafe(value) { + return IsKindOf(value, 'Unsafe'); +} +/** Returns true if the given value is TVoid */ +function IsVoid(value) { + // prettier-ignore + return (IsKindOf(value, 'Void') && + value.type === 'void' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TKind */ +function IsKind(value) { + return ValueGuard.IsObject(value) && index_1.Kind in value && ValueGuard.IsString(value[index_1.Kind]) && !KnownTypes.includes(value[index_1.Kind]); +} +/** Returns true if the given value is TSchema */ +function IsSchema(value) { + // prettier-ignore + return (ValueGuard.IsObject(value)) && (IsAny(value) || + IsArgument(value) || + IsArray(value) || + IsBoolean(value) || + IsBigInt(value) || + IsAsyncIterator(value) || + IsComputed(value) || + IsConstructor(value) || + IsDate(value) || + IsFunction(value) || + IsInteger(value) || + IsIntersect(value) || + IsIterator(value) || + IsLiteral(value) || + IsMappedKey(value) || + IsMappedResult(value) || + IsNever(value) || + IsNot(value) || + IsNull(value) || + IsNumber(value) || + IsObject(value) || + IsPromise(value) || + IsRecord(value) || + IsRef(value) || + IsRegExp(value) || + IsString(value) || + IsSymbol(value) || + IsTemplateLiteral(value) || + IsThis(value) || + IsTuple(value) || + IsUndefined(value) || + IsUnion(value) || + IsUint8Array(value) || + IsUnknown(value) || + IsUnsafe(value) || + IsVoid(value) || + IsKind(value)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/value.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/guard/value.d.ts new file mode 100644 index 00000000..f3d18d10 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/value.d.ts @@ -0,0 +1,34 @@ +/** Returns true if this value has this property key */ +export declare function HasPropertyKey(value: Record, key: K): value is Record & { + [_ in K]: unknown; +}; +/** Returns true if this value is an async iterator */ +export declare function IsAsyncIterator(value: unknown): value is AsyncIterableIterator; +/** Returns true if this value is an array */ +export declare function IsArray(value: unknown): value is unknown[]; +/** Returns true if this value is bigint */ +export declare function IsBigInt(value: unknown): value is bigint; +/** Returns true if this value is a boolean */ +export declare function IsBoolean(value: unknown): value is boolean; +/** Returns true if this value is a Date object */ +export declare function IsDate(value: unknown): value is Date; +/** Returns true if this value is a function */ +export declare function IsFunction(value: unknown): value is Function; +/** Returns true if this value is an iterator */ +export declare function IsIterator(value: unknown): value is IterableIterator; +/** Returns true if this value is null */ +export declare function IsNull(value: unknown): value is null; +/** Returns true if this value is number */ +export declare function IsNumber(value: unknown): value is number; +/** Returns true if this value is an object */ +export declare function IsObject(value: unknown): value is Record; +/** Returns true if this value is RegExp */ +export declare function IsRegExp(value: unknown): value is RegExp; +/** Returns true if this value is string */ +export declare function IsString(value: unknown): value is string; +/** Returns true if this value is symbol */ +export declare function IsSymbol(value: unknown): value is symbol; +/** Returns true if this value is a Uint8Array */ +export declare function IsUint8Array(value: unknown): value is Uint8Array; +/** Returns true if this value is undefined */ +export declare function IsUndefined(value: unknown): value is undefined; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/guard/value.js b/node_modules/@sinclair/typebox/build/cjs/type/guard/value.js new file mode 100644 index 00000000..4be711e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/guard/value.js @@ -0,0 +1,89 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HasPropertyKey = HasPropertyKey; +exports.IsAsyncIterator = IsAsyncIterator; +exports.IsArray = IsArray; +exports.IsBigInt = IsBigInt; +exports.IsBoolean = IsBoolean; +exports.IsDate = IsDate; +exports.IsFunction = IsFunction; +exports.IsIterator = IsIterator; +exports.IsNull = IsNull; +exports.IsNumber = IsNumber; +exports.IsObject = IsObject; +exports.IsRegExp = IsRegExp; +exports.IsString = IsString; +exports.IsSymbol = IsSymbol; +exports.IsUint8Array = IsUint8Array; +exports.IsUndefined = IsUndefined; +// -------------------------------------------------------------------------- +// PropertyKey +// -------------------------------------------------------------------------- +/** Returns true if this value has this property key */ +function HasPropertyKey(value, key) { + return key in value; +} +// -------------------------------------------------------------------------- +// Object Instances +// -------------------------------------------------------------------------- +/** Returns true if this value is an async iterator */ +function IsAsyncIterator(value) { + return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value; +} +/** Returns true if this value is an array */ +function IsArray(value) { + return Array.isArray(value); +} +/** Returns true if this value is bigint */ +function IsBigInt(value) { + return typeof value === 'bigint'; +} +/** Returns true if this value is a boolean */ +function IsBoolean(value) { + return typeof value === 'boolean'; +} +/** Returns true if this value is a Date object */ +function IsDate(value) { + return value instanceof globalThis.Date; +} +/** Returns true if this value is a function */ +function IsFunction(value) { + return typeof value === 'function'; +} +/** Returns true if this value is an iterator */ +function IsIterator(value) { + return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value; +} +/** Returns true if this value is null */ +function IsNull(value) { + return value === null; +} +/** Returns true if this value is number */ +function IsNumber(value) { + return typeof value === 'number'; +} +/** Returns true if this value is an object */ +function IsObject(value) { + return typeof value === 'object' && value !== null; +} +/** Returns true if this value is RegExp */ +function IsRegExp(value) { + return value instanceof globalThis.RegExp; +} +/** Returns true if this value is string */ +function IsString(value) { + return typeof value === 'string'; +} +/** Returns true if this value is symbol */ +function IsSymbol(value) { + return typeof value === 'symbol'; +} +/** Returns true if this value is a Uint8Array */ +function IsUint8Array(value) { + return value instanceof globalThis.Uint8Array; +} +/** Returns true if this value is undefined */ +function IsUndefined(value) { + return value === undefined; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts new file mode 100644 index 00000000..f233de1e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts @@ -0,0 +1,42 @@ +import type { TSchema } from '../schema/index'; +import type { TProperties } from '../object/index'; +import type { TNever } from '../never/index'; +export type TupleToIntersect = T extends [infer I] ? I : T extends [infer I, ...infer R] ? I & TupleToIntersect : never; +export type TupleToUnion = { + [K in keyof T]: T[K]; +}[number]; +export type UnionToIntersect = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never; +export type UnionLast = UnionToIntersect 0 : never> extends (x: infer L) => 0 ? L : never; +export type UnionToTuple> = [U] extends [never] ? Acc : UnionToTuple, [Extract, ...Acc]>; +export type Trim = T extends `${' '}${infer U}` ? Trim : T extends `${infer U}${' '}` ? Trim : T; +export type Assert = T extends E ? T : never; +export type Evaluate = T extends infer O ? { + [K in keyof O]: O[K]; +} : never; +export type Ensure = T extends infer U ? U : never; +export type EmptyString = ''; +export type ZeroString = '0'; +type IncrementBase = { + m: '9'; + t: '01'; + '0': '1'; + '1': '2'; + '2': '3'; + '3': '4'; + '4': '5'; + '5': '6'; + '6': '7'; + '7': '8'; + '8': '9'; + '9': '0'; +}; +type IncrementTake = IncrementBase[T]; +type IncrementStep = T extends IncrementBase['m'] ? IncrementBase['t'] : T extends `${infer L extends keyof IncrementBase}${infer R}` ? L extends IncrementBase['m'] ? `${IncrementTake}${IncrementStep}` : `${IncrementTake}${R}` : never; +type IncrementReverse = T extends `${infer L}${infer R}` ? `${IncrementReverse}${L}` : T; +export type TIncrement = IncrementReverse>>; +/** Increments the given string value + 1 */ +export declare function Increment(T: T): TIncrement; +export type AssertProperties = T extends TProperties ? T : TProperties; +export type AssertRest = T extends E ? T : []; +export type AssertType = T extends E ? T : TNever; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.js b/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.js new file mode 100644 index 00000000..74eb0871 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Increment = Increment; +/** Increments the given string value + 1 */ +function Increment(T) { + return (parseInt(T) + 1).toString(); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.d.ts new file mode 100644 index 00000000..c5f595cf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.d.ts @@ -0,0 +1 @@ +export * from './helpers'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.js b/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.js new file mode 100644 index 00000000..34ace62d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/helpers/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./helpers"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/index.d.ts new file mode 100644 index 00000000..0dd6613b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/index.d.ts @@ -0,0 +1,71 @@ +export * from './any/index'; +export * from './argument/index'; +export * from './array/index'; +export * from './async-iterator/index'; +export * from './awaited/index'; +export * from './bigint/index'; +export * from './boolean/index'; +export * from './clone/index'; +export * from './composite/index'; +export * from './const/index'; +export * from './constructor/index'; +export * from './constructor-parameters/index'; +export * from './date/index'; +export * from './discard/index'; +export * from './enum/index'; +export * from './error/index'; +export * from './exclude/index'; +export * from './extends/index'; +export * from './extract/index'; +export * from './function/index'; +export * from './guard/index'; +export * from './helpers/index'; +export * from './indexed/index'; +export * from './instance-type/index'; +export * from './instantiate/index'; +export * from './integer/index'; +export * from './intersect/index'; +export * from './intrinsic/index'; +export * from './iterator/index'; +export * from './keyof/index'; +export * from './literal/index'; +export * from './mapped/index'; +export * from './module/index'; +export * from './never/index'; +export * from './not/index'; +export * from './null/index'; +export * from './number/index'; +export * from './object/index'; +export * from './omit/index'; +export * from './optional/index'; +export * from './parameters/index'; +export * from './partial/index'; +export * from './patterns/index'; +export * from './pick/index'; +export * from './promise/index'; +export * from './readonly/index'; +export * from './readonly-optional/index'; +export * from './record/index'; +export * from './recursive/index'; +export * from './ref/index'; +export * from './regexp/index'; +export * from './registry/index'; +export * from './required/index'; +export * from './rest/index'; +export * from './return-type/index'; +export * from './schema/index'; +export * from './sets/index'; +export * from './static/index'; +export * from './string/index'; +export * from './symbol/index'; +export * from './symbols/index'; +export * from './template-literal/index'; +export * from './transform/index'; +export * from './tuple/index'; +export * from './type/index'; +export * from './uint8array/index'; +export * from './undefined/index'; +export * from './union/index'; +export * from './unknown/index'; +export * from './unsafe/index'; +export * from './void/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/index.js b/node_modules/@sinclair/typebox/build/cjs/type/index.js new file mode 100644 index 00000000..e752a591 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/index.js @@ -0,0 +1,88 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./any/index"), exports); +__exportStar(require("./argument/index"), exports); +__exportStar(require("./array/index"), exports); +__exportStar(require("./async-iterator/index"), exports); +__exportStar(require("./awaited/index"), exports); +__exportStar(require("./bigint/index"), exports); +__exportStar(require("./boolean/index"), exports); +__exportStar(require("./clone/index"), exports); +__exportStar(require("./composite/index"), exports); +__exportStar(require("./const/index"), exports); +__exportStar(require("./constructor/index"), exports); +__exportStar(require("./constructor-parameters/index"), exports); +__exportStar(require("./date/index"), exports); +__exportStar(require("./discard/index"), exports); +__exportStar(require("./enum/index"), exports); +__exportStar(require("./error/index"), exports); +__exportStar(require("./exclude/index"), exports); +__exportStar(require("./extends/index"), exports); +__exportStar(require("./extract/index"), exports); +__exportStar(require("./function/index"), exports); +__exportStar(require("./guard/index"), exports); +__exportStar(require("./helpers/index"), exports); +__exportStar(require("./indexed/index"), exports); +__exportStar(require("./instance-type/index"), exports); +__exportStar(require("./instantiate/index"), exports); +__exportStar(require("./integer/index"), exports); +__exportStar(require("./intersect/index"), exports); +__exportStar(require("./intrinsic/index"), exports); +__exportStar(require("./iterator/index"), exports); +__exportStar(require("./keyof/index"), exports); +__exportStar(require("./literal/index"), exports); +__exportStar(require("./mapped/index"), exports); +__exportStar(require("./module/index"), exports); +__exportStar(require("./never/index"), exports); +__exportStar(require("./not/index"), exports); +__exportStar(require("./null/index"), exports); +__exportStar(require("./number/index"), exports); +__exportStar(require("./object/index"), exports); +__exportStar(require("./omit/index"), exports); +__exportStar(require("./optional/index"), exports); +__exportStar(require("./parameters/index"), exports); +__exportStar(require("./partial/index"), exports); +__exportStar(require("./patterns/index"), exports); +__exportStar(require("./pick/index"), exports); +__exportStar(require("./promise/index"), exports); +__exportStar(require("./readonly/index"), exports); +__exportStar(require("./readonly-optional/index"), exports); +__exportStar(require("./record/index"), exports); +__exportStar(require("./recursive/index"), exports); +__exportStar(require("./ref/index"), exports); +__exportStar(require("./regexp/index"), exports); +__exportStar(require("./registry/index"), exports); +__exportStar(require("./required/index"), exports); +__exportStar(require("./rest/index"), exports); +__exportStar(require("./return-type/index"), exports); +__exportStar(require("./schema/index"), exports); +__exportStar(require("./sets/index"), exports); +__exportStar(require("./static/index"), exports); +__exportStar(require("./string/index"), exports); +__exportStar(require("./symbol/index"), exports); +__exportStar(require("./symbols/index"), exports); +__exportStar(require("./template-literal/index"), exports); +__exportStar(require("./transform/index"), exports); +__exportStar(require("./tuple/index"), exports); +__exportStar(require("./type/index"), exports); +__exportStar(require("./uint8array/index"), exports); +__exportStar(require("./undefined/index"), exports); +__exportStar(require("./union/index"), exports); +__exportStar(require("./unknown/index"), exports); +__exportStar(require("./unsafe/index"), exports); +__exportStar(require("./void/index"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.d.ts new file mode 100644 index 00000000..201b474c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.d.ts @@ -0,0 +1,4 @@ +export * from './indexed-from-mapped-key'; +export * from './indexed-from-mapped-result'; +export * from './indexed-property-keys'; +export * from './indexed'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.js b/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.js new file mode 100644 index 00000000..a3f16d77 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/index.js @@ -0,0 +1,21 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./indexed-from-mapped-key"), exports); +__exportStar(require("./indexed-from-mapped-result"), exports); +__exportStar(require("./indexed-property-keys"), exports); +__exportStar(require("./indexed"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.d.ts new file mode 100644 index 00000000..8ecf4356 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.d.ts @@ -0,0 +1,13 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TIndex } from './indexed'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +type TMappedIndexPropertyKey = { + [_ in Key]: TIndex; +}; +type TMappedIndexPropertyKeys = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TMappedIndexPropertyKeys> : Result); +type TMappedIndexProperties = Evaluate>; +export type TIndexFromMappedKey> = (Ensure>); +export declare function IndexFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.js new file mode 100644 index 00000000..2a2aaf43 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-key.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexFromMappedKey = IndexFromMappedKey; +const indexed_1 = require("./indexed"); +const index_1 = require("../mapped/index"); +const value_1 = require("../clone/value"); +// prettier-ignore +function MappedIndexPropertyKey(type, key, options) { + return { [key]: (0, indexed_1.Index)(type, [key], (0, value_1.Clone)(options)) }; +} +// prettier-ignore +function MappedIndexPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((result, left) => { + return { ...result, ...MappedIndexPropertyKey(type, left, options) }; + }, {}); +} +// prettier-ignore +function MappedIndexProperties(type, mappedKey, options) { + return MappedIndexPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +function IndexFromMappedKey(type, mappedKey, options) { + const properties = MappedIndexProperties(type, mappedKey, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.d.ts new file mode 100644 index 00000000..d5f13a0e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TIndexPropertyKeys } from './indexed-property-keys'; +import { type TIndex } from './index'; +type TFromProperties = ({ + [K2 in keyof Properties]: TIndex>; +}); +type TFromMappedResult = (TFromProperties); +export type TIndexFromMappedResult> = (TMappedResult); +export declare function IndexFromMappedResult>(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.js new file mode 100644 index 00000000..1bbabeb7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-from-mapped-result.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexFromMappedResult = IndexFromMappedResult; +const index_1 = require("../mapped/index"); +const indexed_property_keys_1 = require("./indexed-property-keys"); +const index_2 = require("./index"); +// prettier-ignore +function FromProperties(type, properties, options) { + const result = {}; + for (const K2 of Object.getOwnPropertyNames(properties)) { + result[K2] = (0, index_2.Index)(type, (0, indexed_property_keys_1.IndexPropertyKeys)(properties[K2]), options); + } + return result; +} +// prettier-ignore +function FromMappedResult(type, mappedResult, options) { + return FromProperties(type, mappedResult.properties, options); +} +// prettier-ignore +function IndexFromMappedResult(type, mappedResult, options) { + const properties = FromMappedResult(type, mappedResult, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.d.ts new file mode 100644 index 00000000..fe337bfd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.d.ts @@ -0,0 +1,14 @@ +import { type TTemplateLiteralGenerate, type TTemplateLiteral } from '../template-literal/index'; +import type { TLiteral, TLiteralValue } from '../literal/index'; +import type { TInteger } from '../integer/index'; +import type { TNumber } from '../number/index'; +import type { TSchema } from '../schema/index'; +import type { TUnion } from '../union/index'; +type TFromTemplateLiteral> = (Keys); +type TFromUnion = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion]> : Result); +type TFromLiteral = (LiteralValue extends PropertyKey ? [`${LiteralValue}`] : []); +export type TIndexPropertyKeys = (Type extends TTemplateLiteral ? TFromTemplateLiteral : Type extends TUnion ? TFromUnion : Type extends TLiteral ? TFromLiteral : Type extends TNumber ? ['[number]'] : Type extends TInteger ? ['[number]'] : [ +]); +/** Returns a tuple of PropertyKeys derived from the given TSchema */ +export declare function IndexPropertyKeys(type: Type): TIndexPropertyKeys; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.js b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.js new file mode 100644 index 00000000..c794ba0b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed-property-keys.js @@ -0,0 +1,36 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexPropertyKeys = IndexPropertyKeys; +const index_1 = require("../template-literal/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromTemplateLiteral(templateLiteral) { + const keys = (0, index_1.TemplateLiteralGenerate)(templateLiteral); + return keys.map(key => key.toString()); +} +// prettier-ignore +function FromUnion(types) { + const result = []; + for (const type of types) + result.push(...IndexPropertyKeys(type)); + return result; +} +// prettier-ignore +function FromLiteral(literalValue) { + return ([literalValue.toString()] // TS 5.4 observes TLiteralValue as not having a toString() + ); +} +/** Returns a tuple of PropertyKeys derived from the given TSchema */ +// prettier-ignore +function IndexPropertyKeys(type) { + return [...new Set(((0, kind_1.IsTemplateLiteral)(type) ? FromTemplateLiteral(type) : + (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : + (0, kind_1.IsLiteral)(type) ? FromLiteral(type.const) : + (0, kind_1.IsNumber)(type) ? ['[number]'] : + (0, kind_1.IsInteger)(type) ? ['[number]'] : + []))]; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.d.ts new file mode 100644 index 00000000..8a8d1d86 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.d.ts @@ -0,0 +1,52 @@ +import { type TSchema, SchemaOptions } from '../schema/index'; +import { type Assert } from '../helpers/index'; +import { type TComputed } from '../computed/index'; +import { type TNever } from '../never/index'; +import { type TArray } from '../array/index'; +import { type TIntersect } from '../intersect/index'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TUnion } from '../union/index'; +import { type TRecursive } from '../recursive/index'; +import { type TRef } from '../ref/index'; +import { type TTuple } from '../tuple/index'; +import { type TIntersectEvaluated } from '../intersect/index'; +import { type TUnionEvaluated } from '../union/index'; +import { type TIndexPropertyKeys } from './indexed-property-keys'; +import { type TIndexFromMappedKey } from './indexed-from-mapped-key'; +import { type TIndexFromMappedResult } from './indexed-from-mapped-result'; +type TFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest, TSchema>]> : Result); +type TFromIntersectRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? TFromIntersectRest : TFromIntersectRest : Result); +type TFromIntersect = (TIntersectEvaluated>>); +type TFromUnionRest = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? [] : TFromUnionRest : Result; +type TFromUnion = (TUnionEvaluated>>); +type TFromTuple = (Key extends keyof Types ? Types[Key] : Key extends '[number]' ? TUnionEvaluated : TNever); +type TFromArray = (Key extends '[number]' ? Type : TNever); +type AssertPropertyKey = Assert; +type TFromProperty = (Key extends keyof Properties ? Properties[Key] : `${AssertPropertyKey}` extends `${AssertPropertyKey}` ? Properties[AssertPropertyKey] : TNever); +export type TIndexFromPropertyKey = (Type extends TRecursive ? TIndexFromPropertyKey : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TObject ? TFromProperty : TNever); +export declare function IndexFromPropertyKey(type: Type, propertyKey: Key): TIndexFromPropertyKey; +export type TIndexFromPropertyKeys = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TIndexFromPropertyKeys, TSchema>]> : Result); +export declare function IndexFromPropertyKeys(type: Type, propertyKeys: [...PropertyKeys]): TIndexFromPropertyKeys; +type FromSchema = (TUnionEvaluated>); +declare function FromSchema(type: Type, propertyKeys: [...PropertyKeys]): FromSchema; +export type TIndexFromComputed = (TComputed<'Index', [Type, Key]>); +export declare function IndexFromComputed(type: Type, key: Key): TIndexFromComputed; +export type TIndex = (FromSchema); +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TIndexFromMappedKey; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index>(T: Type, K: Key, options?: SchemaOptions): TIndex; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, propertyKeys: readonly [...PropertyKeys], options?: SchemaOptions): TIndex; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.js b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.js new file mode 100644 index 00000000..002596dc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/indexed/indexed.js @@ -0,0 +1,98 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexFromPropertyKey = IndexFromPropertyKey; +exports.IndexFromPropertyKeys = IndexFromPropertyKeys; +exports.IndexFromComputed = IndexFromComputed; +exports.Index = Index; +const type_1 = require("../create/type"); +const index_1 = require("../error/index"); +const index_2 = require("../computed/index"); +const index_3 = require("../never/index"); +const index_4 = require("../intersect/index"); +const index_5 = require("../union/index"); +const indexed_property_keys_1 = require("./indexed-property-keys"); +const indexed_from_mapped_key_1 = require("./indexed-from-mapped-key"); +const indexed_from_mapped_result_1 = require("./indexed-from-mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromRest(types, key) { + return types.map(type => IndexFromPropertyKey(type, key)); +} +// prettier-ignore +function FromIntersectRest(types) { + return types.filter(type => !(0, kind_1.IsNever)(type)); +} +// prettier-ignore +function FromIntersect(types, key) { + return ((0, index_4.IntersectEvaluated)(FromIntersectRest(FromRest(types, key)))); +} +// prettier-ignore +function FromUnionRest(types) { + return (types.some(L => (0, kind_1.IsNever)(L)) + ? [] + : types); +} +// prettier-ignore +function FromUnion(types, key) { + return ((0, index_5.UnionEvaluated)(FromUnionRest(FromRest(types, key)))); +} +// prettier-ignore +function FromTuple(types, key) { + return (key in types ? types[key] : + key === '[number]' ? (0, index_5.UnionEvaluated)(types) : + (0, index_3.Never)()); +} +// prettier-ignore +function FromArray(type, key) { + return (key === '[number]' + ? type + : (0, index_3.Never)()); +} +// prettier-ignore +function FromProperty(properties, propertyKey) { + return (propertyKey in properties ? properties[propertyKey] : (0, index_3.Never)()); +} +// prettier-ignore +function IndexFromPropertyKey(type, propertyKey) { + return ((0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf, propertyKey) : + (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf, propertyKey) : + (0, kind_1.IsTuple)(type) ? FromTuple(type.items ?? [], propertyKey) : + (0, kind_1.IsArray)(type) ? FromArray(type.items, propertyKey) : + (0, kind_1.IsObject)(type) ? FromProperty(type.properties, propertyKey) : + (0, index_3.Never)()); +} +// prettier-ignore +function IndexFromPropertyKeys(type, propertyKeys) { + return propertyKeys.map(propertyKey => IndexFromPropertyKey(type, propertyKey)); +} +// prettier-ignore +function FromSchema(type, propertyKeys) { + return ((0, index_5.UnionEvaluated)(IndexFromPropertyKeys(type, propertyKeys))); +} +// prettier-ignore +function IndexFromComputed(type, key) { + return (0, index_2.Computed)('Index', [type, key]); +} +/** `[Json]` Returns an Indexed property type for the given keys */ +function Index(type, key, options) { + // computed-type + if ((0, kind_1.IsRef)(type) || (0, kind_1.IsRef)(key)) { + const error = `Index types using Ref parameters require both Type and Key to be of TSchema`; + if (!(0, kind_1.IsSchema)(type) || !(0, kind_1.IsSchema)(key)) + throw new index_1.TypeBoxError(error); + return (0, index_2.Computed)('Index', [type, key]); + } + // mapped-types + if ((0, kind_1.IsMappedResult)(key)) + return (0, indexed_from_mapped_result_1.IndexFromMappedResult)(type, key, options); + if ((0, kind_1.IsMappedKey)(key)) + return (0, indexed_from_mapped_key_1.IndexFromMappedKey)(type, key, options); + // prettier-ignore + return (0, type_1.CreateType)((0, kind_1.IsSchema)(key) + ? FromSchema(type, (0, indexed_property_keys_1.IndexPropertyKeys)(key)) + : FromSchema(type, key), options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.d.ts new file mode 100644 index 00000000..6f813f63 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.d.ts @@ -0,0 +1 @@ +export * from './instance-type'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.js b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.js new file mode 100644 index 00000000..a2fad0fb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./instance-type"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.d.ts new file mode 100644 index 00000000..525c176a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.d.ts @@ -0,0 +1,6 @@ +import { type TSchema, SchemaOptions } from '../schema/index'; +import { type TConstructor } from '../constructor/index'; +import { type TNever } from '../never/index'; +export type TInstanceType ? InstanceType : TNever> = Result; +/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ +export declare function InstanceType(schema: Type, options?: SchemaOptions): TInstanceType; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.js b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.js new file mode 100644 index 00000000..2d14e36a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instance-type/instance-type.js @@ -0,0 +1,44 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstanceType = InstanceType; +const type_1 = require("../create/type"); +const index_1 = require("../never/index"); +const KindGuard = __importStar(require("../guard/kind")); +/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ +function InstanceType(schema, options) { + return (KindGuard.IsConstructor(schema) ? (0, type_1.CreateType)(schema.returns, options) : (0, index_1.Never)(options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.d.ts new file mode 100644 index 00000000..3371567f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.d.ts @@ -0,0 +1 @@ +export * from './instantiate'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.js b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.js new file mode 100644 index 00000000..2e6f35ae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./instantiate"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.d.ts new file mode 100644 index 00000000..381fb6ca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.d.ts @@ -0,0 +1,50 @@ +import { type TSchema } from '../schema/index'; +import { type TArgument } from '../argument/index'; +import { type TUnknown } from '../unknown/index'; +import { type TReadonlyOptional } from '../readonly-optional/index'; +import { type TReadonly } from '../readonly/index'; +import { type TOptional } from '../optional/index'; +import { type TConstructor } from '../constructor/index'; +import { type TFunction } from '../function/index'; +import { type TIntersect } from '../intersect/index'; +import { type TUnion } from '../union/index'; +import { type TTuple } from '../tuple/index'; +import { type TArray } from '../array/index'; +import { type TAsyncIterator } from '../async-iterator/index'; +import { type TIterator } from '../iterator/index'; +import { type TPromise } from '../promise/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TRecordOrObject, type TRecord } from '../record/index'; +type TFromConstructor, TFromType>> = Result; +type TFromFunction, TFromType>> = Result; +type TFromIntersect>> = Result; +type TFromUnion>> = Result; +type TFromTuple>> = Result; +type TFromArray>> = Result; +type TFromAsyncIterator>> = Result; +type TFromIterator>> = Result; +type TFromPromise>> = Result; +type TFromObject, Result extends TSchema = TObject> = Result; +type TFromRecord, MappedValue extends TSchema = TFromType, Result extends TSchema = TRecordOrObject> = Result; +type TFromArgument = Result; +type TFromProperty ? true : false, IsOptional extends boolean = Type extends TOptional ? true : false, Mapped extends TSchema = TFromType, Result extends TSchema = ([ + IsReadonly, + IsOptional +] extends [true, true] ? TReadonlyOptional : [ + IsReadonly, + IsOptional +] extends [true, false] ? TReadonly : [ + IsReadonly, + IsOptional +] extends [false, true] ? TOptional : Mapped)> = Result; +type TFromProperties; +}> = Result; +export type TFromTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes]> : Result); +export declare function FromTypes(args: [...Args], types: [...Types]): TFromTypes; +export type TFromType = (Type extends TConstructor ? TFromConstructor : Type extends TFunction ? TFromFunction : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TAsyncIterator ? TFromAsyncIterator : Type extends TIterator ? TFromIterator : Type extends TPromise ? TFromPromise : Type extends TObject ? TFromObject : Type extends TRecord ? TFromRecord : Type extends TArgument ? TFromArgument : Type); +/** `[JavaScript]` Instantiates a type with the given parameters */ +export type TInstantiate> = Result; +/** `[JavaScript]` Instantiates a type with the given parameters */ +export declare function Instantiate(type: Type, args: [...Args]): TInstantiate; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.js b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.js new file mode 100644 index 00000000..c1c4970a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/instantiate/instantiate.js @@ -0,0 +1,153 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FromTypes = FromTypes; +exports.Instantiate = Instantiate; +const type_1 = require("../clone/type"); +const index_1 = require("../unknown/index"); +const index_2 = require("../readonly-optional/index"); +const index_3 = require("../readonly/index"); +const index_4 = require("../optional/index"); +const index_5 = require("../object/index"); +const index_6 = require("../record/index"); +const ValueGuard = __importStar(require("../guard/value")); +const KindGuard = __importStar(require("../guard/kind")); +// prettier-ignore +function FromConstructor(args, type) { + type.parameters = FromTypes(args, type.parameters); + type.returns = FromType(args, type.returns); + return type; +} +// prettier-ignore +function FromFunction(args, type) { + type.parameters = FromTypes(args, type.parameters); + type.returns = FromType(args, type.returns); + return type; +} +// prettier-ignore +function FromIntersect(args, type) { + type.allOf = FromTypes(args, type.allOf); + return type; +} +// prettier-ignore +function FromUnion(args, type) { + type.anyOf = FromTypes(args, type.anyOf); + return type; +} +// prettier-ignore +function FromTuple(args, type) { + if (ValueGuard.IsUndefined(type.items)) + return type; + type.items = FromTypes(args, type.items); + return type; +} +// prettier-ignore +function FromArray(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromAsyncIterator(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromIterator(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromPromise(args, type) { + type.item = FromType(args, type.item); + return type; +} +// prettier-ignore +function FromObject(args, type) { + const mappedProperties = FromProperties(args, type.properties); + return { ...type, ...(0, index_5.Object)(mappedProperties) }; // retain options +} +// prettier-ignore +function FromRecord(args, type) { + const mappedKey = FromType(args, (0, index_6.RecordKey)(type)); + const mappedValue = FromType(args, (0, index_6.RecordValue)(type)); + const result = (0, index_6.Record)(mappedKey, mappedValue); + return { ...type, ...result }; // retain options +} +// prettier-ignore +function FromArgument(args, argument) { + return argument.index in args ? args[argument.index] : (0, index_1.Unknown)(); +} +// prettier-ignore +function FromProperty(args, type) { + const isReadonly = KindGuard.IsReadonly(type); + const isOptional = KindGuard.IsOptional(type); + const mapped = FromType(args, type); + return (isReadonly && isOptional ? (0, index_2.ReadonlyOptional)(mapped) : + isReadonly && !isOptional ? (0, index_3.Readonly)(mapped) : + !isReadonly && isOptional ? (0, index_4.Optional)(mapped) : + mapped); +} +// prettier-ignore +function FromProperties(args, properties) { + return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => { + return { ...result, [key]: FromProperty(args, properties[key]) }; + }, {}); +} +// prettier-ignore +function FromTypes(args, types) { + return types.map(type => FromType(args, type)); +} +// prettier-ignore +function FromType(args, type) { + return (KindGuard.IsConstructor(type) ? FromConstructor(args, type) : + KindGuard.IsFunction(type) ? FromFunction(args, type) : + KindGuard.IsIntersect(type) ? FromIntersect(args, type) : + KindGuard.IsUnion(type) ? FromUnion(args, type) : + KindGuard.IsTuple(type) ? FromTuple(args, type) : + KindGuard.IsArray(type) ? FromArray(args, type) : + KindGuard.IsAsyncIterator(type) ? FromAsyncIterator(args, type) : + KindGuard.IsIterator(type) ? FromIterator(args, type) : + KindGuard.IsPromise(type) ? FromPromise(args, type) : + KindGuard.IsObject(type) ? FromObject(args, type) : + KindGuard.IsRecord(type) ? FromRecord(args, type) : + KindGuard.IsArgument(type) ? FromArgument(args, type) : + type); +} +/** `[JavaScript]` Instantiates a type with the given parameters */ +// prettier-ignore +function Instantiate(type, args) { + return FromType(args, (0, type_1.CloneType)(type)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/integer/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/integer/index.d.ts new file mode 100644 index 00000000..3520152d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/integer/index.d.ts @@ -0,0 +1 @@ +export * from './integer'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/integer/index.js b/node_modules/@sinclair/typebox/build/cjs/type/integer/index.js new file mode 100644 index 00000000..d9121bb2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/integer/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./integer"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.d.ts new file mode 100644 index 00000000..24e6f00c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface IntegerOptions extends SchemaOptions { + exclusiveMaximum?: number; + exclusiveMinimum?: number; + maximum?: number; + minimum?: number; + multipleOf?: number; +} +export interface TInteger extends TSchema, IntegerOptions { + [Kind]: 'Integer'; + static: number; + type: 'integer'; +} +/** `[Json]` Creates an Integer type */ +export declare function Integer(options?: IntegerOptions): TInteger; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.js b/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.js new file mode 100644 index 00000000..93db7506 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Integer = Integer; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates an Integer type */ +function Integer(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Integer', type: 'integer' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.d.ts new file mode 100644 index 00000000..2fc585c3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.d.ts @@ -0,0 +1,3 @@ +export * from './intersect-evaluated'; +export * from './intersect-type'; +export * from './intersect'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.js b/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.js new file mode 100644 index 00000000..da316412 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./intersect-evaluated"), exports); +__exportStar(require("./intersect-type"), exports); +__exportStar(require("./intersect"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.d.ts new file mode 100644 index 00000000..2877c269 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.d.ts @@ -0,0 +1,3 @@ +import type { TSchema } from '../schema/index'; +import type { TIntersect, IntersectOptions } from './intersect-type'; +export declare function IntersectCreate(T: [...T], options?: IntersectOptions): TIntersect; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.js b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.js new file mode 100644 index 00000000..4d72e7aa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-create.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IntersectCreate = IntersectCreate; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// ------------------------------------------------------------------ +// IntersectCreate +// ------------------------------------------------------------------ +// prettier-ignore +function IntersectCreate(T, options = {}) { + const allObjects = T.every((schema) => (0, kind_1.IsObject)(schema)); + const clonedUnevaluatedProperties = (0, kind_1.IsSchema)(options.unevaluatedProperties) + ? { unevaluatedProperties: options.unevaluatedProperties } + : {}; + return (0, type_1.CreateType)((options.unevaluatedProperties === false || (0, kind_1.IsSchema)(options.unevaluatedProperties) || allObjects + ? { ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', type: 'object', allOf: T } + : { ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', allOf: T }), options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.d.ts new file mode 100644 index 00000000..3216373f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.d.ts @@ -0,0 +1,13 @@ +import type { TSchema } from '../schema/index'; +import { type TNever } from '../never/index'; +import { type TOptional } from '../optional/index'; +import type { TReadonly } from '../readonly/index'; +import { TIntersect, IntersectOptions } from './intersect-type'; +type TIsIntersectOptional = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TIsIntersectOptional : false : true); +type TRemoveOptionalFromType = (Type extends TReadonly ? TReadonly> : Type extends TOptional ? TRemoveOptionalFromType : Type); +type TRemoveOptionalFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TRemoveOptionalFromRest]> : TRemoveOptionalFromRest : Result); +type TResolveIntersect = (TIsIntersectOptional extends true ? TOptional>> : TIntersect>); +export type TIntersectEvaluated = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TResolveIntersect); +/** `[Json]` Creates an evaluated Intersect type */ +export declare function IntersectEvaluated>(types: [...Types], options?: IntersectOptions): Result; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.js b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.js new file mode 100644 index 00000000..1167f529 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-evaluated.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IntersectEvaluated = IntersectEvaluated; +const index_1 = require("../symbols/index"); +const type_1 = require("../create/type"); +const index_2 = require("../discard/index"); +const index_3 = require("../never/index"); +const index_4 = require("../optional/index"); +const intersect_create_1 = require("./intersect-create"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function IsIntersectOptional(types) { + return types.every(left => (0, kind_1.IsOptional)(left)); +} +// prettier-ignore +function RemoveOptionalFromType(type) { + return ((0, index_2.Discard)(type, [index_1.OptionalKind])); +} +// prettier-ignore +function RemoveOptionalFromRest(types) { + return types.map(left => (0, kind_1.IsOptional)(left) ? RemoveOptionalFromType(left) : left); +} +// prettier-ignore +function ResolveIntersect(types, options) { + return (IsIntersectOptional(types) + ? (0, index_4.Optional)((0, intersect_create_1.IntersectCreate)(RemoveOptionalFromRest(types), options)) + : (0, intersect_create_1.IntersectCreate)(RemoveOptionalFromRest(types), options)); +} +/** `[Json]` Creates an evaluated Intersect type */ +function IntersectEvaluated(types, options = {}) { + if (types.length === 1) + return (0, type_1.CreateType)(types[0], options); + if (types.length === 0) + return (0, index_3.Never)(options); + if (types.some((schema) => (0, kind_1.IsTransform)(schema))) + throw new Error('Cannot intersect transform types'); + return ResolveIntersect(types, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.d.ts new file mode 100644 index 00000000..dc8f3d1f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.d.ts @@ -0,0 +1,15 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +type TIntersectStatic = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TIntersectStatic> : Acc; +export type TUnevaluatedProperties = undefined | TSchema | boolean; +export interface IntersectOptions extends SchemaOptions { + unevaluatedProperties?: TUnevaluatedProperties; +} +export interface TIntersect extends TSchema, IntersectOptions { + [Kind]: 'Intersect'; + static: TIntersectStatic; + type?: 'object'; + allOf: [...T]; +} +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.js b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.js new file mode 100644 index 00000000..aca9239a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect-type.js @@ -0,0 +1,4 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../symbols/index"); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.d.ts new file mode 100644 index 00000000..f438cf50 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.d.ts @@ -0,0 +1,6 @@ +import type { TSchema } from '../schema/index'; +import { type TNever } from '../never/index'; +import { TIntersect, IntersectOptions } from './intersect-type'; +export type Intersect = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TIntersect); +/** `[Json]` Creates an evaluated Intersect type */ +export declare function Intersect(types: [...Types], options?: IntersectOptions): Intersect; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.js b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.js new file mode 100644 index 00000000..10403f77 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intersect/intersect.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Intersect = Intersect; +const type_1 = require("../create/type"); +const index_1 = require("../never/index"); +const intersect_create_1 = require("./intersect-create"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +/** `[Json]` Creates an evaluated Intersect type */ +function Intersect(types, options) { + if (types.length === 1) + return (0, type_1.CreateType)(types[0], options); + if (types.length === 0) + return (0, index_1.Never)(options); + if (types.some((schema) => (0, kind_1.IsTransform)(schema))) + throw new Error('Cannot intersect transform types'); + return (0, intersect_create_1.IntersectCreate)(types, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.d.ts new file mode 100644 index 00000000..274a5f78 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.d.ts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TIntrinsic } from './intrinsic'; +export type TCapitalize = TIntrinsic; +/** `[Json]` Intrinsic function to Capitalize LiteralString types */ +export declare function Capitalize(T: T, options?: SchemaOptions): TCapitalize; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.js new file mode 100644 index 00000000..1e3782e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/capitalize.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Capitalize = Capitalize; +const intrinsic_1 = require("./intrinsic"); +/** `[Json]` Intrinsic function to Capitalize LiteralString types */ +function Capitalize(T, options = {}) { + return (0, intrinsic_1.Intrinsic)(T, 'Capitalize', options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.d.ts new file mode 100644 index 00000000..baf64a7e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.d.ts @@ -0,0 +1,6 @@ +export * from './capitalize'; +export * from './intrinsic-from-mapped-key'; +export * from './intrinsic'; +export * from './lowercase'; +export * from './uncapitalize'; +export * from './uppercase'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.js new file mode 100644 index 00000000..46fda88f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/index.js @@ -0,0 +1,23 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./capitalize"), exports); +__exportStar(require("./intrinsic-from-mapped-key"), exports); +__exportStar(require("./intrinsic"), exports); +__exportStar(require("./lowercase"), exports); +__exportStar(require("./uncapitalize"), exports); +__exportStar(require("./uppercase"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts new file mode 100644 index 00000000..9cca5a35 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts @@ -0,0 +1,14 @@ +import type { SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { Assert } from '../helpers/index'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +import { type TIntrinsic, type IntrinsicMode } from './intrinsic'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +type TMappedIntrinsicPropertyKey = { + [_ in K]: TIntrinsic>, M>; +}; +type TMappedIntrinsicPropertyKeys = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedIntrinsicPropertyKeys> : Acc); +type TMappedIntrinsicProperties = (TMappedIntrinsicPropertyKeys); +export type TIntrinsicFromMappedKey> = (TMappedResult

); +export declare function IntrinsicFromMappedKey>(T: K, M: M, options: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js new file mode 100644 index 00000000..5a3226b6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IntrinsicFromMappedKey = IntrinsicFromMappedKey; +const index_1 = require("../mapped/index"); +const intrinsic_1 = require("./intrinsic"); +const index_2 = require("../literal/index"); +const value_1 = require("../clone/value"); +// prettier-ignore +function MappedIntrinsicPropertyKey(K, M, options) { + return { + [K]: (0, intrinsic_1.Intrinsic)((0, index_2.Literal)(K), M, (0, value_1.Clone)(options)) + }; +} +// prettier-ignore +function MappedIntrinsicPropertyKeys(K, M, options) { + const result = K.reduce((Acc, L) => { + return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) }; + }, {}); + return result; +} +// prettier-ignore +function MappedIntrinsicProperties(T, M, options) { + return MappedIntrinsicPropertyKeys(T['keys'], M, options); +} +// prettier-ignore +function IntrinsicFromMappedKey(T, M, options) { + const P = MappedIntrinsicProperties(T, M, options); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.d.ts new file mode 100644 index 00000000..8e250106 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TTemplateLiteral, type TTemplateLiteralKind } from '../template-literal/index'; +import { type TIntrinsicFromMappedKey } from './intrinsic-from-mapped-key'; +import { type TLiteral } from '../literal/index'; +import { type TUnion } from '../union/index'; +import { type TMappedKey } from '../mapped/index'; +export type IntrinsicMode = 'Uppercase' | 'Lowercase' | 'Capitalize' | 'Uncapitalize'; +type TFromTemplateLiteral = M extends IntrinsicMode ? T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? [TIntrinsic, ...TFromTemplateLiteral] : T : T; +type TFromLiteralValue = (T extends string ? M extends 'Uncapitalize' ? Uncapitalize : M extends 'Capitalize' ? Capitalize : M extends 'Uppercase' ? Uppercase : M extends 'Lowercase' ? Lowercase : string : T); +type TFromRest = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Acc; +export type TIntrinsic = T extends TMappedKey ? TIntrinsicFromMappedKey : T extends TTemplateLiteral ? TTemplateLiteral> : T extends TUnion ? TUnion> : T extends TLiteral ? TLiteral> : T; +/** Applies an intrinsic string manipulation to the given type. */ +export declare function Intrinsic(schema: T, mode: M, options?: SchemaOptions): TIntrinsicFromMappedKey; +/** Applies an intrinsic string manipulation to the given type. */ +export declare function Intrinsic(schema: T, mode: M, options?: SchemaOptions): TIntrinsic; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.js new file mode 100644 index 00000000..1f72f3d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/intrinsic.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Intrinsic = Intrinsic; +const type_1 = require("../create/type"); +const index_1 = require("../template-literal/index"); +const intrinsic_from_mapped_key_1 = require("./intrinsic-from-mapped-key"); +const index_2 = require("../literal/index"); +const index_3 = require("../union/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// ------------------------------------------------------------------ +// Apply +// ------------------------------------------------------------------ +function ApplyUncapitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return [first.toLowerCase(), rest].join(''); +} +function ApplyCapitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return [first.toUpperCase(), rest].join(''); +} +function ApplyUppercase(value) { + return value.toUpperCase(); +} +function ApplyLowercase(value) { + return value.toLowerCase(); +} +function FromTemplateLiteral(schema, mode, options) { + // note: template literals require special runtime handling as they are encoded in string patterns. + // This diverges from the mapped type which would otherwise map on the template literal kind. + const expression = (0, index_1.TemplateLiteralParseExact)(schema.pattern); + const finite = (0, index_1.IsTemplateLiteralExpressionFinite)(expression); + if (!finite) + return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) }; + const strings = [...(0, index_1.TemplateLiteralExpressionGenerate)(expression)]; + const literals = strings.map((value) => (0, index_2.Literal)(value)); + const mapped = FromRest(literals, mode); + const union = (0, index_3.Union)(mapped); + return (0, index_1.TemplateLiteral)([union], options); +} +// prettier-ignore +function FromLiteralValue(value, mode) { + return (typeof value === 'string' ? (mode === 'Uncapitalize' ? ApplyUncapitalize(value) : + mode === 'Capitalize' ? ApplyCapitalize(value) : + mode === 'Uppercase' ? ApplyUppercase(value) : + mode === 'Lowercase' ? ApplyLowercase(value) : + value) : value.toString()); +} +// prettier-ignore +function FromRest(T, M) { + return T.map(L => Intrinsic(L, M)); +} +/** Applies an intrinsic string manipulation to the given type. */ +function Intrinsic(schema, mode, options = {}) { + // prettier-ignore + return ( + // Intrinsic-Mapped-Inference + (0, kind_1.IsMappedKey)(schema) ? (0, intrinsic_from_mapped_key_1.IntrinsicFromMappedKey)(schema, mode, options) : + // Standard-Inference + (0, kind_1.IsTemplateLiteral)(schema) ? FromTemplateLiteral(schema, mode, options) : + (0, kind_1.IsUnion)(schema) ? (0, index_3.Union)(FromRest(schema.anyOf, mode), options) : + (0, kind_1.IsLiteral)(schema) ? (0, index_2.Literal)(FromLiteralValue(schema.const, mode), options) : + // Default Type + (0, type_1.CreateType)(schema, options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.d.ts new file mode 100644 index 00000000..0e6a3ee4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.d.ts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TIntrinsic } from './intrinsic'; +export type TLowercase = TIntrinsic; +/** `[Json]` Intrinsic function to Lowercase LiteralString types */ +export declare function Lowercase(T: T, options?: SchemaOptions): TLowercase; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.js new file mode 100644 index 00000000..1e41b253 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/lowercase.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Lowercase = Lowercase; +const intrinsic_1 = require("./intrinsic"); +/** `[Json]` Intrinsic function to Lowercase LiteralString types */ +function Lowercase(T, options = {}) { + return (0, intrinsic_1.Intrinsic)(T, 'Lowercase', options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.d.ts new file mode 100644 index 00000000..2632073d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.d.ts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TIntrinsic } from './intrinsic'; +export type TUncapitalize = TIntrinsic; +/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ +export declare function Uncapitalize(T: T, options?: SchemaOptions): TUncapitalize; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.js new file mode 100644 index 00000000..d204442f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uncapitalize.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Uncapitalize = Uncapitalize; +const intrinsic_1 = require("./intrinsic"); +/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ +function Uncapitalize(T, options = {}) { + return (0, intrinsic_1.Intrinsic)(T, 'Uncapitalize', options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.d.ts new file mode 100644 index 00000000..b3515110 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.d.ts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TIntrinsic } from './intrinsic'; +export type TUppercase = TIntrinsic; +/** `[Json]` Intrinsic function to Uppercase LiteralString types */ +export declare function Uppercase(T: T, options?: SchemaOptions): TUppercase; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.js b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.js new file mode 100644 index 00000000..aa0bd86e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/intrinsic/uppercase.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Uppercase = Uppercase; +const intrinsic_1 = require("./intrinsic"); +/** `[Json]` Intrinsic function to Uppercase LiteralString types */ +function Uppercase(T, options = {}) { + return (0, intrinsic_1.Intrinsic)(T, 'Uppercase', options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.d.ts new file mode 100644 index 00000000..9ffa4da1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.d.ts @@ -0,0 +1 @@ +export * from './iterator'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.js b/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.js new file mode 100644 index 00000000..5bdc5542 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/iterator/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./iterator"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.d.ts new file mode 100644 index 00000000..73aca9c7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.d.ts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +export interface TIterator extends TSchema { + [Kind]: 'Iterator'; + static: IterableIterator>; + type: 'Iterator'; + items: T; +} +/** `[JavaScript]` Creates an Iterator type */ +export declare function Iterator(items: T, options?: SchemaOptions): TIterator; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.js b/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.js new file mode 100644 index 00000000..d8a084f6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/iterator/iterator.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Iterator = Iterator; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates an Iterator type */ +function Iterator(items, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Iterator', type: 'Iterator', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.d.ts new file mode 100644 index 00000000..ca87784f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.d.ts @@ -0,0 +1,4 @@ +export * from './keyof-from-mapped-result'; +export * from './keyof-property-entries'; +export * from './keyof-property-keys'; +export * from './keyof'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.js b/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.js new file mode 100644 index 00000000..33e448d0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/index.js @@ -0,0 +1,21 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keyof-from-mapped-result"), exports); +__exportStar(require("./keyof-property-entries"), exports); +__exportStar(require("./keyof-property-keys"), exports); +__exportStar(require("./keyof"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.d.ts new file mode 100644 index 00000000..30faae1e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TKeyOfFromType } from './keyof'; +type TFromProperties = ({ + [K2 in keyof Properties]: TKeyOfFromType; +}); +type TFromMappedResult = (Evaluate>); +export type TKeyOfFromMappedResult> = (Ensure>); +export declare function KeyOfFromMappedResult>(mappedResult: MappedResult, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.js new file mode 100644 index 00000000..0c5df452 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-from-mapped-result.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyOfFromMappedResult = KeyOfFromMappedResult; +const index_1 = require("../mapped/index"); +const keyof_1 = require("./keyof"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromProperties(properties, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = (0, keyof_1.KeyOf)(properties[K2], (0, value_1.Clone)(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, options) { + return FromProperties(mappedResult.properties, options); +} +// prettier-ignore +function KeyOfFromMappedResult(mappedResult, options) { + const properties = FromMappedResult(mappedResult, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.d.ts new file mode 100644 index 00000000..0bb734b7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.d.ts @@ -0,0 +1,7 @@ +import { TSchema } from '../schema/index'; +/** + * `[Utility]` Resolves an array of keys and schemas from the given schema. This method is faster + * than obtaining the keys and resolving each individually via indexing. This method was written + * accellerate Intersect and Union encoding. + */ +export declare function KeyOfPropertyEntries(schema: TSchema): [key: string, schema: TSchema][]; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.js b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.js new file mode 100644 index 00000000..10b5e4a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-entries.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyOfPropertyEntries = KeyOfPropertyEntries; +const indexed_1 = require("../indexed/indexed"); +const keyof_property_keys_1 = require("./keyof-property-keys"); +/** + * `[Utility]` Resolves an array of keys and schemas from the given schema. This method is faster + * than obtaining the keys and resolving each individually via indexing. This method was written + * accellerate Intersect and Union encoding. + */ +function KeyOfPropertyEntries(schema) { + const keys = (0, keyof_property_keys_1.KeyOfPropertyKeys)(schema); + const schemas = (0, indexed_1.IndexFromPropertyKeys)(schema, keys); + return keys.map((_, index) => [keys[index], schemas[index]]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.d.ts new file mode 100644 index 00000000..2f029aa0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.d.ts @@ -0,0 +1,24 @@ +import type { TSchema } from '../schema/index'; +import { type ZeroString, type UnionToTuple, type TIncrement } from '../helpers/index'; +import type { TRecursive } from '../recursive/index'; +import type { TIntersect } from '../intersect/index'; +import type { TUnion } from '../union/index'; +import type { TTuple } from '../tuple/index'; +import type { TArray } from '../array/index'; +import type { TObject, TProperties } from '../object/index'; +import { type TSetUnionMany, type TSetIntersectMany } from '../sets/index'; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +type TFromIntersect, PropertyKeys extends PropertyKey[] = TSetUnionMany> = PropertyKeys; +type TFromUnion, PropertyKeys extends PropertyKey[] = TSetIntersectMany> = PropertyKeys; +type TFromTuple = Types extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple, [...Acc, Indexer]> : Acc; +type TFromArray<_ extends TSchema> = ([ + '[number]' +]); +type TFromProperties = (UnionToTuple); +export type TKeyOfPropertyKeys = (Type extends TRecursive ? TKeyOfPropertyKeys : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TObject ? TFromProperties : [ +]); +/** Returns a tuple of PropertyKeys derived from the given TSchema. */ +export declare function KeyOfPropertyKeys(type: Type): TKeyOfPropertyKeys; +/** Returns a regular expression pattern derived from the given TSchema */ +export declare function KeyOfPattern(schema: TSchema): string; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.js b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.js new file mode 100644 index 00000000..e9a85104 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof-property-keys.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyOfPropertyKeys = KeyOfPropertyKeys; +exports.KeyOfPattern = KeyOfPattern; +const index_1 = require("../sets/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromRest(types) { + const result = []; + for (const L of types) + result.push(KeyOfPropertyKeys(L)); + return result; +} +// prettier-ignore +function FromIntersect(types) { + const propertyKeysArray = FromRest(types); + const propertyKeys = (0, index_1.SetUnionMany)(propertyKeysArray); + return propertyKeys; +} +// prettier-ignore +function FromUnion(types) { + const propertyKeysArray = FromRest(types); + const propertyKeys = (0, index_1.SetIntersectMany)(propertyKeysArray); + return propertyKeys; +} +// prettier-ignore +function FromTuple(types) { + return types.map((_, indexer) => indexer.toString()); +} +// prettier-ignore +function FromArray(_) { + return (['[number]']); +} +// prettier-ignore +function FromProperties(T) { + return (globalThis.Object.getOwnPropertyNames(T)); +} +// ------------------------------------------------------------------ +// FromPatternProperties +// ------------------------------------------------------------------ +// prettier-ignore +function FromPatternProperties(patternProperties) { + if (!includePatternProperties) + return []; + const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties); + return patternPropertyKeys.map(key => { + return (key[0] === '^' && key[key.length - 1] === '$') + ? key.slice(1, key.length - 1) + : key; + }); +} +/** Returns a tuple of PropertyKeys derived from the given TSchema. */ +// prettier-ignore +function KeyOfPropertyKeys(type) { + return ((0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf) : + (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : + (0, kind_1.IsTuple)(type) ? FromTuple(type.items ?? []) : + (0, kind_1.IsArray)(type) ? FromArray(type.items) : + (0, kind_1.IsObject)(type) ? FromProperties(type.properties) : + (0, kind_1.IsRecord)(type) ? FromPatternProperties(type.patternProperties) : + []); +} +// ---------------------------------------------------------------- +// KeyOfPattern +// ---------------------------------------------------------------- +let includePatternProperties = false; +/** Returns a regular expression pattern derived from the given TSchema */ +function KeyOfPattern(schema) { + includePatternProperties = true; + const keys = KeyOfPropertyKeys(schema); + includePatternProperties = false; + const pattern = keys.map((key) => `(${key})`); + return `^(${pattern.join('|')})$`; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.d.ts new file mode 100644 index 00000000..d28dac92 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.d.ts @@ -0,0 +1,21 @@ +import type { TSchema } from '../schema/index'; +import type { Assert, Ensure } from '../helpers/index'; +import type { TMappedResult } from '../mapped/index'; +import type { SchemaOptions } from '../schema/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TNumber } from '../number/index'; +import { TComputed } from '../computed/index'; +import { type TRef } from '../ref/index'; +import { type TKeyOfPropertyKeys } from './keyof-property-keys'; +import { type TUnionEvaluated } from '../union/index'; +import { type TKeyOfFromMappedResult } from './keyof-from-mapped-result'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +/** `[Internal]` Used by KeyOfFromMappedResult */ +export type TKeyOfFromType, PropertyKeyTypes extends TSchema[] = TKeyOfPropertyKeysToRest, Result = TUnionEvaluated> = Ensure; +export type TKeyOfPropertyKeysToRest = (PropertyKeys extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? L extends '[number]' ? TKeyOfPropertyKeysToRest : TKeyOfPropertyKeysToRest>]> : Result); +export declare function KeyOfPropertyKeysToRest(propertyKeys: [...PropertyKeys]): TKeyOfPropertyKeysToRest; +export type TKeyOf = (Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TMappedResult ? TKeyOfFromMappedResult : TKeyOfFromType); +/** `[Json]` Creates a KeyOf type */ +export declare function KeyOf(type: Type, options?: SchemaOptions): TKeyOf; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.js b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.js new file mode 100644 index 00000000..7b12990c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/keyof/keyof.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyOfPropertyKeysToRest = KeyOfPropertyKeysToRest; +exports.KeyOf = KeyOf; +const type_1 = require("../create/type"); +const index_1 = require("../literal/index"); +const index_2 = require("../number/index"); +const index_3 = require("../computed/index"); +const index_4 = require("../ref/index"); +const keyof_property_keys_1 = require("./keyof-property-keys"); +const index_5 = require("../union/index"); +const keyof_from_mapped_result_1 = require("./keyof-from-mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromComputed(target, parameters) { + return (0, index_3.Computed)('KeyOf', [(0, index_3.Computed)(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return (0, index_3.Computed)('KeyOf', [(0, index_4.Ref)($ref)]); +} +// prettier-ignore +function KeyOfFromType(type, options) { + const propertyKeys = (0, keyof_property_keys_1.KeyOfPropertyKeys)(type); + const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys); + const result = (0, index_5.UnionEvaluated)(propertyKeyTypes); + return (0, type_1.CreateType)(result, options); +} +// prettier-ignore +function KeyOfPropertyKeysToRest(propertyKeys) { + return propertyKeys.map(L => L === '[number]' ? (0, index_2.Number)() : (0, index_1.Literal)(L)); +} +/** `[Json]` Creates a KeyOf type */ +function KeyOf(type, options) { + return ((0, kind_1.IsComputed)(type) ? FromComputed(type.target, type.parameters) : (0, kind_1.IsRef)(type) ? FromRef(type.$ref) : (0, kind_1.IsMappedResult)(type) ? (0, keyof_from_mapped_result_1.KeyOfFromMappedResult)(type, options) : KeyOfFromType(type, options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/literal/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/literal/index.d.ts new file mode 100644 index 00000000..2f83d932 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/literal/index.d.ts @@ -0,0 +1 @@ +export * from './literal'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/literal/index.js b/node_modules/@sinclair/typebox/build/cjs/type/literal/index.js new file mode 100644 index 00000000..82e72500 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/literal/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./literal"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts new file mode 100644 index 00000000..d2a5e4bf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts @@ -0,0 +1,10 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export type TLiteralValue = boolean | number | string; +export interface TLiteral extends TSchema { + [Kind]: 'Literal'; + static: T; + const: T; +} +/** `[Json]` Creates a Literal type */ +export declare function Literal(value: T, options?: SchemaOptions): TLiteral; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.js b/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.js new file mode 100644 index 00000000..9c5a0d06 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Literal = Literal; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Literal type */ +function Literal(value, options) { + return (0, type_1.CreateType)({ + [index_1.Kind]: 'Literal', + const: value, + type: typeof value, + }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.d.ts new file mode 100644 index 00000000..7e1dbf90 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.d.ts @@ -0,0 +1,3 @@ +export * from './mapped-key'; +export * from './mapped-result'; +export * from './mapped'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.js b/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.js new file mode 100644 index 00000000..a33e180c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./mapped-key"), exports); +__exportStar(require("./mapped-result"), exports); +__exportStar(require("./mapped"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.d.ts new file mode 100644 index 00000000..334487a3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.d.ts @@ -0,0 +1,8 @@ +import type { TSchema } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TMappedKey extends TSchema { + [Kind]: 'MappedKey'; + static: T[number]; + keys: T; +} +export declare function MappedKey(T: [...T]): TMappedKey; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.js new file mode 100644 index 00000000..bebfee07 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-key.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedKey = MappedKey; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +// prettier-ignore +function MappedKey(T) { + return (0, type_1.CreateType)({ + [index_1.Kind]: 'MappedKey', + keys: T + }); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.d.ts new file mode 100644 index 00000000..5caf5e0b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.d.ts @@ -0,0 +1,9 @@ +import type { TSchema } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { Kind } from '../symbols/index'; +export interface TMappedResult extends TSchema { + [Kind]: 'MappedResult'; + properties: T; + static: unknown; +} +export declare function MappedResult(properties: T): TMappedResult; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.js new file mode 100644 index 00000000..2dcb9864 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped-result.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedResult = MappedResult; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +// prettier-ignore +function MappedResult(properties) { + return (0, type_1.CreateType)({ + [index_1.Kind]: 'MappedResult', + properties + }); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.d.ts new file mode 100644 index 00000000..2ec92e12 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.d.ts @@ -0,0 +1,47 @@ +import type { TSchema } from '../schema/index'; +import type { Ensure, Evaluate, Assert } from '../helpers/index'; +import { type TArray } from '../array/index'; +import { type TAsyncIterator } from '../async-iterator/index'; +import { type TConstructor } from '../constructor/index'; +import { type TEnum, type TEnumRecord } from '../enum/index'; +import { type TFunction } from '../function/index'; +import { type TIndexPropertyKeys } from '../indexed/index'; +import { type TIntersect } from '../intersect/index'; +import { type TIterator } from '../iterator/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index'; +import { type TOptional } from '../optional/index'; +import { type TPromise } from '../promise/index'; +import { type TReadonly } from '../readonly/index'; +import { type TTuple } from '../tuple/index'; +import { type TUnion } from '../union/index'; +import { type TSetIncludes } from '../sets/index'; +import { type TMappedResult } from './mapped-result'; +import type { TMappedKey } from './mapped-key'; +type TFromMappedResult = (K extends keyof P ? FromSchemaType : TMappedResult

); +type TMappedKeyToKnownMappedResultProperties = { + [_ in K]: TLiteral>; +}; +type TMappedKeyToUnknownMappedResultProperties

= (P extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedKeyToUnknownMappedResultProperties>; +}> : Acc); +type TMappedKeyToMappedResultProperties = (TSetIncludes extends true ? TMappedKeyToKnownMappedResultProperties : TMappedKeyToUnknownMappedResultProperties

); +type TFromMappedKey> = (TFromMappedResult); +type TFromRest = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Acc); +type FromProperties; +}>> = R; +declare function FromProperties(K: K, T: T): FromProperties; +type FromSchemaType = (T extends TReadonly ? TReadonly> : T extends TOptional ? TOptional> : T extends TMappedResult ? TFromMappedResult : T extends TMappedKey ? TFromMappedKey : T extends TConstructor ? TConstructor, FromSchemaType> : T extends TFunction ? TFunction, FromSchemaType> : T extends TAsyncIterator ? TAsyncIterator> : T extends TIterator ? TIterator> : T extends TIntersect ? TIntersect> : T extends TEnum ? TEnum : T extends TUnion ? TUnion> : T extends TTuple ? TTuple> : T extends TObject ? TObject> : T extends TArray ? TArray> : T extends TPromise ? TPromise> : T); +declare function FromSchemaType(K: K, T: T): FromSchemaType; +export type TMappedFunctionReturnType = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedFunctionReturnType; +}> : Acc); +export declare function MappedFunctionReturnType(K: [...K], T: T): TMappedFunctionReturnType; +export type TMappedFunction> = (T: I) => TSchema; +export type TMapped, R extends TProperties = Evaluate>>> = Ensure>; +/** `[Json]` Creates a Mapped object type */ +export declare function Mapped, F extends TMappedFunction = TMappedFunction, R extends TMapped = TMapped>(key: K, map: F, options?: ObjectOptions): R; +/** `[Json]` Creates a Mapped object type */ +export declare function Mapped = TMappedFunction, R extends TMapped = TMapped>(key: [...K], map: F, options?: ObjectOptions): R; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.js b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.js new file mode 100644 index 00000000..30dfcf2e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/mapped/mapped.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedFunctionReturnType = MappedFunctionReturnType; +exports.Mapped = Mapped; +const index_1 = require("../symbols/index"); +const index_2 = require("../discard/index"); +// evaluation types +const index_3 = require("../array/index"); +const index_4 = require("../async-iterator/index"); +const index_5 = require("../constructor/index"); +const index_6 = require("../function/index"); +const index_7 = require("../indexed/index"); +const index_8 = require("../intersect/index"); +const index_9 = require("../iterator/index"); +const index_10 = require("../literal/index"); +const index_11 = require("../object/index"); +const index_12 = require("../optional/index"); +const index_13 = require("../promise/index"); +const index_14 = require("../readonly/index"); +const index_15 = require("../tuple/index"); +const index_16 = require("../union/index"); +// operator +const index_17 = require("../sets/index"); +// mapping types +const mapped_result_1 = require("./mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function FromMappedResult(K, P) { + return (K in P + ? FromSchemaType(K, P[K]) + : (0, mapped_result_1.MappedResult)(P)); +} +// prettier-ignore +function MappedKeyToKnownMappedResultProperties(K) { + return { [K]: (0, index_10.Literal)(K) }; +} +// prettier-ignore +function MappedKeyToUnknownMappedResultProperties(P) { + const Acc = {}; + for (const L of P) + Acc[L] = (0, index_10.Literal)(L); + return Acc; +} +// prettier-ignore +function MappedKeyToMappedResultProperties(K, P) { + return ((0, index_17.SetIncludes)(P, K) + ? MappedKeyToKnownMappedResultProperties(K) + : MappedKeyToUnknownMappedResultProperties(P)); +} +// prettier-ignore +function FromMappedKey(K, P) { + const R = MappedKeyToMappedResultProperties(K, P); + return FromMappedResult(K, R); +} +// prettier-ignore +function FromRest(K, T) { + return T.map(L => FromSchemaType(K, L)); +} +// prettier-ignore +function FromProperties(K, T) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(T)) + Acc[K2] = FromSchemaType(K, T[K2]); + return Acc; +} +// prettier-ignore +function FromSchemaType(K, T) { + // required to retain user defined options for mapped type + const options = { ...T }; + return ( + // unevaluated modifier types + (0, kind_1.IsOptional)(T) ? (0, index_12.Optional)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.OptionalKind]))) : + (0, kind_1.IsReadonly)(T) ? (0, index_14.Readonly)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.ReadonlyKind]))) : + // unevaluated mapped types + (0, kind_1.IsMappedResult)(T) ? FromMappedResult(K, T.properties) : + (0, kind_1.IsMappedKey)(T) ? FromMappedKey(K, T.keys) : + // unevaluated types + (0, kind_1.IsConstructor)(T) ? (0, index_5.Constructor)(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : + (0, kind_1.IsFunction)(T) ? (0, index_6.Function)(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : + (0, kind_1.IsAsyncIterator)(T) ? (0, index_4.AsyncIterator)(FromSchemaType(K, T.items), options) : + (0, kind_1.IsIterator)(T) ? (0, index_9.Iterator)(FromSchemaType(K, T.items), options) : + (0, kind_1.IsIntersect)(T) ? (0, index_8.Intersect)(FromRest(K, T.allOf), options) : + (0, kind_1.IsUnion)(T) ? (0, index_16.Union)(FromRest(K, T.anyOf), options) : + (0, kind_1.IsTuple)(T) ? (0, index_15.Tuple)(FromRest(K, T.items ?? []), options) : + (0, kind_1.IsObject)(T) ? (0, index_11.Object)(FromProperties(K, T.properties), options) : + (0, kind_1.IsArray)(T) ? (0, index_3.Array)(FromSchemaType(K, T.items), options) : + (0, kind_1.IsPromise)(T) ? (0, index_13.Promise)(FromSchemaType(K, T.item), options) : + T); +} +// prettier-ignore +function MappedFunctionReturnType(K, T) { + const Acc = {}; + for (const L of K) + Acc[L] = FromSchemaType(L, T); + return Acc; +} +/** `[Json]` Creates a Mapped object type */ +function Mapped(key, map, options) { + const K = (0, kind_1.IsSchema)(key) ? (0, index_7.IndexPropertyKeys)(key) : key; + const RT = map({ [index_1.Kind]: 'MappedKey', keys: K }); + const R = MappedFunctionReturnType(K, RT); + return (0, index_11.Object)(R, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/compute.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/module/compute.d.ts new file mode 100644 index 00000000..ae3b05f5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/compute.d.ts @@ -0,0 +1,59 @@ +import { Ensure, Evaluate } from '../helpers/index'; +import { type TSchema } from '../schema/index'; +import { type TArray } from '../array/index'; +import { type TAwaited } from '../awaited/index'; +import { type TAsyncIterator } from '../async-iterator/index'; +import { TComputed } from '../computed/index'; +import { type TConstructor } from '../constructor/index'; +import { type TIndex, type TIndexPropertyKeys } from '../indexed/index'; +import { TEnum, type TEnumRecord } from '../enum/index'; +import { type TFunction } from '../function/index'; +import { type TIntersect, type TIntersectEvaluated } from '../intersect/index'; +import { type TIterator } from '../iterator/index'; +import { type TKeyOf } from '../keyof/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TOmit } from '../omit/index'; +import { type TOptional } from '../optional/index'; +import { type TPick } from '../pick/index'; +import { type TNever } from '../never/index'; +import { TPartial } from '../partial/index'; +import { type TReadonly } from '../readonly/index'; +import { type TRecordOrObject, type TRecord } from '../record/index'; +import { type TRef } from '../ref/index'; +import { type TRequired } from '../required/index'; +import { type TTransform } from '../transform/index'; +import { type TTuple } from '../tuple/index'; +import { type TUnion, type TUnionEvaluated } from '../union/index'; +type TDereferenceParameters = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TRef ? TDereferenceParameters]> : TDereferenceParameters]> : Result); +type TDereference ? TDereference : TFromType : TNever)> = Result; +type TFromAwaited = (Parameters extends [infer T0 extends TSchema] ? TAwaited : never); +type TFromIndex = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TIndex> extends infer Result extends TSchema ? Result : never : never); +type TFromKeyOf = (Parameters extends [infer T0 extends TSchema] ? TKeyOf : never); +type TFromPartial = (Parameters extends [infer T0 extends TSchema] ? TPartial : never); +type TFromOmit = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TOmit : never); +type TFromPick = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TPick : never); +type TFromRequired = (Parameters extends [infer T0 extends TSchema] ? TRequired : never); +type TFromComputed> = (Target extends 'Awaited' ? TFromAwaited : Target extends 'Index' ? TFromIndex : Target extends 'KeyOf' ? TFromKeyOf : Target extends 'Partial' ? TFromPartial : Target extends 'Omit' ? TFromOmit : Target extends 'Pick' ? TFromPick : Target extends 'Required' ? TFromRequired : TNever); +type TFromArray = (Ensure>>); +type TFromAsyncIterator = (TAsyncIterator>); +type TFromConstructor = (TConstructor, TFromType>); +type TFromFunction = Ensure, TFromType>>>; +type TFromIntersect = (Ensure>>); +type TFromIterator = (TIterator>); +type TFromObject = Ensure; +}>>>; +type TFromRecord>> = Result; +type TFromTransform ? TTransform, Output> : TTransform> = Result; +type TFromTuple = (Ensure>>); +type TFromUnion = (Ensure>>); +type TFromTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes]> : Result); +export type TFromType = (Type extends TOptional ? TOptional> : Type extends TReadonly ? TReadonly> : Type extends TTransform ? TFromTransform : Type extends TArray ? TFromArray : Type extends TAsyncIterator ? TFromAsyncIterator : Type extends TComputed ? TFromComputed : Type extends TConstructor ? TFromConstructor : Type extends TFunction ? TFromFunction : Type extends TIntersect ? TFromIntersect : Type extends TIterator ? TFromIterator : Type extends TObject ? TFromObject : Type extends TRecord ? TFromRecord : Type extends TTuple ? TFromTuple : Type extends TEnum ? Type : Type extends TUnion ? TFromUnion : Type); +export declare function FromType(moduleProperties: ModuleProperties, type: Type): TFromType; +export type TComputeType = (Key extends keyof ModuleProperties ? TFromType : TNever); +export declare function ComputeType(moduleProperties: ModuleProperties, key: Key): TComputeType; +export type TComputeModuleProperties = Evaluate<{ + [Key in keyof ModuleProperties]: TComputeType; +}>; +export declare function ComputeModuleProperties(moduleProperties: ModuleProperties): TComputeModuleProperties; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/compute.js b/node_modules/@sinclair/typebox/build/cjs/type/module/compute.js new file mode 100644 index 00000000..cd7c97b6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/compute.js @@ -0,0 +1,205 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FromType = FromType; +exports.ComputeType = ComputeType; +exports.ComputeModuleProperties = ComputeModuleProperties; +const index_1 = require("../create/index"); +const index_2 = require("../clone/index"); +const index_3 = require("../discard/index"); +const index_4 = require("../array/index"); +const index_5 = require("../awaited/index"); +const index_6 = require("../async-iterator/index"); +const index_7 = require("../constructor/index"); +const index_8 = require("../indexed/index"); +const index_9 = require("../function/index"); +const index_10 = require("../intersect/index"); +const index_11 = require("../iterator/index"); +const index_12 = require("../keyof/index"); +const index_13 = require("../object/index"); +const index_14 = require("../omit/index"); +const index_15 = require("../pick/index"); +const index_16 = require("../never/index"); +const index_17 = require("../partial/index"); +const index_18 = require("../record/index"); +const index_19 = require("../required/index"); +const index_20 = require("../tuple/index"); +const index_21 = require("../union/index"); +// ------------------------------------------------------------------ +// Symbols +// ------------------------------------------------------------------ +const index_22 = require("../symbols/index"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const KindGuard = __importStar(require("../guard/kind")); +// prettier-ignore +function DereferenceParameters(moduleProperties, types) { + return types.map((type) => { + return KindGuard.IsRef(type) + ? Dereference(moduleProperties, type.$ref) + : FromType(moduleProperties, type); + }); +} +// prettier-ignore +function Dereference(moduleProperties, ref) { + return (ref in moduleProperties + ? KindGuard.IsRef(moduleProperties[ref]) + ? Dereference(moduleProperties, moduleProperties[ref].$ref) + : FromType(moduleProperties, moduleProperties[ref]) + : (0, index_16.Never)()); +} +// prettier-ignore +function FromAwaited(parameters) { + return (0, index_5.Awaited)(parameters[0]); +} +// prettier-ignore +function FromIndex(parameters) { + return (0, index_8.Index)(parameters[0], parameters[1]); +} +// prettier-ignore +function FromKeyOf(parameters) { + return (0, index_12.KeyOf)(parameters[0]); +} +// prettier-ignore +function FromPartial(parameters) { + return (0, index_17.Partial)(parameters[0]); +} +// prettier-ignore +function FromOmit(parameters) { + return (0, index_14.Omit)(parameters[0], parameters[1]); +} +// prettier-ignore +function FromPick(parameters) { + return (0, index_15.Pick)(parameters[0], parameters[1]); +} +// prettier-ignore +function FromRequired(parameters) { + return (0, index_19.Required)(parameters[0]); +} +// prettier-ignore +function FromComputed(moduleProperties, target, parameters) { + const dereferenced = DereferenceParameters(moduleProperties, parameters); + return (target === 'Awaited' ? FromAwaited(dereferenced) : + target === 'Index' ? FromIndex(dereferenced) : + target === 'KeyOf' ? FromKeyOf(dereferenced) : + target === 'Partial' ? FromPartial(dereferenced) : + target === 'Omit' ? FromOmit(dereferenced) : + target === 'Pick' ? FromPick(dereferenced) : + target === 'Required' ? FromRequired(dereferenced) : + (0, index_16.Never)()); +} +function FromArray(moduleProperties, type) { + return (0, index_4.Array)(FromType(moduleProperties, type)); +} +function FromAsyncIterator(moduleProperties, type) { + return (0, index_6.AsyncIterator)(FromType(moduleProperties, type)); +} +// prettier-ignore +function FromConstructor(moduleProperties, parameters, instanceType) { + return (0, index_7.Constructor)(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType)); +} +// prettier-ignore +function FromFunction(moduleProperties, parameters, returnType) { + return (0, index_9.Function)(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType)); +} +function FromIntersect(moduleProperties, types) { + return (0, index_10.Intersect)(FromTypes(moduleProperties, types)); +} +function FromIterator(moduleProperties, type) { + return (0, index_11.Iterator)(FromType(moduleProperties, type)); +} +function FromObject(moduleProperties, properties) { + return (0, index_13.Object)(globalThis.Object.keys(properties).reduce((result, key) => { + return { ...result, [key]: FromType(moduleProperties, properties[key]) }; + }, {})); +} +// prettier-ignore +function FromRecord(moduleProperties, type) { + const [value, pattern] = [FromType(moduleProperties, (0, index_18.RecordValue)(type)), (0, index_18.RecordPattern)(type)]; + const result = (0, index_2.CloneType)(type); + result.patternProperties[pattern] = value; + return result; +} +// prettier-ignore +function FromTransform(moduleProperties, transform) { + return (KindGuard.IsRef(transform)) + ? { ...Dereference(moduleProperties, transform.$ref), [index_22.TransformKind]: transform[index_22.TransformKind] } + : transform; +} +function FromTuple(moduleProperties, types) { + return (0, index_20.Tuple)(FromTypes(moduleProperties, types)); +} +function FromUnion(moduleProperties, types) { + return (0, index_21.Union)(FromTypes(moduleProperties, types)); +} +function FromTypes(moduleProperties, types) { + return types.map((type) => FromType(moduleProperties, type)); +} +// prettier-ignore +function FromType(moduleProperties, type) { + return ( + // Modifiers + KindGuard.IsOptional(type) ? (0, index_1.CreateType)(FromType(moduleProperties, (0, index_3.Discard)(type, [index_22.OptionalKind])), type) : + KindGuard.IsReadonly(type) ? (0, index_1.CreateType)(FromType(moduleProperties, (0, index_3.Discard)(type, [index_22.ReadonlyKind])), type) : + // Transform + KindGuard.IsTransform(type) ? (0, index_1.CreateType)(FromTransform(moduleProperties, type), type) : + // Types + KindGuard.IsArray(type) ? (0, index_1.CreateType)(FromArray(moduleProperties, type.items), type) : + KindGuard.IsAsyncIterator(type) ? (0, index_1.CreateType)(FromAsyncIterator(moduleProperties, type.items), type) : + KindGuard.IsComputed(type) ? (0, index_1.CreateType)(FromComputed(moduleProperties, type.target, type.parameters)) : + KindGuard.IsConstructor(type) ? (0, index_1.CreateType)(FromConstructor(moduleProperties, type.parameters, type.returns), type) : + KindGuard.IsFunction(type) ? (0, index_1.CreateType)(FromFunction(moduleProperties, type.parameters, type.returns), type) : + KindGuard.IsIntersect(type) ? (0, index_1.CreateType)(FromIntersect(moduleProperties, type.allOf), type) : + KindGuard.IsIterator(type) ? (0, index_1.CreateType)(FromIterator(moduleProperties, type.items), type) : + KindGuard.IsObject(type) ? (0, index_1.CreateType)(FromObject(moduleProperties, type.properties), type) : + KindGuard.IsRecord(type) ? (0, index_1.CreateType)(FromRecord(moduleProperties, type)) : + KindGuard.IsTuple(type) ? (0, index_1.CreateType)(FromTuple(moduleProperties, type.items || []), type) : + KindGuard.IsUnion(type) ? (0, index_1.CreateType)(FromUnion(moduleProperties, type.anyOf), type) : + type); +} +// prettier-ignore +function ComputeType(moduleProperties, key) { + return (key in moduleProperties + ? FromType(moduleProperties, moduleProperties[key]) + : (0, index_16.Never)()); +} +// prettier-ignore +function ComputeModuleProperties(moduleProperties) { + return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => { + return { ...result, [key]: ComputeType(moduleProperties, key) }; + }, {}); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/module/index.d.ts new file mode 100644 index 00000000..20a96c9a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/index.d.ts @@ -0,0 +1 @@ +export * from './module'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/index.js b/node_modules/@sinclair/typebox/build/cjs/type/module/index.js new file mode 100644 index 00000000..0cab86de --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./module"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/infer.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/module/infer.d.ts new file mode 100644 index 00000000..62d01f5c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/infer.d.ts @@ -0,0 +1,49 @@ +import { Ensure, Evaluate } from '../helpers/index'; +import { TSchema } from '../schema/index'; +import { TArray } from '../array/index'; +import { TAsyncIterator } from '../async-iterator/index'; +import { TConstructor } from '../constructor/index'; +import { TEnum, TEnumRecord } from '../enum/index'; +import { TFunction } from '../function/index'; +import { TIntersect } from '../intersect/index'; +import { TIterator } from '../iterator/index'; +import { TObject, TProperties } from '../object/index'; +import { TOptional } from '../optional/index'; +import { TRecord } from '../record/index'; +import { TReadonly } from '../readonly/index'; +import { TRef } from '../ref/index'; +import { TTuple } from '../tuple/index'; +import { TUnion } from '../union/index'; +import { Static } from '../static/index'; +import { TRecursive } from '../recursive/index'; +type TInferArray = (Ensure>>); +type TInferAsyncIterator = (Ensure>>); +type TInferConstructor = Ensure) => TInfer>; +type TInferFunction = Ensure<(...args: TInferTuple) => TInfer>; +type TInferIterator = (Ensure>>); +type TInferIntersect = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TInferIntersect> : Result); +type ReadonlyOptionalPropertyKeys = { + [Key in keyof Properties]: Properties[Key] extends TReadonly ? (Properties[Key] extends TOptional ? Key : never) : never; +}[keyof Properties]; +type ReadonlyPropertyKeys = { + [Key in keyof Source]: Source[Key] extends TReadonly ? (Source[Key] extends TOptional ? never : Key) : never; +}[keyof Source]; +type OptionalPropertyKeys = { + [Key in keyof Source]: Source[Key] extends TOptional ? (Source[Key] extends TReadonly ? never : Key) : never; +}[keyof Source]; +type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; +type InferPropertiesWithModifiers> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; +type InferProperties = InferPropertiesWithModifiers; +}>; +type TInferObject = (InferProperties); +type TInferTuple = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferTuple]> : Result); +type TInferRecord extends infer Key extends PropertyKey ? Key : never, InferedType extends unknown = TInfer> = Ensure<{ + [_ in InferredKey]: InferedType; +}>; +type TInferRef = (Ref extends keyof ModuleProperties ? TInfer : unknown); +type TInferUnion = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferUnion> : Result); +type TInfer = (Type extends TArray ? TInferArray : Type extends TAsyncIterator ? TInferAsyncIterator : Type extends TConstructor ? TInferConstructor : Type extends TFunction ? TInferFunction : Type extends TIntersect ? TInferIntersect : Type extends TIterator ? TInferIterator : Type extends TObject ? TInferObject : Type extends TRecord ? TInferRecord : Type extends TRef ? TInferRef : Type extends TTuple ? TInferTuple : Type extends TEnum ? Static : Type extends TUnion ? TInferUnion : Type extends TRecursive ? TInfer : Static); +/** Inference Path for Imports. This type is used to compute TImport `static` */ +export type TInferFromModuleKey = (Key extends keyof ModuleProperties ? TInfer : never); +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/infer.js b/node_modules/@sinclair/typebox/build/cjs/type/module/infer.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/infer.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/module.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/module/module.d.ts new file mode 100644 index 00000000..e0018863 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/module.d.ts @@ -0,0 +1,27 @@ +import { Kind } from '../symbols/index'; +import { SchemaOptions, TSchema } from '../schema/index'; +import { TProperties } from '../object/index'; +import { Static } from '../static/index'; +import { TComputeModuleProperties } from './compute'; +import { TInferFromModuleKey } from './infer'; +export interface TDefinitions extends TSchema { + static: { + [K in keyof ModuleProperties]: Static; + }; + $defs: ModuleProperties; +} +export interface TImport extends TSchema { + [Kind]: 'Import'; + static: TInferFromModuleKey; + $defs: ModuleProperties; + $ref: Key; +} +export declare class TModule> { + private readonly $defs; + constructor($defs: ModuleProperties); + /** `[Json]` Imports a Type by Key. */ + Import(key: Key, options?: SchemaOptions): TImport; + private WithIdentifiers; +} +/** `[Json]` Creates a Type Definition Module. */ +export declare function Module(properties: Properties): TModule; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/module/module.js b/node_modules/@sinclair/typebox/build/cjs/type/module/module.js new file mode 100644 index 00000000..fe3d7c5d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/module/module.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TModule = void 0; +exports.Module = Module; +const index_1 = require("../create/index"); +const index_2 = require("../symbols/index"); +// ------------------------------------------------------------------ +// Module Infrastructure Types +// ------------------------------------------------------------------ +const compute_1 = require("./compute"); +// ------------------------------------------------------------------ +// Module +// ------------------------------------------------------------------ +// prettier-ignore +class TModule { + constructor($defs) { + const computed = (0, compute_1.ComputeModuleProperties)($defs); + const identified = this.WithIdentifiers(computed); + this.$defs = identified; + } + /** `[Json]` Imports a Type by Key. */ + Import(key, options) { + const $defs = { ...this.$defs, [key]: (0, index_1.CreateType)(this.$defs[key], options) }; + return (0, index_1.CreateType)({ [index_2.Kind]: 'Import', $defs, $ref: key }); + } + // prettier-ignore + WithIdentifiers($defs) { + return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => { + return { ...result, [key]: { ...$defs[key], $id: key } }; + }, {}); + } +} +exports.TModule = TModule; +/** `[Json]` Creates a Type Definition Module. */ +function Module(properties) { + return new TModule(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/never/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/never/index.d.ts new file mode 100644 index 00000000..68647c25 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/never/index.d.ts @@ -0,0 +1 @@ +export * from './never'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/never/index.js b/node_modules/@sinclair/typebox/build/cjs/type/never/index.js new file mode 100644 index 00000000..be0a93d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/never/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); + +__exportStar(require("./never"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/never/never.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/never/never.d.ts new file mode 100644 index 00000000..31ef65b4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/never/never.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TNever extends TSchema { + [Kind]: 'Never'; + static: never; + not: {}; +} +/** `[Json]` Creates a Never type */ +export declare function Never(options?: SchemaOptions): TNever; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/never/never.js b/node_modules/@sinclair/typebox/build/cjs/type/never/never.js new file mode 100644 index 00000000..27227604 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/never/never.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Never = Never; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Never type */ +function Never(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Never', not: {} }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/not/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/not/index.d.ts new file mode 100644 index 00000000..3900eac6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/not/index.d.ts @@ -0,0 +1 @@ +export * from './not'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/not/index.js b/node_modules/@sinclair/typebox/build/cjs/type/not/index.js new file mode 100644 index 00000000..782cfcdd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/not/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./not"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/not/not.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/not/not.d.ts new file mode 100644 index 00000000..911f7ae8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/not/not.d.ts @@ -0,0 +1,10 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +export interface TNot extends TSchema { + [Kind]: 'Not'; + static: T extends TNot ? Static : unknown; + not: T; +} +/** `[Json]` Creates a Not type */ +export declare function Not(type: Type, options?: SchemaOptions): TNot; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/not/not.js b/node_modules/@sinclair/typebox/build/cjs/type/not/not.js new file mode 100644 index 00000000..f8aaf764 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/not/not.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Not = Not; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Not type */ +function Not(type, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Not', not: type }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/null/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/null/index.d.ts new file mode 100644 index 00000000..9c22dead --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/null/index.d.ts @@ -0,0 +1 @@ +export * from './null'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/null/index.js b/node_modules/@sinclair/typebox/build/cjs/type/null/index.js new file mode 100644 index 00000000..7b5c1474 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/null/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./null"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/null/null.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/null/null.d.ts new file mode 100644 index 00000000..39c4f13a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/null/null.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TNull extends TSchema { + [Kind]: 'Null'; + static: null; + type: 'null'; +} +/** `[Json]` Creates a Null type */ +export declare function Null(options?: SchemaOptions): TNull; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/null/null.js b/node_modules/@sinclair/typebox/build/cjs/type/null/null.js new file mode 100644 index 00000000..90772200 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/null/null.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Null = Null; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Null type */ +function Null(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Null', type: 'null' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/number/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/number/index.d.ts new file mode 100644 index 00000000..3238b292 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/number/index.d.ts @@ -0,0 +1 @@ +export * from './number'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/number/index.js b/node_modules/@sinclair/typebox/build/cjs/type/number/index.js new file mode 100644 index 00000000..80cc104f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/number/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./number"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts new file mode 100644 index 00000000..08ffcc2e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface NumberOptions extends SchemaOptions { + exclusiveMaximum?: number; + exclusiveMinimum?: number; + maximum?: number; + minimum?: number; + multipleOf?: number; +} +export interface TNumber extends TSchema, NumberOptions { + [Kind]: 'Number'; + static: number; + type: 'number'; +} +/** `[Json]` Creates a Number type */ +export declare function Number(options?: NumberOptions): TNumber; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/number/number.js b/node_modules/@sinclair/typebox/build/cjs/type/number/number.js new file mode 100644 index 00000000..93300ce1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/number/number.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Number = Number; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Number type */ +function Number(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Number', type: 'number' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/object/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/object/index.d.ts new file mode 100644 index 00000000..1c19a111 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/object/index.d.ts @@ -0,0 +1 @@ +export * from './object'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/object/index.js b/node_modules/@sinclair/typebox/build/cjs/type/object/index.js new file mode 100644 index 00000000..52a6abd5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/object/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./object"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts new file mode 100644 index 00000000..bc131228 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts @@ -0,0 +1,48 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import type { Evaluate, UnionToTuple } from '../helpers/index'; +import type { TReadonly } from '../readonly/index'; +import type { TOptional } from '../optional/index'; +import { Kind } from '../symbols/index'; +type ReadonlyOptionalPropertyKeys = { + [K in keyof T]: T[K] extends TReadonly ? (T[K] extends TOptional ? K : never) : never; +}[keyof T]; +type ReadonlyPropertyKeys = { + [K in keyof T]: T[K] extends TReadonly ? (T[K] extends TOptional ? never : K) : never; +}[keyof T]; +type OptionalPropertyKeys = { + [K in keyof T]: T[K] extends TOptional ? (T[K] extends TReadonly ? never : K) : never; +}[keyof T]; +type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; +type ObjectStaticProperties> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; +type ObjectStatic = ObjectStaticProperties; +}>; +export type TPropertyKey = string | number; +export type TProperties = Record; +/** Creates a RequiredArray derived from the given TProperties value. */ +type TRequiredArray ? never : Key]: Properties[Key]; +}, RequiredKeys extends string[] = UnionToTuple>, Result extends string[] | undefined = RequiredKeys extends [] ? undefined : RequiredKeys> = Result; +export type TAdditionalProperties = undefined | TSchema | boolean; +export interface ObjectOptions extends SchemaOptions { + /** Additional property constraints for this object */ + additionalProperties?: TAdditionalProperties; + /** The minimum number of properties allowed on this object */ + minProperties?: number; + /** The maximum number of properties allowed on this object */ + maxProperties?: number; +} +export interface TObject extends TSchema, ObjectOptions { + [Kind]: 'Object'; + static: ObjectStatic; + additionalProperties?: TAdditionalProperties; + type: 'object'; + properties: T; + required: TRequiredArray; +} +/** `[Json]` Creates an Object type */ +declare function _Object(properties: T, options?: ObjectOptions): TObject; +/** `[Json]` Creates an Object type */ +export declare var Object: typeof _Object; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/object/object.js b/node_modules/@sinclair/typebox/build/cjs/type/object/object.js new file mode 100644 index 00000000..5782a88a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/object/object.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Object = void 0; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +/** Creates a RequiredArray derived from the given TProperties value. */ +function RequiredArray(properties) { + return globalThis.Object.keys(properties).filter((key) => !(0, kind_1.IsOptional)(properties[key])); +} +/** `[Json]` Creates an Object type */ +function _Object(properties, options) { + const required = RequiredArray(properties); + const schema = required.length > 0 ? { [index_1.Kind]: 'Object', type: 'object', required, properties } : { [index_1.Kind]: 'Object', type: 'object', properties }; + return (0, type_1.CreateType)(schema, options); +} +/** `[Json]` Creates an Object type */ +exports.Object = _Object; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/omit/index.d.ts new file mode 100644 index 00000000..0929ee72 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/index.d.ts @@ -0,0 +1,3 @@ +export * from './omit-from-mapped-key'; +export * from './omit-from-mapped-result'; +export * from './omit'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/index.js b/node_modules/@sinclair/typebox/build/cjs/type/omit/index.js new file mode 100644 index 00000000..5b9848b3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./omit-from-mapped-key"), exports); +__exportStar(require("./omit-from-mapped-result"), exports); +__exportStar(require("./omit"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.d.ts new file mode 100644 index 00000000..e2a86dd9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.d.ts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +import { type TOmit } from './omit'; +type TFromPropertyKey = { + [_ in Key]: TOmit; +}; +type TFromPropertyKeys = (PropertyKeys extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys> : Result); +type TFromMappedKey = (TFromPropertyKeys); +export type TOmitFromMappedKey> = (TMappedResult); +export declare function OmitFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.js new file mode 100644 index 00000000..557d87af --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-key.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OmitFromMappedKey = OmitFromMappedKey; +const index_1 = require("../mapped/index"); +const omit_1 = require("./omit"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromPropertyKey(type, key, options) { + return { [key]: (0, omit_1.Omit)(type, [key], (0, value_1.Clone)(options)) }; +} +// prettier-ignore +function FromPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((Acc, LK) => { + return { ...Acc, ...FromPropertyKey(type, LK, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(type, mappedKey, options) { + return FromPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +function OmitFromMappedKey(type, mappedKey, options) { + const properties = FromMappedKey(type, mappedKey, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.d.ts new file mode 100644 index 00000000..a5893036 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TOmit } from './omit'; +type TFromProperties = ({ + [K2 in keyof Properties]: TOmit; +}); +type TFromMappedResult = (Evaluate>); +export type TOmitFromMappedResult> = (Ensure>); +export declare function OmitFromMappedResult>(mappedResult: MappedResult, propertyKeys: [...PropertyKeys], options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.js new file mode 100644 index 00000000..df47ad22 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit-from-mapped-result.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OmitFromMappedResult = OmitFromMappedResult; +const index_1 = require("../mapped/index"); +const omit_1 = require("./omit"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromProperties(properties, propertyKeys, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = (0, omit_1.Omit)(properties[K2], propertyKeys, (0, value_1.Clone)(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, propertyKeys, options) { + return FromProperties(mappedResult.properties, propertyKeys, options); +} +// prettier-ignore +function OmitFromMappedResult(mappedResult, propertyKeys, options) { + const properties = FromMappedResult(mappedResult, propertyKeys, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.d.ts new file mode 100644 index 00000000..273d287d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.d.ts @@ -0,0 +1,36 @@ +import type { SchemaOptions, TSchema } from '../schema/index'; +import type { TupleToUnion, Evaluate } from '../helpers/index'; +import { type TRecursive } from '../recursive/index'; +import type { TMappedKey, TMappedResult } from '../mapped/index'; +import { TComputed } from '../computed/index'; +import { TLiteral, TLiteralValue } from '../literal/index'; +import { type TIndexPropertyKeys } from '../indexed/index'; +import { type TIntersect } from '../intersect/index'; +import { type TUnion } from '../union/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TRef } from '../ref/index'; +import { type TOmitFromMappedKey } from './omit-from-mapped-key'; +import { type TOmitFromMappedResult } from './omit-from-mapped-result'; +type TFromIntersect = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect]> : Result); +type TFromUnion = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion]> : Result); +type TFromProperties> = (Evaluate>); +type TFromObject<_Type extends TObject, PropertyKeys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TUnionFromPropertyKeys = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys]> : TUnionFromPropertyKeys : TUnion); +export type TOmitResolve = (Properties extends TRecursive ? TRecursive> : Properties extends TIntersect ? TIntersect> : Properties extends TUnion ? TUnion> : Properties extends TObject ? TFromObject : TObject<{}>); +type TResolvePropertyKeys = Key extends TSchema ? TIndexPropertyKeys : Key; +type TResolveTypeKey = Key extends PropertyKey[] ? TUnionFromPropertyKeys : Key; +export type TOmit = (Type extends TMappedResult ? TOmitFromMappedResult> : Key extends TMappedKey ? TOmitFromMappedKey : [ + IsTypeRef, + IsKeyRef +] extends [true, true] ? TComputed<'Omit', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [false, true] ? TComputed<'Omit', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [true, false] ? TComputed<'Omit', [Type, TResolveTypeKey]> : TOmitResolve>); +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Omit(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit; +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Omit(type: Type, key: Key, options?: SchemaOptions): TOmit; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.js b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.js new file mode 100644 index 00000000..b2a7658e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/omit/omit.js @@ -0,0 +1,75 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Omit = Omit; +const type_1 = require("../create/type"); +const discard_1 = require("../discard/discard"); +const symbols_1 = require("../symbols/symbols"); +const index_1 = require("../computed/index"); +const index_2 = require("../literal/index"); +const index_3 = require("../indexed/index"); +const index_4 = require("../intersect/index"); +const index_5 = require("../union/index"); +const index_6 = require("../object/index"); +// ------------------------------------------------------------------ +// Mapped +// ------------------------------------------------------------------ +const omit_from_mapped_key_1 = require("./omit-from-mapped-key"); +const omit_from_mapped_result_1 = require("./omit-from-mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +const value_1 = require("../guard/value"); +// prettier-ignore +function FromIntersect(types, propertyKeys) { + return types.map((type) => OmitResolve(type, propertyKeys)); +} +// prettier-ignore +function FromUnion(types, propertyKeys) { + return types.map((type) => OmitResolve(type, propertyKeys)); +} +// ------------------------------------------------------------------ +// FromProperty +// ------------------------------------------------------------------ +// prettier-ignore +function FromProperty(properties, key) { + const { [key]: _, ...R } = properties; + return R; +} +// prettier-ignore +function FromProperties(properties, propertyKeys) { + return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties); +} +// prettier-ignore +function FromObject(type, propertyKeys, properties) { + const options = (0, discard_1.Discard)(type, [symbols_1.TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties, propertyKeys); + return (0, index_6.Object)(mappedProperties, options); +} +// prettier-ignore +function UnionFromPropertyKeys(propertyKeys) { + const result = propertyKeys.reduce((result, key) => (0, kind_1.IsLiteralValue)(key) ? [...result, (0, index_2.Literal)(key)] : result, []); + return (0, index_5.Union)(result); +} +// prettier-ignore +function OmitResolve(type, propertyKeys) { + return ((0, kind_1.IsIntersect)(type) ? (0, index_4.Intersect)(FromIntersect(type.allOf, propertyKeys)) : + (0, kind_1.IsUnion)(type) ? (0, index_5.Union)(FromUnion(type.anyOf, propertyKeys)) : + (0, kind_1.IsObject)(type) ? FromObject(type, propertyKeys, type.properties) : + (0, index_6.Object)({})); +} +/** `[Json]` Constructs a type whose keys are picked from the given type */ +// prettier-ignore +function Omit(type, key, options) { + const typeKey = (0, value_1.IsArray)(key) ? UnionFromPropertyKeys(key) : key; + const propertyKeys = (0, kind_1.IsSchema)(key) ? (0, index_3.IndexPropertyKeys)(key) : key; + const isTypeRef = (0, kind_1.IsRef)(type); + const isKeyRef = (0, kind_1.IsRef)(key); + return ((0, kind_1.IsMappedResult)(type) ? (0, omit_from_mapped_result_1.OmitFromMappedResult)(type, propertyKeys, options) : + (0, kind_1.IsMappedKey)(key) ? (0, omit_from_mapped_key_1.OmitFromMappedKey)(type, key, options) : + (isTypeRef && isKeyRef) ? (0, index_1.Computed)('Omit', [type, typeKey], options) : + (!isTypeRef && isKeyRef) ? (0, index_1.Computed)('Omit', [type, typeKey], options) : + (isTypeRef && !isKeyRef) ? (0, index_1.Computed)('Omit', [type, typeKey], options) : + (0, type_1.CreateType)({ ...OmitResolve(type, propertyKeys), ...options })); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/optional/index.d.ts new file mode 100644 index 00000000..6a8a7246 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/index.d.ts @@ -0,0 +1,2 @@ +export * from './optional-from-mapped-result'; +export * from './optional'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/index.js b/node_modules/@sinclair/typebox/build/cjs/type/optional/index.js new file mode 100644 index 00000000..a02240ad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./optional-from-mapped-result"), exports); +__exportStar(require("./optional"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.d.ts new file mode 100644 index 00000000..c8ae94c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.d.ts @@ -0,0 +1,10 @@ +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TOptionalWithFlag } from './optional'; +type TFromProperties

= ({ + [K2 in keyof P]: TOptionalWithFlag; +}); +type TFromMappedResult = (TFromProperties); +export type TOptionalFromMappedResult> = (TMappedResult

); +export declare function OptionalFromMappedResult>(R: R, F: F): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.js new file mode 100644 index 00000000..1368005f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional-from-mapped-result.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OptionalFromMappedResult = OptionalFromMappedResult; +const index_1 = require("../mapped/index"); +const optional_1 = require("./optional"); +// prettier-ignore +function FromProperties(P, F) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = (0, optional_1.Optional)(P[K2], F); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, F) { + return FromProperties(R.properties, F); +} +// prettier-ignore +function OptionalFromMappedResult(R, F) { + const P = FromMappedResult(R, F); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts new file mode 100644 index 00000000..00dca561 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts @@ -0,0 +1,20 @@ +import type { TSchema } from '../schema/index'; +import type { Ensure } from '../helpers/index'; +import { OptionalKind } from '../symbols/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TOptionalFromMappedResult } from './optional-from-mapped-result'; +type TRemoveOptional = T extends TOptional ? S : T; +type TAddOptional = T extends TOptional ? TOptional : Ensure>; +export type TOptionalWithFlag = F extends false ? TRemoveOptional : TAddOptional; +export type TOptional = T & { + [OptionalKind]: 'Optional'; +}; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T, enable: F): TOptionalFromMappedResult; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T, enable: F): TOptionalWithFlag; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T): TOptionalFromMappedResult; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T): TOptionalWithFlag; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.js b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.js new file mode 100644 index 00000000..99211a81 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Optional = Optional; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +const index_2 = require("../discard/index"); +const optional_from_mapped_result_1 = require("./optional-from-mapped-result"); +const kind_1 = require("../guard/kind"); +function RemoveOptional(schema) { + return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.OptionalKind])); +} +function AddOptional(schema) { + return (0, type_1.CreateType)({ ...schema, [index_1.OptionalKind]: 'Optional' }); +} +// prettier-ignore +function OptionalWithFlag(schema, F) { + return (F === false + ? RemoveOptional(schema) + : AddOptional(schema)); +} +/** `[Json]` Creates a Optional property */ +function Optional(schema, enable) { + const F = enable ?? true; + return (0, kind_1.IsMappedResult)(schema) ? (0, optional_from_mapped_result_1.OptionalFromMappedResult)(schema, F) : OptionalWithFlag(schema, F); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.d.ts new file mode 100644 index 00000000..f7be6e65 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.d.ts @@ -0,0 +1 @@ +export * from './parameters'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.js b/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.js new file mode 100644 index 00000000..da30bef6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/parameters/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./parameters"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.d.ts new file mode 100644 index 00000000..849d0ad7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.d.ts @@ -0,0 +1,7 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TFunction } from '../function/index'; +import { type TTuple } from '../tuple/index'; +import { type TNever } from '../never/index'; +export type TParameters = (Type extends TFunction ? TTuple : TNever); +/** `[JavaScript]` Extracts the Parameters from the given Function type */ +export declare function Parameters(schema: Type, options?: SchemaOptions): TParameters; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.js b/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.js new file mode 100644 index 00000000..1f9b7fff --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/parameters/parameters.js @@ -0,0 +1,44 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parameters = Parameters; +const index_1 = require("../tuple/index"); +const index_2 = require("../never/index"); +const KindGuard = __importStar(require("../guard/kind")); +/** `[JavaScript]` Extracts the Parameters from the given Function type */ +function Parameters(schema, options) { + return (KindGuard.IsFunction(schema) ? (0, index_1.Tuple)(schema.parameters, options) : (0, index_2.Never)()); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/partial/index.d.ts new file mode 100644 index 00000000..439f0125 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/index.d.ts @@ -0,0 +1,2 @@ +export * from './partial-from-mapped-result'; +export * from './partial'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/index.js b/node_modules/@sinclair/typebox/build/cjs/type/partial/index.js new file mode 100644 index 00000000..7ed3fc64 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./partial-from-mapped-result"), exports); +__exportStar(require("./partial"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.d.ts new file mode 100644 index 00000000..6ff2bb76 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TPartial } from './partial'; +type TFromProperties

= ({ + [K2 in keyof P]: TPartial; +}); +type TFromMappedResult = (Evaluate>); +export type TPartialFromMappedResult> = (Ensure>); +export declare function PartialFromMappedResult>(R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.js new file mode 100644 index 00000000..84d8c4f5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial-from-mapped-result.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PartialFromMappedResult = PartialFromMappedResult; +const index_1 = require("../mapped/index"); +const partial_1 = require("./partial"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromProperties(K, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(K)) + Acc[K2] = (0, partial_1.Partial)(K[K2], (0, value_1.Clone)(options)); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, options) { + return FromProperties(R.properties, options); +} +// prettier-ignore +function PartialFromMappedResult(R, options) { + const P = FromMappedResult(R, options); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.d.ts new file mode 100644 index 00000000..82a89a10 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.d.ts @@ -0,0 +1,35 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Evaluate, Ensure } from '../helpers/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TReadonlyOptional } from '../readonly-optional/index'; +import { type TComputed } from '../computed/index'; +import { type TOptional } from '../optional/index'; +import { type TReadonly } from '../readonly/index'; +import { type TRecursive } from '../recursive/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TIntersect } from '../intersect/index'; +import { type TUnion } from '../union/index'; +import { type TRef } from '../ref/index'; +import { type TBigInt } from '../bigint/index'; +import { type TBoolean } from '../boolean/index'; +import { type TInteger } from '../integer/index'; +import { type TLiteral } from '../literal/index'; +import { type TNull } from '../null/index'; +import { type TNumber } from '../number/index'; +import { type TString } from '../string/index'; +import { type TSymbol } from '../symbol/index'; +import { type TUndefined } from '../undefined/index'; +import { type TPartialFromMappedResult } from './partial-from-mapped-result'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +type TFromProperties = Evaluate<{ + [K in keyof Properties]: Properties[K] extends (TReadonlyOptional) ? TReadonlyOptional : Properties[K] extends (TReadonly) ? TReadonlyOptional : Properties[K] extends (TOptional) ? TOptional : TOptional; +}>; +type TFromObject<_Type extends TObject, Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +export type TPartial = (Type extends TRecursive ? TRecursive> : Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : Type extends TBigInt ? Type : Type extends TBoolean ? Type : Type extends TInteger ? Type : Type extends TLiteral ? Type : Type extends TNull ? Type : Type extends TNumber ? Type : Type extends TString ? Type : Type extends TSymbol ? Type : Type extends TUndefined ? Type : TObject<{}>); +/** `[Json]` Constructs a type where all properties are optional */ +export declare function Partial(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult; +/** `[Json]` Constructs a type where all properties are optional */ +export declare function Partial(type: Type, options?: SchemaOptions): TPartial; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.js b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.js new file mode 100644 index 00000000..d7512e27 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/partial/partial.js @@ -0,0 +1,111 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Partial = Partial; +const type_1 = require("../create/type"); +const index_1 = require("../computed/index"); +const index_2 = require("../optional/index"); +const index_3 = require("../object/index"); +const index_4 = require("../intersect/index"); +const index_5 = require("../union/index"); +const index_6 = require("../ref/index"); +const index_7 = require("../discard/index"); +const index_8 = require("../symbols/index"); +const partial_from_mapped_result_1 = require("./partial-from-mapped-result"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const KindGuard = __importStar(require("../guard/kind")); +// prettier-ignore +function FromComputed(target, parameters) { + return (0, index_1.Computed)('Partial', [(0, index_1.Computed)(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return (0, index_1.Computed)('Partial', [(0, index_6.Ref)($ref)]); +} +// prettier-ignore +function FromProperties(properties) { + const partialProperties = {}; + for (const K of globalThis.Object.getOwnPropertyNames(properties)) + partialProperties[K] = (0, index_2.Optional)(properties[K]); + return partialProperties; +} +// prettier-ignore +function FromObject(type, properties) { + const options = (0, index_7.Discard)(type, [index_8.TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties); + return (0, index_3.Object)(mappedProperties, options); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => PartialResolve(type)); +} +// ------------------------------------------------------------------ +// PartialResolve +// ------------------------------------------------------------------ +// prettier-ignore +function PartialResolve(type) { + return ( + // Mappable + KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : + KindGuard.IsRef(type) ? FromRef(type.$ref) : + KindGuard.IsIntersect(type) ? (0, index_4.Intersect)(FromRest(type.allOf)) : + KindGuard.IsUnion(type) ? (0, index_5.Union)(FromRest(type.anyOf)) : + KindGuard.IsObject(type) ? FromObject(type, type.properties) : + // Intrinsic + KindGuard.IsBigInt(type) ? type : + KindGuard.IsBoolean(type) ? type : + KindGuard.IsInteger(type) ? type : + KindGuard.IsLiteral(type) ? type : + KindGuard.IsNull(type) ? type : + KindGuard.IsNumber(type) ? type : + KindGuard.IsString(type) ? type : + KindGuard.IsSymbol(type) ? type : + KindGuard.IsUndefined(type) ? type : + // Passthrough + (0, index_3.Object)({})); +} +/** `[Json]` Constructs a type where all properties are optional */ +function Partial(type, options) { + if (KindGuard.IsMappedResult(type)) { + return (0, partial_from_mapped_result_1.PartialFromMappedResult)(type, options); + } + else { + // special: mapping types require overridable options + return (0, type_1.CreateType)({ ...PartialResolve(type), ...options }); + } +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.d.ts new file mode 100644 index 00000000..99a3bc58 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.d.ts @@ -0,0 +1 @@ +export * from './patterns'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.js b/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.js new file mode 100644 index 00000000..7341fd4b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/patterns/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./patterns"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.d.ts new file mode 100644 index 00000000..37e3ae2d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.d.ts @@ -0,0 +1,8 @@ +export declare const PatternBoolean = "(true|false)"; +export declare const PatternNumber = "(0|[1-9][0-9]*)"; +export declare const PatternString = "(.*)"; +export declare const PatternNever = "(?!.*)"; +export declare const PatternBooleanExact = "^(true|false)$"; +export declare const PatternNumberExact = "^(0|[1-9][0-9]*)$"; +export declare const PatternStringExact = "^(.*)$"; +export declare const PatternNeverExact = "^(?!.*)$"; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.js b/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.js new file mode 100644 index 00000000..cf47b536 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/patterns/patterns.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternNeverExact = exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternNever = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = void 0; +exports.PatternBoolean = '(true|false)'; +exports.PatternNumber = '(0|[1-9][0-9]*)'; +exports.PatternString = '(.*)'; +exports.PatternNever = '(?!.*)'; +exports.PatternBooleanExact = `^${exports.PatternBoolean}$`; +exports.PatternNumberExact = `^${exports.PatternNumber}$`; +exports.PatternStringExact = `^${exports.PatternString}$`; +exports.PatternNeverExact = `^${exports.PatternNever}$`; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/pick/index.d.ts new file mode 100644 index 00000000..01e01141 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/index.d.ts @@ -0,0 +1,3 @@ +export * from './pick-from-mapped-key'; +export * from './pick-from-mapped-result'; +export * from './pick'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/index.js b/node_modules/@sinclair/typebox/build/cjs/type/pick/index.js new file mode 100644 index 00000000..7ee603cf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./pick-from-mapped-key"), exports); +__exportStar(require("./pick-from-mapped-result"), exports); +__exportStar(require("./pick"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.d.ts new file mode 100644 index 00000000..4c3d942e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.d.ts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult, type TMappedKey } from '../mapped/index'; +import { type TPick } from './pick'; +type TFromPropertyKey = { + [_ in Key]: TPick; +}; +type TFromPropertyKeys = (PropertyKeys extends [infer LeftKey extends PropertyKey, ...infer RightKeys extends PropertyKey[]] ? TFromPropertyKeys> : Result); +type TFromMappedKey = (TFromPropertyKeys); +export type TPickFromMappedKey> = (TMappedResult); +export declare function PickFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.js b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.js new file mode 100644 index 00000000..5ca9b161 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-key.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickFromMappedKey = PickFromMappedKey; +const index_1 = require("../mapped/index"); +const pick_1 = require("./pick"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromPropertyKey(type, key, options) { + return { + [key]: (0, pick_1.Pick)(type, [key], (0, value_1.Clone)(options)) + }; +} +// prettier-ignore +function FromPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((result, leftKey) => { + return { ...result, ...FromPropertyKey(type, leftKey, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(type, mappedKey, options) { + return FromPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +function PickFromMappedKey(type, mappedKey, options) { + const properties = FromMappedKey(type, mappedKey, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.d.ts new file mode 100644 index 00000000..7a5be56d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TPick } from './pick'; +type TFromProperties = ({ + [K2 in keyof Properties]: TPick; +}); +type TFromMappedResult = (Evaluate>); +export type TPickFromMappedResult> = (Ensure>); +export declare function PickFromMappedResult>(mappedResult: MappedResult, propertyKeys: [...PropertyKeys], options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.js new file mode 100644 index 00000000..e64fa4af --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick-from-mapped-result.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickFromMappedResult = PickFromMappedResult; +const index_1 = require("../mapped/index"); +const pick_1 = require("./pick"); +const value_1 = require("../clone/value"); +// prettier-ignore +function FromProperties(properties, propertyKeys, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = (0, pick_1.Pick)(properties[K2], propertyKeys, (0, value_1.Clone)(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, propertyKeys, options) { + return FromProperties(mappedResult.properties, propertyKeys, options); +} +// prettier-ignore +function PickFromMappedResult(mappedResult, propertyKeys, options) { + const properties = FromMappedResult(mappedResult, propertyKeys, options); + return (0, index_1.MappedResult)(properties); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.d.ts new file mode 100644 index 00000000..d1310cf3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.d.ts @@ -0,0 +1,36 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { TupleToUnion, Evaluate } from '../helpers/index'; +import { type TRecursive } from '../recursive/index'; +import { type TComputed } from '../computed/index'; +import { type TIntersect } from '../intersect/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TUnion } from '../union/index'; +import { type TMappedKey, type TMappedResult } from '../mapped/index'; +import { type TRef } from '../ref/index'; +import { type TIndexPropertyKeys } from '../indexed/index'; +import { type TPickFromMappedKey } from './pick-from-mapped-key'; +import { type TPickFromMappedResult } from './pick-from-mapped-result'; +type TFromIntersect = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect]> : Result; +type TFromUnion = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion]> : Result; +type TFromProperties> = (Evaluate>); +type TFromObject<_Type extends TObject, Keys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TUnionFromPropertyKeys = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys]> : TUnionFromPropertyKeys : TUnion); +export type TPickResolve = (Type extends TRecursive ? TRecursive> : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : TObject<{}>); +type TResolvePropertyKeys = Key extends TSchema ? TIndexPropertyKeys : Key; +type TResolveTypeKey = Key extends PropertyKey[] ? TUnionFromPropertyKeys : Key; +export type TPick = (Type extends TMappedResult ? TPickFromMappedResult> : Key extends TMappedKey ? TPickFromMappedKey : [ + IsTypeRef, + IsKeyRef +] extends [true, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [false, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [true, false] ? TComputed<'Pick', [Type, TResolveTypeKey]> : TPickResolve>); +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Pick(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick; +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Pick(type: Type, key: Key, options?: SchemaOptions): TPick; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.js b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.js new file mode 100644 index 00000000..a09080bd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/pick/pick.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Pick = Pick; +const type_1 = require("../create/type"); +const discard_1 = require("../discard/discard"); +const index_1 = require("../computed/index"); +const index_2 = require("../intersect/index"); +const index_3 = require("../literal/index"); +const index_4 = require("../object/index"); +const index_5 = require("../union/index"); +const index_6 = require("../indexed/index"); +const symbols_1 = require("../symbols/symbols"); +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +const value_1 = require("../guard/value"); +// ------------------------------------------------------------------ +// Infrastructure +// ------------------------------------------------------------------ +const pick_from_mapped_key_1 = require("./pick-from-mapped-key"); +const pick_from_mapped_result_1 = require("./pick-from-mapped-result"); +function FromIntersect(types, propertyKeys) { + return types.map((type) => PickResolve(type, propertyKeys)); +} +// prettier-ignore +function FromUnion(types, propertyKeys) { + return types.map((type) => PickResolve(type, propertyKeys)); +} +// prettier-ignore +function FromProperties(properties, propertyKeys) { + const result = {}; + for (const K2 of propertyKeys) + if (K2 in properties) + result[K2] = properties[K2]; + return result; +} +// prettier-ignore +function FromObject(Type, keys, properties) { + const options = (0, discard_1.Discard)(Type, [symbols_1.TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties, keys); + return (0, index_4.Object)(mappedProperties, options); +} +// prettier-ignore +function UnionFromPropertyKeys(propertyKeys) { + const result = propertyKeys.reduce((result, key) => (0, kind_1.IsLiteralValue)(key) ? [...result, (0, index_3.Literal)(key)] : result, []); + return (0, index_5.Union)(result); +} +// prettier-ignore +function PickResolve(type, propertyKeys) { + return ((0, kind_1.IsIntersect)(type) ? (0, index_2.Intersect)(FromIntersect(type.allOf, propertyKeys)) : + (0, kind_1.IsUnion)(type) ? (0, index_5.Union)(FromUnion(type.anyOf, propertyKeys)) : + (0, kind_1.IsObject)(type) ? FromObject(type, propertyKeys, type.properties) : + (0, index_4.Object)({})); +} +/** `[Json]` Constructs a type whose keys are picked from the given type */ +// prettier-ignore +function Pick(type, key, options) { + const typeKey = (0, value_1.IsArray)(key) ? UnionFromPropertyKeys(key) : key; + const propertyKeys = (0, kind_1.IsSchema)(key) ? (0, index_6.IndexPropertyKeys)(key) : key; + const isTypeRef = (0, kind_1.IsRef)(type); + const isKeyRef = (0, kind_1.IsRef)(key); + return ((0, kind_1.IsMappedResult)(type) ? (0, pick_from_mapped_result_1.PickFromMappedResult)(type, propertyKeys, options) : + (0, kind_1.IsMappedKey)(key) ? (0, pick_from_mapped_key_1.PickFromMappedKey)(type, key, options) : + (isTypeRef && isKeyRef) ? (0, index_1.Computed)('Pick', [type, typeKey], options) : + (!isTypeRef && isKeyRef) ? (0, index_1.Computed)('Pick', [type, typeKey], options) : + (isTypeRef && !isKeyRef) ? (0, index_1.Computed)('Pick', [type, typeKey], options) : + (0, type_1.CreateType)({ ...PickResolve(type, propertyKeys), ...options })); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/promise/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/promise/index.d.ts new file mode 100644 index 00000000..b0a9756d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/promise/index.d.ts @@ -0,0 +1 @@ +export * from './promise'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/promise/index.js b/node_modules/@sinclair/typebox/build/cjs/type/promise/index.js new file mode 100644 index 00000000..a66101a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/promise/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./promise"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.d.ts new file mode 100644 index 00000000..456426db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.d.ts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +export interface TPromise extends TSchema { + [Kind]: 'Promise'; + static: Promise>; + type: 'Promise'; + item: TSchema; +} +/** `[JavaScript]` Creates a Promise type */ +export declare function Promise(item: T, options?: SchemaOptions): TPromise; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.js b/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.js new file mode 100644 index 00000000..f2b5978b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/promise/promise.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Promise = Promise; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Promise type */ +function Promise(item, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Promise', type: 'Promise', item }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.d.ts new file mode 100644 index 00000000..467744f6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.d.ts @@ -0,0 +1 @@ +export * from './readonly-optional'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.js b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.js new file mode 100644 index 00000000..709b59db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./readonly-optional"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.d.ts new file mode 100644 index 00000000..b329201c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.d.ts @@ -0,0 +1,6 @@ +import type { TSchema } from '../schema/index'; +import { type TReadonly } from '../readonly/index'; +import { type TOptional } from '../optional/index'; +export type TReadonlyOptional = TOptional & TReadonly; +/** `[Json]` Creates a Readonly and Optional property */ +export declare function ReadonlyOptional(schema: T): TReadonly>; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.js b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.js new file mode 100644 index 00000000..e9324cb9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly-optional/readonly-optional.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadonlyOptional = ReadonlyOptional; +const index_1 = require("../readonly/index"); +const index_2 = require("../optional/index"); +/** `[Json]` Creates a Readonly and Optional property */ +function ReadonlyOptional(schema) { + return (0, index_1.Readonly)((0, index_2.Optional)(schema)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.d.ts new file mode 100644 index 00000000..630b7359 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.d.ts @@ -0,0 +1,2 @@ +export * from './readonly-from-mapped-result'; +export * from './readonly'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.js b/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.js new file mode 100644 index 00000000..6d1c4707 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./readonly-from-mapped-result"), exports); +__exportStar(require("./readonly"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.d.ts new file mode 100644 index 00000000..56cf1850 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.d.ts @@ -0,0 +1,10 @@ +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TReadonlyWithFlag } from './readonly'; +type TFromProperties

= ({ + [K2 in keyof P]: TReadonlyWithFlag; +}); +type TFromMappedResult = (TFromProperties); +export type TReadonlyFromMappedResult> = (TMappedResult

); +export declare function ReadonlyFromMappedResult>(R: R, F: F): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.js new file mode 100644 index 00000000..8e69a3e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly-from-mapped-result.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadonlyFromMappedResult = ReadonlyFromMappedResult; +const index_1 = require("../mapped/index"); +const readonly_1 = require("./readonly"); +// prettier-ignore +function FromProperties(K, F) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(K)) + Acc[K2] = (0, readonly_1.Readonly)(K[K2], F); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, F) { + return FromProperties(R.properties, F); +} +// prettier-ignore +function ReadonlyFromMappedResult(R, F) { + const P = FromMappedResult(R, F); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts new file mode 100644 index 00000000..9e0de0b2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts @@ -0,0 +1,20 @@ +import type { TSchema } from '../schema/index'; +import type { Ensure } from '../helpers/index'; +import { ReadonlyKind } from '../symbols/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TReadonlyFromMappedResult } from './readonly-from-mapped-result'; +type TRemoveReadonly = T extends TReadonly ? S : T; +type TAddReadonly = T extends TReadonly ? TReadonly : Ensure>; +export type TReadonlyWithFlag = F extends false ? TRemoveReadonly : TAddReadonly; +export type TReadonly = T & { + [ReadonlyKind]: 'Readonly'; +}; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T, enable: F): TReadonlyFromMappedResult; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T, enable: F): TReadonlyWithFlag; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T): TReadonlyFromMappedResult; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T): TReadonlyWithFlag; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.js b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.js new file mode 100644 index 00000000..d66540c9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Readonly = Readonly; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +const index_2 = require("../discard/index"); +const readonly_from_mapped_result_1 = require("./readonly-from-mapped-result"); +const kind_1 = require("../guard/kind"); +function RemoveReadonly(schema) { + return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.ReadonlyKind])); +} +function AddReadonly(schema) { + return (0, type_1.CreateType)({ ...schema, [index_1.ReadonlyKind]: 'Readonly' }); +} +// prettier-ignore +function ReadonlyWithFlag(schema, F) { + return (F === false + ? RemoveReadonly(schema) + : AddReadonly(schema)); +} +/** `[Json]` Creates a Readonly property */ +function Readonly(schema, enable) { + const F = enable ?? true; + return (0, kind_1.IsMappedResult)(schema) ? (0, readonly_from_mapped_result_1.ReadonlyFromMappedResult)(schema, F) : ReadonlyWithFlag(schema, F); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/record/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/record/index.d.ts new file mode 100644 index 00000000..96bb9f9f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/record/index.d.ts @@ -0,0 +1 @@ +export * from './record'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/record/index.js b/node_modules/@sinclair/typebox/build/cjs/type/record/index.js new file mode 100644 index 00000000..ddabbb5e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/record/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./record"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/record/record.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/record/record.d.ts new file mode 100644 index 00000000..997c6af8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/record/record.d.ts @@ -0,0 +1,71 @@ +import { Kind } from '../symbols/index'; +import type { TSchema } from '../schema/index'; +import type { Static } from '../static/index'; +import type { Evaluate, Ensure, Assert } from '../helpers/index'; +import { type TAny } from '../any/index'; +import { type TBoolean } from '../boolean/index'; +import { type TEnumRecord, type TEnum } from '../enum/index'; +import { type TInteger } from '../integer/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TNever } from '../never/index'; +import { type TNumber } from '../number/index'; +import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions } from '../object/index'; +import { type TRegExp } from '../regexp/index'; +import { type TString } from '../string/index'; +import { type TUnion } from '../union/index'; +import { TIsTemplateLiteralFinite, type TTemplateLiteral } from '../template-literal/index'; +type TFromTemplateLiteralKeyInfinite = Ensure>; +type TFromTemplateLiteralKeyFinite> = (Ensure>>); +type TFromTemplateLiteralKey = TIsTemplateLiteralFinite extends false ? TFromTemplateLiteralKeyInfinite : TFromTemplateLiteralKeyFinite; +type TFromEnumKey, Type extends TSchema> = Ensure>; +type TFromUnionKeyLiteralString, Type extends TSchema> = { + [_ in Key['const']]: Type; +}; +type TFromUnionKeyLiteralNumber, Type extends TSchema> = { + [_ in Key['const']]: Type; +}; +type TFromUnionKeyVariants = Keys extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? (Left extends TUnion ? TFromUnionKeyVariants> : Left extends TLiteral ? TFromUnionKeyVariants> : Left extends TLiteral ? TFromUnionKeyVariants> : {}) : Result; +type TFromUnionKey> = (Ensure>>); +type TFromLiteralKey = (Ensure]: Type; +}>>); +type TFromRegExpKey<_Key extends TRegExp, Type extends TSchema> = (Ensure>); +type TFromStringKey<_Key extends TString, Type extends TSchema> = (Ensure>); +type TFromAnyKey<_Key extends TAny, Type extends TSchema> = (Ensure>); +type TFromNeverKey<_Key extends TNever, Type extends TSchema> = (Ensure>); +type TFromBooleanKey<_Key extends TBoolean, Type extends TSchema> = (Ensure>); +type TFromIntegerKey<_Key extends TSchema, Type extends TSchema> = (Ensure>); +type TFromNumberKey<_Key extends TSchema, Type extends TSchema> = (Ensure>); +type RecordStatic = (Evaluate<{ + [_ in Assert, PropertyKey>]: Static; +}>); +export interface TRecord extends TSchema { + [Kind]: 'Record'; + static: RecordStatic; + type: 'object'; + patternProperties: { + [pattern: string]: Type; + }; + additionalProperties: TAdditionalProperties; +} +export type TRecordOrObject = (Key extends TTemplateLiteral ? TFromTemplateLiteralKey : Key extends TEnum ? TFromEnumKey : Key extends TUnion ? TFromUnionKey : Key extends TLiteral ? TFromLiteralKey : Key extends TBoolean ? TFromBooleanKey : Key extends TInteger ? TFromIntegerKey : Key extends TNumber ? TFromNumberKey : Key extends TRegExp ? TFromRegExpKey : Key extends TString ? TFromStringKey : Key extends TAny ? TFromAnyKey : Key extends TNever ? TFromNeverKey : TNever); +/** `[Json]` Creates a Record type */ +export declare function Record(key: Key, type: Type, options?: ObjectOptions): TRecordOrObject; +/** Gets the Records Pattern */ +export declare function RecordPattern(record: TRecord): string; +/** Gets the Records Key Type */ +export type TRecordKey ? (Key extends TNumber ? TNumber : Key extends TString ? TString : TString) : TString> = Result; +/** Gets the Records Key Type */ +export declare function RecordKey(type: Type): TRecordKey; +/** Gets a Record Value Type */ +export type TRecordValue ? Value : TNever)> = Result; +/** Gets a Record Value Type */ +export declare function RecordValue(type: Type): TRecordValue; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/record/record.js b/node_modules/@sinclair/typebox/build/cjs/type/record/record.js new file mode 100644 index 00000000..2b4811ac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/record/record.js @@ -0,0 +1,123 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Record = Record; +exports.RecordPattern = RecordPattern; +exports.RecordKey = RecordKey; +exports.RecordValue = RecordValue; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +const index_2 = require("../never/index"); +const index_3 = require("../number/index"); +const index_4 = require("../object/index"); +const index_5 = require("../string/index"); +const index_6 = require("../union/index"); +const index_7 = require("../template-literal/index"); +const index_8 = require("../patterns/index"); +const index_9 = require("../indexed/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const value_1 = require("../guard/value"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// ------------------------------------------------------------------ +// RecordCreateFromPattern +// ------------------------------------------------------------------ +// prettier-ignore +function RecordCreateFromPattern(pattern, T, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Record', type: 'object', patternProperties: { [pattern]: T } }, options); +} +// ------------------------------------------------------------------ +// RecordCreateFromKeys +// ------------------------------------------------------------------ +// prettier-ignore +function RecordCreateFromKeys(K, T, options) { + const result = {}; + for (const K2 of K) + result[K2] = T; + return (0, index_4.Object)(result, { ...options, [index_1.Hint]: 'Record' }); +} +// prettier-ignore +function FromTemplateLiteralKey(K, T, options) { + return ((0, index_7.IsTemplateLiteralFinite)(K) + ? RecordCreateFromKeys((0, index_9.IndexPropertyKeys)(K), T, options) + : RecordCreateFromPattern(K.pattern, T, options)); +} +// prettier-ignore +function FromUnionKey(key, type, options) { + return RecordCreateFromKeys((0, index_9.IndexPropertyKeys)((0, index_6.Union)(key)), type, options); +} +// prettier-ignore +function FromLiteralKey(key, type, options) { + return RecordCreateFromKeys([key.toString()], type, options); +} +// prettier-ignore +function FromRegExpKey(key, type, options) { + return RecordCreateFromPattern(key.source, type, options); +} +// prettier-ignore +function FromStringKey(key, type, options) { + const pattern = (0, value_1.IsUndefined)(key.pattern) ? index_8.PatternStringExact : key.pattern; + return RecordCreateFromPattern(pattern, type, options); +} +// prettier-ignore +function FromAnyKey(_, type, options) { + return RecordCreateFromPattern(index_8.PatternStringExact, type, options); +} +// prettier-ignore +function FromNeverKey(_key, type, options) { + return RecordCreateFromPattern(index_8.PatternNeverExact, type, options); +} +// prettier-ignore +function FromBooleanKey(_key, type, options) { + return (0, index_4.Object)({ true: type, false: type }, options); +} +// prettier-ignore +function FromIntegerKey(_key, type, options) { + return RecordCreateFromPattern(index_8.PatternNumberExact, type, options); +} +// prettier-ignore +function FromNumberKey(_, type, options) { + return RecordCreateFromPattern(index_8.PatternNumberExact, type, options); +} +// ------------------------------------------------------------------ +// TRecordOrObject +// ------------------------------------------------------------------ +/** `[Json]` Creates a Record type */ +function Record(key, type, options = {}) { + // prettier-ignore + return ((0, kind_1.IsUnion)(key) ? FromUnionKey(key.anyOf, type, options) : + (0, kind_1.IsTemplateLiteral)(key) ? FromTemplateLiteralKey(key, type, options) : + (0, kind_1.IsLiteral)(key) ? FromLiteralKey(key.const, type, options) : + (0, kind_1.IsBoolean)(key) ? FromBooleanKey(key, type, options) : + (0, kind_1.IsInteger)(key) ? FromIntegerKey(key, type, options) : + (0, kind_1.IsNumber)(key) ? FromNumberKey(key, type, options) : + (0, kind_1.IsRegExp)(key) ? FromRegExpKey(key, type, options) : + (0, kind_1.IsString)(key) ? FromStringKey(key, type, options) : + (0, kind_1.IsAny)(key) ? FromAnyKey(key, type, options) : + (0, kind_1.IsNever)(key) ? FromNeverKey(key, type, options) : + (0, index_2.Never)(options)); +} +// ------------------------------------------------------------------ +// Record Utilities +// ------------------------------------------------------------------ +/** Gets the Records Pattern */ +function RecordPattern(record) { + return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0]; +} +/** Gets the Records Key Type */ +// prettier-ignore +function RecordKey(type) { + const pattern = RecordPattern(type); + return (pattern === index_8.PatternStringExact ? (0, index_5.String)() : + pattern === index_8.PatternNumberExact ? (0, index_3.Number)() : + (0, index_5.String)({ pattern })); +} +/** Gets a Record Value Type */ +// prettier-ignore +function RecordValue(type) { + return type.patternProperties[RecordPattern(type)]; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.d.ts new file mode 100644 index 00000000..940e73f0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.d.ts @@ -0,0 +1 @@ +export * from './recursive'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.js b/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.js new file mode 100644 index 00000000..33d7a786 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/recursive/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./recursive"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.d.ts new file mode 100644 index 00000000..a006a5b6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind, Hint } from '../symbols/index'; +import { Static } from '../static/index'; +export interface TThis extends TSchema { + [Kind]: 'This'; + static: this['params'][0]; + $ref: string; +} +type RecursiveStatic = Static]>; +export interface TRecursive extends TSchema { + [Hint]: 'Recursive'; + static: RecursiveStatic; +} +/** `[Json]` Creates a Recursive type */ +export declare function Recursive(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.js b/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.js new file mode 100644 index 00000000..affc3dac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/recursive/recursive.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Recursive = Recursive; +const type_1 = require("../clone/type"); +const type_2 = require("../create/type"); +const value_1 = require("../guard/value"); +const index_1 = require("../symbols/index"); +// Auto Tracked For Recursive Types without ID's +let Ordinal = 0; +/** `[Json]` Creates a Recursive type */ +function Recursive(callback, options = {}) { + if ((0, value_1.IsUndefined)(options.$id)) + options.$id = `T${Ordinal++}`; + const thisType = (0, type_1.CloneType)(callback({ [index_1.Kind]: 'This', $ref: `${options.$id}` })); + thisType.$id = options.$id; + // prettier-ignore + return (0, type_2.CreateType)({ [index_1.Hint]: 'Recursive', ...thisType }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/ref/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/ref/index.d.ts new file mode 100644 index 00000000..7806b320 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/ref/index.d.ts @@ -0,0 +1 @@ +export * from './ref'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/ref/index.js b/node_modules/@sinclair/typebox/build/cjs/type/ref/index.js new file mode 100644 index 00000000..999b6334 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/ref/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./ref"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.d.ts new file mode 100644 index 00000000..964cd75e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.d.ts @@ -0,0 +1,41 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +import { TUnsafe } from '../unsafe/index'; +import { Static } from '../static/index'; +export interface TRef extends TSchema { + [Kind]: 'Ref'; + static: unknown; + $ref: Ref; +} +export type TRefUnsafe = TUnsafe>; +/** `[Json]` Creates a Ref type.*/ +export declare function Ref($ref: Ref, options?: SchemaOptions): TRef; +/** + * @deprecated `[Json]` Creates a Ref type. This signature was deprecated in 0.34.0 where Ref requires callers to pass + * a `string` value for the reference (and not a schema). + * + * To adhere to the 0.34.0 signature, Ref implementations should be updated to the following. + * + * ```typescript + * // pre-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Ref(T) + * ``` + * should be changed to the following + * + * ```typescript + * // post-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Unsafe>(Type.Ref('T')) + * ``` + * You can also create a generic function to replicate the pre-0.34.0 signature if required + * + * ```typescript + * const LegacyRef = (schema: T) => Type.Unsafe>(Type.Ref(schema.$id!)) + * ``` + */ +export declare function Ref(type: Type, options?: SchemaOptions): TRefUnsafe; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.js b/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.js new file mode 100644 index 00000000..43adcf47 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/ref/ref.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Ref = Ref; +const index_1 = require("../error/index"); +const type_1 = require("../create/type"); +const index_2 = require("../symbols/index"); +/** `[Json]` Creates a Ref type. The referenced type must contain a $id */ +function Ref(...args) { + const [$ref, options] = typeof args[0] === 'string' ? [args[0], args[1]] : [args[0].$id, args[1]]; + if (typeof $ref !== 'string') + throw new index_1.TypeBoxError('Ref: $ref must be a string'); + return (0, type_1.CreateType)({ [index_2.Kind]: 'Ref', $ref }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.d.ts new file mode 100644 index 00000000..bfec43bd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.d.ts @@ -0,0 +1 @@ +export * from './regexp'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.js b/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.js new file mode 100644 index 00000000..cb18af74 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/regexp/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./regexp"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.d.ts new file mode 100644 index 00000000..2d20bff9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.d.ts @@ -0,0 +1,20 @@ +import type { SchemaOptions } from '../schema/index'; +import type { TSchema } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface RegExpOptions extends SchemaOptions { + /** The maximum length of the string */ + maxLength?: number; + /** The minimum length of the string */ + minLength?: number; +} +export interface TRegExp extends TSchema { + [Kind]: 'RegExp'; + static: `${string}`; + type: 'RegExp'; + source: string; + flags: string; +} +/** `[JavaScript]` Creates a RegExp type */ +export declare function RegExp(pattern: string, options?: RegExpOptions): TRegExp; +/** `[JavaScript]` Creates a RegExp type */ +export declare function RegExp(regex: RegExp, options?: RegExpOptions): TRegExp; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.js b/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.js new file mode 100644 index 00000000..d80a2a67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/regexp/regexp.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RegExp = RegExp; +const type_1 = require("../create/type"); +const value_1 = require("../guard/value"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a RegExp type */ +function RegExp(unresolved, options) { + const expr = (0, value_1.IsString)(unresolved) ? new globalThis.RegExp(unresolved) : unresolved; + return (0, type_1.CreateType)({ [index_1.Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/format.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/registry/format.d.ts new file mode 100644 index 00000000..6e7e2227 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/format.d.ts @@ -0,0 +1,13 @@ +export type FormatRegistryValidationFunction = (value: string) => boolean; +/** Returns the entries in this registry */ +export declare function Entries(): Map; +/** Clears all user defined string formats */ +export declare function Clear(): void; +/** Deletes a registered format */ +export declare function Delete(format: string): boolean; +/** Returns true if the user defined string format exists */ +export declare function Has(format: string): boolean; +/** Sets a validation function for a user defined string format */ +export declare function Set(format: string, func: FormatRegistryValidationFunction): void; +/** Gets a validation function for a user defined string format */ +export declare function Get(format: string): FormatRegistryValidationFunction | undefined; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/format.js b/node_modules/@sinclair/typebox/build/cjs/type/registry/format.js new file mode 100644 index 00000000..78a09f58 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/format.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Entries = Entries; +exports.Clear = Clear; +exports.Delete = Delete; +exports.Has = Has; +exports.Set = Set; +exports.Get = Get; +/** A registry for user defined string formats */ +const map = new Map(); +/** Returns the entries in this registry */ +function Entries() { + return new Map(map); +} +/** Clears all user defined string formats */ +function Clear() { + return map.clear(); +} +/** Deletes a registered format */ +function Delete(format) { + return map.delete(format); +} +/** Returns true if the user defined string format exists */ +function Has(format) { + return map.has(format); +} +/** Sets a validation function for a user defined string format */ +function Set(format, func) { + map.set(format, func); +} +/** Gets a validation function for a user defined string format */ +function Get(format) { + return map.get(format); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/registry/index.d.ts new file mode 100644 index 00000000..ab1291dc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/index.d.ts @@ -0,0 +1,2 @@ +export * as FormatRegistry from './format'; +export * as TypeRegistry from './type'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/index.js b/node_modules/@sinclair/typebox/build/cjs/type/registry/index.js new file mode 100644 index 00000000..720e300d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/index.js @@ -0,0 +1,39 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeRegistry = exports.FormatRegistry = void 0; +exports.FormatRegistry = __importStar(require("./format")); +exports.TypeRegistry = __importStar(require("./type")); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/registry/type.d.ts new file mode 100644 index 00000000..504cec7a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/type.d.ts @@ -0,0 +1,13 @@ +export type TypeRegistryValidationFunction = (schema: TSchema, value: unknown) => boolean; +/** Returns the entries in this registry */ +export declare function Entries(): Map>; +/** Clears all user defined types */ +export declare function Clear(): void; +/** Deletes a registered type */ +export declare function Delete(kind: string): boolean; +/** Returns true if this registry contains this kind */ +export declare function Has(kind: string): boolean; +/** Sets a validation function for a user defined type */ +export declare function Set(kind: string, func: TypeRegistryValidationFunction): void; +/** Gets a custom validation function for a user defined type */ +export declare function Get(kind: string): TypeRegistryValidationFunction | undefined; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/registry/type.js b/node_modules/@sinclair/typebox/build/cjs/type/registry/type.js new file mode 100644 index 00000000..d8b90d6b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/registry/type.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Entries = Entries; +exports.Clear = Clear; +exports.Delete = Delete; +exports.Has = Has; +exports.Set = Set; +exports.Get = Get; +/** A registry for user defined types */ +const map = new Map(); +/** Returns the entries in this registry */ +function Entries() { + return new Map(map); +} +/** Clears all user defined types */ +function Clear() { + return map.clear(); +} +/** Deletes a registered type */ +function Delete(kind) { + return map.delete(kind); +} +/** Returns true if this registry contains this kind */ +function Has(kind) { + return map.has(kind); +} +/** Sets a validation function for a user defined type */ +function Set(kind, func) { + map.set(kind, func); +} +/** Gets a custom validation function for a user defined type */ +function Get(kind) { + return map.get(kind); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/required/index.d.ts new file mode 100644 index 00000000..74b2a46c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/index.d.ts @@ -0,0 +1,2 @@ +export * from './required-from-mapped-result'; +export * from './required'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/index.js b/node_modules/@sinclair/typebox/build/cjs/type/required/index.js new file mode 100644 index 00000000..5ec78c87 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./required-from-mapped-result"), exports); +__exportStar(require("./required"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.d.ts new file mode 100644 index 00000000..12ca926c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.d.ts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index'; +import type { Ensure, Evaluate } from '../helpers/index'; +import type { TProperties } from '../object/index'; +import { type TMappedResult } from '../mapped/index'; +import { type TRequired } from './required'; +type TFromProperties

= ({ + [K2 in keyof P]: TRequired; +}); +type TFromMappedResult = (Evaluate>); +export type TRequiredFromMappedResult> = (Ensure>); +export declare function RequiredFromMappedResult>(R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.js b/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.js new file mode 100644 index 00000000..f4031915 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/required-from-mapped-result.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RequiredFromMappedResult = RequiredFromMappedResult; +const index_1 = require("../mapped/index"); +const required_1 = require("./required"); +// prettier-ignore +function FromProperties(P, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = (0, required_1.Required)(P[K2], options); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, options) { + return FromProperties(R.properties, options); +} +// prettier-ignore +function RequiredFromMappedResult(R, options) { + const P = FromMappedResult(R, options); + return (0, index_1.MappedResult)(P); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/required.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/required/required.d.ts new file mode 100644 index 00000000..02c854cf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/required.d.ts @@ -0,0 +1,35 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Evaluate, Ensure } from '../helpers/index'; +import type { TMappedResult } from '../mapped/index'; +import { type TReadonlyOptional } from '../readonly-optional/index'; +import { type TComputed } from '../computed/index'; +import { type TOptional } from '../optional/index'; +import { type TReadonly } from '../readonly/index'; +import { type TRecursive } from '../recursive/index'; +import { type TObject, type TProperties } from '../object/index'; +import { type TIntersect } from '../intersect/index'; +import { type TUnion } from '../union/index'; +import { type TRef } from '../ref/index'; +import { type TBigInt } from '../bigint/index'; +import { type TBoolean } from '../boolean/index'; +import { type TInteger } from '../integer/index'; +import { type TLiteral } from '../literal/index'; +import { type TNull } from '../null/index'; +import { type TNumber } from '../number/index'; +import { type TString } from '../string/index'; +import { type TSymbol } from '../symbol/index'; +import { type TUndefined } from '../undefined/index'; +import { type TRequiredFromMappedResult } from './required-from-mapped-result'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +type TFromProperties = Evaluate<{ + [K in keyof Properties]: Properties[K] extends (TReadonlyOptional) ? TReadonly : Properties[K] extends (TReadonly) ? TReadonly : Properties[K] extends (TOptional) ? S : Properties[K]; +}>; +type TFromObject<_Type extends TObject, Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +export type TRequired = (Type extends TRecursive ? TRecursive> : Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : Type extends TBigInt ? Type : Type extends TBoolean ? Type : Type extends TInteger ? Type : Type extends TLiteral ? Type : Type extends TNull ? Type : Type extends TNumber ? Type : Type extends TString ? Type : Type extends TSymbol ? Type : Type extends TUndefined ? Type : TObject<{}>); +/** `[Json]` Constructs a type where all properties are required */ +export declare function Required(type: MappedResult, options?: SchemaOptions): TRequiredFromMappedResult; +/** `[Json]` Constructs a type where all properties are required */ +export declare function Required(type: Type, options?: SchemaOptions): TRequired; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/required/required.js b/node_modules/@sinclair/typebox/build/cjs/type/required/required.js new file mode 100644 index 00000000..5dd4a6a2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/required/required.js @@ -0,0 +1,110 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Required = Required; +const type_1 = require("../create/type"); +const index_1 = require("../computed/index"); +const index_2 = require("../object/index"); +const index_3 = require("../intersect/index"); +const index_4 = require("../union/index"); +const index_5 = require("../ref/index"); +const index_6 = require("../symbols/index"); +const index_7 = require("../discard/index"); +const required_from_mapped_result_1 = require("./required-from-mapped-result"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const KindGuard = __importStar(require("../guard/kind")); +// prettier-ignore +function FromComputed(target, parameters) { + return (0, index_1.Computed)('Required', [(0, index_1.Computed)(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return (0, index_1.Computed)('Required', [(0, index_5.Ref)($ref)]); +} +// prettier-ignore +function FromProperties(properties) { + const requiredProperties = {}; + for (const K of globalThis.Object.getOwnPropertyNames(properties)) + requiredProperties[K] = (0, index_7.Discard)(properties[K], [index_6.OptionalKind]); + return requiredProperties; +} +// prettier-ignore +function FromObject(type, properties) { + const options = (0, index_7.Discard)(type, [index_6.TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties); + return (0, index_2.Object)(mappedProperties, options); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => RequiredResolve(type)); +} +// ------------------------------------------------------------------ +// RequiredResolve +// ------------------------------------------------------------------ +// prettier-ignore +function RequiredResolve(type) { + return ( + // Mappable + KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : + KindGuard.IsRef(type) ? FromRef(type.$ref) : + KindGuard.IsIntersect(type) ? (0, index_3.Intersect)(FromRest(type.allOf)) : + KindGuard.IsUnion(type) ? (0, index_4.Union)(FromRest(type.anyOf)) : + KindGuard.IsObject(type) ? FromObject(type, type.properties) : + // Intrinsic + KindGuard.IsBigInt(type) ? type : + KindGuard.IsBoolean(type) ? type : + KindGuard.IsInteger(type) ? type : + KindGuard.IsLiteral(type) ? type : + KindGuard.IsNull(type) ? type : + KindGuard.IsNumber(type) ? type : + KindGuard.IsString(type) ? type : + KindGuard.IsSymbol(type) ? type : + KindGuard.IsUndefined(type) ? type : + // Passthrough + (0, index_2.Object)({})); +} +/** `[Json]` Constructs a type where all properties are required */ +function Required(type, options) { + if (KindGuard.IsMappedResult(type)) { + return (0, required_from_mapped_result_1.RequiredFromMappedResult)(type, options); + } + else { + // special: mapping types require overridable options + return (0, type_1.CreateType)({ ...RequiredResolve(type), ...options }); + } +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/rest/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/rest/index.d.ts new file mode 100644 index 00000000..48a8ca03 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/rest/index.d.ts @@ -0,0 +1 @@ +export * from './rest'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/rest/index.js b/node_modules/@sinclair/typebox/build/cjs/type/rest/index.js new file mode 100644 index 00000000..26936494 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/rest/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./rest"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.d.ts new file mode 100644 index 00000000..c49673bc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.d.ts @@ -0,0 +1,10 @@ +import type { TSchema } from '../schema/index'; +import type { TIntersect } from '../intersect/index'; +import type { TUnion } from '../union/index'; +import type { TTuple } from '../tuple/index'; +type TRestResolve = T extends TIntersect ? S : T extends TUnion ? S : T extends TTuple ? S : [ +]; +export type TRest = TRestResolve; +/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ +export declare function Rest(T: T): TRest; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.js b/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.js new file mode 100644 index 00000000..750b3fc7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/rest/rest.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Rest = Rest; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function RestResolve(T) { + return ((0, kind_1.IsIntersect)(T) ? T.allOf : + (0, kind_1.IsUnion)(T) ? T.anyOf : + (0, kind_1.IsTuple)(T) ? T.items ?? [] : + []); +} +/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ +function Rest(T) { + return RestResolve(T); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.d.ts new file mode 100644 index 00000000..7c682236 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.d.ts @@ -0,0 +1 @@ +export * from './return-type'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.js b/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.js new file mode 100644 index 00000000..0f04f363 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/return-type/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./return-type"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.d.ts new file mode 100644 index 00000000..f8b2be4f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.d.ts @@ -0,0 +1,6 @@ +import { type TSchema, type SchemaOptions } from '../schema/index'; +import { type TFunction } from '../function/index'; +import { type TNever } from '../never/index'; +export type TReturnType ? ReturnType : TNever> = Result; +/** `[JavaScript]` Extracts the ReturnType from the given Function type */ +export declare function ReturnType(schema: Type, options?: SchemaOptions): TReturnType; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.js b/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.js new file mode 100644 index 00000000..3f776abf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/return-type/return-type.js @@ -0,0 +1,44 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReturnType = ReturnType; +const type_1 = require("../create/type"); +const index_1 = require("../never/index"); +const KindGuard = __importStar(require("../guard/kind")); +/** `[JavaScript]` Extracts the ReturnType from the given Function type */ +function ReturnType(schema, options) { + return (KindGuard.IsFunction(schema) ? (0, type_1.CreateType)(schema.returns, options) : (0, index_1.Never)(options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.d.ts new file mode 100644 index 00000000..0aa119ee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.d.ts @@ -0,0 +1,33 @@ +import type { TAny } from '../any/index'; +import type { TArray } from '../array/index'; +import type { TAsyncIterator } from '../async-iterator/index'; +import type { TBigInt } from '../bigint/index'; +import type { TBoolean } from '../boolean/index'; +import type { TConstructor } from '../constructor/index'; +import type { TDate } from '../date/index'; +import type { TEnum } from '../enum/index'; +import type { TFunction } from '../function/index'; +import type { TInteger } from '../integer/index'; +import type { TIntersect } from '../intersect/index'; +import type { TIterator } from '../iterator/index'; +import type { TLiteral } from '../literal/index'; +import type { TNot } from '../not/index'; +import type { TNull } from '../null/index'; +import type { TNumber } from '../number/index'; +import type { TObject } from '../object/index'; +import type { TPromise } from '../promise/index'; +import type { TRecord } from '../record/index'; +import type { TThis } from '../recursive/index'; +import type { TRef } from '../ref/index'; +import type { TRegExp } from '../regexp/index'; +import type { TString } from '../string/index'; +import type { TSymbol } from '../symbol/index'; +import type { TTemplateLiteral } from '../template-literal/index'; +import type { TTuple } from '../tuple/index'; +import type { TUint8Array } from '../uint8array/index'; +import type { TUndefined } from '../undefined/index'; +import type { TUnion } from '../union/index'; +import type { TUnknown } from '../unknown/index'; +import type { TVoid } from '../void/index'; +import type { TSchema } from './schema'; +export type TAnySchema = TSchema | TAny | TArray | TAsyncIterator | TBigInt | TBoolean | TConstructor | TDate | TEnum | TFunction | TInteger | TIntersect | TIterator | TLiteral | TNot | TNull | TNumber | TObject | TPromise | TRecord | TRef | TRegExp | TString | TSymbol | TTemplateLiteral | TThis | TTuple | TUndefined | TUnion | TUint8Array | TUnknown | TVoid; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.js b/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/anyschema.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/schema/index.d.ts new file mode 100644 index 00000000..62a85783 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/index.d.ts @@ -0,0 +1,2 @@ +export * from './anyschema'; +export * from './schema'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/index.js b/node_modules/@sinclair/typebox/build/cjs/type/schema/index.js new file mode 100644 index 00000000..3381bb93 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/index.js @@ -0,0 +1,19 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./anyschema"), exports); +__exportStar(require("./schema"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts new file mode 100644 index 00000000..57e2e68b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts @@ -0,0 +1,29 @@ +import { Kind, Hint, ReadonlyKind, OptionalKind } from '../symbols/index'; +export interface SchemaOptions { + $schema?: string; + /** Id for this schema */ + $id?: string; + /** Title of this schema */ + title?: string; + /** Description of this schema */ + description?: string; + /** Default value for this schema */ + default?: any; + /** Example values matching this schema */ + examples?: any; + /** Optional annotation for readOnly */ + readOnly?: boolean; + /** Optional annotation for writeOnly */ + writeOnly?: boolean; + [prop: string]: any; +} +export interface TKind { + [Kind]: string; +} +export interface TSchema extends TKind, SchemaOptions { + [ReadonlyKind]?: string; + [OptionalKind]?: string; + [Hint]?: string; + params: unknown[]; + static: unknown; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.js b/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.js new file mode 100644 index 00000000..aca9239a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.js @@ -0,0 +1,4 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../symbols/index"); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/sets/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/sets/index.d.ts new file mode 100644 index 00000000..cd406b21 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/sets/index.d.ts @@ -0,0 +1 @@ +export * from './set'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/sets/index.js b/node_modules/@sinclair/typebox/build/cjs/type/sets/index.js new file mode 100644 index 00000000..5dec05e9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/sets/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./set"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/sets/set.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/sets/set.d.ts new file mode 100644 index 00000000..11d704cd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/sets/set.d.ts @@ -0,0 +1,28 @@ +export type TSetIncludes = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes : false); +/** Returns true if element right is in the set of left */ +export declare function SetIncludes(T: [...T], S: S): TSetIncludes; +export type TSetIsSubset = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetIsSubset : false : true); +/** Returns true if left is a subset of right */ +export declare function SetIsSubset(T: [...T], S: [...S]): TSetIsSubset; +export type TSetDistinct = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends false ? TSetDistinct : TSetDistinct : Acc; +/** Returns a distinct set of elements */ +export declare function SetDistinct(T: [...T]): TSetDistinct; +export type TSetIntersect = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetIntersect : TSetIntersect : Acc); +/** Returns the Intersect of the given sets */ +export declare function SetIntersect(T: [...T], S: [...S]): TSetIntersect; +export type TSetUnion = ([ + ...T, + ...S +]); +/** Returns the Union of the given sets */ +export declare function SetUnion(T: [...T], S: [...S]): TSetUnion; +export type TSetComplement = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetComplement : TSetComplement : Acc); +/** Returns the Complement by omitting elements in T that are in S */ +export declare function SetComplement(T: [...T], S: [...S]): TSetComplement; +type TSetIntersectManyResolve = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve> : Acc); +export type TSetIntersectMany = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve : []); +export declare function SetIntersectMany(T: [...T]): TSetIntersectMany; +export type TSetUnionMany = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany> : Acc); +/** Returns the Union of multiple sets */ +export declare function SetUnionMany(T: [...T]): TSetUnionMany; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/sets/set.js b/node_modules/@sinclair/typebox/build/cjs/type/sets/set.js new file mode 100644 index 00000000..4d4743f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/sets/set.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetIncludes = SetIncludes; +exports.SetIsSubset = SetIsSubset; +exports.SetDistinct = SetDistinct; +exports.SetIntersect = SetIntersect; +exports.SetUnion = SetUnion; +exports.SetComplement = SetComplement; +exports.SetIntersectMany = SetIntersectMany; +exports.SetUnionMany = SetUnionMany; +/** Returns true if element right is in the set of left */ +// prettier-ignore +function SetIncludes(T, S) { + return T.includes(S); +} +/** Returns true if left is a subset of right */ +function SetIsSubset(T, S) { + return T.every((L) => SetIncludes(S, L)); +} +/** Returns a distinct set of elements */ +function SetDistinct(T) { + return [...new Set(T)]; +} +/** Returns the Intersect of the given sets */ +function SetIntersect(T, S) { + return T.filter((L) => S.includes(L)); +} +/** Returns the Union of the given sets */ +function SetUnion(T, S) { + return [...T, ...S]; +} +/** Returns the Complement by omitting elements in T that are in S */ +// prettier-ignore +function SetComplement(T, S) { + return T.filter(L => !S.includes(L)); +} +// prettier-ignore +function SetIntersectManyResolve(T, Init) { + return T.reduce((Acc, L) => { + return SetIntersect(Acc, L); + }, Init); +} +// prettier-ignore +function SetIntersectMany(T) { + return (T.length === 1 + ? T[0] + // Use left to initialize the accumulator for resolve + : T.length > 1 + ? SetIntersectManyResolve(T.slice(1), T[0]) + : []); +} +/** Returns the Union of multiple sets */ +function SetUnionMany(T) { + const Acc = []; + for (const L of T) + Acc.push(...L); + return Acc; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/static/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/static/index.d.ts new file mode 100644 index 00000000..26c827ff --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/static/index.d.ts @@ -0,0 +1 @@ +export * from './static'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/static/index.js b/node_modules/@sinclair/typebox/build/cjs/type/static/index.js new file mode 100644 index 00000000..3e9cc86c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/static/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./static"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts new file mode 100644 index 00000000..a1242ba9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts @@ -0,0 +1,39 @@ +import type { Evaluate } from '../helpers/index'; +import type { TOptional } from '../optional/index'; +import type { TReadonly } from '../readonly/index'; +import type { TArray } from '../array/index'; +import type { TAsyncIterator } from '../async-iterator/index'; +import type { TConstructor } from '../constructor/index'; +import type { TEnum } from '../enum/index'; +import type { TFunction } from '../function/index'; +import type { TIntersect } from '../intersect/index'; +import type { TImport } from '../module/index'; +import type { TIterator } from '../iterator/index'; +import type { TNot } from '../not/index'; +import type { TObject, TProperties } from '../object/index'; +import type { TPromise } from '../promise/index'; +import type { TRecursive } from '../recursive/index'; +import type { TRecord } from '../record/index'; +import type { TRef } from '../ref/index'; +import type { TTuple } from '../tuple/index'; +import type { TUnion } from '../union/index'; +import type { TUnsafe } from '../unsafe/index'; +import type { TSchema } from '../schema/index'; +import type { TTransform } from '../transform/index'; +import type { TNever } from '../never/index'; +type TDecodeImport = (Key extends keyof ModuleProperties ? TDecodeType extends infer Type extends TSchema ? Type extends TRef ? TDecodeImport : Type : TNever : TNever); +type TDecodeProperties = { + [Key in keyof Properties]: TDecodeType; +}; +type TDecodeTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TDecodeTypes]> : Result); +export type TDecodeType = (Type extends TOptional ? TOptional> : Type extends TReadonly ? TReadonly> : Type extends TTransform ? TUnsafe : Type extends TArray ? TArray> : Type extends TAsyncIterator ? TAsyncIterator> : Type extends TConstructor ? TConstructor, TDecodeType> : Type extends TEnum ? TEnum : Type extends TFunction ? TFunction, TDecodeType> : Type extends TIntersect ? TIntersect> : Type extends TImport ? TDecodeImport : Type extends TIterator ? TIterator> : Type extends TNot ? TNot> : Type extends TObject ? TObject>> : Type extends TPromise ? TPromise> : Type extends TRecord ? TRecord> : Type extends TRecursive ? TRecursive> : Type extends TRef ? TRef : Type extends TTuple ? TTuple> : Type extends TUnion ? TUnion> : Type); +export type StaticDecodeIsAny = boolean extends (Type extends TSchema ? true : false) ? true : false; +/** Creates an decoded static type from a TypeBox type */ +export type StaticDecode extends true ? unknown : Static, Params>> = Result; +/** Creates an encoded static type from a TypeBox type */ +export type StaticEncode> = Result; +/** Creates a static type from a TypeBox type */ +export type Static = Result; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/static/static.js b/node_modules/@sinclair/typebox/build/cjs/type/static/static.js new file mode 100644 index 00000000..dc999c11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/static/static.js @@ -0,0 +1,3 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/string/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/string/index.d.ts new file mode 100644 index 00000000..57f9f48d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/string/index.d.ts @@ -0,0 +1 @@ +export * from './string'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/string/index.js b/node_modules/@sinclair/typebox/build/cjs/type/string/index.js new file mode 100644 index 00000000..320230dd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/string/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./string"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts new file mode 100644 index 00000000..01127ee2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts @@ -0,0 +1,25 @@ +import { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string); +export type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string); +export interface StringOptions extends SchemaOptions { + /** The maximum string length */ + maxLength?: number; + /** The minimum string length */ + minLength?: number; + /** A regular expression pattern this string should match */ + pattern?: string; + /** A format this string should match */ + format?: StringFormatOption; + /** The content encoding for this string */ + contentEncoding?: StringContentEncodingOption; + /** The content media type for this string */ + contentMediaType?: string; +} +export interface TString extends TSchema, StringOptions { + [Kind]: 'String'; + static: string; + type: 'string'; +} +/** `[Json]` Creates a String type */ +export declare function String(options?: StringOptions): TString; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/string/string.js b/node_modules/@sinclair/typebox/build/cjs/type/string/string.js new file mode 100644 index 00000000..e50440b9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/string/string.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.String = String; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a String type */ +function String(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'String', type: 'string' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.d.ts new file mode 100644 index 00000000..39ee91a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.d.ts @@ -0,0 +1 @@ +export * from './symbol'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.js b/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.js new file mode 100644 index 00000000..b7e1a64d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbol/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./symbol"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.d.ts new file mode 100644 index 00000000..e5488eee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.d.ts @@ -0,0 +1,10 @@ +import { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export type TSymbolValue = string | number | undefined; +export interface TSymbol extends TSchema, SchemaOptions { + [Kind]: 'Symbol'; + static: symbol; + type: 'symbol'; +} +/** `[JavaScript]` Creates a Symbol type */ +export declare function Symbol(options?: SchemaOptions): TSymbol; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.js b/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.js new file mode 100644 index 00000000..84c0fb94 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbol/symbol.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Symbol = Symbol; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Symbol type */ +function Symbol(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Symbol', type: 'symbol' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.d.ts new file mode 100644 index 00000000..c1c4b7ba --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.d.ts @@ -0,0 +1 @@ +export * from './symbols'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.js b/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.js new file mode 100644 index 00000000..423576b3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbols/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./symbols"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts new file mode 100644 index 00000000..2c0dad5a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts @@ -0,0 +1,10 @@ +/** Symbol key applied to transform types */ +export declare const TransformKind: unique symbol; +/** Symbol key applied to readonly types */ +export declare const ReadonlyKind: unique symbol; +/** Symbol key applied to optional types */ +export declare const OptionalKind: unique symbol; +/** Symbol key applied to types */ +export declare const Hint: unique symbol; +/** Symbol key applied to types */ +export declare const Kind: unique symbol; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.js b/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.js new file mode 100644 index 00000000..e264a781 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Kind = exports.Hint = exports.OptionalKind = exports.ReadonlyKind = exports.TransformKind = void 0; +/** Symbol key applied to transform types */ +exports.TransformKind = Symbol.for('TypeBox.Transform'); +/** Symbol key applied to readonly types */ +exports.ReadonlyKind = Symbol.for('TypeBox.Readonly'); +/** Symbol key applied to optional types */ +exports.OptionalKind = Symbol.for('TypeBox.Optional'); +/** Symbol key applied to types */ +exports.Hint = Symbol.for('TypeBox.Hint'); +/** Symbol key applied to types */ +exports.Kind = Symbol.for('TypeBox.Kind'); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.d.ts new file mode 100644 index 00000000..e38e308e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.d.ts @@ -0,0 +1,19 @@ +import { TypeBoxError } from '../error/index'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index'; +import type { TUnion } from '../union/index'; +import type { TString } from '../string/index'; +import type { TBoolean } from '../boolean/index'; +import type { TNumber } from '../number/index'; +import type { TInteger } from '../integer/index'; +import type { TBigInt } from '../bigint/index'; +import type { TLiteral } from '../literal/index'; +import type { Expression } from './parse'; +export declare class TemplateLiteralFiniteError extends TypeBoxError { +} +type TFromTemplateLiteralKind = T extends TTemplateLiteral ? TFromTemplateLiteralKinds : T extends TUnion ? TFromTemplateLiteralKinds : T extends TString ? false : T extends TNumber ? false : T extends TInteger ? false : T extends TBigInt ? false : T extends TBoolean ? true : T extends TLiteral ? true : false; +type TFromTemplateLiteralKinds = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? TFromTemplateLiteralKind extends false ? false : TFromTemplateLiteralKinds : true; +export declare function IsTemplateLiteralExpressionFinite(expression: Expression): boolean; +export type TIsTemplateLiteralFinite = T extends TTemplateLiteral ? TFromTemplateLiteralKinds : false; +/** Returns true if this TemplateLiteral resolves to a finite set of values */ +export declare function IsTemplateLiteralFinite(schema: T): boolean; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.js new file mode 100644 index 00000000..1cf2a258 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/finite.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralFiniteError = void 0; +exports.IsTemplateLiteralExpressionFinite = IsTemplateLiteralExpressionFinite; +exports.IsTemplateLiteralFinite = IsTemplateLiteralFinite; +const parse_1 = require("./parse"); +const index_1 = require("../error/index"); +// ------------------------------------------------------------------ +// TemplateLiteralFiniteError +// ------------------------------------------------------------------ +class TemplateLiteralFiniteError extends index_1.TypeBoxError { +} +exports.TemplateLiteralFiniteError = TemplateLiteralFiniteError; +// ------------------------------------------------------------------ +// IsTemplateLiteralFiniteCheck +// ------------------------------------------------------------------ +// prettier-ignore +function IsNumberExpression(expression) { + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === '0' && + expression.expr[1].type === 'const' && + expression.expr[1].const === '[1-9][0-9]*'); +} +// prettier-ignore +function IsBooleanExpression(expression) { + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === 'true' && + expression.expr[1].type === 'const' && + expression.expr[1].const === 'false'); +} +// prettier-ignore +function IsStringExpression(expression) { + return expression.type === 'const' && expression.const === '.*'; +} +// ------------------------------------------------------------------ +// IsTemplateLiteralExpressionFinite +// ------------------------------------------------------------------ +// prettier-ignore +function IsTemplateLiteralExpressionFinite(expression) { + return (IsNumberExpression(expression) || IsStringExpression(expression) ? false : + IsBooleanExpression(expression) ? true : + (expression.type === 'and') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : + (expression.type === 'or') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : + (expression.type === 'const') ? true : + (() => { throw new TemplateLiteralFiniteError(`Unknown expression type`); })()); +} +/** Returns true if this TemplateLiteral resolves to a finite set of values */ +function IsTemplateLiteralFinite(schema) { + const expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern); + return IsTemplateLiteralExpressionFinite(expression); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.d.ts new file mode 100644 index 00000000..da5d099c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.d.ts @@ -0,0 +1,21 @@ +import { TIsTemplateLiteralFinite } from './finite'; +import { TypeBoxError } from '../error/index'; +import type { Assert } from '../helpers/index'; +import type { TBoolean } from '../boolean/index'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index'; +import type { TLiteral, TLiteralValue } from '../literal/index'; +import type { Expression } from './parse'; +import type { TUnion } from '../union/index'; +export declare class TemplateLiteralGenerateError extends TypeBoxError { +} +type TStringReduceUnary = R extends [infer A extends string, ...infer B extends string[]] ? TStringReduceUnary : Acc; +type TStringReduceBinary = L extends [infer A extends string, ...infer B extends string[]] ? TStringReduceBinary]> : Acc; +type TStringReduceMany = T extends [infer L extends string[], infer R extends string[], ...infer Rest extends string[][]] ? TStringReduceMany<[TStringReduceBinary, ...Rest]> : T; +type TStringReduce> = 0 extends keyof O ? Assert : []; +type TFromTemplateLiteralUnionKinds = T extends [infer L extends TLiteral, ...infer R extends TLiteral[]] ? [`${L['const']}`, ...TFromTemplateLiteralUnionKinds] : []; +type TFromTemplateLiteralKinds = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? (L extends TTemplateLiteral ? TFromTemplateLiteralKinds<[...S, ...R], Acc> : L extends TLiteral ? TFromTemplateLiteralKinds : L extends TUnion ? TFromTemplateLiteralKinds]> : L extends TBoolean ? TFromTemplateLiteralKinds : Acc) : Acc; +export declare function TemplateLiteralExpressionGenerate(expression: Expression): IterableIterator; +export type TTemplateLiteralGenerate> = F extends true ? (T extends TTemplateLiteral ? TFromTemplateLiteralKinds extends infer R extends string[][] ? TStringReduce : [] : []) : []; +/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */ +export declare function TemplateLiteralGenerate(schema: T): TTemplateLiteralGenerate; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.js new file mode 100644 index 00000000..3c591fbc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/generate.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralGenerateError = void 0; +exports.TemplateLiteralExpressionGenerate = TemplateLiteralExpressionGenerate; +exports.TemplateLiteralGenerate = TemplateLiteralGenerate; +const finite_1 = require("./finite"); +const parse_1 = require("./parse"); +const index_1 = require("../error/index"); +// ------------------------------------------------------------------ +// TemplateLiteralGenerateError +// ------------------------------------------------------------------ +class TemplateLiteralGenerateError extends index_1.TypeBoxError { +} +exports.TemplateLiteralGenerateError = TemplateLiteralGenerateError; +// ------------------------------------------------------------------ +// TemplateLiteralExpressionGenerate +// ------------------------------------------------------------------ +// prettier-ignore +function* GenerateReduce(buffer) { + if (buffer.length === 1) + return yield* buffer[0]; + for (const left of buffer[0]) { + for (const right of GenerateReduce(buffer.slice(1))) { + yield `${left}${right}`; + } + } +} +// prettier-ignore +function* GenerateAnd(expression) { + return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)])); +} +// prettier-ignore +function* GenerateOr(expression) { + for (const expr of expression.expr) + yield* TemplateLiteralExpressionGenerate(expr); +} +// prettier-ignore +function* GenerateConst(expression) { + return yield expression.const; +} +function* TemplateLiteralExpressionGenerate(expression) { + return expression.type === 'and' + ? yield* GenerateAnd(expression) + : expression.type === 'or' + ? yield* GenerateOr(expression) + : expression.type === 'const' + ? yield* GenerateConst(expression) + : (() => { + throw new TemplateLiteralGenerateError('Unknown expression'); + })(); +} +/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */ +function TemplateLiteralGenerate(schema) { + const expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern); + // prettier-ignore + return ((0, finite_1.IsTemplateLiteralExpressionFinite)(expression) + ? [...TemplateLiteralExpressionGenerate(expression)] + : []); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.d.ts new file mode 100644 index 00000000..83f0ab9f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.d.ts @@ -0,0 +1,7 @@ +export * from './finite'; +export * from './generate'; +export * from './syntax'; +export * from './parse'; +export * from './pattern'; +export * from './union'; +export * from './template-literal'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.js new file mode 100644 index 00000000..12003fa8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/index.js @@ -0,0 +1,24 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./finite"), exports); +__exportStar(require("./generate"), exports); +__exportStar(require("./syntax"), exports); +__exportStar(require("./parse"), exports); +__exportStar(require("./pattern"), exports); +__exportStar(require("./union"), exports); +__exportStar(require("./template-literal"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.d.ts new file mode 100644 index 00000000..585232a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.d.ts @@ -0,0 +1,20 @@ +import { TypeBoxError } from '../error/index'; +export declare class TemplateLiteralParserError extends TypeBoxError { +} +export type Expression = ExpressionAnd | ExpressionOr | ExpressionConst; +export type ExpressionConst = { + type: 'const'; + const: string; +}; +export type ExpressionAnd = { + type: 'and'; + expr: Expression[]; +}; +export type ExpressionOr = { + type: 'or'; + expr: Expression[]; +}; +/** Parses a pattern and returns an expression tree */ +export declare function TemplateLiteralParse(pattern: string): Expression; +/** Parses a pattern and strips forward and trailing ^ and $ */ +export declare function TemplateLiteralParseExact(pattern: string): Expression; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.js new file mode 100644 index 00000000..b1e1fa1f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/parse.js @@ -0,0 +1,174 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralParserError = void 0; +exports.TemplateLiteralParse = TemplateLiteralParse; +exports.TemplateLiteralParseExact = TemplateLiteralParseExact; +const index_1 = require("../error/index"); +// ------------------------------------------------------------------ +// TemplateLiteralParserError +// ------------------------------------------------------------------ +class TemplateLiteralParserError extends index_1.TypeBoxError { +} +exports.TemplateLiteralParserError = TemplateLiteralParserError; +// ------------------------------------------------------------------- +// Unescape +// +// Unescape for these control characters specifically. Note that this +// function is only called on non union group content, and where we +// still want to allow the user to embed control characters in that +// content. For review. +// ------------------------------------------------------------------- +// prettier-ignore +function Unescape(pattern) { + return pattern + .replace(/\\\$/g, '$') + .replace(/\\\*/g, '*') + .replace(/\\\^/g, '^') + .replace(/\\\|/g, '|') + .replace(/\\\(/g, '(') + .replace(/\\\)/g, ')'); +} +// ------------------------------------------------------------------- +// Control Characters +// ------------------------------------------------------------------- +function IsNonEscaped(pattern, index, char) { + return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92; +} +function IsOpenParen(pattern, index) { + return IsNonEscaped(pattern, index, '('); +} +function IsCloseParen(pattern, index) { + return IsNonEscaped(pattern, index, ')'); +} +function IsSeparator(pattern, index) { + return IsNonEscaped(pattern, index, '|'); +} +// ------------------------------------------------------------------- +// Control Groups +// ------------------------------------------------------------------- +function IsGroup(pattern) { + if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) + return false; + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (count === 0 && index !== pattern.length - 1) + return false; + } + return true; +} +// prettier-ignore +function InGroup(pattern) { + return pattern.slice(1, pattern.length - 1); +} +// prettier-ignore +function IsPrecedenceOr(pattern) { + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) + return true; + } + return false; +} +// prettier-ignore +function IsPrecedenceAnd(pattern) { + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + return true; + } + return false; +} +// prettier-ignore +function Or(pattern) { + let [count, start] = [0, 0]; + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) { + const range = pattern.slice(start, index); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + start = index + 1; + } + } + const range = pattern.slice(start); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + if (expressions.length === 0) + return { type: 'const', const: '' }; + if (expressions.length === 1) + return expressions[0]; + return { type: 'or', expr: expressions }; +} +// prettier-ignore +function And(pattern) { + function Group(value, index) { + if (!IsOpenParen(value, index)) + throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`); + let count = 0; + for (let scan = index; scan < value.length; scan++) { + if (IsOpenParen(value, scan)) + count += 1; + if (IsCloseParen(value, scan)) + count -= 1; + if (count === 0) + return [index, scan]; + } + throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`); + } + function Range(pattern, index) { + for (let scan = index; scan < pattern.length; scan++) { + if (IsOpenParen(pattern, scan)) + return [index, scan]; + } + return [index, pattern.length]; + } + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) { + const [start, end] = Group(pattern, index); + const range = pattern.slice(start, end + 1); + expressions.push(TemplateLiteralParse(range)); + index = end; + } + else { + const [start, end] = Range(pattern, index); + const range = pattern.slice(start, end); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + index = end - 1; + } + } + return ((expressions.length === 0) ? { type: 'const', const: '' } : + (expressions.length === 1) ? expressions[0] : + { type: 'and', expr: expressions }); +} +// ------------------------------------------------------------------ +// TemplateLiteralParse +// ------------------------------------------------------------------ +/** Parses a pattern and returns an expression tree */ +function TemplateLiteralParse(pattern) { + // prettier-ignore + return (IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : + IsPrecedenceOr(pattern) ? Or(pattern) : + IsPrecedenceAnd(pattern) ? And(pattern) : + { type: 'const', const: Unescape(pattern) }); +} +// ------------------------------------------------------------------ +// TemplateLiteralParseExact +// ------------------------------------------------------------------ +/** Parses a pattern and strips forward and trailing ^ and $ */ +function TemplateLiteralParseExact(pattern) { + return TemplateLiteralParse(pattern.slice(1, pattern.length - 1)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.d.ts new file mode 100644 index 00000000..3ce97e4b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.d.ts @@ -0,0 +1,5 @@ +import type { TTemplateLiteralKind } from './index'; +import { TypeBoxError } from '../error/index'; +export declare class TemplateLiteralPatternError extends TypeBoxError { +} +export declare function TemplateLiteralPattern(kinds: TTemplateLiteralKind[]): string; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.js new file mode 100644 index 00000000..6e75a540 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/pattern.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralPatternError = void 0; +exports.TemplateLiteralPattern = TemplateLiteralPattern; +const index_1 = require("../patterns/index"); +const index_2 = require("../symbols/index"); +const index_3 = require("../error/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// ------------------------------------------------------------------ +// TemplateLiteralPatternError +// ------------------------------------------------------------------ +class TemplateLiteralPatternError extends index_3.TypeBoxError { +} +exports.TemplateLiteralPatternError = TemplateLiteralPatternError; +// ------------------------------------------------------------------ +// TemplateLiteralPattern +// ------------------------------------------------------------------ +function Escape(value) { + return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} +// prettier-ignore +function Visit(schema, acc) { + return ((0, kind_1.IsTemplateLiteral)(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : + (0, kind_1.IsUnion)(schema) ? `(${schema.anyOf.map((schema) => Visit(schema, acc)).join('|')})` : + (0, kind_1.IsNumber)(schema) ? `${acc}${index_1.PatternNumber}` : + (0, kind_1.IsInteger)(schema) ? `${acc}${index_1.PatternNumber}` : + (0, kind_1.IsBigInt)(schema) ? `${acc}${index_1.PatternNumber}` : + (0, kind_1.IsString)(schema) ? `${acc}${index_1.PatternString}` : + (0, kind_1.IsLiteral)(schema) ? `${acc}${Escape(schema.const.toString())}` : + (0, kind_1.IsBoolean)(schema) ? `${acc}${index_1.PatternBoolean}` : + (() => { throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[index_2.Kind]}'`); })()); +} +function TemplateLiteralPattern(kinds) { + return `^${kinds.map((schema) => Visit(schema, '')).join('')}\$`; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.d.ts new file mode 100644 index 00000000..b52e8ac4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.d.ts @@ -0,0 +1,20 @@ +import type { Assert, Trim } from '../helpers/index'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index'; +import { type TLiteral } from '../literal/index'; +import { type TBoolean } from '../boolean/index'; +import { type TBigInt } from '../bigint/index'; +import { type TNumber } from '../number/index'; +import { type TString } from '../string/index'; +import { type TUnionEvaluated } from '../union/index'; +declare function FromUnion(syntax: string): IterableIterator; +declare function FromTerminal(syntax: string): IterableIterator; +type FromUnionLiteral = T extends `${infer L}|${infer R}` ? [TLiteral>, ...FromUnionLiteral] : T extends `${infer L}` ? [TLiteral>] : [ +]; +type FromUnion = TUnionEvaluated>; +type FromTerminal = T extends 'boolean' ? TBoolean : T extends 'bigint' ? TBigInt : T extends 'number' ? TNumber : T extends 'string' ? TString : FromUnion; +type FromString = T extends `{${infer L}}${infer R}` ? [FromTerminal, ...FromString] : T extends `${infer L}$\{${infer R1}\}${infer R2}` ? [TLiteral, ...FromString<`{${R1}}`>, ...FromString] : T extends `${infer L}$\{${infer R1}\}` ? [TLiteral, ...FromString<`{${R1}}`>] : T extends `${infer L}` ? [TLiteral] : [ +]; +export type TTemplateLiteralSyntax = (TTemplateLiteral, TTemplateLiteralKind[]>>); +/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */ +export declare function TemplateLiteralSyntax(syntax: string): TTemplateLiteralKind[]; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.js new file mode 100644 index 00000000..f78b8afe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/syntax.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralSyntax = TemplateLiteralSyntax; +const index_1 = require("../literal/index"); +const index_2 = require("../boolean/index"); +const index_3 = require("../bigint/index"); +const index_4 = require("../number/index"); +const index_5 = require("../string/index"); +const index_6 = require("../union/index"); +const index_7 = require("../never/index"); +// ------------------------------------------------------------------ +// SyntaxParsers +// ------------------------------------------------------------------ +// prettier-ignore +function* FromUnion(syntax) { + const trim = syntax.trim().replace(/"|'/g, ''); + return (trim === 'boolean' ? yield (0, index_2.Boolean)() : + trim === 'number' ? yield (0, index_4.Number)() : + trim === 'bigint' ? yield (0, index_3.BigInt)() : + trim === 'string' ? yield (0, index_5.String)() : + yield (() => { + const literals = trim.split('|').map((literal) => (0, index_1.Literal)(literal.trim())); + return (literals.length === 0 ? (0, index_7.Never)() : + literals.length === 1 ? literals[0] : + (0, index_6.UnionEvaluated)(literals)); + })()); +} +// prettier-ignore +function* FromTerminal(syntax) { + if (syntax[1] !== '{') { + const L = (0, index_1.Literal)('$'); + const R = FromSyntax(syntax.slice(1)); + return yield* [L, ...R]; + } + for (let i = 2; i < syntax.length; i++) { + if (syntax[i] === '}') { + const L = FromUnion(syntax.slice(2, i)); + const R = FromSyntax(syntax.slice(i + 1)); + return yield* [...L, ...R]; + } + } + yield (0, index_1.Literal)(syntax); +} +// prettier-ignore +function* FromSyntax(syntax) { + for (let i = 0; i < syntax.length; i++) { + if (syntax[i] === '$') { + const L = (0, index_1.Literal)(syntax.slice(0, i)); + const R = FromTerminal(syntax.slice(i)); + return yield* [L, ...R]; + } + } + yield (0, index_1.Literal)(syntax); +} +/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */ +function TemplateLiteralSyntax(syntax) { + return [...FromSyntax(syntax)]; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.d.ts new file mode 100644 index 00000000..d9ac9512 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.d.ts @@ -0,0 +1,30 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Assert } from '../helpers/index'; +import type { TUnion } from '../union/index'; +import type { TLiteral } from '../literal/index'; +import type { TInteger } from '../integer/index'; +import type { TNumber } from '../number/index'; +import type { TBigInt } from '../bigint/index'; +import type { TString } from '../string/index'; +import type { TBoolean } from '../boolean/index'; +import type { TNever } from '../never/index'; +import type { Static } from '../static/index'; +import { type TTemplateLiteralSyntax } from './syntax'; +import { EmptyString } from '../helpers/index'; +import { Kind } from '../symbols/index'; +type TemplateLiteralStaticKind = T extends TUnion ? { + [K in keyof U]: TemplateLiteralStatic, Acc>; +}[number] : T extends TTemplateLiteral ? `${Static}` : T extends TLiteral ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never; +type TemplateLiteralStatic = T extends [infer L, ...infer R] ? `${TemplateLiteralStaticKind}${TemplateLiteralStatic, Acc>}` : Acc; +export type TTemplateLiteralKind = TTemplateLiteral | TUnion | TLiteral | TInteger | TNumber | TBigInt | TString | TBoolean | TNever; +export interface TTemplateLiteral extends TSchema { + [Kind]: 'TemplateLiteral'; + static: TemplateLiteralStatic; + type: 'string'; + pattern: string; +} +/** `[Json]` Creates a TemplateLiteral type from template dsl string */ +export declare function TemplateLiteral(syntax: T, options?: SchemaOptions): TTemplateLiteralSyntax; +/** `[Json]` Creates a TemplateLiteral type */ +export declare function TemplateLiteral(kinds: [...T], options?: SchemaOptions): TTemplateLiteral; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.js new file mode 100644 index 00000000..d785ec1e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/template-literal.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteral = TemplateLiteral; +const type_1 = require("../create/type"); +const syntax_1 = require("./syntax"); +const pattern_1 = require("./pattern"); +const value_1 = require("../guard/value"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a TemplateLiteral type */ +// prettier-ignore +function TemplateLiteral(unresolved, options) { + const pattern = (0, value_1.IsString)(unresolved) + ? (0, pattern_1.TemplateLiteralPattern)((0, syntax_1.TemplateLiteralSyntax)(unresolved)) + : (0, pattern_1.TemplateLiteralPattern)(unresolved); + return (0, type_1.CreateType)({ [index_1.Kind]: 'TemplateLiteral', type: 'string', pattern }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.d.ts new file mode 100644 index 00000000..66f8a614 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.d.ts @@ -0,0 +1,9 @@ +import type { Static } from '../static/index'; +import type { TTemplateLiteral } from './template-literal'; +import type { UnionToTuple } from '../helpers/index'; +import { type TUnionEvaluated } from '../union/index'; +import { type TLiteral } from '../literal/index'; +export type TTemplateLiteralToUnionLiteralArray = (T extends [infer L extends string, ...infer R extends string[]] ? TTemplateLiteralToUnionLiteralArray]> : Acc); +export type TTemplateLiteralToUnion>> = TUnionEvaluated>; +/** Returns a Union from the given TemplateLiteral */ +export declare function TemplateLiteralToUnion(schema: TTemplateLiteral): TTemplateLiteralToUnion; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.js b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.js new file mode 100644 index 00000000..fc66d12b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/template-literal/union.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplateLiteralToUnion = TemplateLiteralToUnion; +const index_1 = require("../union/index"); +const index_2 = require("../literal/index"); +const generate_1 = require("./generate"); +/** Returns a Union from the given TemplateLiteral */ +function TemplateLiteralToUnion(schema) { + const R = (0, generate_1.TemplateLiteralGenerate)(schema); + const L = R.map((S) => (0, index_2.Literal)(S)); + return (0, index_1.UnionEvaluated)(L); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/transform/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/transform/index.d.ts new file mode 100644 index 00000000..d5e7ab19 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/transform/index.d.ts @@ -0,0 +1 @@ +export * from './transform'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/transform/index.js b/node_modules/@sinclair/typebox/build/cjs/type/transform/index.js new file mode 100644 index 00000000..ab77a477 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/transform/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./transform"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.d.ts new file mode 100644 index 00000000..a3343c6d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.d.ts @@ -0,0 +1,30 @@ +import type { TSchema } from '../schema/index'; +import type { Static, StaticDecode } from '../static/index'; +import { TransformKind } from '../symbols/index'; +export declare class TransformDecodeBuilder { + private readonly schema; + constructor(schema: T); + Decode, U>>(decode: D): TransformEncodeBuilder; +} +export declare class TransformEncodeBuilder { + private readonly schema; + private readonly decode; + constructor(schema: T, decode: D); + private EncodeTransform; + private EncodeSchema; + Encode, StaticDecode>>(encode: E): TTransform>; +} +type TransformStatic = T extends TTransform ? S : Static; +export type TransformFunction = (value: T) => U; +export interface TransformOptions { + Decode: TransformFunction, O>; + Encode: TransformFunction>; +} +export interface TTransform extends TSchema { + static: TransformStatic; + [TransformKind]: TransformOptions; + [key: string]: any; +} +/** `[Json]` Creates a Transform type */ +export declare function Transform(schema: I): TransformDecodeBuilder; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.js b/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.js new file mode 100644 index 00000000..7fddc188 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/transform/transform.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = void 0; +exports.Transform = Transform; +const index_1 = require("../symbols/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// ------------------------------------------------------------------ +// TransformBuilders +// ------------------------------------------------------------------ +class TransformDecodeBuilder { + constructor(schema) { + this.schema = schema; + } + Decode(decode) { + return new TransformEncodeBuilder(this.schema, decode); + } +} +exports.TransformDecodeBuilder = TransformDecodeBuilder; +// prettier-ignore +class TransformEncodeBuilder { + constructor(schema, decode) { + this.schema = schema; + this.decode = decode; + } + EncodeTransform(encode, schema) { + const Encode = (value) => schema[index_1.TransformKind].Encode(encode(value)); + const Decode = (value) => this.decode(schema[index_1.TransformKind].Decode(value)); + const Codec = { Encode: Encode, Decode: Decode }; + return { ...schema, [index_1.TransformKind]: Codec }; + } + EncodeSchema(encode, schema) { + const Codec = { Decode: this.decode, Encode: encode }; + return { ...schema, [index_1.TransformKind]: Codec }; + } + Encode(encode) { + return ((0, kind_1.IsTransform)(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema)); + } +} +exports.TransformEncodeBuilder = TransformEncodeBuilder; +/** `[Json]` Creates a Transform type */ +function Transform(schema) { + return new TransformDecodeBuilder(schema); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.d.ts new file mode 100644 index 00000000..9bfe8c57 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.d.ts @@ -0,0 +1 @@ +export * from './tuple'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.js b/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.js new file mode 100644 index 00000000..216f273c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/tuple/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./tuple"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.d.ts new file mode 100644 index 00000000..c4517731 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.d.ts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +type TupleStatic = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TupleStatic]> : Acc; +export interface TTuple extends TSchema { + [Kind]: 'Tuple'; + static: TupleStatic; + type: 'array'; + items: T; + additionalItems?: false; + minItems: T['length']; + maxItems: T['length']; +} +/** `[Json]` Creates a Tuple type */ +export declare function Tuple(types: [...Types], options?: SchemaOptions): TTuple; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.js b/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.js new file mode 100644 index 00000000..b019581c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/tuple/tuple.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Tuple = Tuple; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Tuple type */ +function Tuple(types, options) { + // prettier-ignore + return (0, type_1.CreateType)(types.length > 0 ? + { [index_1.Kind]: 'Tuple', type: 'array', items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : + { [index_1.Kind]: 'Tuple', type: 'array', minItems: types.length, maxItems: types.length }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/type/index.d.ts new file mode 100644 index 00000000..f567d2a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/index.d.ts @@ -0,0 +1,6 @@ +export { JsonTypeBuilder } from './json'; +import { JavaScriptTypeBuilder } from './javascript'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +declare const Type: InstanceType; +export { JavaScriptTypeBuilder }; +export { Type }; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/index.js b/node_modules/@sinclair/typebox/build/cjs/type/type/index.js new file mode 100644 index 00000000..6e038592 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/index.js @@ -0,0 +1,51 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Type = exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = void 0; +// ------------------------------------------------------------------ +// JsonTypeBuilder +// ------------------------------------------------------------------ +var json_1 = require("./json"); +Object.defineProperty(exports, "JsonTypeBuilder", { enumerable: true, get: function () { return json_1.JsonTypeBuilder; } }); +// ------------------------------------------------------------------ +// JavaScriptTypeBuilder +// ------------------------------------------------------------------ +const TypeBuilder = __importStar(require("./type")); +const javascript_1 = require("./javascript"); +Object.defineProperty(exports, "JavaScriptTypeBuilder", { enumerable: true, get: function () { return javascript_1.JavaScriptTypeBuilder; } }); +/** JavaScript Type Builder with Static Resolution for TypeScript */ +const Type = TypeBuilder; +exports.Type = Type; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.d.ts new file mode 100644 index 00000000..6ccc80ff --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.d.ts @@ -0,0 +1,64 @@ +import { JsonTypeBuilder } from './json'; +import { type TArgument } from '../argument/index'; +import { type TAsyncIterator } from '../async-iterator/index'; +import { type TAwaited } from '../awaited/index'; +import { type TBigInt, type BigIntOptions } from '../bigint/index'; +import { type TConstructor } from '../constructor/index'; +import { type TConstructorParameters } from '../constructor-parameters/index'; +import { type TDate, type DateOptions } from '../date/index'; +import { type TFunction } from '../function/index'; +import { type TInstanceType } from '../instance-type/index'; +import { type TInstantiate } from '../instantiate/index'; +import { type TIterator } from '../iterator/index'; +import { type TParameters } from '../parameters/index'; +import { type TPromise } from '../promise/index'; +import { type TRegExp, RegExpOptions } from '../regexp/index'; +import { type TReturnType } from '../return-type/index'; +import { type TSchema, type SchemaOptions } from '../schema/index'; +import { type TSymbol } from '../symbol/index'; +import { type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index'; +import { type TUndefined } from '../undefined/index'; +import { type TVoid } from '../void/index'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +export declare class JavaScriptTypeBuilder extends JsonTypeBuilder { + /** `[JavaScript]` Creates a Generic Argument Type */ + Argument(index: Index): TArgument; + /** `[JavaScript]` Creates a AsyncIterator type */ + AsyncIterator(items: Type, options?: SchemaOptions): TAsyncIterator; + /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ + Awaited(schema: Type, options?: SchemaOptions): TAwaited; + /** `[JavaScript]` Creates a BigInt type */ + BigInt(options?: BigIntOptions): TBigInt; + /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ + ConstructorParameters(schema: Type, options?: SchemaOptions): TConstructorParameters; + /** `[JavaScript]` Creates a Constructor type */ + Constructor(parameters: [...Parameters], instanceType: InstanceType, options?: SchemaOptions): TConstructor; + /** `[JavaScript]` Creates a Date type */ + Date(options?: DateOptions): TDate; + /** `[JavaScript]` Creates a Function type */ + Function(parameters: [...Parameters], returnType: ReturnType, options?: SchemaOptions): TFunction; + /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ + InstanceType(schema: Type, options?: SchemaOptions): TInstanceType; + /** `[JavaScript]` Instantiates a type with the given parameters */ + Instantiate(schema: Type, parameters: [...Parameters]): TInstantiate; + /** `[JavaScript]` Creates an Iterator type */ + Iterator(items: Type, options?: SchemaOptions): TIterator; + /** `[JavaScript]` Extracts the Parameters from the given Function type */ + Parameters(schema: Type, options?: SchemaOptions): TParameters; + /** `[JavaScript]` Creates a Promise type */ + Promise(item: Type, options?: SchemaOptions): TPromise; + /** `[JavaScript]` Creates a RegExp type */ + RegExp(pattern: string, options?: RegExpOptions): TRegExp; + /** `[JavaScript]` Creates a RegExp type */ + RegExp(regex: RegExp, options?: RegExpOptions): TRegExp; + /** `[JavaScript]` Extracts the ReturnType from the given Function type */ + ReturnType(type: Type, options?: SchemaOptions): TReturnType; + /** `[JavaScript]` Creates a Symbol type */ + Symbol(options?: SchemaOptions): TSymbol; + /** `[JavaScript]` Creates a Undefined type */ + Undefined(options?: SchemaOptions): TUndefined; + /** `[JavaScript]` Creates a Uint8Array type */ + Uint8Array(options?: Uint8ArrayOptions): TUint8Array; + /** `[JavaScript]` Creates a Void type */ + Void(options?: SchemaOptions): TVoid; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.js b/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.js new file mode 100644 index 00000000..964879ad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/javascript.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JavaScriptTypeBuilder = void 0; +const json_1 = require("./json"); +const index_1 = require("../argument/index"); +const index_2 = require("../async-iterator/index"); +const index_3 = require("../awaited/index"); +const index_4 = require("../bigint/index"); +const index_5 = require("../constructor/index"); +const index_6 = require("../constructor-parameters/index"); +const index_7 = require("../date/index"); +const index_8 = require("../function/index"); +const index_9 = require("../instance-type/index"); +const index_10 = require("../instantiate/index"); +const index_11 = require("../iterator/index"); +const index_12 = require("../parameters/index"); +const index_13 = require("../promise/index"); +const index_14 = require("../regexp/index"); +const index_15 = require("../return-type/index"); +const index_16 = require("../symbol/index"); +const index_17 = require("../uint8array/index"); +const index_18 = require("../undefined/index"); +const index_19 = require("../void/index"); +/** JavaScript Type Builder with Static Resolution for TypeScript */ +class JavaScriptTypeBuilder extends json_1.JsonTypeBuilder { + /** `[JavaScript]` Creates a Generic Argument Type */ + Argument(index) { + return (0, index_1.Argument)(index); + } + /** `[JavaScript]` Creates a AsyncIterator type */ + AsyncIterator(items, options) { + return (0, index_2.AsyncIterator)(items, options); + } + /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ + Awaited(schema, options) { + return (0, index_3.Awaited)(schema, options); + } + /** `[JavaScript]` Creates a BigInt type */ + BigInt(options) { + return (0, index_4.BigInt)(options); + } + /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ + ConstructorParameters(schema, options) { + return (0, index_6.ConstructorParameters)(schema, options); + } + /** `[JavaScript]` Creates a Constructor type */ + Constructor(parameters, instanceType, options) { + return (0, index_5.Constructor)(parameters, instanceType, options); + } + /** `[JavaScript]` Creates a Date type */ + Date(options = {}) { + return (0, index_7.Date)(options); + } + /** `[JavaScript]` Creates a Function type */ + Function(parameters, returnType, options) { + return (0, index_8.Function)(parameters, returnType, options); + } + /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ + InstanceType(schema, options) { + return (0, index_9.InstanceType)(schema, options); + } + /** `[JavaScript]` Instantiates a type with the given parameters */ + Instantiate(schema, parameters) { + return (0, index_10.Instantiate)(schema, parameters); + } + /** `[JavaScript]` Creates an Iterator type */ + Iterator(items, options) { + return (0, index_11.Iterator)(items, options); + } + /** `[JavaScript]` Extracts the Parameters from the given Function type */ + Parameters(schema, options) { + return (0, index_12.Parameters)(schema, options); + } + /** `[JavaScript]` Creates a Promise type */ + Promise(item, options) { + return (0, index_13.Promise)(item, options); + } + /** `[JavaScript]` Creates a RegExp type */ + RegExp(unresolved, options) { + return (0, index_14.RegExp)(unresolved, options); + } + /** `[JavaScript]` Extracts the ReturnType from the given Function type */ + ReturnType(type, options) { + return (0, index_15.ReturnType)(type, options); + } + /** `[JavaScript]` Creates a Symbol type */ + Symbol(options) { + return (0, index_16.Symbol)(options); + } + /** `[JavaScript]` Creates a Undefined type */ + Undefined(options) { + return (0, index_18.Undefined)(options); + } + /** `[JavaScript]` Creates a Uint8Array type */ + Uint8Array(options) { + return (0, index_17.Uint8Array)(options); + } + /** `[JavaScript]` Creates a Void type */ + Void(options) { + return (0, index_19.Void)(options); + } +} +exports.JavaScriptTypeBuilder = JavaScriptTypeBuilder; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/json.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/type/json.d.ts new file mode 100644 index 00000000..d7a70d54 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/json.d.ts @@ -0,0 +1,208 @@ +import { type TAny } from '../any/index'; +import { type TArray, type ArrayOptions } from '../array/index'; +import { type TBoolean } from '../boolean/index'; +import { type TComposite } from '../composite/index'; +import { type TConst } from '../const/index'; +import { type TEnum, type TEnumKey, type TEnumValue } from '../enum/index'; +import { type TExclude, type TExcludeFromMappedResult, type TExcludeFromTemplateLiteral } from '../exclude/index'; +import { type TExtends, type TExtendsFromMappedKey, type TExtendsFromMappedResult } from '../extends/index'; +import { type TExtract, type TExtractFromMappedResult, type TExtractFromTemplateLiteral } from '../extract/index'; +import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey, type TIndexFromMappedResult, type TIndexFromComputed } from '../indexed/index'; +import { type IntegerOptions, type TInteger } from '../integer/index'; +import { Intersect, type IntersectOptions } from '../intersect/index'; +import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index'; +import { type TKeyOf } from '../keyof/index'; +import { type TLiteral, type TLiteralValue } from '../literal/index'; +import { type TMappedFunction, type TMapped, type TMappedResult } from '../mapped/index'; +import { type TNever } from '../never/index'; +import { type TNot } from '../not/index'; +import { type TNull } from '../null/index'; +import { type TMappedKey } from '../mapped/index'; +import { TModule } from '../module/index'; +import { type TNumber, type NumberOptions } from '../number/index'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index'; +import { type TOmit } from '../omit/index'; +import { type TOptionalWithFlag, type TOptionalFromMappedResult } from '../optional/index'; +import { type TPartial, type TPartialFromMappedResult } from '../partial/index'; +import { type TPick } from '../pick/index'; +import { type TReadonlyWithFlag, type TReadonlyFromMappedResult } from '../readonly/index'; +import { type TReadonlyOptional } from '../readonly-optional/index'; +import { type TRecordOrObject } from '../record/index'; +import { type TRecursive, type TThis } from '../recursive/index'; +import { type TRef, type TRefUnsafe } from '../ref/index'; +import { type TRequired, type TRequiredFromMappedResult } from '../required/index'; +import { type TRest } from '../rest/index'; +import { type TSchema, type SchemaOptions } from '../schema/index'; +import { type TString, type StringOptions } from '../string/index'; +import { type TTemplateLiteral, type TTemplateLiteralKind, type TTemplateLiteralSyntax } from '../template-literal/index'; +import { TransformDecodeBuilder } from '../transform/index'; +import { type TTuple } from '../tuple/index'; +import { Union } from '../union/index'; +import { type TUnknown } from '../unknown/index'; +import { type TUnsafe, type UnsafeOptions } from '../unsafe/index'; +/** Json Type Builder with Static Resolution for TypeScript */ +export declare class JsonTypeBuilder { + /** `[Json]` Creates a Readonly and Optional property */ + ReadonlyOptional(type: Type): TReadonlyOptional; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type, enable: Flag): TReadonlyFromMappedResult; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type, enable: Flag): TReadonlyWithFlag; + /** `[Json]` Creates a Optional property */ + Readonly(type: Type): TReadonlyFromMappedResult; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type): TReadonlyWithFlag; + /** `[Json]` Creates a Optional property */ + Optional(type: Type, enable: Flag): TOptionalFromMappedResult; + /** `[Json]` Creates a Optional property */ + Optional(type: Type, enable: Flag): TOptionalWithFlag; + /** `[Json]` Creates a Optional property */ + Optional(type: Type): TOptionalFromMappedResult; + /** `[Json]` Creates a Optional property */ + Optional(type: Type): TOptionalWithFlag; + /** `[Json]` Creates an Any type */ + Any(options?: SchemaOptions): TAny; + /** `[Json]` Creates an Array type */ + Array(items: Type, options?: ArrayOptions): TArray; + /** `[Json]` Creates a Boolean type */ + Boolean(options?: SchemaOptions): TBoolean; + /** `[Json]` Intrinsic function to Capitalize LiteralString types */ + Capitalize(schema: T, options?: SchemaOptions): TCapitalize; + /** `[Json]` Creates a Composite object type */ + Composite(schemas: [...T], options?: ObjectOptions): TComposite; + /** `[JavaScript]` Creates a readonly const type from the given value. */ + Const(value: T, options?: SchemaOptions): TConst; + /** `[Json]` Creates a Enum type */ + Enum>(item: T, options?: SchemaOptions): TEnum; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromMappedResult; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromTemplateLiteral; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtractFromTemplateLiteral; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtract; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TIndexFromMappedKey; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index>(T: Type, K: Key, options?: SchemaOptions): TIndex; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, propertyKeys: readonly [...PropertyKeys], options?: SchemaOptions): TIndex; + /** `[Json]` Creates an Integer type */ + Integer(options?: IntegerOptions): TInteger; + /** `[Json]` Creates an Intersect type */ + Intersect(types: [...Types], options?: IntersectOptions): Intersect; + /** `[Json]` Creates a KeyOf type */ + KeyOf(type: Type, options?: SchemaOptions): TKeyOf; + /** `[Json]` Creates a Literal type */ + Literal(literalValue: LiteralValue, options?: SchemaOptions): TLiteral; + /** `[Json]` Intrinsic function to Lowercase LiteralString types */ + Lowercase(type: Type, options?: SchemaOptions): TLowercase; + /** `[Json]` Creates a Mapped object type */ + Mapped, F extends TMappedFunction = TMappedFunction, R extends TMapped = TMapped>(key: K, map: F, options?: ObjectOptions): R; + /** `[Json]` Creates a Mapped object type */ + Mapped = TMappedFunction, R extends TMapped = TMapped>(key: [...K], map: F, options?: ObjectOptions): R; + /** `[Json]` Creates a Type Definition Module. */ + Module(properties: Properties): TModule; + /** `[Json]` Creates a Never type */ + Never(options?: SchemaOptions): TNever; + /** `[Json]` Creates a Not type */ + Not(type: T, options?: SchemaOptions): TNot; + /** `[Json]` Creates a Null type */ + Null(options?: SchemaOptions): TNull; + /** `[Json]` Creates a Number type */ + Number(options?: NumberOptions): TNumber; + /** `[Json]` Creates an Object type */ + Object(properties: T, options?: ObjectOptions): TObject; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Omit(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Omit(type: Type, key: Key, options?: SchemaOptions): TOmit; + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult; + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type: Type, options?: SchemaOptions): TPartial; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type: Type, key: Key, options?: SchemaOptions): TPick; + /** `[Json]` Creates a Record type */ + Record(key: Key, value: Value, options?: ObjectOptions): TRecordOrObject; + /** `[Json]` Creates a Recursive type */ + Recursive(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive; + /** `[Json]` Creates a Ref type.*/ + Ref($ref: Ref, options?: SchemaOptions): TRef; + /** + * @deprecated `[Json]` Creates a Ref type. This signature was deprecated in 0.34.0 where Ref requires callers to pass + * a `string` value for the reference (and not a schema). + * + * To adhere to the 0.34.0 signature, Ref implementations should be updated to the following. + * + * ```typescript + * // pre-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Ref(T) + * ``` + * should be changed to the following + * + * ```typescript + * // post-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Unsafe>(Type.Ref('T')) + * ``` + * You can also create a generic function to replicate the pre-0.34.0 signature if required + * + * ```typescript + * const LegacyRef = (schema: T) => Type.Unsafe>(Type.Ref(schema.$id!)) + * ``` + */ + Ref(type: Type, options?: SchemaOptions): TRefUnsafe; + /** `[Json]` Constructs a type where all properties are required */ + Required(type: MappedResult, options?: SchemaOptions): TRequiredFromMappedResult; + /** `[Json]` Constructs a type where all properties are required */ + Required(type: Type, options?: SchemaOptions): TRequired; + /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ + Rest(type: Type): TRest; + /** `[Json]` Creates a String type */ + String(options?: StringOptions): TString; + /** `[Json]` Creates a TemplateLiteral type from template dsl string */ + TemplateLiteral(syntax: Syntax, options?: SchemaOptions): TTemplateLiteralSyntax; + /** `[Json]` Creates a TemplateLiteral type */ + TemplateLiteral(kinds: [...Kinds], options?: SchemaOptions): TTemplateLiteral; + /** `[Json]` Creates a Transform type */ + Transform(type: Type): TransformDecodeBuilder; + /** `[Json]` Creates a Tuple type */ + Tuple(types: [...Types], options?: SchemaOptions): TTuple; + /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ + Uncapitalize(type: Type, options?: SchemaOptions): TUncapitalize; + /** `[Json]` Creates a Union type */ + Union(types: [...Types], options?: SchemaOptions): Union; + /** `[Json]` Creates an Unknown type */ + Unknown(options?: SchemaOptions): TUnknown; + /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ + Unsafe(options?: UnsafeOptions): TUnsafe; + /** `[Json]` Intrinsic function to Uppercase LiteralString types */ + Uppercase(schema: T, options?: SchemaOptions): TUppercase; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/json.js b/node_modules/@sinclair/typebox/build/cjs/type/type/json.js new file mode 100644 index 00000000..bb376580 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/json.js @@ -0,0 +1,226 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JsonTypeBuilder = void 0; +const index_1 = require("../any/index"); +const index_2 = require("../array/index"); +const index_3 = require("../boolean/index"); +const index_4 = require("../composite/index"); +const index_5 = require("../const/index"); +const index_6 = require("../enum/index"); +const index_7 = require("../exclude/index"); +const index_8 = require("../extends/index"); +const index_9 = require("../extract/index"); +const index_10 = require("../indexed/index"); +const index_11 = require("../integer/index"); +const index_12 = require("../intersect/index"); +const index_13 = require("../intrinsic/index"); +const index_14 = require("../keyof/index"); +const index_15 = require("../literal/index"); +const index_16 = require("../mapped/index"); +const index_17 = require("../never/index"); +const index_18 = require("../not/index"); +const index_19 = require("../null/index"); +const index_20 = require("../module/index"); +const index_21 = require("../number/index"); +const index_22 = require("../object/index"); +const index_23 = require("../omit/index"); +const index_24 = require("../optional/index"); +const index_25 = require("../partial/index"); +const index_26 = require("../pick/index"); +const index_27 = require("../readonly/index"); +const index_28 = require("../readonly-optional/index"); +const index_29 = require("../record/index"); +const index_30 = require("../recursive/index"); +const index_31 = require("../ref/index"); +const index_32 = require("../required/index"); +const index_33 = require("../rest/index"); +const index_34 = require("../string/index"); +const index_35 = require("../template-literal/index"); +const index_36 = require("../transform/index"); +const index_37 = require("../tuple/index"); +const index_38 = require("../union/index"); +const index_39 = require("../unknown/index"); +const index_40 = require("../unsafe/index"); +/** Json Type Builder with Static Resolution for TypeScript */ +class JsonTypeBuilder { + // ------------------------------------------------------------------------ + // Modifiers + // ------------------------------------------------------------------------ + /** `[Json]` Creates a Readonly and Optional property */ + ReadonlyOptional(type) { + return (0, index_28.ReadonlyOptional)(type); + } + /** `[Json]` Creates a Readonly property */ + Readonly(type, enable) { + return (0, index_27.Readonly)(type, enable ?? true); + } + /** `[Json]` Creates a Optional property */ + Optional(type, enable) { + return (0, index_24.Optional)(type, enable ?? true); + } + // ------------------------------------------------------------------------ + // Types + // ------------------------------------------------------------------------ + /** `[Json]` Creates an Any type */ + Any(options) { + return (0, index_1.Any)(options); + } + /** `[Json]` Creates an Array type */ + Array(items, options) { + return (0, index_2.Array)(items, options); + } + /** `[Json]` Creates a Boolean type */ + Boolean(options) { + return (0, index_3.Boolean)(options); + } + /** `[Json]` Intrinsic function to Capitalize LiteralString types */ + Capitalize(schema, options) { + return (0, index_13.Capitalize)(schema, options); + } + /** `[Json]` Creates a Composite object type */ + Composite(schemas, options) { + return (0, index_4.Composite)(schemas, options); // (error) TS 5.4.0-dev - review TComposite implementation + } + /** `[JavaScript]` Creates a readonly const type from the given value. */ + Const(value, options) { + return (0, index_5.Const)(value, options); + } + /** `[Json]` Creates a Enum type */ + Enum(item, options) { + return (0, index_6.Enum)(item, options); + } + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType, excludedMembers, options) { + return (0, index_7.Exclude)(unionType, excludedMembers, options); + } + /** `[Json]` Creates a Conditional type */ + Extends(L, R, T, F, options) { + return (0, index_8.Extends)(L, R, T, F, options); + } + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type, union, options) { + return (0, index_9.Extract)(type, union, options); + } + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type, key, options) { + return (0, index_10.Index)(type, key, options); + } + /** `[Json]` Creates an Integer type */ + Integer(options) { + return (0, index_11.Integer)(options); + } + /** `[Json]` Creates an Intersect type */ + Intersect(types, options) { + return (0, index_12.Intersect)(types, options); + } + /** `[Json]` Creates a KeyOf type */ + KeyOf(type, options) { + return (0, index_14.KeyOf)(type, options); + } + /** `[Json]` Creates a Literal type */ + Literal(literalValue, options) { + return (0, index_15.Literal)(literalValue, options); + } + /** `[Json]` Intrinsic function to Lowercase LiteralString types */ + Lowercase(type, options) { + return (0, index_13.Lowercase)(type, options); + } + /** `[Json]` Creates a Mapped object type */ + Mapped(key, map, options) { + return (0, index_16.Mapped)(key, map, options); + } + /** `[Json]` Creates a Type Definition Module. */ + Module(properties) { + return (0, index_20.Module)(properties); + } + /** `[Json]` Creates a Never type */ + Never(options) { + return (0, index_17.Never)(options); + } + /** `[Json]` Creates a Not type */ + Not(type, options) { + return (0, index_18.Not)(type, options); + } + /** `[Json]` Creates a Null type */ + Null(options) { + return (0, index_19.Null)(options); + } + /** `[Json]` Creates a Number type */ + Number(options) { + return (0, index_21.Number)(options); + } + /** `[Json]` Creates an Object type */ + Object(properties, options) { + return (0, index_22.Object)(properties, options); + } + /** `[Json]` Constructs a type whose keys are omitted from the given type */ + Omit(schema, selector, options) { + return (0, index_23.Omit)(schema, selector, options); + } + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type, options) { + return (0, index_25.Partial)(type, options); + } + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type, key, options) { + return (0, index_26.Pick)(type, key, options); + } + /** `[Json]` Creates a Record type */ + Record(key, value, options) { + return (0, index_29.Record)(key, value, options); + } + /** `[Json]` Creates a Recursive type */ + Recursive(callback, options) { + return (0, index_30.Recursive)(callback, options); + } + /** `[Json]` Creates a Ref type. The referenced type must contain a $id */ + Ref(...args) { + return (0, index_31.Ref)(args[0], args[1]); + } + /** `[Json]` Constructs a type where all properties are required */ + Required(type, options) { + return (0, index_32.Required)(type, options); + } + /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ + Rest(type) { + return (0, index_33.Rest)(type); + } + /** `[Json]` Creates a String type */ + String(options) { + return (0, index_34.String)(options); + } + /** `[Json]` Creates a TemplateLiteral type */ + TemplateLiteral(unresolved, options) { + return (0, index_35.TemplateLiteral)(unresolved, options); + } + /** `[Json]` Creates a Transform type */ + Transform(type) { + return (0, index_36.Transform)(type); + } + /** `[Json]` Creates a Tuple type */ + Tuple(types, options) { + return (0, index_37.Tuple)(types, options); + } + /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ + Uncapitalize(type, options) { + return (0, index_13.Uncapitalize)(type, options); + } + /** `[Json]` Creates a Union type */ + Union(types, options) { + return (0, index_38.Union)(types, options); + } + /** `[Json]` Creates an Unknown type */ + Unknown(options) { + return (0, index_39.Unknown)(options); + } + /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ + Unsafe(options) { + return (0, index_40.Unsafe)(options); + } + /** `[Json]` Intrinsic function to Uppercase LiteralString types */ + Uppercase(schema, options) { + return (0, index_13.Uppercase)(schema, options); + } +} +exports.JsonTypeBuilder = JsonTypeBuilder; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/type/type.d.ts new file mode 100644 index 00000000..f10185d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/type.d.ts @@ -0,0 +1,59 @@ +export { Any } from '../any/index'; +export { Argument } from '../argument/index'; +export { Array } from '../array/index'; +export { AsyncIterator } from '../async-iterator/index'; +export { Awaited } from '../awaited/index'; +export { BigInt } from '../bigint/index'; +export { Boolean } from '../boolean/index'; +export { Composite } from '../composite/index'; +export { Const } from '../const/index'; +export { Constructor } from '../constructor/index'; +export { ConstructorParameters } from '../constructor-parameters/index'; +export { Date } from '../date/index'; +export { Enum } from '../enum/index'; +export { Exclude } from '../exclude/index'; +export { Extends } from '../extends/index'; +export { Extract } from '../extract/index'; +export { Function } from '../function/index'; +export { Index } from '../indexed/index'; +export { InstanceType } from '../instance-type/index'; +export { Instantiate } from '../instantiate/index'; +export { Integer } from '../integer/index'; +export { Intersect } from '../intersect/index'; +export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index'; +export { Iterator } from '../iterator/index'; +export { KeyOf } from '../keyof/index'; +export { Literal } from '../literal/index'; +export { Mapped } from '../mapped/index'; +export { Module } from '../module/index'; +export { Never } from '../never/index'; +export { Not } from '../not/index'; +export { Null } from '../null/index'; +export { Number } from '../number/index'; +export { Object } from '../object/index'; +export { Omit } from '../omit/index'; +export { Optional } from '../optional/index'; +export { Parameters } from '../parameters/index'; +export { Partial } from '../partial/index'; +export { Pick } from '../pick/index'; +export { Promise } from '../promise/index'; +export { Readonly } from '../readonly/index'; +export { ReadonlyOptional } from '../readonly-optional/index'; +export { Record } from '../record/index'; +export { Recursive } from '../recursive/index'; +export { Ref } from '../ref/index'; +export { RegExp } from '../regexp/index'; +export { Required } from '../required/index'; +export { Rest } from '../rest/index'; +export { ReturnType } from '../return-type/index'; +export { String } from '../string/index'; +export { Symbol } from '../symbol/index'; +export { TemplateLiteral } from '../template-literal/index'; +export { Transform } from '../transform/index'; +export { Tuple } from '../tuple/index'; +export { Uint8Array } from '../uint8array/index'; +export { Undefined } from '../undefined/index'; +export { Union } from '../union/index'; +export { Unknown } from '../unknown/index'; +export { Unsafe } from '../unsafe/index'; +export { Void } from '../void/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/type/type.js b/node_modules/@sinclair/typebox/build/cjs/type/type/type.js new file mode 100644 index 00000000..1dfd445c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/type/type.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Module = exports.Mapped = exports.Literal = exports.KeyOf = exports.Iterator = exports.Uppercase = exports.Lowercase = exports.Uncapitalize = exports.Capitalize = exports.Intersect = exports.Integer = exports.Instantiate = exports.InstanceType = exports.Index = exports.Function = exports.Extract = exports.Extends = exports.Exclude = exports.Enum = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Argument = exports.Any = void 0; +exports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.Transform = exports.TemplateLiteral = exports.Symbol = exports.String = exports.ReturnType = void 0; +// ------------------------------------------------------------------ +// Type: Module +// ------------------------------------------------------------------ +var index_1 = require("../any/index"); +Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_1.Any; } }); +var index_2 = require("../argument/index"); +Object.defineProperty(exports, "Argument", { enumerable: true, get: function () { return index_2.Argument; } }); +var index_3 = require("../array/index"); +Object.defineProperty(exports, "Array", { enumerable: true, get: function () { return index_3.Array; } }); +var index_4 = require("../async-iterator/index"); +Object.defineProperty(exports, "AsyncIterator", { enumerable: true, get: function () { return index_4.AsyncIterator; } }); +var index_5 = require("../awaited/index"); +Object.defineProperty(exports, "Awaited", { enumerable: true, get: function () { return index_5.Awaited; } }); +var index_6 = require("../bigint/index"); +Object.defineProperty(exports, "BigInt", { enumerable: true, get: function () { return index_6.BigInt; } }); +var index_7 = require("../boolean/index"); +Object.defineProperty(exports, "Boolean", { enumerable: true, get: function () { return index_7.Boolean; } }); +var index_8 = require("../composite/index"); +Object.defineProperty(exports, "Composite", { enumerable: true, get: function () { return index_8.Composite; } }); +var index_9 = require("../const/index"); +Object.defineProperty(exports, "Const", { enumerable: true, get: function () { return index_9.Const; } }); +var index_10 = require("../constructor/index"); +Object.defineProperty(exports, "Constructor", { enumerable: true, get: function () { return index_10.Constructor; } }); +var index_11 = require("../constructor-parameters/index"); +Object.defineProperty(exports, "ConstructorParameters", { enumerable: true, get: function () { return index_11.ConstructorParameters; } }); +var index_12 = require("../date/index"); +Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return index_12.Date; } }); +var index_13 = require("../enum/index"); +Object.defineProperty(exports, "Enum", { enumerable: true, get: function () { return index_13.Enum; } }); +var index_14 = require("../exclude/index"); +Object.defineProperty(exports, "Exclude", { enumerable: true, get: function () { return index_14.Exclude; } }); +var index_15 = require("../extends/index"); +Object.defineProperty(exports, "Extends", { enumerable: true, get: function () { return index_15.Extends; } }); +var index_16 = require("../extract/index"); +Object.defineProperty(exports, "Extract", { enumerable: true, get: function () { return index_16.Extract; } }); +var index_17 = require("../function/index"); +Object.defineProperty(exports, "Function", { enumerable: true, get: function () { return index_17.Function; } }); +var index_18 = require("../indexed/index"); +Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return index_18.Index; } }); +var index_19 = require("../instance-type/index"); +Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_19.InstanceType; } }); +var index_20 = require("../instantiate/index"); +Object.defineProperty(exports, "Instantiate", { enumerable: true, get: function () { return index_20.Instantiate; } }); +var index_21 = require("../integer/index"); +Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return index_21.Integer; } }); +var index_22 = require("../intersect/index"); +Object.defineProperty(exports, "Intersect", { enumerable: true, get: function () { return index_22.Intersect; } }); +var index_23 = require("../intrinsic/index"); +Object.defineProperty(exports, "Capitalize", { enumerable: true, get: function () { return index_23.Capitalize; } }); +Object.defineProperty(exports, "Uncapitalize", { enumerable: true, get: function () { return index_23.Uncapitalize; } }); +Object.defineProperty(exports, "Lowercase", { enumerable: true, get: function () { return index_23.Lowercase; } }); +Object.defineProperty(exports, "Uppercase", { enumerable: true, get: function () { return index_23.Uppercase; } }); +var index_24 = require("../iterator/index"); +Object.defineProperty(exports, "Iterator", { enumerable: true, get: function () { return index_24.Iterator; } }); +var index_25 = require("../keyof/index"); +Object.defineProperty(exports, "KeyOf", { enumerable: true, get: function () { return index_25.KeyOf; } }); +var index_26 = require("../literal/index"); +Object.defineProperty(exports, "Literal", { enumerable: true, get: function () { return index_26.Literal; } }); +var index_27 = require("../mapped/index"); +Object.defineProperty(exports, "Mapped", { enumerable: true, get: function () { return index_27.Mapped; } }); +var index_28 = require("../module/index"); +Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return index_28.Module; } }); +var index_29 = require("../never/index"); +Object.defineProperty(exports, "Never", { enumerable: true, get: function () { return index_29.Never; } }); +var index_30 = require("../not/index"); +Object.defineProperty(exports, "Not", { enumerable: true, get: function () { return index_30.Not; } }); +var index_31 = require("../null/index"); +Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return index_31.Null; } }); +var index_32 = require("../number/index"); +Object.defineProperty(exports, "Number", { enumerable: true, get: function () { return index_32.Number; } }); +var index_33 = require("../object/index"); +Object.defineProperty(exports, "Object", { enumerable: true, get: function () { return index_33.Object; } }); +var index_34 = require("../omit/index"); +Object.defineProperty(exports, "Omit", { enumerable: true, get: function () { return index_34.Omit; } }); +var index_35 = require("../optional/index"); +Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return index_35.Optional; } }); +var index_36 = require("../parameters/index"); +Object.defineProperty(exports, "Parameters", { enumerable: true, get: function () { return index_36.Parameters; } }); +var index_37 = require("../partial/index"); +Object.defineProperty(exports, "Partial", { enumerable: true, get: function () { return index_37.Partial; } }); +var index_38 = require("../pick/index"); +Object.defineProperty(exports, "Pick", { enumerable: true, get: function () { return index_38.Pick; } }); +var index_39 = require("../promise/index"); +Object.defineProperty(exports, "Promise", { enumerable: true, get: function () { return index_39.Promise; } }); +var index_40 = require("../readonly/index"); +Object.defineProperty(exports, "Readonly", { enumerable: true, get: function () { return index_40.Readonly; } }); +var index_41 = require("../readonly-optional/index"); +Object.defineProperty(exports, "ReadonlyOptional", { enumerable: true, get: function () { return index_41.ReadonlyOptional; } }); +var index_42 = require("../record/index"); +Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return index_42.Record; } }); +var index_43 = require("../recursive/index"); +Object.defineProperty(exports, "Recursive", { enumerable: true, get: function () { return index_43.Recursive; } }); +var index_44 = require("../ref/index"); +Object.defineProperty(exports, "Ref", { enumerable: true, get: function () { return index_44.Ref; } }); +var index_45 = require("../regexp/index"); +Object.defineProperty(exports, "RegExp", { enumerable: true, get: function () { return index_45.RegExp; } }); +var index_46 = require("../required/index"); +Object.defineProperty(exports, "Required", { enumerable: true, get: function () { return index_46.Required; } }); +var index_47 = require("../rest/index"); +Object.defineProperty(exports, "Rest", { enumerable: true, get: function () { return index_47.Rest; } }); +var index_48 = require("../return-type/index"); +Object.defineProperty(exports, "ReturnType", { enumerable: true, get: function () { return index_48.ReturnType; } }); +var index_49 = require("../string/index"); +Object.defineProperty(exports, "String", { enumerable: true, get: function () { return index_49.String; } }); +var index_50 = require("../symbol/index"); +Object.defineProperty(exports, "Symbol", { enumerable: true, get: function () { return index_50.Symbol; } }); +var index_51 = require("../template-literal/index"); +Object.defineProperty(exports, "TemplateLiteral", { enumerable: true, get: function () { return index_51.TemplateLiteral; } }); +var index_52 = require("../transform/index"); +Object.defineProperty(exports, "Transform", { enumerable: true, get: function () { return index_52.Transform; } }); +var index_53 = require("../tuple/index"); +Object.defineProperty(exports, "Tuple", { enumerable: true, get: function () { return index_53.Tuple; } }); +var index_54 = require("../uint8array/index"); +Object.defineProperty(exports, "Uint8Array", { enumerable: true, get: function () { return index_54.Uint8Array; } }); +var index_55 = require("../undefined/index"); +Object.defineProperty(exports, "Undefined", { enumerable: true, get: function () { return index_55.Undefined; } }); +var index_56 = require("../union/index"); +Object.defineProperty(exports, "Union", { enumerable: true, get: function () { return index_56.Union; } }); +var index_57 = require("../unknown/index"); +Object.defineProperty(exports, "Unknown", { enumerable: true, get: function () { return index_57.Unknown; } }); +var index_58 = require("../unsafe/index"); +Object.defineProperty(exports, "Unsafe", { enumerable: true, get: function () { return index_58.Unsafe; } }); +var index_59 = require("../void/index"); +Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return index_59.Void; } }); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.d.ts new file mode 100644 index 00000000..61605afa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.d.ts @@ -0,0 +1 @@ +export * from './uint8array'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.js b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.js new file mode 100644 index 00000000..aa9dce4e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./uint8array"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.d.ts new file mode 100644 index 00000000..8d7dfda6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.d.ts @@ -0,0 +1,13 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface Uint8ArrayOptions extends SchemaOptions { + maxByteLength?: number; + minByteLength?: number; +} +export interface TUint8Array extends TSchema, Uint8ArrayOptions { + [Kind]: 'Uint8Array'; + static: Uint8Array; + type: 'uint8array'; +} +/** `[JavaScript]` Creates a Uint8Array type */ +export declare function Uint8Array(options?: Uint8ArrayOptions): TUint8Array; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.js b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.js new file mode 100644 index 00000000..dff545f3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/uint8array/uint8array.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Uint8Array = Uint8Array; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Uint8Array type */ +function Uint8Array(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Uint8Array', type: 'Uint8Array' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.d.ts new file mode 100644 index 00000000..e8723091 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.d.ts @@ -0,0 +1 @@ +export * from './undefined'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.js b/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.js new file mode 100644 index 00000000..9572194c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/undefined/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./undefined"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.d.ts new file mode 100644 index 00000000..be776c0c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TUndefined extends TSchema { + [Kind]: 'Undefined'; + static: undefined; + type: 'undefined'; +} +/** `[JavaScript]` Creates a Undefined type */ +export declare function Undefined(options?: SchemaOptions): TUndefined; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.js b/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.js new file mode 100644 index 00000000..ae5c97c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/undefined/undefined.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Undefined = Undefined; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Undefined type */ +function Undefined(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Undefined', type: 'undefined' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/union/index.d.ts new file mode 100644 index 00000000..e4c105d9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/index.d.ts @@ -0,0 +1,3 @@ +export * from './union-evaluated'; +export * from './union-type'; +export * from './union'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/index.js b/node_modules/@sinclair/typebox/build/cjs/type/union/index.js new file mode 100644 index 00000000..b00c8063 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./union-evaluated"), exports); +__exportStar(require("./union-type"), exports); +__exportStar(require("./union"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.d.ts new file mode 100644 index 00000000..967c7904 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.d.ts @@ -0,0 +1,3 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { TUnion } from './union-type'; +export declare function UnionCreate(T: [...T], options?: SchemaOptions): TUnion; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.js b/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.js new file mode 100644 index 00000000..d632d3d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-create.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnionCreate = UnionCreate; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +function UnionCreate(T, options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Union', anyOf: T }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.d.ts new file mode 100644 index 00000000..b68b963f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.d.ts @@ -0,0 +1,13 @@ +import type { SchemaOptions, TSchema } from '../schema/index'; +import { type TNever } from '../never/index'; +import { type TOptional } from '../optional/index'; +import type { TReadonly } from '../readonly/index'; +import type { TUnion } from './union-type'; +type TIsUnionOptional = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? true : TIsUnionOptional : false); +type TRemoveOptionalFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TRemoveOptionalFromRest]> : TRemoveOptionalFromRest : Result); +type TRemoveOptionalFromType = (Type extends TReadonly ? TReadonly> : Type extends TOptional ? TRemoveOptionalFromType : Type); +type TResolveUnion, IsOptional extends boolean = TIsUnionOptional> = (IsOptional extends true ? TOptional> : TUnion); +export type TUnionEvaluated = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TResolveUnion); +/** `[Json]` Creates an evaluated Union type */ +export declare function UnionEvaluated>(T: [...Types], options?: SchemaOptions): Result; +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.js b/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.js new file mode 100644 index 00000000..803c067b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-evaluated.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnionEvaluated = UnionEvaluated; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +const index_2 = require("../discard/index"); +const index_3 = require("../never/index"); +const index_4 = require("../optional/index"); +const union_create_1 = require("./union-create"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../guard/kind"); +// prettier-ignore +function IsUnionOptional(types) { + return types.some(type => (0, kind_1.IsOptional)(type)); +} +// prettier-ignore +function RemoveOptionalFromRest(types) { + return types.map(left => (0, kind_1.IsOptional)(left) ? RemoveOptionalFromType(left) : left); +} +// prettier-ignore +function RemoveOptionalFromType(T) { + return ((0, index_2.Discard)(T, [index_1.OptionalKind])); +} +// prettier-ignore +function ResolveUnion(types, options) { + const isOptional = IsUnionOptional(types); + return (isOptional + ? (0, index_4.Optional)((0, union_create_1.UnionCreate)(RemoveOptionalFromRest(types), options)) + : (0, union_create_1.UnionCreate)(RemoveOptionalFromRest(types), options)); +} +/** `[Json]` Creates an evaluated Union type */ +function UnionEvaluated(T, options) { + // prettier-ignore + return (T.length === 1 ? (0, type_1.CreateType)(T[0], options) : + T.length === 0 ? (0, index_3.Never)(options) : + ResolveUnion(T, options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts new file mode 100644 index 00000000..0ea080ae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts @@ -0,0 +1,12 @@ +import type { TSchema } from '../schema/index'; +import type { Static } from '../static/index'; +import { Kind } from '../symbols/index'; +type UnionStatic = { + [K in keyof T]: T[K] extends TSchema ? Static : never; +}[number]; +export interface TUnion extends TSchema { + [Kind]: 'Union'; + static: UnionStatic; + anyOf: T; +} +export {}; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.js b/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.js new file mode 100644 index 00000000..aca9239a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.js @@ -0,0 +1,4 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../symbols/index"); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/union/union.d.ts new file mode 100644 index 00000000..3990e2f3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union.d.ts @@ -0,0 +1,6 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { type TNever } from '../never/index'; +import type { TUnion } from './union-type'; +export type Union = (T extends [] ? TNever : T extends [TSchema] ? T[0] : TUnion); +/** `[Json]` Creates a Union type */ +export declare function Union(types: [...Types], options?: SchemaOptions): Union; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/union/union.js b/node_modules/@sinclair/typebox/build/cjs/type/union/union.js new file mode 100644 index 00000000..cedaca06 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/union/union.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Union = Union; +const index_1 = require("../never/index"); +const type_1 = require("../create/type"); +const union_create_1 = require("./union-create"); +/** `[Json]` Creates a Union type */ +function Union(types, options) { + // prettier-ignore + return (types.length === 0 ? (0, index_1.Never)(options) : + types.length === 1 ? (0, type_1.CreateType)(types[0], options) : + (0, union_create_1.UnionCreate)(types, options)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.d.ts new file mode 100644 index 00000000..e37c907d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.d.ts @@ -0,0 +1 @@ +export * from './unknown'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.js b/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.js new file mode 100644 index 00000000..2caa9202 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unknown/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./unknown"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.d.ts new file mode 100644 index 00000000..e5fd1a87 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.d.ts @@ -0,0 +1,8 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TUnknown extends TSchema { + [Kind]: 'Unknown'; + static: unknown; +} +/** `[Json]` Creates an Unknown type */ +export declare function Unknown(options?: SchemaOptions): TUnknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.js b/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.js new file mode 100644 index 00000000..74752f80 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unknown/unknown.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Unknown = Unknown; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates an Unknown type */ +function Unknown(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Unknown' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.d.ts new file mode 100644 index 00000000..88d357e5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.d.ts @@ -0,0 +1 @@ +export * from './unsafe'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.js b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.js new file mode 100644 index 00000000..9cd8bc98 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./unsafe"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.d.ts new file mode 100644 index 00000000..2a9cadf9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.d.ts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface UnsafeOptions extends SchemaOptions { + [Kind]?: string; +} +export interface TUnsafe extends TSchema { + [Kind]: string; + static: T; +} +/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ +export declare function Unsafe(options?: UnsafeOptions): TUnsafe; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.js b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.js new file mode 100644 index 00000000..830ebe21 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/unsafe/unsafe.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Unsafe = Unsafe; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ +function Unsafe(options = {}) { + return (0, type_1.CreateType)({ [index_1.Kind]: options[index_1.Kind] ?? 'Unsafe' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/type/void/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/void/index.d.ts new file mode 100644 index 00000000..5a3f0de8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/void/index.d.ts @@ -0,0 +1 @@ +export * from './void'; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/void/index.js b/node_modules/@sinclair/typebox/build/cjs/type/void/index.js new file mode 100644 index 00000000..3d41b64e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/void/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./void"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/type/void/void.d.ts b/node_modules/@sinclair/typebox/build/cjs/type/void/void.d.ts new file mode 100644 index 00000000..24a6eee3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/void/void.d.ts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index'; +import { Kind } from '../symbols/index'; +export interface TVoid extends TSchema { + [Kind]: 'Void'; + static: void; + type: 'void'; +} +/** `[JavaScript]` Creates a Void type */ +export declare function Void(options?: SchemaOptions): TVoid; diff --git a/node_modules/@sinclair/typebox/build/cjs/type/void/void.js b/node_modules/@sinclair/typebox/build/cjs/type/void/void.js new file mode 100644 index 00000000..1707711d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/type/void/void.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Void = Void; +const type_1 = require("../create/type"); +const index_1 = require("../symbols/index"); +/** `[JavaScript]` Creates a Void type */ +function Void(options) { + return (0, type_1.CreateType)({ [index_1.Kind]: 'Void', type: 'void' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts new file mode 100644 index 00000000..875d1902 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts @@ -0,0 +1,15 @@ +import { ValueErrorIterator, ValueError } from '../../errors/index'; +import { TypeBoxError } from '../../type/error/error'; +import { TSchema } from '../../type/schema/index'; +import { Static } from '../../type/static/index'; +export declare class AssertError extends TypeBoxError { + #private; + error: ValueError | undefined; + constructor(iterator: ValueErrorIterator); + /** Returns an iterator for each error in this value. */ + Errors(): ValueErrorIterator; +} +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +export declare function Assert(schema: T, references: TSchema[], value: unknown): asserts value is Static; +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +export declare function Assert(schema: T, value: unknown): asserts value is Static; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.js b/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.js new file mode 100644 index 00000000..8069d6d8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.js @@ -0,0 +1,55 @@ +"use strict"; + +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _AssertError_instances, _AssertError_iterator, _AssertError_Iterator; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssertError = void 0; +exports.Assert = Assert; +const index_1 = require("../../errors/index"); +const error_1 = require("../../type/error/error"); +const check_1 = require("../check/check"); +// ------------------------------------------------------------------ +// AssertError +// ------------------------------------------------------------------ +class AssertError extends error_1.TypeBoxError { + constructor(iterator) { + const error = iterator.First(); + super(error === undefined ? 'Invalid Value' : error.message); + _AssertError_instances.add(this); + _AssertError_iterator.set(this, void 0); + __classPrivateFieldSet(this, _AssertError_iterator, iterator, "f"); + this.error = error; + } + /** Returns an iterator for each error in this value. */ + Errors() { + return new index_1.ValueErrorIterator(__classPrivateFieldGet(this, _AssertError_instances, "m", _AssertError_Iterator).call(this)); + } +} +exports.AssertError = AssertError; +_AssertError_iterator = new WeakMap(), _AssertError_instances = new WeakSet(), _AssertError_Iterator = function* _AssertError_Iterator() { + if (this.error) + yield this.error; + yield* __classPrivateFieldGet(this, _AssertError_iterator, "f"); +}; +// ------------------------------------------------------------------ +// AssertValue +// ------------------------------------------------------------------ +function AssertValue(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return; + throw new AssertError((0, index_1.Errors)(schema, references, value)); +} +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +function Assert(...args) { + return args.length === 3 ? AssertValue(args[0], args[1], args[2]) : AssertValue(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/assert/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/assert/index.d.ts new file mode 100644 index 00000000..336b0ab1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/assert/index.d.ts @@ -0,0 +1 @@ +export * from './assert'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/assert/index.js b/node_modules/@sinclair/typebox/build/cjs/value/assert/index.js new file mode 100644 index 00000000..731e0d39 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/assert/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./assert"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.d.ts new file mode 100644 index 00000000..059fa401 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.d.ts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index'; +import type { TSchema } from '../../type/schema/index'; +import type { Static } from '../../type/static/index'; +export declare class ValueCastError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema, message: string); +} +/** Casts a value into a given type and references. The return value will retain as much information of the original value as possible. */ +export declare function Cast(schema: T, references: TSchema[], value: unknown): Static; +/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ +export declare function Cast(schema: T, value: unknown): Static; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.js b/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.js new file mode 100644 index 00000000..0ef98bca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/cast/cast.js @@ -0,0 +1,241 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueCastError = void 0; +exports.Cast = Cast; +const index_1 = require("../guard/index"); +const index_2 = require("../../type/error/index"); +const index_3 = require("../../type/symbols/index"); +const index_4 = require("../create/index"); +const index_5 = require("../check/index"); +const index_6 = require("../clone/index"); +const index_7 = require("../deref/index"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueCastError extends index_2.TypeBoxError { + constructor(schema, message) { + super(message); + this.schema = schema; + } +} +exports.ValueCastError = ValueCastError; +// ------------------------------------------------------------------ +// The following logic assigns a score to a schema based on how well +// it matches a given value. For object types, the score is calculated +// by evaluating each property of the value against the schema's +// properties. To avoid bias towards objects with many properties, +// each property contributes equally to the total score. Properties +// that exactly match literal values receive the highest possible +// score, as literals are often used as discriminators in union types. +// ------------------------------------------------------------------ +function ScoreUnion(schema, references, value) { + if (schema[index_3.Kind] === 'Object' && typeof value === 'object' && !(0, index_1.IsNull)(value)) { + const object = schema; + const keys = Object.getOwnPropertyNames(value); + const entries = Object.entries(object.properties); + return entries.reduce((acc, [key, schema]) => { + const literal = schema[index_3.Kind] === 'Literal' && schema.const === value[key] ? 100 : 0; + const checks = (0, index_5.Check)(schema, references, value[key]) ? 10 : 0; + const exists = keys.includes(key) ? 1 : 0; + return acc + (literal + checks + exists); + }, 0); + } + else if (schema[index_3.Kind] === 'Union') { + const schemas = schema.anyOf.map((schema) => (0, index_7.Deref)(schema, references)); + const scores = schemas.map((schema) => ScoreUnion(schema, references, value)); + return Math.max(...scores); + } + else { + return (0, index_5.Check)(schema, references, value) ? 1 : 0; + } +} +function SelectUnion(union, references, value) { + const schemas = union.anyOf.map((schema) => (0, index_7.Deref)(schema, references)); + let [select, best] = [schemas[0], 0]; + for (const schema of schemas) { + const score = ScoreUnion(schema, references, value); + if (score > best) { + select = schema; + best = score; + } + } + return select; +} +function CastUnion(union, references, value) { + if ('default' in union) { + return typeof value === 'function' ? union.default : (0, index_6.Clone)(union.default); + } + else { + const schema = SelectUnion(union, references, value); + return Cast(schema, references, value); + } +} +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function DefaultClone(schema, references, value) { + return (0, index_5.Check)(schema, references, value) ? (0, index_6.Clone)(value) : (0, index_4.Create)(schema, references); +} +function Default(schema, references, value) { + return (0, index_5.Check)(schema, references, value) ? value : (0, index_4.Create)(schema, references); +} +// ------------------------------------------------------------------ +// Cast +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return (0, index_6.Clone)(value); + const created = (0, index_1.IsArray)(value) ? (0, index_6.Clone)(value) : (0, index_4.Create)(schema, references); + const minimum = (0, index_1.IsNumber)(schema.minItems) && created.length < schema.minItems ? [...created, ...Array.from({ length: schema.minItems - created.length }, () => null)] : created; + const maximum = (0, index_1.IsNumber)(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum; + const casted = maximum.map((value) => Visit(schema.items, references, value)); + if (schema.uniqueItems !== true) + return casted; + const unique = [...new Set(casted)]; + if (!(0, index_5.Check)(schema, references, unique)) + throw new ValueCastError(schema, 'Array cast produced invalid data due to uniqueItems constraint'); + return unique; +} +function FromConstructor(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return (0, index_4.Create)(schema, references); + const required = new Set(schema.returns.required || []); + const result = function () { }; + for (const [key, property] of Object.entries(schema.returns.properties)) { + if (!required.has(key) && value.prototype[key] === undefined) + continue; + result.prototype[key] = Visit(property, references, value.prototype[key]); + } + return result; +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +// ------------------------------------------------------------------ +// Intersect +// ------------------------------------------------------------------ +function IntersectAssign(correct, value) { + // trust correct on mismatch | value on non-object + if (((0, index_1.IsObject)(correct) && !(0, index_1.IsObject)(value)) || (!(0, index_1.IsObject)(correct) && (0, index_1.IsObject)(value))) + return correct; + if (!(0, index_1.IsObject)(correct) || !(0, index_1.IsObject)(value)) + return value; + return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key) => { + const property = key in value ? IntersectAssign(correct[key], value[key]) : correct[key]; + return { ...result, [key]: property }; + }, {}); +} +function FromIntersect(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return value; + const correct = (0, index_4.Create)(schema, references); + const assigned = IntersectAssign(correct, value); + return (0, index_5.Check)(schema, references, assigned) ? assigned : correct; +} +function FromNever(schema, references, value) { + throw new ValueCastError(schema, 'Never types cannot be cast'); +} +function FromObject(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return value; + if (value === null || typeof value !== 'object') + return (0, index_4.Create)(schema, references); + const required = new Set(schema.required || []); + const result = {}; + for (const [key, property] of Object.entries(schema.properties)) { + if (!required.has(key) && value[key] === undefined) + continue; + result[key] = Visit(property, references, value[key]); + } + // additional schema properties + if (typeof schema.additionalProperties === 'object') { + const propertyNames = Object.getOwnPropertyNames(schema.properties); + for (const propertyName of Object.getOwnPropertyNames(value)) { + if (propertyNames.includes(propertyName)) + continue; + result[propertyName] = Visit(schema.additionalProperties, references, value[propertyName]); + } + } + return result; +} +function FromRecord(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return (0, index_6.Clone)(value); + if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) + return (0, index_4.Create)(schema, references); + const subschemaPropertyName = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const subschema = schema.patternProperties[subschemaPropertyName]; + const result = {}; + for (const [propKey, propValue] of Object.entries(value)) { + result[propKey] = Visit(subschema, references, propValue); + } + return result; +} +function FromRef(schema, references, value) { + return Visit((0, index_7.Deref)(schema, references), references, value); +} +function FromThis(schema, references, value) { + return Visit((0, index_7.Deref)(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if ((0, index_5.Check)(schema, references, value)) + return (0, index_6.Clone)(value); + if (!(0, index_1.IsArray)(value)) + return (0, index_4.Create)(schema, references); + if (schema.items === undefined) + return []; + return schema.items.map((schema, index) => Visit(schema, references, value[index])); +} +function FromUnion(schema, references, value) { + return (0, index_5.Check)(schema, references, value) ? (0, index_6.Clone)(value) : CastUnion(schema, references, value); +} +function Visit(schema, references, value) { + const references_ = (0, index_1.IsString)(schema.$id) ? (0, index_7.Pushref)(schema, references) : references; + const schema_ = schema; + switch (schema[index_3.Kind]) { + // -------------------------------------------------------------- + // Structural + // -------------------------------------------------------------- + case 'Array': + return FromArray(schema_, references_, value); + case 'Constructor': + return FromConstructor(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Never': + return FromNever(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + // -------------------------------------------------------------- + // DefaultClone + // -------------------------------------------------------------- + case 'Date': + case 'Symbol': + case 'Uint8Array': + return DefaultClone(schema, references, value); + // -------------------------------------------------------------- + // Default + // -------------------------------------------------------------- + default: + return Default(schema_, references_, value); + } +} +/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ +function Cast(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/cast/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/cast/index.d.ts new file mode 100644 index 00000000..f549ae73 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/cast/index.d.ts @@ -0,0 +1 @@ +export * from './cast'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/cast/index.js b/node_modules/@sinclair/typebox/build/cjs/value/cast/index.js new file mode 100644 index 00000000..ffd22f3e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/cast/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./cast"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/check/check.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/check/check.d.ts new file mode 100644 index 00000000..415cee8a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/check/check.d.ts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index'; +import type { TSchema } from '../../type/schema/index'; +import type { Static } from '../../type/static/index'; +export declare class ValueCheckUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +/** Returns true if the value matches the given type. */ +export declare function Check(schema: T, references: TSchema[], value: unknown): value is Static; +/** Returns true if the value matches the given type. */ +export declare function Check(schema: T, value: unknown): value is Static; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/check/check.js b/node_modules/@sinclair/typebox/build/cjs/value/check/check.js new file mode 100644 index 00000000..29784eaf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/check/check.js @@ -0,0 +1,475 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueCheckUnknownTypeError = void 0; +exports.Check = Check; +const index_1 = require("../../system/index"); +const index_2 = require("../deref/index"); +const index_3 = require("../hash/index"); +const index_4 = require("../../type/symbols/index"); +const index_5 = require("../../type/keyof/index"); +const index_6 = require("../../type/extends/index"); +const index_7 = require("../../type/registry/index"); +const index_8 = require("../../type/error/index"); +const index_9 = require("../../type/never/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_10 = require("../guard/index"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueCheckUnknownTypeError extends index_8.TypeBoxError { + constructor(schema) { + super(`Unknown type`); + this.schema = schema; + } +} +exports.ValueCheckUnknownTypeError = ValueCheckUnknownTypeError; +// ------------------------------------------------------------------ +// TypeGuards +// ------------------------------------------------------------------ +function IsAnyOrUnknown(schema) { + return schema[index_4.Kind] === 'Any' || schema[index_4.Kind] === 'Unknown'; +} +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +function IsDefined(value) { + return value !== undefined; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromAny(schema, references, value) { + return true; +} +function FromArgument(schema, references, value) { + return true; +} +function FromArray(schema, references, value) { + if (!(0, index_10.IsArray)(value)) + return false; + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + return false; + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + return false; + } + if (!value.every((value) => Visit(schema.items, references, value))) { + return false; + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = (0, index_3.Hash)(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + return false; + } + // contains + if (!(IsDefined(schema.contains) || (0, index_10.IsNumber)(schema.minContains) || (0, index_10.IsNumber)(schema.maxContains))) { + return true; // exit + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : (0, index_9.Never)(); + const containsCount = value.reduce((acc, value) => (Visit(containsSchema, references, value) ? acc + 1 : acc), 0); + if (containsCount === 0) { + return false; + } + if ((0, index_10.IsNumber)(schema.minContains) && containsCount < schema.minContains) { + return false; + } + if ((0, index_10.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) { + return false; + } + return true; +} +function FromAsyncIterator(schema, references, value) { + return (0, index_10.IsAsyncIterator)(value); +} +function FromBigInt(schema, references, value) { + if (!(0, index_10.IsBigInt)(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + return false; + } + return true; +} +function FromBoolean(schema, references, value) { + return (0, index_10.IsBoolean)(value); +} +function FromConstructor(schema, references, value) { + return Visit(schema.returns, references, value.prototype); +} +function FromDate(schema, references, value) { + if (!(0, index_10.IsDate)(value)) + return false; + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + return false; + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + return false; + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + return false; + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + return false; + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + return false; + } + return true; +} +function FromFunction(schema, references, value) { + return (0, index_10.IsFunction)(value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromInteger(schema, references, value) { + if (!(0, index_10.IsInteger)(value)) { + return false; + } + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function FromIntersect(schema, references, value) { + const check1 = schema.allOf.every((schema) => Visit(schema, references, value)); + if (schema.unevaluatedProperties === false) { + const keyPattern = new RegExp((0, index_5.KeyOfPattern)(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key)); + return check1 && check2; + } + else if ((0, kind_1.IsSchema)(schema.unevaluatedProperties)) { + const keyCheck = new RegExp((0, index_5.KeyOfPattern)(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key])); + return check1 && check2; + } + else { + return check1; + } +} +function FromIterator(schema, references, value) { + return (0, index_10.IsIterator)(value); +} +function FromLiteral(schema, references, value) { + return value === schema.const; +} +function FromNever(schema, references, value) { + return false; +} +function FromNot(schema, references, value) { + return !Visit(schema.not, references, value); +} +function FromNull(schema, references, value) { + return (0, index_10.IsNull)(value); +} +function FromNumber(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsNumberLike(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function FromObject(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsObjectLike(value)) + return false; + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + if (!Visit(property, references, value[knownKey])) { + return false; + } + if (((0, index_6.ExtendsUndefinedCheck)(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) { + return false; + } + } + else { + if (index_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) { + return false; + } + } + } + if (schema.additionalProperties === false) { + const valueKeys = Object.getOwnPropertyNames(value); + // optimization: value is valid if schemaKey length matches the valueKey length + if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) { + return true; + } + else { + return valueKeys.every((valueKey) => knownKeys.includes(valueKey)); + } + } + else if (typeof schema.additionalProperties === 'object') { + const valueKeys = Object.getOwnPropertyNames(value); + return valueKeys.every((key) => knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key])); + } + else { + return true; + } +} +function FromPromise(schema, references, value) { + return (0, index_10.IsPromise)(value); +} +function FromRecord(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsRecordLike(value)) { + return false; + } + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + // prettier-ignore + const check1 = Object.entries(value).every(([key, value]) => { + return (regex.test(key)) ? Visit(patternSchema, references, value) : true; + }); + // prettier-ignore + const check2 = typeof schema.additionalProperties === 'object' ? Object.entries(value).every(([key, value]) => { + return (!regex.test(key)) ? Visit(schema.additionalProperties, references, value) : true; + }) : true; + const check3 = schema.additionalProperties === false + ? Object.getOwnPropertyNames(value).every((key) => { + return regex.test(key); + }) + : true; + return check1 && check2 && check3; +} +function FromRef(schema, references, value) { + return Visit((0, index_2.Deref)(schema, references), references, value); +} +function FromRegExp(schema, references, value) { + const regex = new RegExp(schema.source, schema.flags); + if (IsDefined(schema.minLength)) { + if (!(value.length >= schema.minLength)) + return false; + } + if (IsDefined(schema.maxLength)) { + if (!(value.length <= schema.maxLength)) + return false; + } + return regex.test(value); +} +function FromString(schema, references, value) { + if (!(0, index_10.IsString)(value)) { + return false; + } + if (IsDefined(schema.minLength)) { + if (!(value.length >= schema.minLength)) + return false; + } + if (IsDefined(schema.maxLength)) { + if (!(value.length <= schema.maxLength)) + return false; + } + if (IsDefined(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) + return false; + } + if (IsDefined(schema.format)) { + if (!index_7.FormatRegistry.Has(schema.format)) + return false; + const func = index_7.FormatRegistry.Get(schema.format); + return func(value); + } + return true; +} +function FromSymbol(schema, references, value) { + return (0, index_10.IsSymbol)(value); +} +function FromTemplateLiteral(schema, references, value) { + return (0, index_10.IsString)(value) && new RegExp(schema.pattern).test(value); +} +function FromThis(schema, references, value) { + return Visit((0, index_2.Deref)(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if (!(0, index_10.IsArray)(value)) { + return false; + } + if (schema.items === undefined && !(value.length === 0)) { + return false; + } + if (!(value.length === schema.maxItems)) { + return false; + } + if (!schema.items) { + return true; + } + for (let i = 0; i < schema.items.length; i++) { + if (!Visit(schema.items[i], references, value[i])) + return false; + } + return true; +} +function FromUndefined(schema, references, value) { + return (0, index_10.IsUndefined)(value); +} +function FromUnion(schema, references, value) { + return schema.anyOf.some((inner) => Visit(inner, references, value)); +} +function FromUint8Array(schema, references, value) { + if (!(0, index_10.IsUint8Array)(value)) { + return false; + } + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + return false; + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + return false; + } + return true; +} +function FromUnknown(schema, references, value) { + return true; +} +function FromVoid(schema, references, value) { + return index_1.TypeSystemPolicy.IsVoidLike(value); +} +function FromKind(schema, references, value) { + if (!index_7.TypeRegistry.Has(schema[index_4.Kind])) + return false; + const func = index_7.TypeRegistry.Get(schema[index_4.Kind]); + return func(schema, value); +} +function Visit(schema, references, value) { + const references_ = IsDefined(schema.$id) ? (0, index_2.Pushref)(schema, references) : references; + const schema_ = schema; + switch (schema_[index_4.Kind]) { + case 'Any': + return FromAny(schema_, references_, value); + case 'Argument': + return FromArgument(schema_, references_, value); + case 'Array': + return FromArray(schema_, references_, value); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_, value); + case 'BigInt': + return FromBigInt(schema_, references_, value); + case 'Boolean': + return FromBoolean(schema_, references_, value); + case 'Constructor': + return FromConstructor(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Function': + return FromFunction(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Integer': + return FromInteger(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Iterator': + return FromIterator(schema_, references_, value); + case 'Literal': + return FromLiteral(schema_, references_, value); + case 'Never': + return FromNever(schema_, references_, value); + case 'Not': + return FromNot(schema_, references_, value); + case 'Null': + return FromNull(schema_, references_, value); + case 'Number': + return FromNumber(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Promise': + return FromPromise(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'RegExp': + return FromRegExp(schema_, references_, value); + case 'String': + return FromString(schema_, references_, value); + case 'Symbol': + return FromSymbol(schema_, references_, value); + case 'TemplateLiteral': + return FromTemplateLiteral(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Undefined': + return FromUndefined(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + case 'Uint8Array': + return FromUint8Array(schema_, references_, value); + case 'Unknown': + return FromUnknown(schema_, references_, value); + case 'Void': + return FromVoid(schema_, references_, value); + default: + if (!index_7.TypeRegistry.Has(schema_[index_4.Kind])) + throw new ValueCheckUnknownTypeError(schema_); + return FromKind(schema_, references_, value); + } +} +/** Returns true if the value matches the given type. */ +function Check(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/check/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/check/index.d.ts new file mode 100644 index 00000000..01a8e34b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/check/index.d.ts @@ -0,0 +1 @@ +export * from './check'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/check/index.js b/node_modules/@sinclair/typebox/build/cjs/value/check/index.js new file mode 100644 index 00000000..b9713936 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/check/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./check"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.d.ts new file mode 100644 index 00000000..3d561ce6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.d.ts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index'; +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Clean(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.js b/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.js new file mode 100644 index 00000000..fe01e851 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clean/clean.js @@ -0,0 +1,149 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Clean = Clean; +const index_1 = require("../../type/keyof/index"); +const index_2 = require("../check/index"); +const index_3 = require("../clone/index"); +const index_4 = require("../deref/index"); +const index_5 = require("../../type/symbols/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +// prettier-ignore +const index_6 = require("../guard/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +// prettier-ignore +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// IsCheckable +// ------------------------------------------------------------------ +function IsCheckable(schema) { + return (0, kind_1.IsKind)(schema) && schema[index_5.Kind] !== 'Unsafe'; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + if (!(0, index_6.IsArray)(value)) + return value; + return value.map((value) => Visit(schema.items, references, value)); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromIntersect(schema, references, value) { + const unevaluatedProperties = schema.unevaluatedProperties; + const intersections = schema.allOf.map((schema) => Visit(schema, references, (0, index_3.Clone)(value))); + const composite = intersections.reduce((acc, value) => ((0, index_6.IsObject)(value) ? { ...acc, ...value } : value), {}); + if (!(0, index_6.IsObject)(value) || !(0, index_6.IsObject)(composite) || !(0, kind_1.IsKind)(unevaluatedProperties)) + return composite; + const knownkeys = (0, index_1.KeyOfPropertyKeys)(schema); + for (const key of Object.getOwnPropertyNames(value)) { + if (knownkeys.includes(key)) + continue; + if ((0, index_2.Check)(unevaluatedProperties, references, value[key])) { + composite[key] = Visit(unevaluatedProperties, references, value[key]); + } + } + return composite; +} +function FromObject(schema, references, value) { + if (!(0, index_6.IsObject)(value) || (0, index_6.IsArray)(value)) + return value; // Check IsArray for AllowArrayObject configuration + const additionalProperties = schema.additionalProperties; + for (const key of Object.getOwnPropertyNames(value)) { + if ((0, index_6.HasPropertyKey)(schema.properties, key)) { + value[key] = Visit(schema.properties[key], references, value[key]); + continue; + } + if ((0, kind_1.IsKind)(additionalProperties) && (0, index_2.Check)(additionalProperties, references, value[key])) { + value[key] = Visit(additionalProperties, references, value[key]); + continue; + } + delete value[key]; + } + return value; +} +function FromRecord(schema, references, value) { + if (!(0, index_6.IsObject)(value)) + return value; + const additionalProperties = schema.additionalProperties; + const propertyKeys = Object.getOwnPropertyNames(value); + const [propertyKey, propertySchema] = Object.entries(schema.patternProperties)[0]; + const propertyKeyTest = new RegExp(propertyKey); + for (const key of propertyKeys) { + if (propertyKeyTest.test(key)) { + value[key] = Visit(propertySchema, references, value[key]); + continue; + } + if ((0, kind_1.IsKind)(additionalProperties) && (0, index_2.Check)(additionalProperties, references, value[key])) { + value[key] = Visit(additionalProperties, references, value[key]); + continue; + } + delete value[key]; + } + return value; +} +function FromRef(schema, references, value) { + return Visit((0, index_4.Deref)(schema, references), references, value); +} +function FromThis(schema, references, value) { + return Visit((0, index_4.Deref)(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if (!(0, index_6.IsArray)(value)) + return value; + if ((0, index_6.IsUndefined)(schema.items)) + return []; + const length = Math.min(value.length, schema.items.length); + for (let i = 0; i < length; i++) { + value[i] = Visit(schema.items[i], references, value[i]); + } + // prettier-ignore + return value.length > length + ? value.slice(0, length) + : value; +} +function FromUnion(schema, references, value) { + for (const inner of schema.anyOf) { + if (IsCheckable(inner) && (0, index_2.Check)(inner, references, value)) { + return Visit(inner, references, value); + } + } + return value; +} +function Visit(schema, references, value) { + const references_ = (0, index_6.IsString)(schema.$id) ? (0, index_4.Pushref)(schema, references) : references; + const schema_ = schema; + switch (schema_[index_5.Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return value; + } +} +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +function Clean(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clean/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/clean/index.d.ts new file mode 100644 index 00000000..39161636 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clean/index.d.ts @@ -0,0 +1 @@ +export * from './clean'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clean/index.js b/node_modules/@sinclair/typebox/build/cjs/value/clean/index.js new file mode 100644 index 00000000..0408bf04 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clean/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./clean"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.d.ts new file mode 100644 index 00000000..06a609ec --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.d.ts @@ -0,0 +1,2 @@ +/** Returns a clone of the given value */ +export declare function Clone(value: T): T; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.js b/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.js new file mode 100644 index 00000000..de410cc9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clone/clone.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Clone = Clone; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_1 = require("../guard/index"); +// ------------------------------------------------------------------ +// Clonable +// ------------------------------------------------------------------ +function FromObject(value) { + const Acc = {}; + for (const key of Object.getOwnPropertyNames(value)) { + Acc[key] = Clone(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + Acc[key] = Clone(value[key]); + } + return Acc; +} +function FromArray(value) { + return value.map((element) => Clone(element)); +} +function FromTypedArray(value) { + return value.slice(); +} +function FromMap(value) { + return new Map(Clone([...value.entries()])); +} +function FromSet(value) { + return new Set(Clone([...value.entries()])); +} +function FromDate(value) { + return new Date(value.toISOString()); +} +function FromValue(value) { + return value; +} +// ------------------------------------------------------------------ +// Clone +// ------------------------------------------------------------------ +/** Returns a clone of the given value */ +function Clone(value) { + if ((0, index_1.IsArray)(value)) + return FromArray(value); + if ((0, index_1.IsDate)(value)) + return FromDate(value); + if ((0, index_1.IsTypedArray)(value)) + return FromTypedArray(value); + if ((0, index_1.IsMap)(value)) + return FromMap(value); + if ((0, index_1.IsSet)(value)) + return FromSet(value); + if ((0, index_1.IsObject)(value)) + return FromObject(value); + if ((0, index_1.IsValueType)(value)) + return FromValue(value); + throw new Error('ValueClone: Unable to clone value'); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clone/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/clone/index.d.ts new file mode 100644 index 00000000..f86973e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clone/index.d.ts @@ -0,0 +1 @@ +export * from './clone'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/clone/index.js b/node_modules/@sinclair/typebox/build/cjs/value/clone/index.js new file mode 100644 index 00000000..cea5715b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/clone/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./clone"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.d.ts new file mode 100644 index 00000000..10461a17 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.d.ts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index'; +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +export declare function Convert(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.js b/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.js new file mode 100644 index 00000000..f4ee204d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/convert/convert.js @@ -0,0 +1,264 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Convert = Convert; +const index_1 = require("../clone/index"); +const index_2 = require("../check/index"); +const index_3 = require("../deref/index"); +const index_4 = require("../../type/symbols/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_5 = require("../guard/index"); +// ------------------------------------------------------------------ +// Conversions +// ------------------------------------------------------------------ +function IsStringNumeric(value) { + return (0, index_5.IsString)(value) && !isNaN(value) && !isNaN(parseFloat(value)); +} +function IsValueToString(value) { + return (0, index_5.IsBigInt)(value) || (0, index_5.IsBoolean)(value) || (0, index_5.IsNumber)(value); +} +function IsValueTrue(value) { + return value === true || ((0, index_5.IsNumber)(value) && value === 1) || ((0, index_5.IsBigInt)(value) && value === BigInt('1')) || ((0, index_5.IsString)(value) && (value.toLowerCase() === 'true' || value === '1')); +} +function IsValueFalse(value) { + return value === false || ((0, index_5.IsNumber)(value) && (value === 0 || Object.is(value, -0))) || ((0, index_5.IsBigInt)(value) && value === BigInt('0')) || ((0, index_5.IsString)(value) && (value.toLowerCase() === 'false' || value === '0' || value === '-0')); +} +function IsTimeStringWithTimeZone(value) { + return (0, index_5.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsTimeStringWithoutTimeZone(value) { + return (0, index_5.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateTimeStringWithTimeZone(value) { + return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsDateTimeStringWithoutTimeZone(value) { + return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateString(value) { + return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value); +} +// ------------------------------------------------------------------ +// Convert +// ------------------------------------------------------------------ +function TryConvertLiteralString(value, target) { + const conversion = TryConvertString(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralNumber(value, target) { + const conversion = TryConvertNumber(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralBoolean(value, target) { + const conversion = TryConvertBoolean(value); + return conversion === target ? conversion : value; +} +// prettier-ignore +function TryConvertLiteral(schema, value) { + return ((0, index_5.IsString)(schema.const) ? TryConvertLiteralString(value, schema.const) : + (0, index_5.IsNumber)(schema.const) ? TryConvertLiteralNumber(value, schema.const) : + (0, index_5.IsBoolean)(schema.const) ? TryConvertLiteralBoolean(value, schema.const) : + value); +} +function TryConvertBoolean(value) { + return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value; +} +function TryConvertBigInt(value) { + const truncateInteger = (value) => value.split('.')[0]; + return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : (0, index_5.IsNumber)(value) ? BigInt(Math.trunc(value)) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value; +} +function TryConvertString(value) { + return (0, index_5.IsSymbol)(value) && value.description !== undefined ? value.description.toString() : IsValueToString(value) ? value.toString() : value; +} +function TryConvertNumber(value) { + return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertInteger(value) { + return IsStringNumeric(value) ? parseInt(value) : (0, index_5.IsNumber)(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertNull(value) { + return (0, index_5.IsString)(value) && value.toLowerCase() === 'null' ? null : value; +} +function TryConvertUndefined(value) { + return (0, index_5.IsString)(value) && value === 'undefined' ? undefined : value; +} +// ------------------------------------------------------------------ +// note: this function may return an invalid dates for the regex +// tests above. Invalid dates will however be checked during the +// casting function and will return a epoch date if invalid. +// Consider better string parsing for the iso dates in future +// revisions. +// ------------------------------------------------------------------ +// prettier-ignore +function TryConvertDate(value) { + return ((0, index_5.IsDate)(value) ? value : + (0, index_5.IsNumber)(value) ? new Date(value) : + IsValueTrue(value) ? new Date(1) : + IsValueFalse(value) ? new Date(0) : + IsStringNumeric(value) ? new Date(parseInt(value)) : + IsTimeStringWithoutTimeZone(value) ? new Date(`1970-01-01T${value}.000Z`) : + IsTimeStringWithTimeZone(value) ? new Date(`1970-01-01T${value}`) : + IsDateTimeStringWithoutTimeZone(value) ? new Date(`${value}.000Z`) : + IsDateTimeStringWithTimeZone(value) ? new Date(value) : + IsDateString(value) ? new Date(`${value}T00:00:00.000Z`) : + value); +} +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function Default(value) { + return value; +} +// ------------------------------------------------------------------ +// Convert +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + const elements = (0, index_5.IsArray)(value) ? value : [value]; + return elements.map((element) => Visit(schema.items, references, element)); +} +function FromBigInt(schema, references, value) { + return TryConvertBigInt(value); +} +function FromBoolean(schema, references, value) { + return TryConvertBoolean(value); +} +function FromDate(schema, references, value) { + return TryConvertDate(value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromInteger(schema, references, value) { + return TryConvertInteger(value); +} +function FromIntersect(schema, references, value) { + return schema.allOf.reduce((value, schema) => Visit(schema, references, value), value); +} +function FromLiteral(schema, references, value) { + return TryConvertLiteral(schema, value); +} +function FromNull(schema, references, value) { + return TryConvertNull(value); +} +function FromNumber(schema, references, value) { + return TryConvertNumber(value); +} +// prettier-ignore +function FromObject(schema, references, value) { + if (!(0, index_5.IsObject)(value) || (0, index_5.IsArray)(value)) + return value; + for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) { + if (!(0, index_5.HasPropertyKey)(value, propertyKey)) + continue; + value[propertyKey] = Visit(schema.properties[propertyKey], references, value[propertyKey]); + } + return value; +} +function FromRecord(schema, references, value) { + const isConvertable = (0, index_5.IsObject)(value) && !(0, index_5.IsArray)(value); + if (!isConvertable) + return value; + const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[propertyKey]; + for (const [propKey, propValue] of Object.entries(value)) { + value[propKey] = Visit(property, references, propValue); + } + return value; +} +function FromRef(schema, references, value) { + return Visit((0, index_3.Deref)(schema, references), references, value); +} +function FromString(schema, references, value) { + return TryConvertString(value); +} +function FromSymbol(schema, references, value) { + return (0, index_5.IsString)(value) || (0, index_5.IsNumber)(value) ? Symbol(value) : value; +} +function FromThis(schema, references, value) { + return Visit((0, index_3.Deref)(schema, references), references, value); +} +// prettier-ignore +function FromTuple(schema, references, value) { + const isConvertable = (0, index_5.IsArray)(value) && !(0, index_5.IsUndefined)(schema.items); + if (!isConvertable) + return value; + return value.map((value, index) => { + return (index < schema.items.length) + ? Visit(schema.items[index], references, value) + : value; + }); +} +function FromUndefined(schema, references, value) { + return TryConvertUndefined(value); +} +function FromUnion(schema, references, value) { + // Check if original value already matches one of the union variants + for (const subschema of schema.anyOf) { + if ((0, index_2.Check)(subschema, references, value)) { + return value; + } + } + // Attempt conversion for each variant + for (const subschema of schema.anyOf) { + const converted = Visit(subschema, references, (0, index_1.Clone)(value)); + if (!(0, index_2.Check)(subschema, references, converted)) + continue; + return converted; + } + return value; +} +function Visit(schema, references, value) { + const references_ = (0, index_3.Pushref)(schema, references); + const schema_ = schema; + switch (schema[index_4.Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'BigInt': + return FromBigInt(schema_, references_, value); + case 'Boolean': + return FromBoolean(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Integer': + return FromInteger(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Literal': + return FromLiteral(schema_, references_, value); + case 'Null': + return FromNull(schema_, references_, value); + case 'Number': + return FromNumber(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'String': + return FromString(schema_, references_, value); + case 'Symbol': + return FromSymbol(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Undefined': + return FromUndefined(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return Default(value); + } +} +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +// prettier-ignore +function Convert(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/convert/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/convert/index.d.ts new file mode 100644 index 00000000..c5b7be79 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/convert/index.d.ts @@ -0,0 +1 @@ +export * from './convert'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/convert/index.js b/node_modules/@sinclair/typebox/build/cjs/value/convert/index.js new file mode 100644 index 00000000..1f664d74 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/convert/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./convert"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/create/create.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/create/create.d.ts new file mode 100644 index 00000000..104aaaaf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/create/create.d.ts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index'; +import type { TSchema } from '../../type/schema/index'; +import type { Static } from '../../type/static/index'; +export declare class ValueCreateError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema, message: string); +} +/** Creates a value from the given schema and references */ +export declare function Create(schema: T, references: TSchema[]): Static; +/** Creates a value from the given schema */ +export declare function Create(schema: T): Static; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/create/create.js b/node_modules/@sinclair/typebox/build/cjs/value/create/create.js new file mode 100644 index 00000000..945677dd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/create/create.js @@ -0,0 +1,474 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueCreateError = void 0; +exports.Create = Create; +const index_1 = require("../guard/index"); +const index_2 = require("../check/index"); +const index_3 = require("../clone/index"); +const index_4 = require("../deref/index"); +const index_5 = require("../../type/template-literal/index"); +const index_6 = require("../../type/registry/index"); +const index_7 = require("../../type/symbols/index"); +const index_8 = require("../../type/error/index"); +const guard_1 = require("../guard/guard"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueCreateError extends index_8.TypeBoxError { + constructor(schema, message) { + super(message); + this.schema = schema; + } +} +exports.ValueCreateError = ValueCreateError; +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function FromDefault(value) { + return (0, guard_1.IsFunction)(value) ? value() : (0, index_3.Clone)(value); +} +// ------------------------------------------------------------------ +// Create +// ------------------------------------------------------------------ +function FromAny(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromArgument(schema, references) { + return {}; +} +function FromArray(schema, references) { + if (schema.uniqueItems === true && !(0, index_1.HasPropertyKey)(schema, 'default')) { + throw new ValueCreateError(schema, 'Array with the uniqueItems constraint requires a default value'); + } + else if ('contains' in schema && !(0, index_1.HasPropertyKey)(schema, 'default')) { + throw new ValueCreateError(schema, 'Array with the contains constraint requires a default value'); + } + else if ('default' in schema) { + return FromDefault(schema.default); + } + else if (schema.minItems !== undefined) { + return Array.from({ length: schema.minItems }).map((item) => { + return Visit(schema.items, references); + }); + } + else { + return []; + } +} +function FromAsyncIterator(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return (async function* () { })(); + } +} +function FromBigInt(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return BigInt(0); + } +} +function FromBoolean(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return false; + } +} +function FromConstructor(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + const value = Visit(schema.returns, references); + if (typeof value === 'object' && !Array.isArray(value)) { + return class { + constructor() { + for (const [key, val] of Object.entries(value)) { + const self = this; + self[key] = val; + } + } + }; + } + else { + return class { + }; + } + } +} +function FromDate(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimumTimestamp !== undefined) { + return new Date(schema.minimumTimestamp); + } + else { + return new Date(); + } +} +function FromFunction(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return () => Visit(schema.returns, references); + } +} +function FromImport(schema, references) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions]); +} +function FromInteger(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function FromIntersect(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + // -------------------------------------------------------------- + // Note: The best we can do here is attempt to instance each + // sub type and apply through object assign. For non-object + // sub types, we just escape the assignment and just return + // the value. In the latter case, this is typically going to + // be a consequence of an illogical intersection. + // -------------------------------------------------------------- + const value = schema.allOf.reduce((acc, schema) => { + const next = Visit(schema, references); + return typeof next === 'object' ? { ...acc, ...next } : next; + }, {}); + if (!(0, index_2.Check)(schema, references, value)) + throw new ValueCreateError(schema, 'Intersect produced invalid value. Consider using a default value.'); + return value; + } +} +function FromIterator(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return (function* () { })(); + } +} +function FromLiteral(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return schema.const; + } +} +function FromNever(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'Never types cannot be created. Consider using a default value.'); + } +} +function FromNot(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'Not types must have a default value'); + } +} +function FromNull(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return null; + } +} +function FromNumber(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function FromObject(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + const required = new Set(schema.required); + const Acc = {}; + for (const [key, subschema] of Object.entries(schema.properties)) { + if (!required.has(key)) + continue; + Acc[key] = Visit(subschema, references); + } + return Acc; + } +} +function FromPromise(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Promise.resolve(Visit(schema.item, references)); + } +} +function FromRecord(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromRef(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Visit((0, index_4.Deref)(schema, references), references); + } +} +function FromRegExp(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'RegExp types cannot be created. Consider using a default value.'); + } +} +function FromString(schema, references) { + if (schema.pattern !== undefined) { + if (!(0, index_1.HasPropertyKey)(schema, 'default')) { + throw new ValueCreateError(schema, 'String types with patterns must specify a default value'); + } + else { + return FromDefault(schema.default); + } + } + else if (schema.format !== undefined) { + if (!(0, index_1.HasPropertyKey)(schema, 'default')) { + throw new ValueCreateError(schema, 'String types with formats must specify a default value'); + } + else { + return FromDefault(schema.default); + } + } + else { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minLength !== undefined) { + // prettier-ignore + return Array.from({ length: schema.minLength }).map(() => ' ').join(''); + } + else { + return ''; + } + } +} +function FromSymbol(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if ('value' in schema) { + return Symbol.for(schema.value); + } + else { + return Symbol(); + } +} +function FromTemplateLiteral(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + if (!(0, index_5.IsTemplateLiteralFinite)(schema)) + throw new ValueCreateError(schema, 'Can only create template literals that produce a finite variants. Consider using a default value.'); + const generated = (0, index_5.TemplateLiteralGenerate)(schema); + return generated[0]; +} +function FromThis(schema, references) { + if (recursiveDepth++ > recursiveMaxDepth) + throw new ValueCreateError(schema, 'Cannot create recursive type as it appears possibly infinite. Consider using a default.'); + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Visit((0, index_4.Deref)(schema, references), references); + } +} +function FromTuple(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + if (schema.items === undefined) { + return []; + } + else { + return Array.from({ length: schema.minItems }).map((_, index) => Visit(schema.items[index], references)); + } +} +function FromUndefined(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return undefined; + } +} +function FromUnion(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.anyOf.length === 0) { + throw new Error('ValueCreate.Union: Cannot create Union with zero variants'); + } + else { + return Visit(schema.anyOf[0], references); + } +} +function FromUint8Array(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minByteLength !== undefined) { + return new Uint8Array(schema.minByteLength); + } + else { + return new Uint8Array(0); + } +} +function FromUnknown(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromVoid(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return void 0; + } +} +function FromKind(schema, references) { + if ((0, index_1.HasPropertyKey)(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new Error('User defined types must specify a default value'); + } +} +function Visit(schema, references) { + const references_ = (0, index_4.Pushref)(schema, references); + const schema_ = schema; + switch (schema_[index_7.Kind]) { + case 'Any': + return FromAny(schema_, references_); + case 'Argument': + return FromArgument(schema_, references_); + case 'Array': + return FromArray(schema_, references_); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_); + case 'BigInt': + return FromBigInt(schema_, references_); + case 'Boolean': + return FromBoolean(schema_, references_); + case 'Constructor': + return FromConstructor(schema_, references_); + case 'Date': + return FromDate(schema_, references_); + case 'Function': + return FromFunction(schema_, references_); + case 'Import': + return FromImport(schema_, references_); + case 'Integer': + return FromInteger(schema_, references_); + case 'Intersect': + return FromIntersect(schema_, references_); + case 'Iterator': + return FromIterator(schema_, references_); + case 'Literal': + return FromLiteral(schema_, references_); + case 'Never': + return FromNever(schema_, references_); + case 'Not': + return FromNot(schema_, references_); + case 'Null': + return FromNull(schema_, references_); + case 'Number': + return FromNumber(schema_, references_); + case 'Object': + return FromObject(schema_, references_); + case 'Promise': + return FromPromise(schema_, references_); + case 'Record': + return FromRecord(schema_, references_); + case 'Ref': + return FromRef(schema_, references_); + case 'RegExp': + return FromRegExp(schema_, references_); + case 'String': + return FromString(schema_, references_); + case 'Symbol': + return FromSymbol(schema_, references_); + case 'TemplateLiteral': + return FromTemplateLiteral(schema_, references_); + case 'This': + return FromThis(schema_, references_); + case 'Tuple': + return FromTuple(schema_, references_); + case 'Undefined': + return FromUndefined(schema_, references_); + case 'Union': + return FromUnion(schema_, references_); + case 'Uint8Array': + return FromUint8Array(schema_, references_); + case 'Unknown': + return FromUnknown(schema_, references_); + case 'Void': + return FromVoid(schema_, references_); + default: + if (!index_6.TypeRegistry.Has(schema_[index_7.Kind])) + throw new ValueCreateError(schema_, 'Unknown type'); + return FromKind(schema_, references_); + } +} +// ------------------------------------------------------------------ +// State +// ------------------------------------------------------------------ +const recursiveMaxDepth = 512; +let recursiveDepth = 0; +/** Creates a value from the given schema */ +function Create(...args) { + recursiveDepth = 0; + return args.length === 2 ? Visit(args[0], args[1]) : Visit(args[0], []); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/create/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/create/index.d.ts new file mode 100644 index 00000000..1e03cceb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/create/index.d.ts @@ -0,0 +1 @@ +export * from './create'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/create/index.js b/node_modules/@sinclair/typebox/build/cjs/value/create/index.js new file mode 100644 index 00000000..03ff0b3a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/create/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./create"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.d.ts new file mode 100644 index 00000000..3e1f16fb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.d.ts @@ -0,0 +1,6 @@ +import type { TSchema } from '../../type/schema/index'; +import type { StaticDecode } from '../../type/static/index'; +/** Decodes a value or throws if error */ +export declare function Decode, Result extends Static = Static>(schema: T, references: TSchema[], value: unknown): Result; +/** Decodes a value or throws if error */ +export declare function Decode, Result extends Static = Static>(schema: T, value: unknown): Result; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.js b/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.js new file mode 100644 index 00000000..5dd27499 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/decode/decode.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Decode = Decode; +const index_1 = require("../transform/index"); +const index_2 = require("../check/index"); +const index_3 = require("../../errors/index"); +/** Decodes a value or throws if error */ +function Decode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + if (!(0, index_2.Check)(schema, references, value)) + throw new index_1.TransformDecodeCheckError(schema, value, (0, index_3.Errors)(schema, references, value).First()); + return (0, index_1.HasTransform)(schema, references) ? (0, index_1.TransformDecode)(schema, references, value) : value; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/decode/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/decode/index.d.ts new file mode 100644 index 00000000..92fccb94 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/decode/index.d.ts @@ -0,0 +1 @@ +export * from './decode'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/decode/index.js b/node_modules/@sinclair/typebox/build/cjs/value/decode/index.js new file mode 100644 index 00000000..beb28a13 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/decode/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./decode"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/default/default.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/default/default.d.ts new file mode 100644 index 00000000..3b7d7dbb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/default/default.d.ts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index'; +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Default(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/default/default.js b/node_modules/@sinclair/typebox/build/cjs/value/default/default.js new file mode 100644 index 00000000..7e71d11a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/default/default.js @@ -0,0 +1,176 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Default = Default; +const index_1 = require("../check/index"); +const index_2 = require("../clone/index"); +const index_3 = require("../deref/index"); +const index_4 = require("../../type/symbols/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_5 = require("../guard/index"); +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// ValueOrDefault +// ------------------------------------------------------------------ +function ValueOrDefault(schema, value) { + const defaultValue = (0, index_5.HasPropertyKey)(schema, 'default') ? schema.default : undefined; + const clone = (0, index_5.IsFunction)(defaultValue) ? defaultValue() : (0, index_2.Clone)(defaultValue); + return (0, index_5.IsUndefined)(value) ? clone : (0, index_5.IsObject)(value) && (0, index_5.IsObject)(clone) ? Object.assign(clone, value) : value; +} +// ------------------------------------------------------------------ +// HasDefaultProperty +// ------------------------------------------------------------------ +function HasDefaultProperty(schema) { + return (0, kind_1.IsKind)(schema) && 'default' in schema; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + // if the value is an array, we attempt to initialize it's elements + if ((0, index_5.IsArray)(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = Visit(schema.items, references, value[i]); + } + return value; + } + // ... otherwise use default initialization + const defaulted = ValueOrDefault(schema, value); + if (!(0, index_5.IsArray)(defaulted)) + return defaulted; + for (let i = 0; i < defaulted.length; i++) { + defaulted[i] = Visit(schema.items, references, defaulted[i]); + } + return defaulted; +} +function FromDate(schema, references, value) { + // special case intercept for dates + return (0, index_5.IsDate)(value) ? value : ValueOrDefault(schema, value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromIntersect(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + return schema.allOf.reduce((acc, schema) => { + const next = Visit(schema, references, defaulted); + return (0, index_5.IsObject)(next) ? { ...acc, ...next } : next; + }, {}); +} +function FromObject(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + // return defaulted + if (!(0, index_5.IsObject)(defaulted)) + return defaulted; + const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties); + // properties + for (const key of knownPropertyKeys) { + // note: we need to traverse into the object and test if the return value + // yielded a non undefined result. Here we interpret an undefined result as + // a non assignable property and continue. + const propertyValue = Visit(schema.properties[key], references, defaulted[key]); + if ((0, index_5.IsUndefined)(propertyValue)) + continue; + defaulted[key] = Visit(schema.properties[key], references, defaulted[key]); + } + // return if not additional properties + if (!HasDefaultProperty(schema.additionalProperties)) + return defaulted; + // additional properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (knownPropertyKeys.includes(key)) + continue; + defaulted[key] = Visit(schema.additionalProperties, references, defaulted[key]); + } + return defaulted; +} +function FromRecord(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + if (!(0, index_5.IsObject)(defaulted)) + return defaulted; + const additionalPropertiesSchema = schema.additionalProperties; + const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0]; + const knownPropertyKey = new RegExp(propertyKeyPattern); + // properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema))) + continue; + defaulted[key] = Visit(propertySchema, references, defaulted[key]); + } + // return if not additional properties + if (!HasDefaultProperty(additionalPropertiesSchema)) + return defaulted; + // additional properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (knownPropertyKey.test(key)) + continue; + defaulted[key] = Visit(additionalPropertiesSchema, references, defaulted[key]); + } + return defaulted; +} +function FromRef(schema, references, value) { + return Visit((0, index_3.Deref)(schema, references), references, ValueOrDefault(schema, value)); +} +function FromThis(schema, references, value) { + return Visit((0, index_3.Deref)(schema, references), references, value); +} +function FromTuple(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + if (!(0, index_5.IsArray)(defaulted) || (0, index_5.IsUndefined)(schema.items)) + return defaulted; + const [items, max] = [schema.items, Math.max(schema.items.length, defaulted.length)]; + for (let i = 0; i < max; i++) { + if (i < items.length) + defaulted[i] = Visit(items[i], references, defaulted[i]); + } + return defaulted; +} +function FromUnion(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + for (const inner of schema.anyOf) { + const result = Visit(inner, references, (0, index_2.Clone)(defaulted)); + if ((0, index_1.Check)(inner, references, result)) { + return result; + } + } + return defaulted; +} +function Visit(schema, references, value) { + const references_ = (0, index_3.Pushref)(schema, references); + const schema_ = schema; + switch (schema_[index_4.Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return ValueOrDefault(schema_, value); + } +} +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +function Default(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/default/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/default/index.d.ts new file mode 100644 index 00000000..acced897 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/default/index.d.ts @@ -0,0 +1 @@ +export * from './default'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/default/index.js b/node_modules/@sinclair/typebox/build/cjs/value/default/index.js new file mode 100644 index 00000000..8d122b0b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/default/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./default"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.d.ts new file mode 100644 index 00000000..78f274a0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.d.ts @@ -0,0 +1,32 @@ +import type { Static } from '../../type/static/index'; +import { TypeBoxError } from '../../type/error/index'; +import { type TLiteral } from '../../type/literal/index'; +import { type TObject } from '../../type/object/index'; +import { type TString } from '../../type/string/index'; +import { type TUnknown } from '../../type/unknown/index'; +import { type TUnion } from '../../type/union/index'; +export type Insert = Static; +export declare const Insert: TObject<{ + type: TLiteral<'insert'>; + path: TString; + value: TUnknown; +}>; +export type Update = Static; +export declare const Update: TObject<{ + type: TLiteral<'update'>; + path: TString; + value: TUnknown; +}>; +export type Delete = Static; +export declare const Delete: TObject<{ + type: TLiteral<'delete'>; + path: TString; +}>; +export type Edit = Static; +export declare const Edit: TUnion<[typeof Insert, typeof Update, typeof Delete]>; +export declare class ValueDiffError extends TypeBoxError { + readonly value: unknown; + constructor(value: unknown, message: string); +} +export declare function Diff(current: unknown, next: unknown): Edit[]; +export declare function Patch(current: unknown, edits: Edit[]): T; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.js b/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.js new file mode 100644 index 00000000..3b4da636 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/delta/delta.js @@ -0,0 +1,178 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueDiffError = exports.Edit = exports.Delete = exports.Update = exports.Insert = void 0; +exports.Diff = Diff; +exports.Patch = Patch; +const index_1 = require("../guard/index"); +const index_2 = require("../pointer/index"); +const index_3 = require("../clone/index"); +const equal_1 = require("../equal/equal"); +const index_4 = require("../../type/error/index"); +const index_5 = require("../../type/literal/index"); +const index_6 = require("../../type/object/index"); +const index_7 = require("../../type/string/index"); +const index_8 = require("../../type/unknown/index"); +const index_9 = require("../../type/union/index"); +exports.Insert = (0, index_6.Object)({ + type: (0, index_5.Literal)('insert'), + path: (0, index_7.String)(), + value: (0, index_8.Unknown)(), +}); +exports.Update = (0, index_6.Object)({ + type: (0, index_5.Literal)('update'), + path: (0, index_7.String)(), + value: (0, index_8.Unknown)(), +}); +exports.Delete = (0, index_6.Object)({ + type: (0, index_5.Literal)('delete'), + path: (0, index_7.String)(), +}); +exports.Edit = (0, index_9.Union)([exports.Insert, exports.Update, exports.Delete]); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueDiffError extends index_4.TypeBoxError { + constructor(value, message) { + super(message); + this.value = value; + } +} +exports.ValueDiffError = ValueDiffError; +// ------------------------------------------------------------------ +// Command Factory +// ------------------------------------------------------------------ +function CreateUpdate(path, value) { + return { type: 'update', path, value }; +} +function CreateInsert(path, value) { + return { type: 'insert', path, value }; +} +function CreateDelete(path) { + return { type: 'delete', path }; +} +// ------------------------------------------------------------------ +// AssertDiffable +// ------------------------------------------------------------------ +function AssertDiffable(value) { + if (globalThis.Object.getOwnPropertySymbols(value).length > 0) + throw new ValueDiffError(value, 'Cannot diff objects with symbols'); +} +// ------------------------------------------------------------------ +// Diffing Generators +// ------------------------------------------------------------------ +function* ObjectType(path, current, next) { + AssertDiffable(current); + AssertDiffable(next); + if (!(0, index_1.IsStandardObject)(next)) + return yield CreateUpdate(path, next); + const currentKeys = globalThis.Object.getOwnPropertyNames(current); + const nextKeys = globalThis.Object.getOwnPropertyNames(next); + // ---------------------------------------------------------------- + // inserts + // ---------------------------------------------------------------- + for (const key of nextKeys) { + if ((0, index_1.HasPropertyKey)(current, key)) + continue; + yield CreateInsert(`${path}/${key}`, next[key]); + } + // ---------------------------------------------------------------- + // updates + // ---------------------------------------------------------------- + for (const key of currentKeys) { + if (!(0, index_1.HasPropertyKey)(next, key)) + continue; + if ((0, equal_1.Equal)(current, next)) + continue; + yield* Visit(`${path}/${key}`, current[key], next[key]); + } + // ---------------------------------------------------------------- + // deletes + // ---------------------------------------------------------------- + for (const key of currentKeys) { + if ((0, index_1.HasPropertyKey)(next, key)) + continue; + yield CreateDelete(`${path}/${key}`); + } +} +function* ArrayType(path, current, next) { + if (!(0, index_1.IsArray)(next)) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } + for (let i = 0; i < next.length; i++) { + if (i < current.length) + continue; + yield CreateInsert(`${path}/${i}`, next[i]); + } + for (let i = current.length - 1; i >= 0; i--) { + if (i < next.length) + continue; + yield CreateDelete(`${path}/${i}`); + } +} +function* TypedArrayType(path, current, next) { + if (!(0, index_1.IsTypedArray)(next) || current.length !== next.length || globalThis.Object.getPrototypeOf(current).constructor.name !== globalThis.Object.getPrototypeOf(next).constructor.name) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } +} +function* ValueType(path, current, next) { + if (current === next) + return; + yield CreateUpdate(path, next); +} +function* Visit(path, current, next) { + if ((0, index_1.IsStandardObject)(current)) + return yield* ObjectType(path, current, next); + if ((0, index_1.IsArray)(current)) + return yield* ArrayType(path, current, next); + if ((0, index_1.IsTypedArray)(current)) + return yield* TypedArrayType(path, current, next); + if ((0, index_1.IsValueType)(current)) + return yield* ValueType(path, current, next); + throw new ValueDiffError(current, 'Unable to diff value'); +} +// ------------------------------------------------------------------ +// Diff +// ------------------------------------------------------------------ +function Diff(current, next) { + return [...Visit('', current, next)]; +} +// ------------------------------------------------------------------ +// Patch +// ------------------------------------------------------------------ +function IsRootUpdate(edits) { + return edits.length > 0 && edits[0].path === '' && edits[0].type === 'update'; +} +function IsIdentity(edits) { + return edits.length === 0; +} +function Patch(current, edits) { + if (IsRootUpdate(edits)) { + return (0, index_3.Clone)(edits[0].value); + } + if (IsIdentity(edits)) { + return (0, index_3.Clone)(current); + } + const clone = (0, index_3.Clone)(current); + for (const edit of edits) { + switch (edit.type) { + case 'insert': { + index_2.ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'update': { + index_2.ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'delete': { + index_2.ValuePointer.Delete(clone, edit.path); + break; + } + } + } + return clone; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/delta/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/delta/index.d.ts new file mode 100644 index 00000000..30b4b95d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/delta/index.d.ts @@ -0,0 +1 @@ +export * from './delta'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/delta/index.js b/node_modules/@sinclair/typebox/build/cjs/value/delta/index.js new file mode 100644 index 00000000..54f49ace --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/delta/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./delta"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.d.ts new file mode 100644 index 00000000..95cda810 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.d.ts @@ -0,0 +1,12 @@ +import type { TSchema } from '../../type/schema/index'; +import type { TRef } from '../../type/ref/index'; +import type { TThis } from '../../type/recursive/index'; +import { TypeBoxError } from '../../type/error/index'; +export declare class TypeDereferenceError extends TypeBoxError { + readonly schema: TRef | TThis; + constructor(schema: TRef | TThis); +} +/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */ +export declare function Pushref(schema: TSchema, references: TSchema[]): TSchema[]; +/** `[Internal]` Dereferences a schema from the references array or throws if not found */ +export declare function Deref(schema: TSchema, references: TSchema[]): TSchema; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.js b/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.js new file mode 100644 index 00000000..421dd2d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/deref/deref.js @@ -0,0 +1,36 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeDereferenceError = void 0; +exports.Pushref = Pushref; +exports.Deref = Deref; +const index_1 = require("../../type/error/index"); +const index_2 = require("../../type/symbols/index"); +const guard_1 = require("../guard/guard"); +class TypeDereferenceError extends index_1.TypeBoxError { + constructor(schema) { + super(`Unable to dereference schema with $id '${schema.$ref}'`); + this.schema = schema; + } +} +exports.TypeDereferenceError = TypeDereferenceError; +function Resolve(schema, references) { + const target = references.find((target) => target.$id === schema.$ref); + if (target === undefined) + throw new TypeDereferenceError(schema); + return Deref(target, references); +} +/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */ +function Pushref(schema, references) { + if (!(0, guard_1.IsString)(schema.$id) || references.some((target) => target.$id === schema.$id)) + return references; + references.push(schema); + return references; +} +/** `[Internal]` Dereferences a schema from the references array or throws if not found */ +function Deref(schema, references) { + // prettier-ignore + return (schema[index_2.Kind] === 'This' || schema[index_2.Kind] === 'Ref') + ? Resolve(schema, references) + : schema; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/deref/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/deref/index.d.ts new file mode 100644 index 00000000..329a6eaa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/deref/index.d.ts @@ -0,0 +1 @@ +export * from './deref'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/deref/index.js b/node_modules/@sinclair/typebox/build/cjs/value/deref/index.js new file mode 100644 index 00000000..6b8ba2e7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/deref/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./deref"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.d.ts new file mode 100644 index 00000000..88d71458 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.d.ts @@ -0,0 +1,6 @@ +import type { TSchema } from '../../type/schema/index'; +import type { StaticEncode } from '../../type/static/index'; +/** Encodes a value or throws if error */ +export declare function Encode, Result extends Static = Static>(schema: T, references: TSchema[], value: unknown): Result; +/** Encodes a value or throws if error */ +export declare function Encode, Result extends Static = Static>(schema: T, value: unknown): Result; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.js b/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.js new file mode 100644 index 00000000..daa465a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/encode/encode.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Encode = Encode; +const index_1 = require("../transform/index"); +const index_2 = require("../check/index"); +const index_3 = require("../../errors/index"); +/** Encodes a value or throws if error */ +function Encode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + const encoded = (0, index_1.HasTransform)(schema, references) ? (0, index_1.TransformEncode)(schema, references, value) : value; + if (!(0, index_2.Check)(schema, references, encoded)) + throw new index_1.TransformEncodeCheckError(schema, encoded, (0, index_3.Errors)(schema, references, encoded).First()); + return encoded; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/encode/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/encode/index.d.ts new file mode 100644 index 00000000..a447c575 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/encode/index.d.ts @@ -0,0 +1 @@ +export * from './encode'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/encode/index.js b/node_modules/@sinclair/typebox/build/cjs/value/encode/index.js new file mode 100644 index 00000000..39261de9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/encode/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./encode"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.d.ts new file mode 100644 index 00000000..d1095c4c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.d.ts @@ -0,0 +1,2 @@ +/** Returns true if the left value deep-equals the right */ +export declare function Equal(left: T, right: unknown): right is T; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.js b/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.js new file mode 100644 index 00000000..48e20108 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/equal/equal.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Equal = Equal; +const index_1 = require("../guard/index"); +// ------------------------------------------------------------------ +// Equality Checks +// ------------------------------------------------------------------ +function ObjectType(left, right) { + if (!(0, index_1.IsObject)(right)) + return false; + const leftKeys = [...Object.keys(left), ...Object.getOwnPropertySymbols(left)]; + const rightKeys = [...Object.keys(right), ...Object.getOwnPropertySymbols(right)]; + if (leftKeys.length !== rightKeys.length) + return false; + return leftKeys.every((key) => Equal(left[key], right[key])); +} +function DateType(left, right) { + return (0, index_1.IsDate)(right) && left.getTime() === right.getTime(); +} +function ArrayType(left, right) { + if (!(0, index_1.IsArray)(right) || left.length !== right.length) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function TypedArrayType(left, right) { + if (!(0, index_1.IsTypedArray)(right) || left.length !== right.length || Object.getPrototypeOf(left).constructor.name !== Object.getPrototypeOf(right).constructor.name) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function ValueType(left, right) { + return left === right; +} +// ------------------------------------------------------------------ +// Equal +// ------------------------------------------------------------------ +/** Returns true if the left value deep-equals the right */ +function Equal(left, right) { + if ((0, index_1.IsDate)(left)) + return DateType(left, right); + if ((0, index_1.IsTypedArray)(left)) + return TypedArrayType(left, right); + if ((0, index_1.IsArray)(left)) + return ArrayType(left, right); + if ((0, index_1.IsObject)(left)) + return ObjectType(left, right); + if ((0, index_1.IsValueType)(left)) + return ValueType(left, right); + throw new Error('ValueEquals: Unable to compare value'); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/equal/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/equal/index.d.ts new file mode 100644 index 00000000..1dc26948 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/equal/index.d.ts @@ -0,0 +1 @@ +export * from './equal'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/equal/index.js b/node_modules/@sinclair/typebox/build/cjs/value/equal/index.js new file mode 100644 index 00000000..73607b0f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/equal/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./equal"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.d.ts new file mode 100644 index 00000000..0a5f1151 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.d.ts @@ -0,0 +1,74 @@ +export type ObjectType = Record; +export type ArrayType = unknown[]; +export type ValueType = null | undefined | symbol | bigint | number | boolean | string; +export type TypedArrayType = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +/** Returns true if this value is an async iterator */ +export declare function IsAsyncIterator(value: unknown): value is AsyncIterableIterator; +/** Returns true if this value is an iterator */ +export declare function IsIterator(value: unknown): value is IterableIterator; +/** Returns true if this value is not an instance of a class */ +export declare function IsStandardObject(value: unknown): value is ObjectType; +/** Returns true if this value is an instance of a class */ +export declare function IsInstanceObject(value: unknown): value is ObjectType; +/** Returns true if this value is a Promise */ +export declare function IsPromise(value: unknown): value is Promise; +/** Returns true if this value is a Date */ +export declare function IsDate(value: unknown): value is Date; +/** Returns true if this value is an instance of Map */ +export declare function IsMap(value: unknown): value is Map; +/** Returns true if this value is an instance of Set */ +export declare function IsSet(value: unknown): value is Set; +/** Returns true if this value is RegExp */ +export declare function IsRegExp(value: unknown): value is RegExp; +/** Returns true if this value is a typed array */ +export declare function IsTypedArray(value: unknown): value is TypedArrayType; +/** Returns true if the value is a Int8Array */ +export declare function IsInt8Array(value: unknown): value is Int8Array; +/** Returns true if the value is a Uint8Array */ +export declare function IsUint8Array(value: unknown): value is Uint8Array; +/** Returns true if the value is a Uint8ClampedArray */ +export declare function IsUint8ClampedArray(value: unknown): value is Uint8ClampedArray; +/** Returns true if the value is a Int16Array */ +export declare function IsInt16Array(value: unknown): value is Int16Array; +/** Returns true if the value is a Uint16Array */ +export declare function IsUint16Array(value: unknown): value is Uint16Array; +/** Returns true if the value is a Int32Array */ +export declare function IsInt32Array(value: unknown): value is Int32Array; +/** Returns true if the value is a Uint32Array */ +export declare function IsUint32Array(value: unknown): value is Uint32Array; +/** Returns true if the value is a Float32Array */ +export declare function IsFloat32Array(value: unknown): value is Float32Array; +/** Returns true if the value is a Float64Array */ +export declare function IsFloat64Array(value: unknown): value is Float64Array; +/** Returns true if the value is a BigInt64Array */ +export declare function IsBigInt64Array(value: unknown): value is BigInt64Array; +/** Returns true if the value is a BigUint64Array */ +export declare function IsBigUint64Array(value: unknown): value is BigUint64Array; +/** Returns true if this value has this property key */ +export declare function HasPropertyKey(value: Record, key: K): value is Record & { + [_ in K]: unknown; +}; +/** Returns true of this value is an object type */ +export declare function IsObject(value: unknown): value is ObjectType; +/** Returns true if this value is an array, but not a typed array */ +export declare function IsArray(value: unknown): value is ArrayType; +/** Returns true if this value is an undefined */ +export declare function IsUndefined(value: unknown): value is undefined; +/** Returns true if this value is an null */ +export declare function IsNull(value: unknown): value is null; +/** Returns true if this value is an boolean */ +export declare function IsBoolean(value: unknown): value is boolean; +/** Returns true if this value is an number */ +export declare function IsNumber(value: unknown): value is number; +/** Returns true if this value is an integer */ +export declare function IsInteger(value: unknown): value is number; +/** Returns true if this value is bigint */ +export declare function IsBigInt(value: unknown): value is bigint; +/** Returns true if this value is string */ +export declare function IsString(value: unknown): value is string; +/** Returns true if this value is a function */ +export declare function IsFunction(value: unknown): value is Function; +/** Returns true if this value is a symbol */ +export declare function IsSymbol(value: unknown): value is symbol; +/** Returns true if this value is a value type such as number, string, boolean */ +export declare function IsValueType(value: unknown): value is ValueType; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.js b/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.js new file mode 100644 index 00000000..14acc38a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/guard/guard.js @@ -0,0 +1,195 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IsAsyncIterator = IsAsyncIterator; +exports.IsIterator = IsIterator; +exports.IsStandardObject = IsStandardObject; +exports.IsInstanceObject = IsInstanceObject; +exports.IsPromise = IsPromise; +exports.IsDate = IsDate; +exports.IsMap = IsMap; +exports.IsSet = IsSet; +exports.IsRegExp = IsRegExp; +exports.IsTypedArray = IsTypedArray; +exports.IsInt8Array = IsInt8Array; +exports.IsUint8Array = IsUint8Array; +exports.IsUint8ClampedArray = IsUint8ClampedArray; +exports.IsInt16Array = IsInt16Array; +exports.IsUint16Array = IsUint16Array; +exports.IsInt32Array = IsInt32Array; +exports.IsUint32Array = IsUint32Array; +exports.IsFloat32Array = IsFloat32Array; +exports.IsFloat64Array = IsFloat64Array; +exports.IsBigInt64Array = IsBigInt64Array; +exports.IsBigUint64Array = IsBigUint64Array; +exports.HasPropertyKey = HasPropertyKey; +exports.IsObject = IsObject; +exports.IsArray = IsArray; +exports.IsUndefined = IsUndefined; +exports.IsNull = IsNull; +exports.IsBoolean = IsBoolean; +exports.IsNumber = IsNumber; +exports.IsInteger = IsInteger; +exports.IsBigInt = IsBigInt; +exports.IsString = IsString; +exports.IsFunction = IsFunction; +exports.IsSymbol = IsSymbol; +exports.IsValueType = IsValueType; +// -------------------------------------------------------------------------- +// Iterators +// -------------------------------------------------------------------------- +/** Returns true if this value is an async iterator */ +function IsAsyncIterator(value) { + return IsObject(value) && globalThis.Symbol.asyncIterator in value; +} +/** Returns true if this value is an iterator */ +function IsIterator(value) { + return IsObject(value) && globalThis.Symbol.iterator in value; +} +// -------------------------------------------------------------------------- +// Object Instances +// -------------------------------------------------------------------------- +/** Returns true if this value is not an instance of a class */ +function IsStandardObject(value) { + return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null); +} +/** Returns true if this value is an instance of a class */ +function IsInstanceObject(value) { + return IsObject(value) && !IsArray(value) && IsFunction(value.constructor) && value.constructor.name !== 'Object'; +} +// -------------------------------------------------------------------------- +// JavaScript +// -------------------------------------------------------------------------- +/** Returns true if this value is a Promise */ +function IsPromise(value) { + return value instanceof globalThis.Promise; +} +/** Returns true if this value is a Date */ +function IsDate(value) { + return value instanceof Date && globalThis.Number.isFinite(value.getTime()); +} +/** Returns true if this value is an instance of Map */ +function IsMap(value) { + return value instanceof globalThis.Map; +} +/** Returns true if this value is an instance of Set */ +function IsSet(value) { + return value instanceof globalThis.Set; +} +/** Returns true if this value is RegExp */ +function IsRegExp(value) { + return value instanceof globalThis.RegExp; +} +/** Returns true if this value is a typed array */ +function IsTypedArray(value) { + return globalThis.ArrayBuffer.isView(value); +} +/** Returns true if the value is a Int8Array */ +function IsInt8Array(value) { + return value instanceof globalThis.Int8Array; +} +/** Returns true if the value is a Uint8Array */ +function IsUint8Array(value) { + return value instanceof globalThis.Uint8Array; +} +/** Returns true if the value is a Uint8ClampedArray */ +function IsUint8ClampedArray(value) { + return value instanceof globalThis.Uint8ClampedArray; +} +/** Returns true if the value is a Int16Array */ +function IsInt16Array(value) { + return value instanceof globalThis.Int16Array; +} +/** Returns true if the value is a Uint16Array */ +function IsUint16Array(value) { + return value instanceof globalThis.Uint16Array; +} +/** Returns true if the value is a Int32Array */ +function IsInt32Array(value) { + return value instanceof globalThis.Int32Array; +} +/** Returns true if the value is a Uint32Array */ +function IsUint32Array(value) { + return value instanceof globalThis.Uint32Array; +} +/** Returns true if the value is a Float32Array */ +function IsFloat32Array(value) { + return value instanceof globalThis.Float32Array; +} +/** Returns true if the value is a Float64Array */ +function IsFloat64Array(value) { + return value instanceof globalThis.Float64Array; +} +/** Returns true if the value is a BigInt64Array */ +function IsBigInt64Array(value) { + return value instanceof globalThis.BigInt64Array; +} +/** Returns true if the value is a BigUint64Array */ +function IsBigUint64Array(value) { + return value instanceof globalThis.BigUint64Array; +} +// -------------------------------------------------------------------------- +// PropertyKey +// -------------------------------------------------------------------------- +/** Returns true if this value has this property key */ +function HasPropertyKey(value, key) { + return key in value; +} +// -------------------------------------------------------------------------- +// Standard +// -------------------------------------------------------------------------- +/** Returns true of this value is an object type */ +function IsObject(value) { + return value !== null && typeof value === 'object'; +} +/** Returns true if this value is an array, but not a typed array */ +function IsArray(value) { + return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value); +} +/** Returns true if this value is an undefined */ +function IsUndefined(value) { + return value === undefined; +} +/** Returns true if this value is an null */ +function IsNull(value) { + return value === null; +} +/** Returns true if this value is an boolean */ +function IsBoolean(value) { + return typeof value === 'boolean'; +} +/** Returns true if this value is an number */ +function IsNumber(value) { + return typeof value === 'number'; +} +/** Returns true if this value is an integer */ +function IsInteger(value) { + return globalThis.Number.isInteger(value); +} +/** Returns true if this value is bigint */ +function IsBigInt(value) { + return typeof value === 'bigint'; +} +/** Returns true if this value is string */ +function IsString(value) { + return typeof value === 'string'; +} +/** Returns true if this value is a function */ +function IsFunction(value) { + return typeof value === 'function'; +} +/** Returns true if this value is a symbol */ +function IsSymbol(value) { + return typeof value === 'symbol'; +} +/** Returns true if this value is a value type such as number, string, boolean */ +function IsValueType(value) { + // prettier-ignore + return (IsBigInt(value) || + IsBoolean(value) || + IsNull(value) || + IsNumber(value) || + IsString(value) || + IsSymbol(value) || + IsUndefined(value)); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/guard/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/guard/index.d.ts new file mode 100644 index 00000000..def49623 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/guard/index.d.ts @@ -0,0 +1 @@ +export * from './guard'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/guard/index.js b/node_modules/@sinclair/typebox/build/cjs/value/guard/index.js new file mode 100644 index 00000000..4735f3e5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/guard/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./guard"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.d.ts new file mode 100644 index 00000000..f6fdc27e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.d.ts @@ -0,0 +1,7 @@ +import { TypeBoxError } from '../../type/error/index'; +export declare class ValueHashError extends TypeBoxError { + readonly value: unknown; + constructor(value: unknown); +} +/** Creates a FNV1A-64 non cryptographic hash of the given value */ +export declare function Hash(value: unknown): bigint; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.js b/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.js new file mode 100644 index 00000000..2c1fccaf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/hash/hash.js @@ -0,0 +1,152 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueHashError = void 0; +exports.Hash = Hash; +const index_1 = require("../guard/index"); +const index_2 = require("../../type/error/index"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueHashError extends index_2.TypeBoxError { + constructor(value) { + super(`Unable to hash value`); + this.value = value; + } +} +exports.ValueHashError = ValueHashError; +// ------------------------------------------------------------------ +// ByteMarker +// ------------------------------------------------------------------ +var ByteMarker; +(function (ByteMarker) { + ByteMarker[ByteMarker["Undefined"] = 0] = "Undefined"; + ByteMarker[ByteMarker["Null"] = 1] = "Null"; + ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean"; + ByteMarker[ByteMarker["Number"] = 3] = "Number"; + ByteMarker[ByteMarker["String"] = 4] = "String"; + ByteMarker[ByteMarker["Object"] = 5] = "Object"; + ByteMarker[ByteMarker["Array"] = 6] = "Array"; + ByteMarker[ByteMarker["Date"] = 7] = "Date"; + ByteMarker[ByteMarker["Uint8Array"] = 8] = "Uint8Array"; + ByteMarker[ByteMarker["Symbol"] = 9] = "Symbol"; + ByteMarker[ByteMarker["BigInt"] = 10] = "BigInt"; +})(ByteMarker || (ByteMarker = {})); +// ------------------------------------------------------------------ +// State +// ------------------------------------------------------------------ +let Accumulator = BigInt('14695981039346656037'); +const [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)]; +const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i)); +const F64 = new Float64Array(1); +const F64In = new DataView(F64.buffer); +const F64Out = new Uint8Array(F64.buffer); +// ------------------------------------------------------------------ +// NumberToBytes +// ------------------------------------------------------------------ +function* NumberToBytes(value) { + const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8); + for (let i = 0; i < byteCount; i++) { + yield (value >> (8 * (byteCount - 1 - i))) & 0xff; + } +} +// ------------------------------------------------------------------ +// Hashing Functions +// ------------------------------------------------------------------ +function ArrayType(value) { + FNV1A64(ByteMarker.Array); + for (const item of value) { + Visit(item); + } +} +function BooleanType(value) { + FNV1A64(ByteMarker.Boolean); + FNV1A64(value ? 1 : 0); +} +function BigIntType(value) { + FNV1A64(ByteMarker.BigInt); + F64In.setBigInt64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function DateType(value) { + FNV1A64(ByteMarker.Date); + Visit(value.getTime()); +} +function NullType(value) { + FNV1A64(ByteMarker.Null); +} +function NumberType(value) { + FNV1A64(ByteMarker.Number); + F64In.setFloat64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function ObjectType(value) { + FNV1A64(ByteMarker.Object); + for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) { + Visit(key); + Visit(value[key]); + } +} +function StringType(value) { + FNV1A64(ByteMarker.String); + for (let i = 0; i < value.length; i++) { + for (const byte of NumberToBytes(value.charCodeAt(i))) { + FNV1A64(byte); + } + } +} +function SymbolType(value) { + FNV1A64(ByteMarker.Symbol); + Visit(value.description); +} +function Uint8ArrayType(value) { + FNV1A64(ByteMarker.Uint8Array); + for (let i = 0; i < value.length; i++) { + FNV1A64(value[i]); + } +} +function UndefinedType(value) { + return FNV1A64(ByteMarker.Undefined); +} +function Visit(value) { + if ((0, index_1.IsArray)(value)) + return ArrayType(value); + if ((0, index_1.IsBoolean)(value)) + return BooleanType(value); + if ((0, index_1.IsBigInt)(value)) + return BigIntType(value); + if ((0, index_1.IsDate)(value)) + return DateType(value); + if ((0, index_1.IsNull)(value)) + return NullType(value); + if ((0, index_1.IsNumber)(value)) + return NumberType(value); + if ((0, index_1.IsObject)(value)) + return ObjectType(value); + if ((0, index_1.IsString)(value)) + return StringType(value); + if ((0, index_1.IsSymbol)(value)) + return SymbolType(value); + if ((0, index_1.IsUint8Array)(value)) + return Uint8ArrayType(value); + if ((0, index_1.IsUndefined)(value)) + return UndefinedType(value); + throw new ValueHashError(value); +} +function FNV1A64(byte) { + Accumulator = Accumulator ^ Bytes[byte]; + Accumulator = (Accumulator * Prime) % Size; +} +// ------------------------------------------------------------------ +// Hash +// ------------------------------------------------------------------ +/** Creates a FNV1A-64 non cryptographic hash of the given value */ +function Hash(value) { + Accumulator = BigInt('14695981039346656037'); + Visit(value); + return Accumulator; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/hash/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/hash/index.d.ts new file mode 100644 index 00000000..6719163c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/hash/index.d.ts @@ -0,0 +1 @@ +export * from './hash'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/hash/index.js b/node_modules/@sinclair/typebox/build/cjs/value/hash/index.js new file mode 100644 index 00000000..789dfc0e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/hash/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./hash"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/index.d.ts new file mode 100644 index 00000000..45a4d03f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/index.d.ts @@ -0,0 +1,20 @@ +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index'; +export * from './guard/index'; +export * from './assert/index'; +export * from './cast/index'; +export * from './check/index'; +export * from './clean/index'; +export * from './clone/index'; +export * from './convert/index'; +export * from './create/index'; +export * from './decode/index'; +export * from './default/index'; +export * from './delta/index'; +export * from './encode/index'; +export * from './equal/index'; +export * from './hash/index'; +export * from './mutate/index'; +export * from './parse/index'; +export * from './pointer/index'; +export * from './transform/index'; +export { Value } from './value/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/index.js b/node_modules/@sinclair/typebox/build/cjs/value/index.js new file mode 100644 index 00000000..3348788d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/index.js @@ -0,0 +1,53 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Value = exports.ValueErrorIterator = exports.ValueErrorType = void 0; +// ------------------------------------------------------------------ +// Errors (re-export) +// ------------------------------------------------------------------ +var index_1 = require("../errors/index"); +Object.defineProperty(exports, "ValueErrorType", { enumerable: true, get: function () { return index_1.ValueErrorType; } }); +Object.defineProperty(exports, "ValueErrorIterator", { enumerable: true, get: function () { return index_1.ValueErrorIterator; } }); +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +__exportStar(require("./guard/index"), exports); +// ------------------------------------------------------------------ +// Operators +// ------------------------------------------------------------------ +__exportStar(require("./assert/index"), exports); +__exportStar(require("./cast/index"), exports); +__exportStar(require("./check/index"), exports); +__exportStar(require("./clean/index"), exports); +__exportStar(require("./clone/index"), exports); +__exportStar(require("./convert/index"), exports); +__exportStar(require("./create/index"), exports); +__exportStar(require("./decode/index"), exports); +__exportStar(require("./default/index"), exports); +__exportStar(require("./delta/index"), exports); +__exportStar(require("./encode/index"), exports); +__exportStar(require("./equal/index"), exports); +__exportStar(require("./hash/index"), exports); +__exportStar(require("./mutate/index"), exports); +__exportStar(require("./parse/index"), exports); +__exportStar(require("./pointer/index"), exports); +__exportStar(require("./transform/index"), exports); +// ------------------------------------------------------------------ +// Namespace +// ------------------------------------------------------------------ +var index_2 = require("./value/index"); +Object.defineProperty(exports, "Value", { enumerable: true, get: function () { return index_2.Value; } }); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.d.ts new file mode 100644 index 00000000..3e2a7755 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.d.ts @@ -0,0 +1 @@ +export * from './mutate'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.js b/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.js new file mode 100644 index 00000000..542c4ed2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/mutate/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./mutate"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.d.ts new file mode 100644 index 00000000..71a28a5a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.d.ts @@ -0,0 +1,9 @@ +import { TypeBoxError } from '../../type/error/index'; +export declare class ValueMutateError extends TypeBoxError { + constructor(message: string); +} +export type Mutable = { + [key: string]: unknown; +} | unknown[]; +/** `[Mutable]` Performs a deep mutable value assignment while retaining internal references */ +export declare function Mutate(current: Mutable, next: Mutable): void; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.js b/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.js new file mode 100644 index 00000000..09879221 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/mutate/mutate.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueMutateError = void 0; +exports.Mutate = Mutate; +const index_1 = require("../guard/index"); +const index_2 = require("../pointer/index"); +const index_3 = require("../clone/index"); +const index_4 = require("../../type/error/index"); +// ------------------------------------------------------------------ +// IsStandardObject +// ------------------------------------------------------------------ +function IsStandardObject(value) { + return (0, index_1.IsObject)(value) && !(0, index_1.IsArray)(value); +} +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValueMutateError extends index_4.TypeBoxError { + constructor(message) { + super(message); + } +} +exports.ValueMutateError = ValueMutateError; +function ObjectType(root, path, current, next) { + if (!IsStandardObject(current)) { + index_2.ValuePointer.Set(root, path, (0, index_3.Clone)(next)); + } + else { + const currentKeys = Object.getOwnPropertyNames(current); + const nextKeys = Object.getOwnPropertyNames(next); + for (const currentKey of currentKeys) { + if (!nextKeys.includes(currentKey)) { + delete current[currentKey]; + } + } + for (const nextKey of nextKeys) { + if (!currentKeys.includes(nextKey)) { + current[nextKey] = null; + } + } + for (const nextKey of nextKeys) { + Visit(root, `${path}/${nextKey}`, current[nextKey], next[nextKey]); + } + } +} +function ArrayType(root, path, current, next) { + if (!(0, index_1.IsArray)(current)) { + index_2.ValuePointer.Set(root, path, (0, index_3.Clone)(next)); + } + else { + for (let index = 0; index < next.length; index++) { + Visit(root, `${path}/${index}`, current[index], next[index]); + } + current.splice(next.length); + } +} +function TypedArrayType(root, path, current, next) { + if ((0, index_1.IsTypedArray)(current) && current.length === next.length) { + for (let i = 0; i < current.length; i++) { + current[i] = next[i]; + } + } + else { + index_2.ValuePointer.Set(root, path, (0, index_3.Clone)(next)); + } +} +function ValueType(root, path, current, next) { + if (current === next) + return; + index_2.ValuePointer.Set(root, path, next); +} +function Visit(root, path, current, next) { + if ((0, index_1.IsArray)(next)) + return ArrayType(root, path, current, next); + if ((0, index_1.IsTypedArray)(next)) + return TypedArrayType(root, path, current, next); + if (IsStandardObject(next)) + return ObjectType(root, path, current, next); + if ((0, index_1.IsValueType)(next)) + return ValueType(root, path, current, next); +} +// ------------------------------------------------------------------ +// IsNonMutableValue +// ------------------------------------------------------------------ +function IsNonMutableValue(value) { + return (0, index_1.IsTypedArray)(value) || (0, index_1.IsValueType)(value); +} +function IsMismatchedValue(current, next) { + // prettier-ignore + return ((IsStandardObject(current) && (0, index_1.IsArray)(next)) || + ((0, index_1.IsArray)(current) && IsStandardObject(next))); +} +// ------------------------------------------------------------------ +// Mutate +// ------------------------------------------------------------------ +/** `[Mutable]` Performs a deep mutable value assignment while retaining internal references */ +function Mutate(current, next) { + if (IsNonMutableValue(current) || IsNonMutableValue(next)) + throw new ValueMutateError('Only object and array types can be mutated at the root level'); + if (IsMismatchedValue(current, next)) + throw new ValueMutateError('Cannot assign due type mismatch of assignable values'); + Visit(current, '', current, next); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/parse/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/parse/index.d.ts new file mode 100644 index 00000000..dd1a55cc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/parse/index.d.ts @@ -0,0 +1 @@ +export * from './parse'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/parse/index.js b/node_modules/@sinclair/typebox/build/cjs/value/parse/index.js new file mode 100644 index 00000000..101a7115 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/parse/index.js @@ -0,0 +1,18 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./parse"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.d.ts new file mode 100644 index 00000000..c79c4217 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.d.ts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index'; +import { TSchema } from '../../type/schema/index'; +import { StaticDecode } from '../../type/static/index'; +export declare class ParseError extends TypeBoxError { + constructor(message: string); +} +export type TParseOperation = 'Assert' | 'Cast' | 'Clean' | 'Clone' | 'Convert' | 'Decode' | 'Default' | 'Encode' | ({} & string); +export type TParseFunction = (type: TSchema, references: TSchema[], value: unknown) => unknown; +export declare namespace ParseRegistry { + function Delete(key: string): void; + function Set(key: string, callback: TParseFunction): void; + function Get(key: string): TParseFunction | undefined; +} +export declare const ParseDefault: readonly ["Clone", "Clean", "Default", "Convert", "Assert", "Decode"]; +/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */ +export declare function Parse, Result extends Output = Output>(schema: Type, references: TSchema[], value: unknown): Result; +/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */ +export declare function Parse, Result extends Output = Output>(schema: Type, value: unknown): Result; +/** Parses a value using the specified operations. */ +export declare function Parse(operations: TParseOperation[], schema: Type, references: TSchema[], value: unknown): unknown; +/** Parses a value using the specified operations. */ +export declare function Parse(operations: TParseOperation[], schema: Type, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.js b/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.js new file mode 100644 index 00000000..5065576f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/parse/parse.js @@ -0,0 +1,87 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseDefault = exports.ParseRegistry = exports.ParseError = void 0; +exports.Parse = Parse; +const index_1 = require("../../type/error/index"); +const index_2 = require("../transform/index"); +const index_3 = require("../assert/index"); +const index_4 = require("../cast/index"); +const index_5 = require("../clean/index"); +const index_6 = require("../clone/index"); +const index_7 = require("../convert/index"); +const index_8 = require("../default/index"); +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +const index_9 = require("../guard/index"); +// ------------------------------------------------------------------ +// Error +// ------------------------------------------------------------------ +class ParseError extends index_1.TypeBoxError { + constructor(message) { + super(message); + } +} +exports.ParseError = ParseError; +// prettier-ignore +var ParseRegistry; +(function (ParseRegistry) { + const registry = new Map([ + ['Assert', (type, references, value) => { (0, index_3.Assert)(type, references, value); return value; }], + ['Cast', (type, references, value) => (0, index_4.Cast)(type, references, value)], + ['Clean', (type, references, value) => (0, index_5.Clean)(type, references, value)], + ['Clone', (_type, _references, value) => (0, index_6.Clone)(value)], + ['Convert', (type, references, value) => (0, index_7.Convert)(type, references, value)], + ['Decode', (type, references, value) => ((0, index_2.HasTransform)(type, references) ? (0, index_2.TransformDecode)(type, references, value) : value)], + ['Default', (type, references, value) => (0, index_8.Default)(type, references, value)], + ['Encode', (type, references, value) => ((0, index_2.HasTransform)(type, references) ? (0, index_2.TransformEncode)(type, references, value) : value)], + ]); + // Deletes an entry from the registry + function Delete(key) { + registry.delete(key); + } + ParseRegistry.Delete = Delete; + // Sets an entry in the registry + function Set(key, callback) { + registry.set(key, callback); + } + ParseRegistry.Set = Set; + // Gets an entry in the registry + function Get(key) { + return registry.get(key); + } + ParseRegistry.Get = Get; +})(ParseRegistry || (exports.ParseRegistry = ParseRegistry = {})); +// ------------------------------------------------------------------ +// Default Parse Pipeline +// ------------------------------------------------------------------ +// prettier-ignore +exports.ParseDefault = [ + 'Clone', + 'Clean', + 'Default', + 'Convert', + 'Assert', + 'Decode' +]; +// ------------------------------------------------------------------ +// ParseValue +// ------------------------------------------------------------------ +function ParseValue(operations, type, references, value) { + return operations.reduce((value, operationKey) => { + const operation = ParseRegistry.Get(operationKey); + if ((0, index_9.IsUndefined)(operation)) + throw new ParseError(`Unable to find Parse operation '${operationKey}'`); + return operation(type, references, value); + }, value); +} +/** Parses a value */ +function Parse(...args) { + // prettier-ignore + const [operations, schema, references, value] = (args.length === 4 ? [args[0], args[1], args[2], args[3]] : + args.length === 3 ? (0, index_9.IsArray)(args[0]) ? [args[0], args[1], [], args[2]] : [exports.ParseDefault, args[0], args[1], args[2]] : + args.length === 2 ? [exports.ParseDefault, args[0], [], args[1]] : + (() => { throw new ParseError('Invalid Arguments'); })()); + return ParseValue(operations, schema, references, value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.d.ts new file mode 100644 index 00000000..16fc13e8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.d.ts @@ -0,0 +1 @@ +export * as ValuePointer from './pointer'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.js b/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.js new file mode 100644 index 00000000..84c1e263 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/pointer/index.js @@ -0,0 +1,38 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValuePointer = void 0; +exports.ValuePointer = __importStar(require("./pointer")); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.d.ts new file mode 100644 index 00000000..80286558 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.d.ts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index'; +export declare class ValuePointerRootSetError extends TypeBoxError { + readonly value: unknown; + readonly path: string; + readonly update: unknown; + constructor(value: unknown, path: string, update: unknown); +} +export declare class ValuePointerRootDeleteError extends TypeBoxError { + readonly value: unknown; + readonly path: string; + constructor(value: unknown, path: string); +} +/** Formats the given pointer into navigable key components */ +export declare function Format(pointer: string): IterableIterator; +/** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ +export declare function Set(value: any, pointer: string, update: unknown): void; +/** Deletes a value at the given pointer */ +export declare function Delete(value: any, pointer: string): void; +/** Returns true if a value exists at the given pointer */ +export declare function Has(value: any, pointer: string): boolean; +/** Gets the value at the given pointer */ +export declare function Get(value: any, pointer: string): any; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.js b/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.js new file mode 100644 index 00000000..af349ffa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/pointer/pointer.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValuePointerRootDeleteError = exports.ValuePointerRootSetError = void 0; +exports.Format = Format; +exports.Set = Set; +exports.Delete = Delete; +exports.Has = Has; +exports.Get = Get; +const index_1 = require("../../type/error/index"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +class ValuePointerRootSetError extends index_1.TypeBoxError { + constructor(value, path, update) { + super('Cannot set root value'); + this.value = value; + this.path = path; + this.update = update; + } +} +exports.ValuePointerRootSetError = ValuePointerRootSetError; +class ValuePointerRootDeleteError extends index_1.TypeBoxError { + constructor(value, path) { + super('Cannot delete root value'); + this.value = value; + this.path = path; + } +} +exports.ValuePointerRootDeleteError = ValuePointerRootDeleteError; +// ------------------------------------------------------------------ +// ValuePointer +// ------------------------------------------------------------------ +/** Provides functionality to update values through RFC6901 string pointers */ +// prettier-ignore +function Escape(component) { + return component.indexOf('~') === -1 ? component : component.replace(/~1/g, '/').replace(/~0/g, '~'); +} +/** Formats the given pointer into navigable key components */ +// prettier-ignore +function* Format(pointer) { + if (pointer === '') + return; + let [start, end] = [0, 0]; + for (let i = 0; i < pointer.length; i++) { + const char = pointer.charAt(i); + if (char === '/') { + if (i === 0) { + start = i + 1; + } + else { + end = i; + yield Escape(pointer.slice(start, end)); + start = i + 1; + } + } + else { + end = i; + } + } + yield Escape(pointer.slice(start)); +} +/** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ +// prettier-ignore +function Set(value, pointer, update) { + if (pointer === '') + throw new ValuePointerRootSetError(value, pointer, update); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + next[component] = {}; + owner = next; + next = next[component]; + key = component; + } + owner[key] = update; +} +/** Deletes a value at the given pointer */ +// prettier-ignore +function Delete(value, pointer) { + if (pointer === '') + throw new ValuePointerRootDeleteError(value, pointer); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined || next[component] === null) + return; + owner = next; + next = next[component]; + key = component; + } + if (Array.isArray(owner)) { + const index = parseInt(key); + owner.splice(index, 1); + } + else { + delete owner[key]; + } +} +/** Returns true if a value exists at the given pointer */ +// prettier-ignore +function Has(value, pointer) { + if (pointer === '') + return true; + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + return false; + owner = next; + next = next[component]; + key = component; + } + return Object.getOwnPropertyNames(owner).includes(key); +} +/** Gets the value at the given pointer */ +// prettier-ignore +function Get(value, pointer) { + if (pointer === '') + return value; + let current = value; + for (const component of Format(pointer)) { + if (current[component] === undefined) + return undefined; + current = current[component]; + } + return current; +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.d.ts new file mode 100644 index 00000000..79e3bed8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.d.ts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index'; +import { ValueError } from '../../errors/index'; +import type { TSchema } from '../../type/schema/index'; +export declare class TransformDecodeCheckError extends TypeBoxError { + readonly schema: TSchema; + readonly value: unknown; + readonly error: ValueError; + constructor(schema: TSchema, value: unknown, error: ValueError); +} +export declare class TransformDecodeError extends TypeBoxError { + readonly schema: TSchema; + readonly path: string; + readonly value: unknown; + readonly error: Error; + constructor(schema: TSchema, path: string, value: unknown, error: Error); +} +/** + * `[Internal]` Decodes the value and returns the result. This function requires that + * the caller `Check` the value before use. Passing unchecked values may result in + * undefined behavior. Refer to the `Value.Decode()` for implementation details. + */ +export declare function TransformDecode(schema: TSchema, references: TSchema[], value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.js b/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.js new file mode 100644 index 00000000..cef4f0bd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/decode.js @@ -0,0 +1,214 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TransformDecodeError = exports.TransformDecodeCheckError = void 0; +exports.TransformDecode = TransformDecode; +const policy_1 = require("../../system/policy"); +const index_1 = require("../../type/symbols/index"); +const index_2 = require("../../type/error/index"); +const index_3 = require("../../type/keyof/index"); +const index_4 = require("../deref/index"); +const index_5 = require("../check/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_6 = require("../guard/index"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +// thrown externally +// prettier-ignore +class TransformDecodeCheckError extends index_2.TypeBoxError { + constructor(schema, value, error) { + super(`Unable to decode value as it does not match the expected schema`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +exports.TransformDecodeCheckError = TransformDecodeCheckError; +// prettier-ignore +class TransformDecodeError extends index_2.TypeBoxError { + constructor(schema, path, value, error) { + super(error instanceof Error ? error.message : 'Unknown error'); + this.schema = schema; + this.path = path; + this.value = value; + this.error = error; + } +} +exports.TransformDecodeError = TransformDecodeError; +// ------------------------------------------------------------------ +// Decode +// ------------------------------------------------------------------ +// prettier-ignore +function Default(schema, path, value) { + try { + return (0, kind_1.IsTransform)(schema) ? schema[index_1.TransformKind].Decode(value) : value; + } + catch (error) { + throw new TransformDecodeError(schema, path, value, error); + } +} +// prettier-ignore +function FromArray(schema, references, path, value) { + return ((0, index_6.IsArray)(value)) + ? Default(schema, path, value.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value))) + : Default(schema, path, value); +} +// prettier-ignore +function FromIntersect(schema, references, path, value) { + if (!(0, index_6.IsObject)(value) || (0, index_6.IsValueType)(value)) + return Default(schema, path, value); + const knownEntries = (0, index_3.KeyOfPropertyEntries)(schema); + const knownKeys = knownEntries.map(entry => entry[0]); + const knownProperties = { ...value }; + for (const [knownKey, knownSchema] of knownEntries) + if (knownKey in knownProperties) { + knownProperties[knownKey] = Visit(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]); + } + if (!(0, kind_1.IsTransform)(schema.unevaluatedProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const unevaluatedProperties = schema.unevaluatedProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + unknownProperties[key] = Default(unevaluatedProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromImport(schema, references, path, value) { + const additional = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + const result = Visit(target, [...references, ...additional], path, value); + return Default(schema, path, result); +} +function FromNot(schema, references, path, value) { + return Default(schema, path, Visit(schema.not, references, path, value)); +} +// prettier-ignore +function FromObject(schema, references, path, value) { + if (!(0, index_6.IsObject)(value)) + return Default(schema, path, value); + const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema); + const knownProperties = { ...value }; + for (const key of knownKeys) { + if (!(0, index_6.HasPropertyKey)(knownProperties, key)) + continue; + // if the property value is undefined, but the target is not, nor does it satisfy exact optional + // property policy, then we need to continue. This is a special case for optional property handling + // where a transforms wrapped in a optional modifiers should not run. + if ((0, index_6.IsUndefined)(knownProperties[key]) && (!(0, kind_1.IsUndefined)(schema.properties[key]) || + policy_1.TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) + continue; + // decode property + knownProperties[key] = Visit(schema.properties[key], references, `${path}/${key}`, knownProperties[key]); + } + if (!(0, kind_1.IsSchema)(schema.additionalProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + unknownProperties[key] = Default(additionalProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromRecord(schema, references, path, value) { + if (!(0, index_6.IsObject)(value)) + return Default(schema, path, value); + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const knownKeys = new RegExp(pattern); + const knownProperties = { ...value }; + for (const key of Object.getOwnPropertyNames(value)) + if (knownKeys.test(key)) { + knownProperties[key] = Visit(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]); + } + if (!(0, kind_1.IsSchema)(schema.additionalProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.test(key)) { + unknownProperties[key] = Default(additionalProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromRef(schema, references, path, value) { + const target = (0, index_4.Deref)(schema, references); + return Default(schema, path, Visit(target, references, path, value)); +} +// prettier-ignore +function FromThis(schema, references, path, value) { + const target = (0, index_4.Deref)(schema, references); + return Default(schema, path, Visit(target, references, path, value)); +} +// prettier-ignore +function FromTuple(schema, references, path, value) { + return ((0, index_6.IsArray)(value) && (0, index_6.IsArray)(schema.items)) + ? Default(schema, path, schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value[index]))) + : Default(schema, path, value); +} +// prettier-ignore +function FromUnion(schema, references, path, value) { + for (const subschema of schema.anyOf) { + if (!(0, index_5.Check)(subschema, references, value)) + continue; + // note: ensure interior is decoded first + const decoded = Visit(subschema, references, path, value); + return Default(schema, path, decoded); + } + return Default(schema, path, value); +} +// prettier-ignore +function Visit(schema, references, path, value) { + const references_ = (0, index_4.Pushref)(schema, references); + const schema_ = schema; + switch (schema[index_1.Kind]) { + case 'Array': + return FromArray(schema_, references_, path, value); + case 'Import': + return FromImport(schema_, references_, path, value); + case 'Intersect': + return FromIntersect(schema_, references_, path, value); + case 'Not': + return FromNot(schema_, references_, path, value); + case 'Object': + return FromObject(schema_, references_, path, value); + case 'Record': + return FromRecord(schema_, references_, path, value); + case 'Ref': + return FromRef(schema_, references_, path, value); + case 'Symbol': + return Default(schema_, path, value); + case 'This': + return FromThis(schema_, references_, path, value); + case 'Tuple': + return FromTuple(schema_, references_, path, value); + case 'Union': + return FromUnion(schema_, references_, path, value); + default: + return Default(schema_, path, value); + } +} +/** + * `[Internal]` Decodes the value and returns the result. This function requires that + * the caller `Check` the value before use. Passing unchecked values may result in + * undefined behavior. Refer to the `Value.Decode()` for implementation details. + */ +function TransformDecode(schema, references, value) { + return Visit(schema, references, '', value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.d.ts new file mode 100644 index 00000000..be21c683 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.d.ts @@ -0,0 +1,23 @@ +import { TypeBoxError } from '../../type/error/index'; +import { ValueError } from '../../errors/index'; +import type { TSchema } from '../../type/schema/index'; +export declare class TransformEncodeCheckError extends TypeBoxError { + readonly schema: TSchema; + readonly value: unknown; + readonly error: ValueError; + constructor(schema: TSchema, value: unknown, error: ValueError); +} +export declare class TransformEncodeError extends TypeBoxError { + readonly schema: TSchema; + readonly path: string; + readonly value: unknown; + readonly error: Error; + constructor(schema: TSchema, path: string, value: unknown, error: Error); +} +/** + * `[Internal]` Encodes the value and returns the result. This function expects the + * caller to pass a statically checked value. This function does not check the encoded + * result, meaning the result should be passed to `Check` before use. Refer to the + * `Value.Encode()` function for implementation details. + */ +export declare function TransformEncode(schema: TSchema, references: TSchema[], value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.js b/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.js new file mode 100644 index 00000000..310a2236 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/encode.js @@ -0,0 +1,225 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TransformEncodeError = exports.TransformEncodeCheckError = void 0; +exports.TransformEncode = TransformEncode; +const policy_1 = require("../../system/policy"); +const index_1 = require("../../type/symbols/index"); +const index_2 = require("../../type/error/index"); +const index_3 = require("../../type/keyof/index"); +const index_4 = require("../deref/index"); +const index_5 = require("../check/index"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_6 = require("../guard/index"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +// prettier-ignore +class TransformEncodeCheckError extends index_2.TypeBoxError { + constructor(schema, value, error) { + super(`The encoded value does not match the expected schema`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +exports.TransformEncodeCheckError = TransformEncodeCheckError; +// prettier-ignore +class TransformEncodeError extends index_2.TypeBoxError { + constructor(schema, path, value, error) { + super(`${error instanceof Error ? error.message : 'Unknown error'}`); + this.schema = schema; + this.path = path; + this.value = value; + this.error = error; + } +} +exports.TransformEncodeError = TransformEncodeError; +// ------------------------------------------------------------------ +// Encode +// ------------------------------------------------------------------ +// prettier-ignore +function Default(schema, path, value) { + try { + return (0, kind_1.IsTransform)(schema) ? schema[index_1.TransformKind].Encode(value) : value; + } + catch (error) { + throw new TransformEncodeError(schema, path, value, error); + } +} +// prettier-ignore +function FromArray(schema, references, path, value) { + const defaulted = Default(schema, path, value); + return (0, index_6.IsArray)(defaulted) + ? defaulted.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value)) + : defaulted; +} +// prettier-ignore +function FromImport(schema, references, path, value) { + const additional = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + const result = Default(schema, path, value); + return Visit(target, [...references, ...additional], path, result); +} +// prettier-ignore +function FromIntersect(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!(0, index_6.IsObject)(value) || (0, index_6.IsValueType)(value)) + return defaulted; + const knownEntries = (0, index_3.KeyOfPropertyEntries)(schema); + const knownKeys = knownEntries.map(entry => entry[0]); + const knownProperties = { ...defaulted }; + for (const [knownKey, knownSchema] of knownEntries) + if (knownKey in knownProperties) { + knownProperties[knownKey] = Visit(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]); + } + if (!(0, kind_1.IsTransform)(schema.unevaluatedProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const unevaluatedProperties = schema.unevaluatedProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + properties[key] = Default(unevaluatedProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromNot(schema, references, path, value) { + return Default(schema.not, path, Default(schema, path, value)); +} +// prettier-ignore +function FromObject(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!(0, index_6.IsObject)(defaulted)) + return defaulted; + const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema); + const knownProperties = { ...defaulted }; + for (const key of knownKeys) { + if (!(0, index_6.HasPropertyKey)(knownProperties, key)) + continue; + // if the property value is undefined, but the target is not, nor does it satisfy exact optional + // property policy, then we need to continue. This is a special case for optional property handling + // where a transforms wrapped in a optional modifiers should not run. + if ((0, index_6.IsUndefined)(knownProperties[key]) && (!(0, kind_1.IsUndefined)(schema.properties[key]) || + policy_1.TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) + continue; + // encode property + knownProperties[key] = Visit(schema.properties[key], references, `${path}/${key}`, knownProperties[key]); + } + if (!(0, kind_1.IsSchema)(schema.additionalProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + properties[key] = Default(additionalProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromRecord(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!(0, index_6.IsObject)(value)) + return defaulted; + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const knownKeys = new RegExp(pattern); + const knownProperties = { ...defaulted }; + for (const key of Object.getOwnPropertyNames(value)) + if (knownKeys.test(key)) { + knownProperties[key] = Visit(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]); + } + if (!(0, kind_1.IsSchema)(schema.additionalProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.test(key)) { + properties[key] = Default(additionalProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromRef(schema, references, path, value) { + const target = (0, index_4.Deref)(schema, references); + const resolved = Visit(target, references, path, value); + return Default(schema, path, resolved); +} +// prettier-ignore +function FromThis(schema, references, path, value) { + const target = (0, index_4.Deref)(schema, references); + const resolved = Visit(target, references, path, value); + return Default(schema, path, resolved); +} +// prettier-ignore +function FromTuple(schema, references, path, value) { + const value1 = Default(schema, path, value); + return (0, index_6.IsArray)(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value1[index])) : []; +} +// prettier-ignore +function FromUnion(schema, references, path, value) { + // test value against union variants + for (const subschema of schema.anyOf) { + if (!(0, index_5.Check)(subschema, references, value)) + continue; + const value1 = Visit(subschema, references, path, value); + return Default(schema, path, value1); + } + // test transformed value against union variants + for (const subschema of schema.anyOf) { + const value1 = Visit(subschema, references, path, value); + if (!(0, index_5.Check)(schema, references, value1)) + continue; + return Default(schema, path, value1); + } + return Default(schema, path, value); +} +// prettier-ignore +function Visit(schema, references, path, value) { + const references_ = (0, index_4.Pushref)(schema, references); + const schema_ = schema; + switch (schema[index_1.Kind]) { + case 'Array': + return FromArray(schema_, references_, path, value); + case 'Import': + return FromImport(schema_, references_, path, value); + case 'Intersect': + return FromIntersect(schema_, references_, path, value); + case 'Not': + return FromNot(schema_, references_, path, value); + case 'Object': + return FromObject(schema_, references_, path, value); + case 'Record': + return FromRecord(schema_, references_, path, value); + case 'Ref': + return FromRef(schema_, references_, path, value); + case 'This': + return FromThis(schema_, references_, path, value); + case 'Tuple': + return FromTuple(schema_, references_, path, value); + case 'Union': + return FromUnion(schema_, references_, path, value); + default: + return Default(schema_, path, value); + } +} +/** + * `[Internal]` Encodes the value and returns the result. This function expects the + * caller to pass a statically checked value. This function does not check the encoded + * result, meaning the result should be passed to `Check` before use. Refer to the + * `Value.Encode()` function for implementation details. + */ +function TransformEncode(schema, references, value) { + return Visit(schema, references, '', value); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/has.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/transform/has.d.ts new file mode 100644 index 00000000..85c383c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/has.d.ts @@ -0,0 +1,3 @@ +import type { TSchema } from '../../type/schema/index'; +/** Returns true if this schema contains a transform codec */ +export declare function HasTransform(schema: TSchema, references: TSchema[]): boolean; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/has.js b/node_modules/@sinclair/typebox/build/cjs/value/transform/has.js new file mode 100644 index 00000000..66c5f6e3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/has.js @@ -0,0 +1,133 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HasTransform = HasTransform; +const index_1 = require("../deref/index"); +const index_2 = require("../../type/symbols/index"); +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +const kind_1 = require("../../type/guard/kind"); +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +const index_3 = require("../guard/index"); +// prettier-ignore +function FromArray(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromAsyncIterator(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromConstructor(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromFunction(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromIntersect(schema, references) { + return (0, kind_1.IsTransform)(schema) || (0, kind_1.IsTransform)(schema.unevaluatedProperties) || schema.allOf.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromImport(schema, references) { + const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => [...result, schema.$defs[key]], []); + const target = schema.$defs[schema.$ref]; + return (0, kind_1.IsTransform)(schema) || Visit(target, [...additional, ...references]); +} +// prettier-ignore +function FromIterator(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromNot(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.not, references); +} +// prettier-ignore +function FromObject(schema, references) { + return ((0, kind_1.IsTransform)(schema) || + Object.values(schema.properties).some((schema) => Visit(schema, references)) || + ((0, kind_1.IsSchema)(schema.additionalProperties) && Visit(schema.additionalProperties, references))); +} +// prettier-ignore +function FromPromise(schema, references) { + return (0, kind_1.IsTransform)(schema) || Visit(schema.item, references); +} +// prettier-ignore +function FromRecord(schema, references) { + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[pattern]; + return (0, kind_1.IsTransform)(schema) || Visit(property, references) || ((0, kind_1.IsSchema)(schema.additionalProperties) && (0, kind_1.IsTransform)(schema.additionalProperties)); +} +// prettier-ignore +function FromRef(schema, references) { + if ((0, kind_1.IsTransform)(schema)) + return true; + return Visit((0, index_1.Deref)(schema, references), references); +} +// prettier-ignore +function FromThis(schema, references) { + if ((0, kind_1.IsTransform)(schema)) + return true; + return Visit((0, index_1.Deref)(schema, references), references); +} +// prettier-ignore +function FromTuple(schema, references) { + return (0, kind_1.IsTransform)(schema) || (!(0, index_3.IsUndefined)(schema.items) && schema.items.some((schema) => Visit(schema, references))); +} +// prettier-ignore +function FromUnion(schema, references) { + return (0, kind_1.IsTransform)(schema) || schema.anyOf.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function Visit(schema, references) { + const references_ = (0, index_1.Pushref)(schema, references); + const schema_ = schema; + if (schema.$id && visited.has(schema.$id)) + return false; + if (schema.$id) + visited.add(schema.$id); + switch (schema[index_2.Kind]) { + case 'Array': + return FromArray(schema_, references_); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_); + case 'Constructor': + return FromConstructor(schema_, references_); + case 'Function': + return FromFunction(schema_, references_); + case 'Import': + return FromImport(schema_, references_); + case 'Intersect': + return FromIntersect(schema_, references_); + case 'Iterator': + return FromIterator(schema_, references_); + case 'Not': + return FromNot(schema_, references_); + case 'Object': + return FromObject(schema_, references_); + case 'Promise': + return FromPromise(schema_, references_); + case 'Record': + return FromRecord(schema_, references_); + case 'Ref': + return FromRef(schema_, references_); + case 'This': + return FromThis(schema_, references_); + case 'Tuple': + return FromTuple(schema_, references_); + case 'Union': + return FromUnion(schema_, references_); + default: + return (0, kind_1.IsTransform)(schema); + } +} +const visited = new Set(); +/** Returns true if this schema contains a transform codec */ +function HasTransform(schema, references) { + visited.clear(); + return Visit(schema, references); +} diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/transform/index.d.ts new file mode 100644 index 00000000..69c14501 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/index.d.ts @@ -0,0 +1,3 @@ +export * from './decode'; +export * from './encode'; +export * from './has'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/transform/index.js b/node_modules/@sinclair/typebox/build/cjs/value/transform/index.js new file mode 100644 index 00000000..d1b8db9b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/transform/index.js @@ -0,0 +1,20 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./decode"), exports); +__exportStar(require("./encode"), exports); +__exportStar(require("./has"), exports); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/value/index.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/value/index.d.ts new file mode 100644 index 00000000..bae7b15e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/value/index.d.ts @@ -0,0 +1 @@ +export * as Value from './value'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/value/index.js b/node_modules/@sinclair/typebox/build/cjs/value/value/index.js new file mode 100644 index 00000000..bcaa68a7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/value/index.js @@ -0,0 +1,38 @@ +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Value = void 0; +exports.Value = __importStar(require("./value")); diff --git a/node_modules/@sinclair/typebox/build/cjs/value/value/value.d.ts b/node_modules/@sinclair/typebox/build/cjs/value/value/value.d.ts new file mode 100644 index 00000000..1ee58f89 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/value/value.d.ts @@ -0,0 +1,16 @@ +export { Errors, ValueErrorIterator } from '../../errors/index'; +export { Assert } from '../assert/index'; +export { Cast } from '../cast/index'; +export { Check } from '../check/index'; +export { Clean } from '../clean/index'; +export { Clone } from '../clone/index'; +export { Convert } from '../convert/index'; +export { Create } from '../create/index'; +export { Decode } from '../decode/index'; +export { Default } from '../default/index'; +export { Diff, Patch, Edit } from '../delta/index'; +export { Encode } from '../encode/index'; +export { Equal } from '../equal/index'; +export { Hash } from '../hash/index'; +export { Mutate, type Mutable } from '../mutate/index'; +export { Parse } from '../parse/index'; diff --git a/node_modules/@sinclair/typebox/build/cjs/value/value/value.js b/node_modules/@sinclair/typebox/build/cjs/value/value/value.js new file mode 100644 index 00000000..e72c589c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/cjs/value/value/value.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parse = exports.Mutate = exports.Hash = exports.Equal = exports.Encode = exports.Edit = exports.Patch = exports.Diff = exports.Default = exports.Decode = exports.Create = exports.Convert = exports.Clone = exports.Clean = exports.Check = exports.Cast = exports.Assert = exports.ValueErrorIterator = exports.Errors = void 0; +var index_1 = require("../../errors/index"); +Object.defineProperty(exports, "Errors", { enumerable: true, get: function () { return index_1.Errors; } }); +Object.defineProperty(exports, "ValueErrorIterator", { enumerable: true, get: function () { return index_1.ValueErrorIterator; } }); +var index_2 = require("../assert/index"); +Object.defineProperty(exports, "Assert", { enumerable: true, get: function () { return index_2.Assert; } }); +var index_3 = require("../cast/index"); +Object.defineProperty(exports, "Cast", { enumerable: true, get: function () { return index_3.Cast; } }); +var index_4 = require("../check/index"); +Object.defineProperty(exports, "Check", { enumerable: true, get: function () { return index_4.Check; } }); +var index_5 = require("../clean/index"); +Object.defineProperty(exports, "Clean", { enumerable: true, get: function () { return index_5.Clean; } }); +var index_6 = require("../clone/index"); +Object.defineProperty(exports, "Clone", { enumerable: true, get: function () { return index_6.Clone; } }); +var index_7 = require("../convert/index"); +Object.defineProperty(exports, "Convert", { enumerable: true, get: function () { return index_7.Convert; } }); +var index_8 = require("../create/index"); +Object.defineProperty(exports, "Create", { enumerable: true, get: function () { return index_8.Create; } }); +var index_9 = require("../decode/index"); +Object.defineProperty(exports, "Decode", { enumerable: true, get: function () { return index_9.Decode; } }); +var index_10 = require("../default/index"); +Object.defineProperty(exports, "Default", { enumerable: true, get: function () { return index_10.Default; } }); +var index_11 = require("../delta/index"); +Object.defineProperty(exports, "Diff", { enumerable: true, get: function () { return index_11.Diff; } }); +Object.defineProperty(exports, "Patch", { enumerable: true, get: function () { return index_11.Patch; } }); +Object.defineProperty(exports, "Edit", { enumerable: true, get: function () { return index_11.Edit; } }); +var index_12 = require("../encode/index"); +Object.defineProperty(exports, "Encode", { enumerable: true, get: function () { return index_12.Encode; } }); +var index_13 = require("../equal/index"); +Object.defineProperty(exports, "Equal", { enumerable: true, get: function () { return index_13.Equal; } }); +var index_14 = require("../hash/index"); +Object.defineProperty(exports, "Hash", { enumerable: true, get: function () { return index_14.Hash; } }); +var index_15 = require("../mutate/index"); +Object.defineProperty(exports, "Mutate", { enumerable: true, get: function () { return index_15.Mutate; } }); +var index_16 = require("../parse/index"); +Object.defineProperty(exports, "Parse", { enumerable: true, get: function () { return index_16.Parse; } }); diff --git a/node_modules/@sinclair/typebox/build/esm/compiler/compiler.d.mts b/node_modules/@sinclair/typebox/build/esm/compiler/compiler.d.mts new file mode 100644 index 00000000..eebbffa0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/compiler/compiler.d.mts @@ -0,0 +1,55 @@ +import { ValueErrorIterator } from '../errors/index.mjs'; +import { TypeBoxError } from '../type/error/index.mjs'; +import type { TSchema } from '../type/schema/index.mjs'; +import type { Static, StaticDecode, StaticEncode } from '../type/static/index.mjs'; +export type CheckFunction = (value: unknown) => boolean; +export declare class TypeCheck { + private readonly schema; + private readonly references; + private readonly checkFunc; + private readonly code; + private readonly hasTransform; + constructor(schema: T, references: TSchema[], checkFunc: CheckFunction, code: string); + /** Returns the generated assertion code used to validate this type. */ + Code(): string; + /** Returns the schema type used to validate */ + Schema(): T; + /** Returns reference types used to validate */ + References(): TSchema[]; + /** Returns an iterator for each error in this value. */ + Errors(value: unknown): ValueErrorIterator; + /** Returns true if the value matches the compiled type. */ + Check(value: unknown): value is Static; + /** Decodes a value or throws if error */ + Decode, Result extends Static = Static>(value: unknown): Result; + /** Encodes a value or throws if error */ + Encode, Result extends Static = Static>(value: unknown): Result; +} +export declare class TypeCompilerUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare class TypeCompilerTypeGuardError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare namespace Policy { + function IsExactOptionalProperty(value: string, key: string, expression: string): string; + function IsObjectLike(value: string): string; + function IsRecordLike(value: string): string; + function IsNumberLike(value: string): string; + function IsVoidLike(value: string): string; +} +export type TypeCompilerLanguageOption = 'typescript' | 'javascript'; +export interface TypeCompilerCodegenOptions { + language?: TypeCompilerLanguageOption; +} +/** Compiles Types for Runtime Type Checking */ +export declare namespace TypeCompiler { + /** Generates the code used to assert this type and returns it as a string */ + function Code(schema: T, references: TSchema[], options?: TypeCompilerCodegenOptions): string; + /** Generates the code used to assert this type and returns it as a string */ + function Code(schema: T, options?: TypeCompilerCodegenOptions): string; + /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */ + function Compile(schema: T, references?: TSchema[]): TypeCheck; +} diff --git a/node_modules/@sinclair/typebox/build/esm/compiler/compiler.mjs b/node_modules/@sinclair/typebox/build/esm/compiler/compiler.mjs new file mode 100644 index 00000000..d7936f90 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/compiler/compiler.mjs @@ -0,0 +1,662 @@ +import { TransformEncode, TransformDecode, HasTransform, TransformDecodeCheckError, TransformEncodeCheckError } from '../value/transform/index.mjs'; +import { Errors } from '../errors/index.mjs'; +import { TypeSystemPolicy } from '../system/index.mjs'; +import { TypeBoxError } from '../type/error/index.mjs'; +import { Deref } from '../value/deref/index.mjs'; +import { Hash } from '../value/hash/index.mjs'; +import { Kind } from '../type/symbols/index.mjs'; +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs'; +import { KeyOfPattern } from '../type/keyof/index.mjs'; +import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs'; +import { Never } from '../type/never/index.mjs'; +import { Ref } from '../type/ref/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsString, IsNumber, IsBigInt } from '../value/guard/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsSchema } from '../type/guard/type.mjs'; +// ------------------------------------------------------------------ +// TypeCheck +// ------------------------------------------------------------------ +export class TypeCheck { + constructor(schema, references, checkFunc, code) { + this.schema = schema; + this.references = references; + this.checkFunc = checkFunc; + this.code = code; + this.hasTransform = HasTransform(schema, references); + } + /** Returns the generated assertion code used to validate this type. */ + Code() { + return this.code; + } + /** Returns the schema type used to validate */ + Schema() { + return this.schema; + } + /** Returns reference types used to validate */ + References() { + return this.references; + } + /** Returns an iterator for each error in this value. */ + Errors(value) { + return Errors(this.schema, this.references, value); + } + /** Returns true if the value matches the compiled type. */ + Check(value) { + return this.checkFunc(value); + } + /** Decodes a value or throws if error */ + Decode(value) { + if (!this.checkFunc(value)) + throw new TransformDecodeCheckError(this.schema, value, this.Errors(value).First()); + return (this.hasTransform ? TransformDecode(this.schema, this.references, value) : value); + } + /** Encodes a value or throws if error */ + Encode(value) { + const encoded = this.hasTransform ? TransformEncode(this.schema, this.references, value) : value; + if (!this.checkFunc(encoded)) + throw new TransformEncodeCheckError(this.schema, value, this.Errors(value).First()); + return encoded; + } +} +// ------------------------------------------------------------------ +// Character +// ------------------------------------------------------------------ +var Character; +(function (Character) { + function DollarSign(code) { + return code === 36; + } + Character.DollarSign = DollarSign; + function IsUnderscore(code) { + return code === 95; + } + Character.IsUnderscore = IsUnderscore; + function IsAlpha(code) { + return (code >= 65 && code <= 90) || (code >= 97 && code <= 122); + } + Character.IsAlpha = IsAlpha; + function IsNumeric(code) { + return code >= 48 && code <= 57; + } + Character.IsNumeric = IsNumeric; +})(Character || (Character = {})); +// ------------------------------------------------------------------ +// MemberExpression +// ------------------------------------------------------------------ +var MemberExpression; +(function (MemberExpression) { + function IsFirstCharacterNumeric(value) { + if (value.length === 0) + return false; + return Character.IsNumeric(value.charCodeAt(0)); + } + function IsAccessor(value) { + if (IsFirstCharacterNumeric(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + const check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code); + if (!check) + return false; + } + return true; + } + function EscapeHyphen(key) { + return key.replace(/'/g, "\\'"); + } + function Encode(object, key) { + return IsAccessor(key) ? `${object}.${key}` : `${object}['${EscapeHyphen(key)}']`; + } + MemberExpression.Encode = Encode; +})(MemberExpression || (MemberExpression = {})); +// ------------------------------------------------------------------ +// Identifier +// ------------------------------------------------------------------ +var Identifier; +(function (Identifier) { + function Encode($id) { + const buffer = []; + for (let i = 0; i < $id.length; i++) { + const code = $id.charCodeAt(i); + if (Character.IsNumeric(code) || Character.IsAlpha(code)) { + buffer.push($id.charAt(i)); + } + else { + buffer.push(`_${code}_`); + } + } + return buffer.join('').replace(/__/g, '_'); + } + Identifier.Encode = Encode; +})(Identifier || (Identifier = {})); +// ------------------------------------------------------------------ +// LiteralString +// ------------------------------------------------------------------ +var LiteralString; +(function (LiteralString) { + function Escape(content) { + return content.replace(/'/g, "\\'"); + } + LiteralString.Escape = Escape; +})(LiteralString || (LiteralString = {})); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class TypeCompilerUnknownTypeError extends TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +export class TypeCompilerTypeGuardError extends TypeBoxError { + constructor(schema) { + super('Preflight validation check failed to guard for the given schema'); + this.schema = schema; + } +} +// ------------------------------------------------------------------ +// Policy +// ------------------------------------------------------------------ +export var Policy; +(function (Policy) { + function IsExactOptionalProperty(value, key, expression) { + return TypeSystemPolicy.ExactOptionalPropertyTypes ? `('${key}' in ${value} ? ${expression} : true)` : `(${MemberExpression.Encode(value, key)} !== undefined ? ${expression} : true)`; + } + Policy.IsExactOptionalProperty = IsExactOptionalProperty; + function IsObjectLike(value) { + return !TypeSystemPolicy.AllowArrayObject ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}))` : `(typeof ${value} === 'object' && ${value} !== null)`; + } + Policy.IsObjectLike = IsObjectLike; + function IsRecordLike(value) { + return !TypeSystemPolicy.AllowArrayObject + ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}) && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))` + : `(typeof ${value} === 'object' && ${value} !== null && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`; + } + Policy.IsRecordLike = IsRecordLike; + function IsNumberLike(value) { + return TypeSystemPolicy.AllowNaN ? `typeof ${value} === 'number'` : `Number.isFinite(${value})`; + } + Policy.IsNumberLike = IsNumberLike; + function IsVoidLike(value) { + return TypeSystemPolicy.AllowNullVoid ? `(${value} === undefined || ${value} === null)` : `${value} === undefined`; + } + Policy.IsVoidLike = IsVoidLike; +})(Policy || (Policy = {})); +/** Compiles Types for Runtime Type Checking */ +export var TypeCompiler; +(function (TypeCompiler) { + // ---------------------------------------------------------------- + // Guards + // ---------------------------------------------------------------- + function IsAnyOrUnknown(schema) { + return schema[Kind] === 'Any' || schema[Kind] === 'Unknown'; + } + // ---------------------------------------------------------------- + // Types + // ---------------------------------------------------------------- + function* FromAny(schema, references, value) { + yield 'true'; + } + function* FromArgument(schema, references, value) { + yield 'true'; + } + function* FromArray(schema, references, value) { + yield `Array.isArray(${value})`; + const [parameter, accumulator] = [CreateParameter('value', 'any'), CreateParameter('acc', 'number')]; + if (IsNumber(schema.maxItems)) + yield `${value}.length <= ${schema.maxItems}`; + if (IsNumber(schema.minItems)) + yield `${value}.length >= ${schema.minItems}`; + const elementExpression = CreateExpression(schema.items, references, 'value'); + yield `${value}.every((${parameter}) => ${elementExpression})`; + if (IsSchema(schema.contains) || IsNumber(schema.minContains) || IsNumber(schema.maxContains)) { + const containsSchema = IsSchema(schema.contains) ? schema.contains : Never(); + const checkExpression = CreateExpression(containsSchema, references, 'value'); + const checkMinContains = IsNumber(schema.minContains) ? [`(count >= ${schema.minContains})`] : []; + const checkMaxContains = IsNumber(schema.maxContains) ? [`(count <= ${schema.maxContains})`] : []; + const checkCount = `const count = value.reduce((${accumulator}, ${parameter}) => ${checkExpression} ? acc + 1 : acc, 0)`; + const check = [`(count > 0)`, ...checkMinContains, ...checkMaxContains].join(' && '); + yield `((${parameter}) => { ${checkCount}; return ${check}})(${value})`; + } + if (schema.uniqueItems === true) { + const check = `const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true`; + const block = `const set = new Set(); for(const element of value) { ${check} }`; + yield `((${parameter}) => { ${block} )(${value})`; + } + } + function* FromAsyncIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.asyncIterator in ${value})`; + } + function* FromBigInt(schema, references, value) { + yield `(typeof ${value} === 'bigint')`; + if (IsBigInt(schema.exclusiveMaximum)) + yield `${value} < BigInt(${schema.exclusiveMaximum})`; + if (IsBigInt(schema.exclusiveMinimum)) + yield `${value} > BigInt(${schema.exclusiveMinimum})`; + if (IsBigInt(schema.maximum)) + yield `${value} <= BigInt(${schema.maximum})`; + if (IsBigInt(schema.minimum)) + yield `${value} >= BigInt(${schema.minimum})`; + if (IsBigInt(schema.multipleOf)) + yield `(${value} % BigInt(${schema.multipleOf})) === 0`; + } + function* FromBoolean(schema, references, value) { + yield `(typeof ${value} === 'boolean')`; + } + function* FromConstructor(schema, references, value) { + yield* Visit(schema.returns, references, `${value}.prototype`); + } + function* FromDate(schema, references, value) { + yield `(${value} instanceof Date) && Number.isFinite(${value}.getTime())`; + if (IsNumber(schema.exclusiveMaximumTimestamp)) + yield `${value}.getTime() < ${schema.exclusiveMaximumTimestamp}`; + if (IsNumber(schema.exclusiveMinimumTimestamp)) + yield `${value}.getTime() > ${schema.exclusiveMinimumTimestamp}`; + if (IsNumber(schema.maximumTimestamp)) + yield `${value}.getTime() <= ${schema.maximumTimestamp}`; + if (IsNumber(schema.minimumTimestamp)) + yield `${value}.getTime() >= ${schema.minimumTimestamp}`; + if (IsNumber(schema.multipleOfTimestamp)) + yield `(${value}.getTime() % ${schema.multipleOfTimestamp}) === 0`; + } + function* FromFunction(schema, references, value) { + yield `(typeof ${value} === 'function')`; + } + function* FromImport(schema, references, value) { + const members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => { + return [...result, schema.$defs[key]]; + }, []); + yield* Visit(Ref(schema.$ref), [...references, ...members], value); + } + function* FromInteger(schema, references, value) { + yield `Number.isInteger(${value})`; + if (IsNumber(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if (IsNumber(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if (IsNumber(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if (IsNumber(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if (IsNumber(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* FromIntersect(schema, references, value) { + const check1 = schema.allOf.map((schema) => CreateExpression(schema, references, value)).join(' && '); + if (schema.unevaluatedProperties === false) { + const keyCheck = CreateVariable(`${new RegExp(KeyOfPattern(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key))`; + yield `(${check1} && ${check2})`; + } + else if (IsSchema(schema.unevaluatedProperties)) { + const keyCheck = CreateVariable(`${new RegExp(KeyOfPattern(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key) || ${CreateExpression(schema.unevaluatedProperties, references, `${value}[key]`)})`; + yield `(${check1} && ${check2})`; + } + else { + yield `(${check1})`; + } + } + function* FromIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.iterator in ${value})`; + } + function* FromLiteral(schema, references, value) { + if (typeof schema.const === 'number' || typeof schema.const === 'boolean') { + yield `(${value} === ${schema.const})`; + } + else { + yield `(${value} === '${LiteralString.Escape(schema.const)}')`; + } + } + function* FromNever(schema, references, value) { + yield `false`; + } + function* FromNot(schema, references, value) { + const expression = CreateExpression(schema.not, references, value); + yield `(!${expression})`; + } + function* FromNull(schema, references, value) { + yield `(${value} === null)`; + } + function* FromNumber(schema, references, value) { + yield Policy.IsNumberLike(value); + if (IsNumber(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if (IsNumber(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if (IsNumber(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if (IsNumber(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if (IsNumber(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* FromObject(schema, references, value) { + yield Policy.IsObjectLike(value); + if (IsNumber(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if (IsNumber(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const memberExpression = MemberExpression.Encode(value, knownKey); + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, memberExpression); + if (ExtendsUndefinedCheck(property) || IsAnyOrUnknown(property)) + yield `('${knownKey}' in ${value})`; + } + else { + const expression = CreateExpression(property, references, memberExpression); + yield Policy.IsExactOptionalProperty(value, knownKey, expression); + } + } + if (schema.additionalProperties === false) { + if (schema.required && schema.required.length === knownKeys.length) { + yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`; + } + else { + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`; + } + } + if (typeof schema.additionalProperties === 'object') { + const expression = CreateExpression(schema.additionalProperties, references, `${value}[key]`); + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`; + } + } + function* FromPromise(schema, references, value) { + yield `${value} instanceof Promise`; + } + function* FromRecord(schema, references, value) { + yield Policy.IsRecordLike(value); + if (IsNumber(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if (IsNumber(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const variable = CreateVariable(`${new RegExp(patternKey)}`); + const check1 = CreateExpression(patternSchema, references, 'value'); + const check2 = IsSchema(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true'; + const expression = `(${variable}.test(key) ? ${check1} : ${check2})`; + yield `(Object.entries(${value}).every(([key, value]) => ${expression}))`; + } + function* FromRef(schema, references, value) { + const target = Deref(schema, references); + // Reference: If we have seen this reference before we can just yield and return the function call. + // If this isn't the case we defer to visit to generate and set the function for subsequent passes. + if (state.functions.has(schema.$ref)) + return yield `${CreateFunctionName(schema.$ref)}(${value})`; + yield* Visit(target, references, value); + } + function* FromRegExp(schema, references, value) { + const variable = CreateVariable(`${new RegExp(schema.source, schema.flags)};`); + yield `(typeof ${value} === 'string')`; + if (IsNumber(schema.maxLength)) + yield `${value}.length <= ${schema.maxLength}`; + if (IsNumber(schema.minLength)) + yield `${value}.length >= ${schema.minLength}`; + yield `${variable}.test(${value})`; + } + function* FromString(schema, references, value) { + yield `(typeof ${value} === 'string')`; + if (IsNumber(schema.maxLength)) + yield `${value}.length <= ${schema.maxLength}`; + if (IsNumber(schema.minLength)) + yield `${value}.length >= ${schema.minLength}`; + if (schema.pattern !== undefined) { + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + if (schema.format !== undefined) { + yield `format('${schema.format}', ${value})`; + } + } + function* FromSymbol(schema, references, value) { + yield `(typeof ${value} === 'symbol')`; + } + function* FromTemplateLiteral(schema, references, value) { + yield `(typeof ${value} === 'string')`; + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + function* FromThis(schema, references, value) { + // Note: This types are assured to be hoisted prior to this call. Just yield the function. + yield `${CreateFunctionName(schema.$ref)}(${value})`; + } + function* FromTuple(schema, references, value) { + yield `Array.isArray(${value})`; + if (schema.items === undefined) + return yield `${value}.length === 0`; + yield `(${value}.length === ${schema.maxItems})`; + for (let i = 0; i < schema.items.length; i++) { + const expression = CreateExpression(schema.items[i], references, `${value}[${i}]`); + yield `${expression}`; + } + } + function* FromUndefined(schema, references, value) { + yield `${value} === undefined`; + } + function* FromUnion(schema, references, value) { + const expressions = schema.anyOf.map((schema) => CreateExpression(schema, references, value)); + yield `(${expressions.join(' || ')})`; + } + function* FromUint8Array(schema, references, value) { + yield `${value} instanceof Uint8Array`; + if (IsNumber(schema.maxByteLength)) + yield `(${value}.length <= ${schema.maxByteLength})`; + if (IsNumber(schema.minByteLength)) + yield `(${value}.length >= ${schema.minByteLength})`; + } + function* FromUnknown(schema, references, value) { + yield 'true'; + } + function* FromVoid(schema, references, value) { + yield Policy.IsVoidLike(value); + } + function* FromKind(schema, references, value) { + const instance = state.instances.size; + state.instances.set(instance, schema); + yield `kind('${schema[Kind]}', ${instance}, ${value})`; + } + function* Visit(schema, references, value, useHoisting = true) { + const references_ = IsString(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + // -------------------------------------------------------------- + // Hoisting + // -------------------------------------------------------------- + if (useHoisting && IsString(schema.$id)) { + const functionName = CreateFunctionName(schema.$id); + if (state.functions.has(functionName)) { + return yield `${functionName}(${value})`; + } + else { + // Note: In the case of cyclic types, we need to create a 'functions' record + // to prevent infinitely re-visiting the CreateFunction. Subsequent attempts + // to visit will be caught by the above condition. + state.functions.set(functionName, ''); + const functionCode = CreateFunction(functionName, schema, references, 'value', false); + state.functions.set(functionName, functionCode); + return yield `${functionName}(${value})`; + } + } + switch (schema_[Kind]) { + case 'Any': + return yield* FromAny(schema_, references_, value); + case 'Argument': + return yield* FromArgument(schema_, references_, value); + case 'Array': + return yield* FromArray(schema_, references_, value); + case 'AsyncIterator': + return yield* FromAsyncIterator(schema_, references_, value); + case 'BigInt': + return yield* FromBigInt(schema_, references_, value); + case 'Boolean': + return yield* FromBoolean(schema_, references_, value); + case 'Constructor': + return yield* FromConstructor(schema_, references_, value); + case 'Date': + return yield* FromDate(schema_, references_, value); + case 'Function': + return yield* FromFunction(schema_, references_, value); + case 'Import': + return yield* FromImport(schema_, references_, value); + case 'Integer': + return yield* FromInteger(schema_, references_, value); + case 'Intersect': + return yield* FromIntersect(schema_, references_, value); + case 'Iterator': + return yield* FromIterator(schema_, references_, value); + case 'Literal': + return yield* FromLiteral(schema_, references_, value); + case 'Never': + return yield* FromNever(schema_, references_, value); + case 'Not': + return yield* FromNot(schema_, references_, value); + case 'Null': + return yield* FromNull(schema_, references_, value); + case 'Number': + return yield* FromNumber(schema_, references_, value); + case 'Object': + return yield* FromObject(schema_, references_, value); + case 'Promise': + return yield* FromPromise(schema_, references_, value); + case 'Record': + return yield* FromRecord(schema_, references_, value); + case 'Ref': + return yield* FromRef(schema_, references_, value); + case 'RegExp': + return yield* FromRegExp(schema_, references_, value); + case 'String': + return yield* FromString(schema_, references_, value); + case 'Symbol': + return yield* FromSymbol(schema_, references_, value); + case 'TemplateLiteral': + return yield* FromTemplateLiteral(schema_, references_, value); + case 'This': + return yield* FromThis(schema_, references_, value); + case 'Tuple': + return yield* FromTuple(schema_, references_, value); + case 'Undefined': + return yield* FromUndefined(schema_, references_, value); + case 'Union': + return yield* FromUnion(schema_, references_, value); + case 'Uint8Array': + return yield* FromUint8Array(schema_, references_, value); + case 'Unknown': + return yield* FromUnknown(schema_, references_, value); + case 'Void': + return yield* FromVoid(schema_, references_, value); + default: + if (!TypeRegistry.Has(schema_[Kind])) + throw new TypeCompilerUnknownTypeError(schema); + return yield* FromKind(schema_, references_, value); + } + } + // ---------------------------------------------------------------- + // Compiler State + // ---------------------------------------------------------------- + // prettier-ignore + const state = { + language: 'javascript', // target language + functions: new Map(), // local functions + variables: new Map(), // local variables + instances: new Map() // exterior kind instances + }; + // ---------------------------------------------------------------- + // Compiler Factory + // ---------------------------------------------------------------- + function CreateExpression(schema, references, value, useHoisting = true) { + return `(${[...Visit(schema, references, value, useHoisting)].join(' && ')})`; + } + function CreateFunctionName($id) { + return `check_${Identifier.Encode($id)}`; + } + function CreateVariable(expression) { + const variableName = `local_${state.variables.size}`; + state.variables.set(variableName, `const ${variableName} = ${expression}`); + return variableName; + } + function CreateFunction(name, schema, references, value, useHoisting = true) { + const [newline, pad] = ['\n', (length) => ''.padStart(length, ' ')]; + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const expression = [...Visit(schema, references, value, useHoisting)].map((expression) => `${pad(4)}${expression}`).join(` &&${newline}`); + return `function ${name}(${parameter})${returns} {${newline}${pad(2)}return (${newline}${expression}${newline}${pad(2)})\n}`; + } + function CreateParameter(name, type) { + const annotation = state.language === 'typescript' ? `: ${type}` : ''; + return `${name}${annotation}`; + } + function CreateReturns(type) { + return state.language === 'typescript' ? `: ${type}` : ''; + } + // ---------------------------------------------------------------- + // Compile + // ---------------------------------------------------------------- + function Build(schema, references, options) { + const functionCode = CreateFunction('check', schema, references, 'value'); // will populate functions and variables + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const functions = [...state.functions.values()]; + const variables = [...state.variables.values()]; + // prettier-ignore + const checkFunction = IsString(schema.$id) // ensure top level schemas with $id's are hoisted + ? `return function check(${parameter})${returns} {\n return ${CreateFunctionName(schema.$id)}(value)\n}` + : `return ${functionCode}`; + return [...variables, ...functions, checkFunction].join('\n'); + } + /** Generates the code used to assert this type and returns it as a string */ + function Code(...args) { + const defaults = { language: 'javascript' }; + // prettier-ignore + const [schema, references, options] = (args.length === 2 && IsArray(args[1]) ? [args[0], args[1], defaults] : + args.length === 2 && !IsArray(args[1]) ? [args[0], [], args[1]] : + args.length === 3 ? [args[0], args[1], args[2]] : + args.length === 1 ? [args[0], [], defaults] : + [null, [], defaults]); + // compiler-reset + state.language = options.language; + state.variables.clear(); + state.functions.clear(); + state.instances.clear(); + if (!IsSchema(schema)) + throw new TypeCompilerTypeGuardError(schema); + for (const schema of references) + if (!IsSchema(schema)) + throw new TypeCompilerTypeGuardError(schema); + return Build(schema, references, options); + } + TypeCompiler.Code = Code; + /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */ + function Compile(schema, references = []) { + const generatedCode = Code(schema, references, { language: 'javascript' }); + const compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode); + const instances = new Map(state.instances); + function typeRegistryFunction(kind, instance, value) { + if (!TypeRegistry.Has(kind) || !instances.has(instance)) + return false; + const checkFunc = TypeRegistry.Get(kind); + const schema = instances.get(instance); + return checkFunc(schema, value); + } + function formatRegistryFunction(format, value) { + if (!FormatRegistry.Has(format)) + return false; + const checkFunc = FormatRegistry.Get(format); + return checkFunc(value); + } + function hashFunction(value) { + return Hash(value); + } + const checkFunction = compiledFunction(typeRegistryFunction, formatRegistryFunction, hashFunction); + return new TypeCheck(schema, references, checkFunction, generatedCode); + } + TypeCompiler.Compile = Compile; +})(TypeCompiler || (TypeCompiler = {})); diff --git a/node_modules/@sinclair/typebox/build/esm/compiler/index.d.mts b/node_modules/@sinclair/typebox/build/esm/compiler/index.d.mts new file mode 100644 index 00000000..9c511bc5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/compiler/index.d.mts @@ -0,0 +1,2 @@ +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index.mjs'; +export * from './compiler.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/compiler/index.mjs b/node_modules/@sinclair/typebox/build/esm/compiler/index.mjs new file mode 100644 index 00000000..680a4bdb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/compiler/index.mjs @@ -0,0 +1,2 @@ +export { ValueErrorType, ValueErrorIterator } from '../errors/index.mjs'; +export * from './compiler.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/errors/errors.d.mts b/node_modules/@sinclair/typebox/build/esm/errors/errors.d.mts new file mode 100644 index 00000000..4f506973 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/errors.d.mts @@ -0,0 +1,91 @@ +import { TypeBoxError } from '../type/error/index.mjs'; +import type { TSchema } from '../type/schema/index.mjs'; +export declare enum ValueErrorType { + ArrayContains = 0, + ArrayMaxContains = 1, + ArrayMaxItems = 2, + ArrayMinContains = 3, + ArrayMinItems = 4, + ArrayUniqueItems = 5, + Array = 6, + AsyncIterator = 7, + BigIntExclusiveMaximum = 8, + BigIntExclusiveMinimum = 9, + BigIntMaximum = 10, + BigIntMinimum = 11, + BigIntMultipleOf = 12, + BigInt = 13, + Boolean = 14, + DateExclusiveMaximumTimestamp = 15, + DateExclusiveMinimumTimestamp = 16, + DateMaximumTimestamp = 17, + DateMinimumTimestamp = 18, + DateMultipleOfTimestamp = 19, + Date = 20, + Function = 21, + IntegerExclusiveMaximum = 22, + IntegerExclusiveMinimum = 23, + IntegerMaximum = 24, + IntegerMinimum = 25, + IntegerMultipleOf = 26, + Integer = 27, + IntersectUnevaluatedProperties = 28, + Intersect = 29, + Iterator = 30, + Kind = 31, + Literal = 32, + Never = 33, + Not = 34, + Null = 35, + NumberExclusiveMaximum = 36, + NumberExclusiveMinimum = 37, + NumberMaximum = 38, + NumberMinimum = 39, + NumberMultipleOf = 40, + Number = 41, + ObjectAdditionalProperties = 42, + ObjectMaxProperties = 43, + ObjectMinProperties = 44, + ObjectRequiredProperty = 45, + Object = 46, + Promise = 47, + RegExp = 48, + StringFormatUnknown = 49, + StringFormat = 50, + StringMaxLength = 51, + StringMinLength = 52, + StringPattern = 53, + String = 54, + Symbol = 55, + TupleLength = 56, + Tuple = 57, + Uint8ArrayMaxByteLength = 58, + Uint8ArrayMinByteLength = 59, + Uint8Array = 60, + Undefined = 61, + Union = 62, + Void = 63 +} +export interface ValueError { + type: ValueErrorType; + schema: TSchema; + path: string; + value: unknown; + message: string; + errors: ValueErrorIterator[]; +} +export declare class ValueErrorsUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +export declare class ValueErrorIterator { + private readonly iterator; + constructor(iterator: IterableIterator); + [Symbol.iterator](): IterableIterator; + /** Returns the first value error or undefined if no errors */ + First(): ValueError | undefined; +} +/** Returns an iterator for each error in this value. */ +export declare function Errors(schema: T, references: TSchema[], value: unknown): ValueErrorIterator; +/** Returns an iterator for each error in this value. */ +export declare function Errors(schema: T, value: unknown): ValueErrorIterator; diff --git a/node_modules/@sinclair/typebox/build/esm/errors/errors.mjs b/node_modules/@sinclair/typebox/build/esm/errors/errors.mjs new file mode 100644 index 00000000..7525b75a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/errors.mjs @@ -0,0 +1,592 @@ +import { TypeSystemPolicy } from '../system/index.mjs'; +import { KeyOfPattern } from '../type/keyof/index.mjs'; +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs'; +import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs'; +import { GetErrorFunction } from './function.mjs'; +import { TypeBoxError } from '../type/error/index.mjs'; +import { Deref } from '../value/deref/index.mjs'; +import { Hash } from '../value/hash/index.mjs'; +import { Check } from '../value/check/index.mjs'; +import { Kind } from '../type/symbols/index.mjs'; +import { Never } from '../type/never/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +// prettier-ignore +import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../value/guard/index.mjs'; +// ------------------------------------------------------------------ +// ValueErrorType +// ------------------------------------------------------------------ +export var ValueErrorType; +(function (ValueErrorType) { + ValueErrorType[ValueErrorType["ArrayContains"] = 0] = "ArrayContains"; + ValueErrorType[ValueErrorType["ArrayMaxContains"] = 1] = "ArrayMaxContains"; + ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems"; + ValueErrorType[ValueErrorType["ArrayMinContains"] = 3] = "ArrayMinContains"; + ValueErrorType[ValueErrorType["ArrayMinItems"] = 4] = "ArrayMinItems"; + ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 5] = "ArrayUniqueItems"; + ValueErrorType[ValueErrorType["Array"] = 6] = "Array"; + ValueErrorType[ValueErrorType["AsyncIterator"] = 7] = "AsyncIterator"; + ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 8] = "BigIntExclusiveMaximum"; + ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 9] = "BigIntExclusiveMinimum"; + ValueErrorType[ValueErrorType["BigIntMaximum"] = 10] = "BigIntMaximum"; + ValueErrorType[ValueErrorType["BigIntMinimum"] = 11] = "BigIntMinimum"; + ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 12] = "BigIntMultipleOf"; + ValueErrorType[ValueErrorType["BigInt"] = 13] = "BigInt"; + ValueErrorType[ValueErrorType["Boolean"] = 14] = "Boolean"; + ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 15] = "DateExclusiveMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 16] = "DateExclusiveMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 17] = "DateMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 18] = "DateMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMultipleOfTimestamp"] = 19] = "DateMultipleOfTimestamp"; + ValueErrorType[ValueErrorType["Date"] = 20] = "Date"; + ValueErrorType[ValueErrorType["Function"] = 21] = "Function"; + ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 22] = "IntegerExclusiveMaximum"; + ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 23] = "IntegerExclusiveMinimum"; + ValueErrorType[ValueErrorType["IntegerMaximum"] = 24] = "IntegerMaximum"; + ValueErrorType[ValueErrorType["IntegerMinimum"] = 25] = "IntegerMinimum"; + ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 26] = "IntegerMultipleOf"; + ValueErrorType[ValueErrorType["Integer"] = 27] = "Integer"; + ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 28] = "IntersectUnevaluatedProperties"; + ValueErrorType[ValueErrorType["Intersect"] = 29] = "Intersect"; + ValueErrorType[ValueErrorType["Iterator"] = 30] = "Iterator"; + ValueErrorType[ValueErrorType["Kind"] = 31] = "Kind"; + ValueErrorType[ValueErrorType["Literal"] = 32] = "Literal"; + ValueErrorType[ValueErrorType["Never"] = 33] = "Never"; + ValueErrorType[ValueErrorType["Not"] = 34] = "Not"; + ValueErrorType[ValueErrorType["Null"] = 35] = "Null"; + ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 36] = "NumberExclusiveMaximum"; + ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 37] = "NumberExclusiveMinimum"; + ValueErrorType[ValueErrorType["NumberMaximum"] = 38] = "NumberMaximum"; + ValueErrorType[ValueErrorType["NumberMinimum"] = 39] = "NumberMinimum"; + ValueErrorType[ValueErrorType["NumberMultipleOf"] = 40] = "NumberMultipleOf"; + ValueErrorType[ValueErrorType["Number"] = 41] = "Number"; + ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 42] = "ObjectAdditionalProperties"; + ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 43] = "ObjectMaxProperties"; + ValueErrorType[ValueErrorType["ObjectMinProperties"] = 44] = "ObjectMinProperties"; + ValueErrorType[ValueErrorType["ObjectRequiredProperty"] = 45] = "ObjectRequiredProperty"; + ValueErrorType[ValueErrorType["Object"] = 46] = "Object"; + ValueErrorType[ValueErrorType["Promise"] = 47] = "Promise"; + ValueErrorType[ValueErrorType["RegExp"] = 48] = "RegExp"; + ValueErrorType[ValueErrorType["StringFormatUnknown"] = 49] = "StringFormatUnknown"; + ValueErrorType[ValueErrorType["StringFormat"] = 50] = "StringFormat"; + ValueErrorType[ValueErrorType["StringMaxLength"] = 51] = "StringMaxLength"; + ValueErrorType[ValueErrorType["StringMinLength"] = 52] = "StringMinLength"; + ValueErrorType[ValueErrorType["StringPattern"] = 53] = "StringPattern"; + ValueErrorType[ValueErrorType["String"] = 54] = "String"; + ValueErrorType[ValueErrorType["Symbol"] = 55] = "Symbol"; + ValueErrorType[ValueErrorType["TupleLength"] = 56] = "TupleLength"; + ValueErrorType[ValueErrorType["Tuple"] = 57] = "Tuple"; + ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 58] = "Uint8ArrayMaxByteLength"; + ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 59] = "Uint8ArrayMinByteLength"; + ValueErrorType[ValueErrorType["Uint8Array"] = 60] = "Uint8Array"; + ValueErrorType[ValueErrorType["Undefined"] = 61] = "Undefined"; + ValueErrorType[ValueErrorType["Union"] = 62] = "Union"; + ValueErrorType[ValueErrorType["Void"] = 63] = "Void"; +})(ValueErrorType || (ValueErrorType = {})); +// ------------------------------------------------------------------ +// ValueErrors +// ------------------------------------------------------------------ +export class ValueErrorsUnknownTypeError extends TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +// ------------------------------------------------------------------ +// EscapeKey +// ------------------------------------------------------------------ +function EscapeKey(key) { + return key.replace(/~/g, '~0').replace(/\//g, '~1'); // RFC6901 Path +} +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +function IsDefined(value) { + return value !== undefined; +} +// ------------------------------------------------------------------ +// ValueErrorIterator +// ------------------------------------------------------------------ +export class ValueErrorIterator { + constructor(iterator) { + this.iterator = iterator; + } + [Symbol.iterator]() { + return this.iterator; + } + /** Returns the first value error or undefined if no errors */ + First() { + const next = this.iterator.next(); + return next.done ? undefined : next.value; + } +} +// -------------------------------------------------------------------------- +// Create +// -------------------------------------------------------------------------- +function Create(errorType, schema, path, value, errors = []) { + return { + type: errorType, + schema, + path, + value, + message: GetErrorFunction()({ errorType, path, schema, value, errors }), + errors, + }; +} +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- +function* FromAny(schema, references, path, value) { } +function* FromArgument(schema, references, path, value) { } +function* FromArray(schema, references, path, value) { + if (!IsArray(value)) { + return yield Create(ValueErrorType.Array, schema, path, value); + } + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + yield Create(ValueErrorType.ArrayMinItems, schema, path, value); + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + yield Create(ValueErrorType.ArrayMaxItems, schema, path, value); + } + for (let i = 0; i < value.length; i++) { + yield* Visit(schema.items, references, `${path}/${i}`, value[i]); + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = Hash(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value); + } + // contains + if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) { + return; + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : Never(); + const containsCount = value.reduce((acc, value, index) => (Visit(containsSchema, references, `${path}${index}`, value).next().done === true ? acc + 1 : acc), 0); + if (containsCount === 0) { + yield Create(ValueErrorType.ArrayContains, schema, path, value); + } + if (IsNumber(schema.minContains) && containsCount < schema.minContains) { + yield Create(ValueErrorType.ArrayMinContains, schema, path, value); + } + if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) { + yield Create(ValueErrorType.ArrayMaxContains, schema, path, value); + } +} +function* FromAsyncIterator(schema, references, path, value) { + if (!IsAsyncIterator(value)) + yield Create(ValueErrorType.AsyncIterator, schema, path, value); +} +function* FromBigInt(schema, references, path, value) { + if (!IsBigInt(value)) + return yield Create(ValueErrorType.BigInt, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.BigIntMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.BigIntMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value); + } +} +function* FromBoolean(schema, references, path, value) { + if (!IsBoolean(value)) + yield Create(ValueErrorType.Boolean, schema, path, value); +} +function* FromConstructor(schema, references, path, value) { + yield* Visit(schema.returns, references, path, value.prototype); +} +function* FromDate(schema, references, path, value) { + if (!IsDate(value)) + return yield Create(ValueErrorType.Date, schema, path, value); + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value); + } +} +function* FromFunction(schema, references, path, value) { + if (!IsFunction(value)) + yield Create(ValueErrorType.Function, schema, path, value); +} +function* FromImport(schema, references, path, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + yield* Visit(target, [...references, ...definitions], path, value); +} +function* FromInteger(schema, references, path, value) { + if (!IsInteger(value)) + return yield Create(ValueErrorType.Integer, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.IntegerMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.IntegerMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value); + } +} +function* FromIntersect(schema, references, path, value) { + let hasError = false; + for (const inner of schema.allOf) { + for (const error of Visit(inner, references, path, value)) { + hasError = true; + yield error; + } + } + if (hasError) { + return yield Create(ValueErrorType.Intersect, schema, path, value); + } + if (schema.unevaluatedProperties === false) { + const keyCheck = new RegExp(KeyOfPattern(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value); + } + } + } + if (typeof schema.unevaluatedProperties === 'object') { + const keyCheck = new RegExp(KeyOfPattern(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next(); + if (!next.done) + yield next.value; // yield interior + } + } + } +} +function* FromIterator(schema, references, path, value) { + if (!IsIterator(value)) + yield Create(ValueErrorType.Iterator, schema, path, value); +} +function* FromLiteral(schema, references, path, value) { + if (!(value === schema.const)) + yield Create(ValueErrorType.Literal, schema, path, value); +} +function* FromNever(schema, references, path, value) { + yield Create(ValueErrorType.Never, schema, path, value); +} +function* FromNot(schema, references, path, value) { + if (Visit(schema.not, references, path, value).next().done === true) + yield Create(ValueErrorType.Not, schema, path, value); +} +function* FromNull(schema, references, path, value) { + if (!IsNull(value)) + yield Create(ValueErrorType.Null, schema, path, value); +} +function* FromNumber(schema, references, path, value) { + if (!TypeSystemPolicy.IsNumberLike(value)) + return yield Create(ValueErrorType.Number, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.NumberMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.NumberMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.NumberMultipleOf, schema, path, value); + } +} +function* FromObject(schema, references, path, value) { + if (!TypeSystemPolicy.IsObjectLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const requiredKeys = Array.isArray(schema.required) ? schema.required : []; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + const unknownKeys = Object.getOwnPropertyNames(value); + for (const requiredKey of requiredKeys) { + if (unknownKeys.includes(requiredKey)) + continue; + yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${EscapeKey(requiredKey)}`, undefined); + } + if (schema.additionalProperties === false) { + for (const valueKey of unknownKeys) { + if (!knownKeys.includes(valueKey)) { + yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(valueKey)}`, value[valueKey]); + } + } + } + if (typeof schema.additionalProperties === 'object') { + for (const valueKey of unknownKeys) { + if (knownKeys.includes(valueKey)) + continue; + yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(valueKey)}`, value[valueKey]); + } + } + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]); + if (ExtendsUndefinedCheck(schema) && !(knownKey in value)) { + yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${EscapeKey(knownKey)}`, undefined); + } + } + else { + if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) { + yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]); + } + } + } +} +function* FromPromise(schema, references, path, value) { + if (!IsPromise(value)) + yield Create(ValueErrorType.Promise, schema, path, value); +} +function* FromRecord(schema, references, path, value) { + if (!TypeSystemPolicy.IsRecordLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + yield* Visit(patternSchema, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + if (typeof schema.additionalProperties === 'object') { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (!regex.test(propertyKey)) + yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + } + if (schema.additionalProperties === false) { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + continue; + return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(propertyKey)}`, propertyValue); + } + } +} +function* FromRef(schema, references, path, value) { + yield* Visit(Deref(schema, references), references, path, value); +} +function* FromRegExp(schema, references, path, value) { + if (!IsString(value)) + return yield Create(ValueErrorType.String, schema, path, value); + if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { + yield Create(ValueErrorType.StringMinLength, schema, path, value); + } + if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { + yield Create(ValueErrorType.StringMaxLength, schema, path, value); + } + const regex = new RegExp(schema.source, schema.flags); + if (!regex.test(value)) { + return yield Create(ValueErrorType.RegExp, schema, path, value); + } +} +function* FromString(schema, references, path, value) { + if (!IsString(value)) + return yield Create(ValueErrorType.String, schema, path, value); + if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { + yield Create(ValueErrorType.StringMinLength, schema, path, value); + } + if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { + yield Create(ValueErrorType.StringMaxLength, schema, path, value); + } + if (IsString(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } + } + if (IsString(schema.format)) { + if (!FormatRegistry.Has(schema.format)) { + yield Create(ValueErrorType.StringFormatUnknown, schema, path, value); + } + else { + const format = FormatRegistry.Get(schema.format); + if (!format(value)) { + yield Create(ValueErrorType.StringFormat, schema, path, value); + } + } + } +} +function* FromSymbol(schema, references, path, value) { + if (!IsSymbol(value)) + yield Create(ValueErrorType.Symbol, schema, path, value); +} +function* FromTemplateLiteral(schema, references, path, value) { + if (!IsString(value)) + return yield Create(ValueErrorType.String, schema, path, value); + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } +} +function* FromThis(schema, references, path, value) { + yield* Visit(Deref(schema, references), references, path, value); +} +function* FromTuple(schema, references, path, value) { + if (!IsArray(value)) + return yield Create(ValueErrorType.Tuple, schema, path, value); + if (schema.items === undefined && !(value.length === 0)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!(value.length === schema.maxItems)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!schema.items) { + return; + } + for (let i = 0; i < schema.items.length; i++) { + yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]); + } +} +function* FromUndefined(schema, references, path, value) { + if (!IsUndefined(value)) + yield Create(ValueErrorType.Undefined, schema, path, value); +} +function* FromUnion(schema, references, path, value) { + if (Check(schema, references, value)) + return; + const errors = schema.anyOf.map((variant) => new ValueErrorIterator(Visit(variant, references, path, value))); + yield Create(ValueErrorType.Union, schema, path, value, errors); +} +function* FromUint8Array(schema, references, path, value) { + if (!IsUint8Array(value)) + return yield Create(ValueErrorType.Uint8Array, schema, path, value); + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value); + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value); + } +} +function* FromUnknown(schema, references, path, value) { } +function* FromVoid(schema, references, path, value) { + if (!TypeSystemPolicy.IsVoidLike(value)) + yield Create(ValueErrorType.Void, schema, path, value); +} +function* FromKind(schema, references, path, value) { + const check = TypeRegistry.Get(schema[Kind]); + if (!check(schema, value)) + yield Create(ValueErrorType.Kind, schema, path, value); +} +function* Visit(schema, references, path, value) { + const references_ = IsDefined(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema_[Kind]) { + case 'Any': + return yield* FromAny(schema_, references_, path, value); + case 'Argument': + return yield* FromArgument(schema_, references_, path, value); + case 'Array': + return yield* FromArray(schema_, references_, path, value); + case 'AsyncIterator': + return yield* FromAsyncIterator(schema_, references_, path, value); + case 'BigInt': + return yield* FromBigInt(schema_, references_, path, value); + case 'Boolean': + return yield* FromBoolean(schema_, references_, path, value); + case 'Constructor': + return yield* FromConstructor(schema_, references_, path, value); + case 'Date': + return yield* FromDate(schema_, references_, path, value); + case 'Function': + return yield* FromFunction(schema_, references_, path, value); + case 'Import': + return yield* FromImport(schema_, references_, path, value); + case 'Integer': + return yield* FromInteger(schema_, references_, path, value); + case 'Intersect': + return yield* FromIntersect(schema_, references_, path, value); + case 'Iterator': + return yield* FromIterator(schema_, references_, path, value); + case 'Literal': + return yield* FromLiteral(schema_, references_, path, value); + case 'Never': + return yield* FromNever(schema_, references_, path, value); + case 'Not': + return yield* FromNot(schema_, references_, path, value); + case 'Null': + return yield* FromNull(schema_, references_, path, value); + case 'Number': + return yield* FromNumber(schema_, references_, path, value); + case 'Object': + return yield* FromObject(schema_, references_, path, value); + case 'Promise': + return yield* FromPromise(schema_, references_, path, value); + case 'Record': + return yield* FromRecord(schema_, references_, path, value); + case 'Ref': + return yield* FromRef(schema_, references_, path, value); + case 'RegExp': + return yield* FromRegExp(schema_, references_, path, value); + case 'String': + return yield* FromString(schema_, references_, path, value); + case 'Symbol': + return yield* FromSymbol(schema_, references_, path, value); + case 'TemplateLiteral': + return yield* FromTemplateLiteral(schema_, references_, path, value); + case 'This': + return yield* FromThis(schema_, references_, path, value); + case 'Tuple': + return yield* FromTuple(schema_, references_, path, value); + case 'Undefined': + return yield* FromUndefined(schema_, references_, path, value); + case 'Union': + return yield* FromUnion(schema_, references_, path, value); + case 'Uint8Array': + return yield* FromUint8Array(schema_, references_, path, value); + case 'Unknown': + return yield* FromUnknown(schema_, references_, path, value); + case 'Void': + return yield* FromVoid(schema_, references_, path, value); + default: + if (!TypeRegistry.Has(schema_[Kind])) + throw new ValueErrorsUnknownTypeError(schema); + return yield* FromKind(schema_, references_, path, value); + } +} +/** Returns an iterator for each error in this value. */ +export function Errors(...args) { + const iterator = args.length === 3 ? Visit(args[0], args[1], '', args[2]) : Visit(args[0], [], '', args[1]); + return new ValueErrorIterator(iterator); +} diff --git a/node_modules/@sinclair/typebox/build/esm/errors/function.d.mts b/node_modules/@sinclair/typebox/build/esm/errors/function.d.mts new file mode 100644 index 00000000..b59f7b95 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/function.d.mts @@ -0,0 +1,21 @@ +import { TSchema } from '../type/schema/index.mjs'; +import { ValueErrorIterator, ValueErrorType } from './errors.mjs'; +/** Creates an error message using en-US as the default locale */ +export declare function DefaultErrorFunction(error: ErrorFunctionParameter): string; +export type ErrorFunctionParameter = { + /** The type of validation error */ + errorType: ValueErrorType; + /** The path of the error */ + path: string; + /** The schema associated with the error */ + schema: TSchema; + /** The value associated with the error */ + value: unknown; + /** Interior errors for this error */ + errors: ValueErrorIterator[]; +}; +export type ErrorFunction = (parameter: ErrorFunctionParameter) => string; +/** Sets the error function used to generate error messages. */ +export declare function SetErrorFunction(callback: ErrorFunction): void; +/** Gets the error function used to generate error messages */ +export declare function GetErrorFunction(): ErrorFunction; diff --git a/node_modules/@sinclair/typebox/build/esm/errors/function.mjs b/node_modules/@sinclair/typebox/build/esm/errors/function.mjs new file mode 100644 index 00000000..9bdabafa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/function.mjs @@ -0,0 +1,147 @@ +import { Kind } from '../type/symbols/index.mjs'; +import { ValueErrorType } from './errors.mjs'; +/** Creates an error message using en-US as the default locale */ +export function DefaultErrorFunction(error) { + switch (error.errorType) { + case ValueErrorType.ArrayContains: + return 'Expected array to contain at least one matching value'; + case ValueErrorType.ArrayMaxContains: + return `Expected array to contain no more than ${error.schema.maxContains} matching values`; + case ValueErrorType.ArrayMinContains: + return `Expected array to contain at least ${error.schema.minContains} matching values`; + case ValueErrorType.ArrayMaxItems: + return `Expected array length to be less or equal to ${error.schema.maxItems}`; + case ValueErrorType.ArrayMinItems: + return `Expected array length to be greater or equal to ${error.schema.minItems}`; + case ValueErrorType.ArrayUniqueItems: + return 'Expected array elements to be unique'; + case ValueErrorType.Array: + return 'Expected array'; + case ValueErrorType.AsyncIterator: + return 'Expected AsyncIterator'; + case ValueErrorType.BigIntExclusiveMaximum: + return `Expected bigint to be less than ${error.schema.exclusiveMaximum}`; + case ValueErrorType.BigIntExclusiveMinimum: + return `Expected bigint to be greater than ${error.schema.exclusiveMinimum}`; + case ValueErrorType.BigIntMaximum: + return `Expected bigint to be less or equal to ${error.schema.maximum}`; + case ValueErrorType.BigIntMinimum: + return `Expected bigint to be greater or equal to ${error.schema.minimum}`; + case ValueErrorType.BigIntMultipleOf: + return `Expected bigint to be a multiple of ${error.schema.multipleOf}`; + case ValueErrorType.BigInt: + return 'Expected bigint'; + case ValueErrorType.Boolean: + return 'Expected boolean'; + case ValueErrorType.DateExclusiveMinimumTimestamp: + return `Expected Date timestamp to be greater than ${error.schema.exclusiveMinimumTimestamp}`; + case ValueErrorType.DateExclusiveMaximumTimestamp: + return `Expected Date timestamp to be less than ${error.schema.exclusiveMaximumTimestamp}`; + case ValueErrorType.DateMinimumTimestamp: + return `Expected Date timestamp to be greater or equal to ${error.schema.minimumTimestamp}`; + case ValueErrorType.DateMaximumTimestamp: + return `Expected Date timestamp to be less or equal to ${error.schema.maximumTimestamp}`; + case ValueErrorType.DateMultipleOfTimestamp: + return `Expected Date timestamp to be a multiple of ${error.schema.multipleOfTimestamp}`; + case ValueErrorType.Date: + return 'Expected Date'; + case ValueErrorType.Function: + return 'Expected function'; + case ValueErrorType.IntegerExclusiveMaximum: + return `Expected integer to be less than ${error.schema.exclusiveMaximum}`; + case ValueErrorType.IntegerExclusiveMinimum: + return `Expected integer to be greater than ${error.schema.exclusiveMinimum}`; + case ValueErrorType.IntegerMaximum: + return `Expected integer to be less or equal to ${error.schema.maximum}`; + case ValueErrorType.IntegerMinimum: + return `Expected integer to be greater or equal to ${error.schema.minimum}`; + case ValueErrorType.IntegerMultipleOf: + return `Expected integer to be a multiple of ${error.schema.multipleOf}`; + case ValueErrorType.Integer: + return 'Expected integer'; + case ValueErrorType.IntersectUnevaluatedProperties: + return 'Unexpected property'; + case ValueErrorType.Intersect: + return 'Expected all values to match'; + case ValueErrorType.Iterator: + return 'Expected Iterator'; + case ValueErrorType.Literal: + return `Expected ${typeof error.schema.const === 'string' ? `'${error.schema.const}'` : error.schema.const}`; + case ValueErrorType.Never: + return 'Never'; + case ValueErrorType.Not: + return 'Value should not match'; + case ValueErrorType.Null: + return 'Expected null'; + case ValueErrorType.NumberExclusiveMaximum: + return `Expected number to be less than ${error.schema.exclusiveMaximum}`; + case ValueErrorType.NumberExclusiveMinimum: + return `Expected number to be greater than ${error.schema.exclusiveMinimum}`; + case ValueErrorType.NumberMaximum: + return `Expected number to be less or equal to ${error.schema.maximum}`; + case ValueErrorType.NumberMinimum: + return `Expected number to be greater or equal to ${error.schema.minimum}`; + case ValueErrorType.NumberMultipleOf: + return `Expected number to be a multiple of ${error.schema.multipleOf}`; + case ValueErrorType.Number: + return 'Expected number'; + case ValueErrorType.Object: + return 'Expected object'; + case ValueErrorType.ObjectAdditionalProperties: + return 'Unexpected property'; + case ValueErrorType.ObjectMaxProperties: + return `Expected object to have no more than ${error.schema.maxProperties} properties`; + case ValueErrorType.ObjectMinProperties: + return `Expected object to have at least ${error.schema.minProperties} properties`; + case ValueErrorType.ObjectRequiredProperty: + return 'Expected required property'; + case ValueErrorType.Promise: + return 'Expected Promise'; + case ValueErrorType.RegExp: + return 'Expected string to match regular expression'; + case ValueErrorType.StringFormatUnknown: + return `Unknown format '${error.schema.format}'`; + case ValueErrorType.StringFormat: + return `Expected string to match '${error.schema.format}' format`; + case ValueErrorType.StringMaxLength: + return `Expected string length less or equal to ${error.schema.maxLength}`; + case ValueErrorType.StringMinLength: + return `Expected string length greater or equal to ${error.schema.minLength}`; + case ValueErrorType.StringPattern: + return `Expected string to match '${error.schema.pattern}'`; + case ValueErrorType.String: + return 'Expected string'; + case ValueErrorType.Symbol: + return 'Expected symbol'; + case ValueErrorType.TupleLength: + return `Expected tuple to have ${error.schema.maxItems || 0} elements`; + case ValueErrorType.Tuple: + return 'Expected tuple'; + case ValueErrorType.Uint8ArrayMaxByteLength: + return `Expected byte length less or equal to ${error.schema.maxByteLength}`; + case ValueErrorType.Uint8ArrayMinByteLength: + return `Expected byte length greater or equal to ${error.schema.minByteLength}`; + case ValueErrorType.Uint8Array: + return 'Expected Uint8Array'; + case ValueErrorType.Undefined: + return 'Expected undefined'; + case ValueErrorType.Union: + return 'Expected union value'; + case ValueErrorType.Void: + return 'Expected void'; + case ValueErrorType.Kind: + return `Expected kind '${error.schema[Kind]}'`; + default: + return 'Unknown error type'; + } +} +/** Manages error message providers */ +let errorFunction = DefaultErrorFunction; +/** Sets the error function used to generate error messages. */ +export function SetErrorFunction(callback) { + errorFunction = callback; +} +/** Gets the error function used to generate error messages */ +export function GetErrorFunction() { + return errorFunction; +} diff --git a/node_modules/@sinclair/typebox/build/esm/errors/index.d.mts b/node_modules/@sinclair/typebox/build/esm/errors/index.d.mts new file mode 100644 index 00000000..1c886b00 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/index.d.mts @@ -0,0 +1,2 @@ +export * from './errors.mjs'; +export * from './function.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/errors/index.mjs b/node_modules/@sinclair/typebox/build/esm/errors/index.mjs new file mode 100644 index 00000000..1c886b00 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/errors/index.mjs @@ -0,0 +1,2 @@ +export * from './errors.mjs'; +export * from './function.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/index.d.mts b/node_modules/@sinclair/typebox/build/esm/index.d.mts new file mode 100644 index 00000000..5dafc757 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/index.d.mts @@ -0,0 +1,71 @@ +export * from './type/clone/index.mjs'; +export * from './type/create/index.mjs'; +export * from './type/error/index.mjs'; +export * from './type/guard/index.mjs'; +export * from './type/helpers/index.mjs'; +export * from './type/patterns/index.mjs'; +export * from './type/registry/index.mjs'; +export * from './type/sets/index.mjs'; +export * from './type/symbols/index.mjs'; +export * from './type/any/index.mjs'; +export * from './type/array/index.mjs'; +export * from './type/argument/index.mjs'; +export * from './type/async-iterator/index.mjs'; +export * from './type/awaited/index.mjs'; +export * from './type/bigint/index.mjs'; +export * from './type/boolean/index.mjs'; +export * from './type/composite/index.mjs'; +export * from './type/const/index.mjs'; +export * from './type/constructor/index.mjs'; +export * from './type/constructor-parameters/index.mjs'; +export * from './type/date/index.mjs'; +export * from './type/enum/index.mjs'; +export * from './type/exclude/index.mjs'; +export * from './type/extends/index.mjs'; +export * from './type/extract/index.mjs'; +export * from './type/function/index.mjs'; +export * from './type/indexed/index.mjs'; +export * from './type/instance-type/index.mjs'; +export * from './type/instantiate/index.mjs'; +export * from './type/integer/index.mjs'; +export * from './type/intersect/index.mjs'; +export * from './type/iterator/index.mjs'; +export * from './type/intrinsic/index.mjs'; +export * from './type/keyof/index.mjs'; +export * from './type/literal/index.mjs'; +export * from './type/module/index.mjs'; +export * from './type/mapped/index.mjs'; +export * from './type/never/index.mjs'; +export * from './type/not/index.mjs'; +export * from './type/null/index.mjs'; +export * from './type/number/index.mjs'; +export * from './type/object/index.mjs'; +export * from './type/omit/index.mjs'; +export * from './type/optional/index.mjs'; +export * from './type/parameters/index.mjs'; +export * from './type/partial/index.mjs'; +export * from './type/pick/index.mjs'; +export * from './type/promise/index.mjs'; +export * from './type/readonly/index.mjs'; +export * from './type/readonly-optional/index.mjs'; +export * from './type/record/index.mjs'; +export * from './type/recursive/index.mjs'; +export * from './type/ref/index.mjs'; +export * from './type/regexp/index.mjs'; +export * from './type/required/index.mjs'; +export * from './type/rest/index.mjs'; +export * from './type/return-type/index.mjs'; +export * from './type/schema/index.mjs'; +export * from './type/static/index.mjs'; +export * from './type/string/index.mjs'; +export * from './type/symbol/index.mjs'; +export * from './type/template-literal/index.mjs'; +export * from './type/transform/index.mjs'; +export * from './type/tuple/index.mjs'; +export * from './type/uint8array/index.mjs'; +export * from './type/undefined/index.mjs'; +export * from './type/union/index.mjs'; +export * from './type/unknown/index.mjs'; +export * from './type/unsafe/index.mjs'; +export * from './type/void/index.mjs'; +export * from './type/type/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/index.mjs b/node_modules/@sinclair/typebox/build/esm/index.mjs new file mode 100644 index 00000000..3e0498ae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/index.mjs @@ -0,0 +1,80 @@ +// ------------------------------------------------------------------ +// Infrastructure +// ------------------------------------------------------------------ +export * from './type/clone/index.mjs'; +export * from './type/create/index.mjs'; +export * from './type/error/index.mjs'; +export * from './type/guard/index.mjs'; +export * from './type/helpers/index.mjs'; +export * from './type/patterns/index.mjs'; +export * from './type/registry/index.mjs'; +export * from './type/sets/index.mjs'; +export * from './type/symbols/index.mjs'; +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +export * from './type/any/index.mjs'; +export * from './type/array/index.mjs'; +export * from './type/argument/index.mjs'; +export * from './type/async-iterator/index.mjs'; +export * from './type/awaited/index.mjs'; +export * from './type/bigint/index.mjs'; +export * from './type/boolean/index.mjs'; +export * from './type/composite/index.mjs'; +export * from './type/const/index.mjs'; +export * from './type/constructor/index.mjs'; +export * from './type/constructor-parameters/index.mjs'; +export * from './type/date/index.mjs'; +export * from './type/enum/index.mjs'; +export * from './type/exclude/index.mjs'; +export * from './type/extends/index.mjs'; +export * from './type/extract/index.mjs'; +export * from './type/function/index.mjs'; +export * from './type/indexed/index.mjs'; +export * from './type/instance-type/index.mjs'; +export * from './type/instantiate/index.mjs'; +export * from './type/integer/index.mjs'; +export * from './type/intersect/index.mjs'; +export * from './type/iterator/index.mjs'; +export * from './type/intrinsic/index.mjs'; +export * from './type/keyof/index.mjs'; +export * from './type/literal/index.mjs'; +export * from './type/module/index.mjs'; +export * from './type/mapped/index.mjs'; +export * from './type/never/index.mjs'; +export * from './type/not/index.mjs'; +export * from './type/null/index.mjs'; +export * from './type/number/index.mjs'; +export * from './type/object/index.mjs'; +export * from './type/omit/index.mjs'; +export * from './type/optional/index.mjs'; +export * from './type/parameters/index.mjs'; +export * from './type/partial/index.mjs'; +export * from './type/pick/index.mjs'; +export * from './type/promise/index.mjs'; +export * from './type/readonly/index.mjs'; +export * from './type/readonly-optional/index.mjs'; +export * from './type/record/index.mjs'; +export * from './type/recursive/index.mjs'; +export * from './type/ref/index.mjs'; +export * from './type/regexp/index.mjs'; +export * from './type/required/index.mjs'; +export * from './type/rest/index.mjs'; +export * from './type/return-type/index.mjs'; +export * from './type/schema/index.mjs'; +export * from './type/static/index.mjs'; +export * from './type/string/index.mjs'; +export * from './type/symbol/index.mjs'; +export * from './type/template-literal/index.mjs'; +export * from './type/transform/index.mjs'; +export * from './type/tuple/index.mjs'; +export * from './type/uint8array/index.mjs'; +export * from './type/undefined/index.mjs'; +export * from './type/union/index.mjs'; +export * from './type/unknown/index.mjs'; +export * from './type/unsafe/index.mjs'; +export * from './type/void/index.mjs'; +// ------------------------------------------------------------------ +// Type.* +// ------------------------------------------------------------------ +export * from './type/type/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/index.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/index.d.mts new file mode 100644 index 00000000..4321a7b5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/index.d.mts @@ -0,0 +1,2 @@ +export * as Runtime from './runtime/index.mjs'; +export * as Static from './static/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/index.mjs b/node_modules/@sinclair/typebox/build/esm/parser/index.mjs new file mode 100644 index 00000000..4321a7b5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/index.mjs @@ -0,0 +1,2 @@ +export * as Runtime from './runtime/index.mjs'; +export * as Static from './static/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.d.mts new file mode 100644 index 00000000..1a547cdf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.d.mts @@ -0,0 +1,23 @@ +import { IArray, IConst, IContext, IIdent, INumber, IOptional, IRef, IString, ITuple, IUnion } from './types.mjs'; +/** Returns true if the value is a Array Parser */ +export declare function IsArray(value: unknown): value is IArray; +/** Returns true if the value is a Const Parser */ +export declare function IsConst(value: unknown): value is IConst; +/** Returns true if the value is a Context Parser */ +export declare function IsContext(value: unknown): value is IContext; +/** Returns true if the value is a Ident Parser */ +export declare function IsIdent(value: unknown): value is IIdent; +/** Returns true if the value is a Number Parser */ +export declare function IsNumber(value: unknown): value is INumber; +/** Returns true if the value is a Optional Parser */ +export declare function IsOptional(value: unknown): value is IOptional; +/** Returns true if the value is a Ref Parser */ +export declare function IsRef(value: unknown): value is IRef; +/** Returns true if the value is a String Parser */ +export declare function IsString(value: unknown): value is IString; +/** Returns true if the value is a Tuple Parser */ +export declare function IsTuple(value: unknown): value is ITuple; +/** Returns true if the value is a Union Parser */ +export declare function IsUnion(value: unknown): value is IUnion; +/** Returns true if the value is a Parser */ +export declare function IsParser(value: unknown): value is IContext | IUnion | IArray | IConst | IIdent | INumber | IOptional | IRef | IString | ITuple; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.mjs new file mode 100644 index 00000000..73446ccc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/guard.mjs @@ -0,0 +1,72 @@ +// ------------------------------------------------------------------ +// Value Guard +// ------------------------------------------------------------------ +// prettier-ignore +function HasPropertyKey(value, key) { + return key in value; +} +// prettier-ignore +function IsObjectValue(value) { + return typeof value === 'object' && value !== null; +} +// prettier-ignore +function IsArrayValue(value) { + return globalThis.Array.isArray(value); +} +// ------------------------------------------------------------------ +// Parser Guard +// ------------------------------------------------------------------ +/** Returns true if the value is a Array Parser */ +export function IsArray(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Array' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser); +} +/** Returns true if the value is a Const Parser */ +export function IsConst(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Const' && HasPropertyKey(value, 'value') && typeof value.value === 'string'; +} +/** Returns true if the value is a Context Parser */ +export function IsContext(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Context' && HasPropertyKey(value, 'left') && IsParser(value.left) && HasPropertyKey(value, 'right') && IsParser(value.right); +} +/** Returns true if the value is a Ident Parser */ +export function IsIdent(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ident'; +} +/** Returns true if the value is a Number Parser */ +export function IsNumber(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Number'; +} +/** Returns true if the value is a Optional Parser */ +export function IsOptional(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Optional' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser); +} +/** Returns true if the value is a Ref Parser */ +export function IsRef(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ref' && HasPropertyKey(value, 'ref') && typeof value.ref === 'string'; +} +/** Returns true if the value is a String Parser */ +export function IsString(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'String' && HasPropertyKey(value, 'options') && IsArrayValue(value.options); +} +/** Returns true if the value is a Tuple Parser */ +export function IsTuple(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Tuple' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers); +} +/** Returns true if the value is a Union Parser */ +export function IsUnion(value) { + return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Union' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers); +} +/** Returns true if the value is a Parser */ +export function IsParser(value) { + // prettier-ignore + return (IsArray(value) || + IsConst(value) || + IsContext(value) || + IsIdent(value) || + IsNumber(value) || + IsOptional(value) || + IsRef(value) || + IsString(value) || + IsTuple(value) || + IsUnion(value)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.d.mts new file mode 100644 index 00000000..67ae62fc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.d.mts @@ -0,0 +1,5 @@ +export * as Guard from './guard.mjs'; +export * as Token from './token.mjs'; +export * from './types.mjs'; +export * from './module.mjs'; +export * from './parse.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.mjs new file mode 100644 index 00000000..67ae62fc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/index.mjs @@ -0,0 +1,5 @@ +export * as Guard from './guard.mjs'; +export * as Token from './token.mjs'; +export * from './types.mjs'; +export * from './module.mjs'; +export * from './parse.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.d.mts new file mode 100644 index 00000000..fb538f67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.d.mts @@ -0,0 +1,9 @@ +import * as Types from './types.mjs'; +export declare class Module { + private readonly properties; + constructor(properties: Properties); + /** Parses using one of the parsers defined on this instance */ + Parse(key: Key, content: string, context: unknown): [] | [Types.StaticParser, string]; + /** Parses using one of the parsers defined on this instance */ + Parse(key: Key, content: string): [] | [Types.StaticParser, string]; +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.mjs new file mode 100644 index 00000000..7f9d017d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/module.mjs @@ -0,0 +1,17 @@ +import { Parse } from './parse.mjs'; +// ------------------------------------------------------------------ +// Module +// ------------------------------------------------------------------ +export class Module { + constructor(properties) { + this.properties = properties; + } + /** Parses using one of the parsers defined on this instance */ + Parse(...args) { + // prettier-ignore + const [key, content, context] = (args.length === 3 ? [args[0], args[1], args[2]] : + args.length === 2 ? [args[0], args[1], undefined] : + (() => { throw Error('Invalid parse arguments'); })()); + return Parse(this.properties, this.properties[key], content, context); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.d.mts new file mode 100644 index 00000000..054efa3e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.d.mts @@ -0,0 +1,9 @@ +import * as Types from './types.mjs'; +/** Parses content using the given Parser */ +export declare function Parse(moduleProperties: Types.IModuleProperties, parser: Parser, code: string, context: unknown): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(moduleProperties: Types.IModuleProperties, parser: Parser, code: string): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(parser: Parser, content: string, context: unknown): [] | [Types.StaticParser, string]; +/** Parses content using the given Parser */ +export declare function Parse(parser: Parser, content: string): [] | [Types.StaticParser, string]; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.mjs new file mode 100644 index 00000000..62a8a627 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/parse.mjs @@ -0,0 +1,123 @@ +import * as Guard from './guard.mjs'; +import * as Token from './token.mjs'; +// ------------------------------------------------------------------ +// Context +// ------------------------------------------------------------------ +function ParseContext(moduleProperties, left, right, code, context) { + const result = ParseParser(moduleProperties, left, code, context); + return result.length === 2 ? ParseParser(moduleProperties, right, result[1], result[0]) : []; +} +// ------------------------------------------------------------------ +// Array +// ------------------------------------------------------------------ +function ParseArray(moduleProperties, parser, code, context) { + const buffer = []; + let rest = code; + while (rest.length > 0) { + const result = ParseParser(moduleProperties, parser, rest, context); + if (result.length === 0) + return [buffer, rest]; + buffer.push(result[0]); + rest = result[1]; + } + return [buffer, rest]; +} +// ------------------------------------------------------------------ +// Const +// ------------------------------------------------------------------ +function ParseConst(value, code, context) { + return Token.Const(value, code); +} +// ------------------------------------------------------------------ +// Ident +// ------------------------------------------------------------------ +function ParseIdent(code, _context) { + return Token.Ident(code); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +// prettier-ignore +function ParseNumber(code, _context) { + return Token.Number(code); +} +// ------------------------------------------------------------------ +// Optional +// ------------------------------------------------------------------ +function ParseOptional(moduleProperties, parser, code, context) { + const result = ParseParser(moduleProperties, parser, code, context); + return (result.length === 2 ? [[result[0]], result[1]] : [[], code]); +} +// ------------------------------------------------------------------ +// Ref +// ------------------------------------------------------------------ +function ParseRef(moduleProperties, ref, code, context) { + const parser = moduleProperties[ref]; + if (!Guard.IsParser(parser)) + throw Error(`Cannot dereference Parser '${ref}'`); + return ParseParser(moduleProperties, parser, code, context); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function ParseString(options, code, _context) { + return Token.String(options, code); +} +// ------------------------------------------------------------------ +// Tuple +// ------------------------------------------------------------------ +function ParseTuple(moduleProperties, parsers, code, context) { + const buffer = []; + let rest = code; + for (const parser of parsers) { + const result = ParseParser(moduleProperties, parser, rest, context); + if (result.length === 0) + return []; + buffer.push(result[0]); + rest = result[1]; + } + return [buffer, rest]; +} +// ------------------------------------------------------------------ +// Union +// ------------------------------------------------------------------ +// prettier-ignore +function ParseUnion(moduleProperties, parsers, code, context) { + for (const parser of parsers) { + const result = ParseParser(moduleProperties, parser, code, context); + if (result.length === 0) + continue; + return result; + } + return []; +} +// ------------------------------------------------------------------ +// Parser +// ------------------------------------------------------------------ +// prettier-ignore +function ParseParser(moduleProperties, parser, code, context) { + const result = (Guard.IsContext(parser) ? ParseContext(moduleProperties, parser.left, parser.right, code, context) : + Guard.IsArray(parser) ? ParseArray(moduleProperties, parser.parser, code, context) : + Guard.IsConst(parser) ? ParseConst(parser.value, code, context) : + Guard.IsIdent(parser) ? ParseIdent(code, context) : + Guard.IsNumber(parser) ? ParseNumber(code, context) : + Guard.IsOptional(parser) ? ParseOptional(moduleProperties, parser.parser, code, context) : + Guard.IsRef(parser) ? ParseRef(moduleProperties, parser.ref, code, context) : + Guard.IsString(parser) ? ParseString(parser.options, code, context) : + Guard.IsTuple(parser) ? ParseTuple(moduleProperties, parser.parsers, code, context) : + Guard.IsUnion(parser) ? ParseUnion(moduleProperties, parser.parsers, code, context) : + []); + return (result.length === 2 + ? [parser.mapping(result[0], context), result[1]] + : result); +} +/** Parses content using the given parser */ +// prettier-ignore +export function Parse(...args) { + const withModuleProperties = typeof args[1] === 'string' ? false : true; + const [moduleProperties, parser, content, context] = withModuleProperties + ? [args[0], args[1], args[2], args[3]] + : [{}, args[0], args[1], args[2]]; + return ParseParser(moduleProperties, parser, content, context); +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.d.mts new file mode 100644 index 00000000..47a2d4ce --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.d.mts @@ -0,0 +1,8 @@ +/** Takes the next constant string value skipping any whitespace */ +export declare function Const(value: string, code: string): [] | [string, string]; +/** Scans for the next Ident token */ +export declare function Ident(code: string): [] | [string, string]; +/** Scans for the next number token */ +export declare function Number(code: string): [string, string] | []; +/** Scans the next Literal String value */ +export declare function String(options: string[], code: string): [string, string] | []; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.mjs new file mode 100644 index 00000000..88460cbe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/token.mjs @@ -0,0 +1,223 @@ +// ------------------------------------------------------------------ +// Chars +// ------------------------------------------------------------------ +// prettier-ignore +var Chars; +(function (Chars) { + /** Returns true if the char code is a whitespace */ + function IsWhitespace(value) { + return value === 32; + } + Chars.IsWhitespace = IsWhitespace; + /** Returns true if the char code is a newline */ + function IsNewline(value) { + return value === 10; + } + Chars.IsNewline = IsNewline; + /** Returns true if the char code is a alpha */ + function IsAlpha(value) { + return ((value >= 65 && value <= 90) || // A-Z + (value >= 97 && value <= 122) // a-z + ); + } + Chars.IsAlpha = IsAlpha; + /** Returns true if the char code is zero */ + function IsZero(value) { + return value === 48; + } + Chars.IsZero = IsZero; + /** Returns true if the char code is non-zero */ + function IsNonZero(value) { + return value >= 49 && value <= 57; + } + Chars.IsNonZero = IsNonZero; + /** Returns true if the char code is a digit */ + function IsDigit(value) { + return (IsNonZero(value) || + IsZero(value)); + } + Chars.IsDigit = IsDigit; + /** Returns true if the char code is a dot */ + function IsDot(value) { + return value === 46; + } + Chars.IsDot = IsDot; + /** Returns true if this char code is a underscore */ + function IsUnderscore(value) { + return value === 95; + } + Chars.IsUnderscore = IsUnderscore; + /** Returns true if this char code is a dollar sign */ + function IsDollarSign(value) { + return value === 36; + } + Chars.IsDollarSign = IsDollarSign; +})(Chars || (Chars = {})); +// ------------------------------------------------------------------ +// Trim +// ------------------------------------------------------------------ +// prettier-ignore +var Trim; +(function (Trim) { + /** Trims Whitespace and retains Newline, Tabspaces, etc. */ + function TrimWhitespaceOnly(code) { + for (let i = 0; i < code.length; i++) { + if (Chars.IsWhitespace(code.charCodeAt(i))) + continue; + return code.slice(i); + } + return code; + } + Trim.TrimWhitespaceOnly = TrimWhitespaceOnly; + /** Trims Whitespace including Newline, Tabspaces, etc. */ + function TrimAll(code) { + return code.trimStart(); + } + Trim.TrimAll = TrimAll; +})(Trim || (Trim = {})); +// ------------------------------------------------------------------ +// Const +// ------------------------------------------------------------------ +/** Checks the value matches the next string */ +// prettier-ignore +function NextTokenCheck(value, code) { + if (value.length > code.length) + return false; + for (let i = 0; i < value.length; i++) { + if (value.charCodeAt(i) !== code.charCodeAt(i)) + return false; + } + return true; +} +/** Gets the next constant string value or empty if no match */ +// prettier-ignore +function NextConst(value, code) { + return NextTokenCheck(value, code) + ? [code.slice(0, value.length), code.slice(value.length)] + : []; +} +/** Takes the next constant string value skipping any whitespace */ +// prettier-ignore +export function Const(value, code) { + if (value.length === 0) + return ['', code]; + const char_0 = value.charCodeAt(0); + return (Chars.IsNewline(char_0) ? NextConst(value, Trim.TrimWhitespaceOnly(code)) : + Chars.IsWhitespace(char_0) ? NextConst(value, code) : + NextConst(value, Trim.TrimAll(code))); +} +// ------------------------------------------------------------------ +// Ident +// ------------------------------------------------------------------ +// prettier-ignore +function IdentIsFirst(char) { + return (Chars.IsAlpha(char) || + Chars.IsDollarSign(char) || + Chars.IsUnderscore(char)); +} +// prettier-ignore +function IdentIsRest(char) { + return (Chars.IsAlpha(char) || + Chars.IsDigit(char) || + Chars.IsDollarSign(char) || + Chars.IsUnderscore(char)); +} +// prettier-ignore +function NextIdent(code) { + if (!IdentIsFirst(code.charCodeAt(0))) + return []; + for (let i = 1; i < code.length; i++) { + const char = code.charCodeAt(i); + if (IdentIsRest(char)) + continue; + const slice = code.slice(0, i); + const rest = code.slice(i); + return [slice, rest]; + } + return [code, '']; +} +/** Scans for the next Ident token */ +// prettier-ignore +export function Ident(code) { + return NextIdent(Trim.TrimAll(code)); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +/** Checks that the next number is not a leading zero */ +// prettier-ignore +function NumberLeadingZeroCheck(code, index) { + const char_0 = code.charCodeAt(index + 0); + const char_1 = code.charCodeAt(index + 1); + return (( + // 1-9 + Chars.IsNonZero(char_0)) || ( + // 0 + Chars.IsZero(char_0) && + !Chars.IsDigit(char_1)) || ( + // 0. + Chars.IsZero(char_0) && + Chars.IsDot(char_1)) || ( + // .0 + Chars.IsDot(char_0) && + Chars.IsDigit(char_1))); +} +/** Gets the next number token */ +// prettier-ignore +function NextNumber(code) { + const negated = code.charAt(0) === '-'; + const index = negated ? 1 : 0; + if (!NumberLeadingZeroCheck(code, index)) { + return []; + } + const dash = negated ? '-' : ''; + let hasDot = false; + for (let i = index; i < code.length; i++) { + const char_i = code.charCodeAt(i); + if (Chars.IsDigit(char_i)) { + continue; + } + if (Chars.IsDot(char_i)) { + if (hasDot) { + const slice = code.slice(index, i); + const rest = code.slice(i); + return [`${dash}${slice}`, rest]; + } + hasDot = true; + continue; + } + const slice = code.slice(index, i); + const rest = code.slice(i); + return [`${dash}${slice}`, rest]; + } + return [code, '']; +} +/** Scans for the next number token */ +// prettier-ignore +export function Number(code) { + return NextNumber(Trim.TrimAll(code)); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function NextString(options, code) { + const first = code.charAt(0); + if (!options.includes(first)) + return []; + const quote = first; + for (let i = 1; i < code.length; i++) { + const char = code.charAt(i); + if (char === quote) { + const slice = code.slice(1, i); + const rest = code.slice(i + 1); + return [slice, rest]; + } + } + return []; +} +/** Scans the next Literal String value */ +// prettier-ignore +export function String(options, code) { + return NextString(options, Trim.TrimAll(code)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.d.mts new file mode 100644 index 00000000..42009627 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.d.mts @@ -0,0 +1,98 @@ +export type IModuleProperties = Record; +/** Force output static type evaluation for Arrays */ +export type StaticEnsure = T extends infer R ? R : never; +/** Infers the Output Parameter for a Parser */ +export type StaticParser = Parser extends IParser ? Output : unknown; +export type IMapping = (input: Input, context: any) => Output; +/** Maps input to output. This is the default Mapping */ +export declare const Identity: (value: unknown) => unknown; +/** Maps the output as the given parameter T */ +export declare const As: (mapping: T) => ((value: unknown) => T); +export interface IParser { + type: string; + mapping: IMapping; +} +export type ContextParameter<_Left extends IParser, Right extends IParser> = (StaticParser); +export interface IContext extends IParser { + type: 'Context'; + left: IParser; + right: IParser; +} +/** `[Context]` Creates a Context Parser */ +export declare function Context>>(left: Left, right: Right, mapping: Mapping): IContext>; +/** `[Context]` Creates a Context Parser */ +export declare function Context(left: Left, right: Right): IContext>; +export type ArrayParameter = StaticEnsure[]>; +export interface IArray extends IParser { + type: 'Array'; + parser: IParser; +} +/** `[EBNF]` Creates an Array Parser */ +export declare function Array>>(parser: Parser, mapping: Mapping): IArray>; +/** `[EBNF]` Creates an Array Parser */ +export declare function Array(parser: Parser): IArray>; +export interface IConst extends IParser { + type: 'Const'; + value: string; +} +/** `[TERM]` Creates a Const Parser */ +export declare function Const>(value: Value, mapping: Mapping): IConst>; +/** `[TERM]` Creates a Const Parser */ +export declare function Const(value: Value): IConst; +export interface IRef extends IParser { + type: 'Ref'; + ref: string; +} +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +export declare function Ref>(ref: string, mapping: Mapping): IRef>; +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +export declare function Ref(ref: string): IRef; +export interface IString extends IParser { + type: 'String'; + options: string[]; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export declare function String>(options: string[], mapping: Mapping): IString>; +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export declare function String(options: string[]): IString; +export interface IIdent extends IParser { + type: 'Ident'; +} +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +export declare function Ident>(mapping: Mapping): IIdent>; +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +export declare function Ident(): IIdent; +export interface INumber extends IParser { + type: 'Number'; +} +/** `[TERM]` Creates an Number Parser */ +export declare function Number>(mapping: Mapping): INumber>; +/** `[TERM]` Creates an Number Parser */ +export declare function Number(): INumber; +export type OptionalParameter] | []> = (Result); +export interface IOptional extends IParser { + type: 'Optional'; + parser: IParser; +} +/** `[EBNF]` Creates an Optional Parser */ +export declare function Optional>>(parser: Parser, mapping: Mapping): IOptional>; +/** `[EBNF]` Creates an Optional Parser */ +export declare function Optional(parser: Parser): IOptional>; +export type TupleParameter = StaticEnsure>]> : Result>; +export interface ITuple extends IParser { + type: 'Tuple'; + parsers: IParser[]; +} +/** `[BNF]` Creates a Tuple Parser */ +export declare function Tuple>>(parsers: [...Parsers], mapping: Mapping): ITuple>; +/** `[BNF]` Creates a Tuple Parser */ +export declare function Tuple(parsers: [...Parsers]): ITuple>; +export type UnionParameter = StaticEnsure> : Result>; +export interface IUnion extends IParser { + type: 'Union'; + parsers: IParser[]; +} +/** `[BNF]` Creates a Union parser */ +export declare function Union>>(parsers: [...Parsers], mapping: Mapping): IUnion>; +/** `[BNF]` Creates a Union parser */ +export declare function Union(parsers: [...Parsers]): IUnion>; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.mjs b/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.mjs new file mode 100644 index 00000000..c503b0b2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/runtime/types.mjs @@ -0,0 +1,55 @@ +/** Maps input to output. This is the default Mapping */ +export const Identity = (value) => value; +/** Maps the output as the given parameter T */ +// prettier-ignore +export const As = (mapping) => (_) => mapping; +/** `[Context]` Creates a Context Parser */ +export function Context(...args) { + const [left, right, mapping] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], args[1], Identity]; + return { type: 'Context', left, right, mapping }; +} +/** `[EBNF]` Creates an Array Parser */ +export function Array(...args) { + const [parser, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Array', parser, mapping }; +} +/** `[TERM]` Creates a Const Parser */ +export function Const(...args) { + const [value, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Const', value, mapping }; +} +/** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ +export function Ref(...args) { + const [ref, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Ref', ref, mapping }; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export function String(...params) { + const [options, mapping] = params.length === 2 ? [params[0], params[1]] : [params[0], Identity]; + return { type: 'String', options, mapping }; +} +/** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ +export function Ident(...params) { + const mapping = params.length === 1 ? params[0] : Identity; + return { type: 'Ident', mapping }; +} +/** `[TERM]` Creates an Number Parser */ +export function Number(...params) { + const mapping = params.length === 1 ? params[0] : Identity; + return { type: 'Number', mapping }; +} +/** `[EBNF]` Creates an Optional Parser */ +export function Optional(...args) { + const [parser, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Optional', parser, mapping }; +} +/** `[BNF]` Creates a Tuple Parser */ +export function Tuple(...args) { + const [parsers, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Tuple', parsers, mapping }; +} +/** `[BNF]` Creates a Union parser */ +export function Union(...args) { + const [parsers, mapping] = args.length === 2 ? [args[0], args[1]] : [args[0], Identity]; + return { type: 'Union', parsers, mapping }; +} diff --git a/node_modules/@sinclair/typebox/build/esm/parser/static/index.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/static/index.d.mts new file mode 100644 index 00000000..4300144d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/static/index.d.mts @@ -0,0 +1,3 @@ +export * as Token from './token.mjs'; +export * from './parse.mjs'; +export * from './types.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/static/index.mjs b/node_modules/@sinclair/typebox/build/esm/parser/static/index.mjs new file mode 100644 index 00000000..4300144d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/static/index.mjs @@ -0,0 +1,3 @@ +export * as Token from './token.mjs'; +export * from './parse.mjs'; +export * from './types.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/parser/static/parse.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/static/parse.d.mts new file mode 100644 index 00000000..30d30d2e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/static/parse.d.mts @@ -0,0 +1,20 @@ +import * as Tokens from './token.mjs'; +import * as Types from './types.mjs'; +type ContextParser = (Parse extends [infer Context extends unknown, infer Rest extends string] ? Parse : []); +type ArrayParser = (Parse extends [infer Value1 extends unknown, infer Rest extends string] ? ArrayParser : [Result, Code]); +type ConstParser = (Tokens.Const extends [infer Match extends Value, infer Rest extends string] ? [Match, Rest] : []); +type IdentParser = (Tokens.Ident extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type NumberParser = (Tokens.Number extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type OptionalParser = (Parse extends [infer Value extends unknown, infer Rest extends string] ? [[Value], Rest] : [[], Code]); +type StringParser = (Tokens.String extends [infer Match extends string, infer Rest extends string] ? [Match, Rest] : []); +type TupleParser = (Parsers extends [infer Left extends Types.IParser, ...infer Right extends Types.IParser[]] ? Parse extends [infer Value extends unknown, infer Rest extends string] ? TupleParser : [] : [Result, Code]); +type UnionParser = (Parsers extends [infer Left extends Types.IParser, ...infer Right extends Types.IParser[]] ? Parse extends [infer Value extends unknown, infer Rest extends string] ? [Value, Rest] : UnionParser : []); +type ParseCode = (Type extends Types.Context ? ContextParser : Type extends Types.Array ? ArrayParser : Type extends Types.Const ? ConstParser : Type extends Types.Ident ? IdentParser : Type extends Types.Number ? NumberParser : Type extends Types.Optional ? OptionalParser : Type extends Types.String ? StringParser : Type extends Types.Tuple ? TupleParser : Type extends Types.Union ? UnionParser : [ +]); +type ParseMapping = ((Parser['mapping'] & { + input: Result; + context: Context; +})['output']); +/** Parses code with the given parser */ +export type Parse = (ParseCode extends [infer L extends unknown, infer R extends string] ? [ParseMapping, R] : []); +export {}; diff --git a/node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/CustomSet.js b/node_modules/@sinclair/typebox/build/esm/parser/static/parse.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/CustomSet.js rename to node_modules/@sinclair/typebox/build/esm/parser/static/parse.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/parser/static/token.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/static/token.d.mts new file mode 100644 index 00000000..003f854e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/static/token.d.mts @@ -0,0 +1,108 @@ +declare namespace Chars { + type Empty = ''; + type Space = ' '; + type Newline = '\n'; + type Dot = '.'; + type Hyphen = '-'; + type Digit = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9' + ]; + type Alpha = [ + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z' + ]; +} +declare namespace Trim { + type W4 = `${W3}${W3}`; + type W3 = `${W2}${W2}`; + type W2 = `${W1}${W1}`; + type W1 = `${W0}${W0}`; + type W0 = ` `; + /** Trims whitespace only */ + export type TrimWhitespace = (Code extends `${W4}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W3}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W1}${infer Rest extends string}` ? TrimWhitespace : Code extends `${W0}${infer Rest extends string}` ? TrimWhitespace : Code); + /** Trims Whitespace and Newline */ + export type TrimAll = (Code extends `${W4}${infer Rest extends string}` ? TrimAll : Code extends `${W3}${infer Rest extends string}` ? TrimAll : Code extends `${W1}${infer Rest extends string}` ? TrimAll : Code extends `${W0}${infer Rest extends string}` ? TrimAll : Code extends `${Chars.Newline}${infer Rest extends string}` ? TrimAll : Code); + export {}; +} +/** Scans for the next match union */ +type NextUnion = (Variants extends [infer Variant extends string, ...infer Rest1 extends string[]] ? NextConst extends [infer Match extends string, infer Rest2 extends string] ? [Match, Rest2] : NextUnion : []); +type NextConst = (Code extends `${Value}${infer Rest extends string}` ? [Value, Rest] : []); +/** Scans for the next constant value */ +export type Const = (Value extends '' ? ['', Code] : Value extends `${infer First extends string}${string}` ? (First extends Chars.Newline ? NextConst> : First extends Chars.Space ? NextConst : NextConst>) : never); +type NextNumberNegate = (Code extends `${Chars.Hyphen}${infer Rest extends string}` ? [Chars.Hyphen, Rest] : [Chars.Empty, Code]); +type NextNumberZeroCheck = (Code extends `0${infer Rest}` ? NextUnion extends [string, string] ? false : true : true); +type NextNumberScan = (NextUnion<[...Chars.Digit, Chars.Dot], Code> extends [infer Char extends string, infer Rest extends string] ? Char extends Chars.Dot ? HasDecimal extends false ? NextNumberScan : [Result, `.${Rest}`] : NextNumberScan : [Result, Code]); +export type NextNumber = (NextNumberNegate extends [infer Negate extends string, infer Rest extends string] ? NextNumberZeroCheck extends true ? NextNumberScan extends [infer Number extends string, infer Rest2 extends string] ? Number extends Chars.Empty ? [] : [`${Negate}${Number}`, Rest2] : [] : [] : []); +/** Scans for the next literal number */ +export type Number = NextNumber>; +type NextStringQuote = NextUnion; +type NextStringBody = (Code extends `${infer Char extends string}${infer Rest extends string}` ? Char extends Quote ? [Result, Rest] : NextStringBody : []); +type NextString = (NextStringQuote extends [infer Quote extends string, infer Rest extends string] ? NextStringBody extends [infer String extends string, infer Rest extends string] ? [String, Rest] : [] : []); +/** Scans for the next literal string */ +export type String = NextString>; +type IdentLeft = [...Chars.Alpha, '_', '$']; +type IdentRight = [...Chars.Digit, ...IdentLeft]; +type NextIdentScan = (NextUnion extends [infer Char extends string, infer Rest extends string] ? NextIdentScan : [Result, Code]); +type NextIdent = (NextUnion extends [infer Left extends string, infer Rest1 extends string] ? NextIdentScan extends [infer Right extends string, infer Rest2 extends string] ? [`${Left}${Right}`, Rest2] : [] : []); +/** Scans for the next Ident */ +export type Ident = NextIdent>; +export {}; diff --git a/node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/Scheduler.js b/node_modules/@sinclair/typebox/build/esm/parser/static/token.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/Scheduler.js rename to node_modules/@sinclair/typebox/build/esm/parser/static/token.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/parser/static/types.d.mts b/node_modules/@sinclair/typebox/build/esm/parser/static/types.d.mts new file mode 100644 index 00000000..ec60c9b6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/parser/static/types.d.mts @@ -0,0 +1,69 @@ +/** + * `[ACTION]` Inference mapping base type. Used to specify semantic actions for + * Parser productions. This type is implemented as a higher-kinded type where + * productions are received on the `input` property with mapping assigned + * the `output` property. The parsing context is available on the `context` + * property. + */ +export interface IMapping { + context: unknown; + input: unknown; + output: unknown; +} +/** `[ACTION]` Default inference mapping. */ +export interface Identity extends IMapping { + output: this['input']; +} +/** `[ACTION]` Maps the given argument `T` as the mapping output */ +export interface As extends IMapping { + output: T; +} +/** Base type Parser implemented by all other parsers */ +export interface IParser { + type: string; + mapping: Mapping; +} +/** `[Context]` Creates a Context Parser */ +export interface Context extends IParser { + type: 'Context'; + left: Left; + right: Right; +} +/** `[EBNF]` Creates an Array Parser */ +export interface Array extends IParser { + type: 'Array'; + parser: Parser; +} +/** `[TERM]` Creates a Const Parser */ +export interface Const extends IParser { + type: 'Const'; + value: Value; +} +/** `[TERM]` Creates an Ident Parser. */ +export interface Ident extends IParser { + type: 'Ident'; +} +/** `[TERM]` Creates a Number Parser. */ +export interface Number extends IParser { + type: 'Number'; +} +/** `[EBNF]` Creates a Optional Parser */ +export interface Optional extends IParser { + type: 'Optional'; + parser: Parser; +} +/** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ +export interface String extends IParser { + type: 'String'; + quote: Options; +} +/** `[BNF]` Creates a Tuple Parser */ +export interface Tuple extends IParser { + type: 'Tuple'; + parsers: [...Parsers]; +} +/** `[BNF]` Creates a Union Parser */ +export interface Union extends IParser { + type: 'Union'; + parsers: [...Parsers]; +} diff --git a/node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/SlicedGenerator.js b/node_modules/@sinclair/typebox/build/esm/parser/static/types.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/arbitrary/_internals/interfaces/SlicedGenerator.js rename to node_modules/@sinclair/typebox/build/esm/parser/static/types.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/index.d.mts b/node_modules/@sinclair/typebox/build/esm/syntax/index.d.mts new file mode 100644 index 00000000..bd50b1a3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/index.d.mts @@ -0,0 +1 @@ +export * from './syntax.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/index.mjs b/node_modules/@sinclair/typebox/build/esm/syntax/index.mjs new file mode 100644 index 00000000..bd50b1a3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/index.mjs @@ -0,0 +1 @@ +export * from './syntax.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/mapping.d.mts b/node_modules/@sinclair/typebox/build/esm/syntax/mapping.d.mts new file mode 100644 index 00000000..8e04ecbd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/mapping.d.mts @@ -0,0 +1,167 @@ +import * as T from '../type/index.mjs'; +type TDereference = (Key extends keyof Context ? Context[Key] : T.TRef); +type TDelimitedDecode = (Input extends [infer Left, ...infer Right] ? Left extends [infer Item, infer _] ? TDelimitedDecode : TDelimitedDecode : Result); +type TDelimited = Input extends [infer Left extends unknown[], infer Right extends unknown[]] ? TDelimitedDecode<[...Left, ...Right]> : []; +export type TGenericReferenceParameterListMapping = TDelimited; +export declare function GenericReferenceParameterListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TGenericReferenceMapping'] ? T.TInstantiate, Args> : never : never> = Result; +export declare function GenericReferenceMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TGenericArgumentsListMapping = TDelimited; +export declare function GenericArgumentsListMapping(input: [unknown, unknown], context: unknown): unknown[]; +type GenericArgumentsContext = (Arguments extends [...infer Left extends string[], infer Right extends string] ? GenericArgumentsContext; +}> : T.Evaluate); +export type TGenericArgumentsMapping = Input extends ['<', infer Arguments extends string[], '>'] ? Context extends infer Context extends T.TProperties ? GenericArgumentsContext : never : never; +declare const GenericArgumentsContext: (_arguments: string[], context: T.TProperties) => T.TProperties; +export declare function GenericArgumentsMapping(input: [unknown, unknown, unknown], context: unknown): T.TProperties; +export type TKeywordStringMapping = T.TString; +export declare function KeywordStringMapping(input: 'string', context: unknown): T.TString; +export type TKeywordNumberMapping = T.TNumber; +export declare function KeywordNumberMapping(input: 'number', context: unknown): T.TNumber; +export type TKeywordBooleanMapping = T.TBoolean; +export declare function KeywordBooleanMapping(input: 'boolean', context: unknown): T.TBoolean; +export type TKeywordUndefinedMapping = T.TUndefined; +export declare function KeywordUndefinedMapping(input: 'undefined', context: unknown): T.TUndefined; +export type TKeywordNullMapping = T.TNull; +export declare function KeywordNullMapping(input: 'null', context: unknown): T.TNull; +export type TKeywordIntegerMapping = T.TInteger; +export declare function KeywordIntegerMapping(input: 'integer', context: unknown): T.TInteger; +export type TKeywordBigIntMapping = T.TBigInt; +export declare function KeywordBigIntMapping(input: 'bigint', context: unknown): T.TBigInt; +export type TKeywordUnknownMapping = T.TUnknown; +export declare function KeywordUnknownMapping(input: 'unknown', context: unknown): T.TUnknown; +export type TKeywordAnyMapping = T.TAny; +export declare function KeywordAnyMapping(input: 'any', context: unknown): T.TAny; +export type TKeywordNeverMapping = T.TNever; +export declare function KeywordNeverMapping(input: 'never', context: unknown): T.TNever; +export type TKeywordSymbolMapping = T.TSymbol; +export declare function KeywordSymbolMapping(input: 'symbol', context: unknown): T.TSymbol; +export type TKeywordVoidMapping = T.TVoid; +export declare function KeywordVoidMapping(input: 'void', context: unknown): T.TVoid; +export type TKeywordMapping = Input; +export declare function KeywordMapping(input: unknown, context: unknown): unknown; +export type TLiteralStringMapping = Input extends T.TLiteralValue ? T.TLiteral : never; +export declare function LiteralStringMapping(input: string, context: unknown): T.TLiteral; +export type TLiteralNumberMapping = Input extends `${infer Value extends number}` ? T.TLiteral : never; +export declare function LiteralNumberMapping(input: string, context: unknown): T.TLiteral; +export type TLiteralBooleanMapping = Input extends 'true' ? T.TLiteral : T.TLiteral; +export declare function LiteralBooleanMapping(input: 'true' | 'false', context: unknown): T.TLiteral; +export type TLiteralMapping = Input; +export declare function LiteralMapping(input: unknown, context: unknown): unknown; +export type TKeyOfMapping = Input extends [unknown] ? true : false; +export declare function KeyOfMapping(input: [unknown] | [], context: unknown): boolean; +type TIndexArrayMappingReduce = (Input extends [infer Left extends unknown, ...infer Right extends unknown[]] ? Left extends ['[', infer Type extends T.TSchema, ']'] ? TIndexArrayMappingReduce : TIndexArrayMappingReduce : Result); +export type TIndexArrayMapping = Input extends unknown[] ? TIndexArrayMappingReduce : []; +export declare function IndexArrayMapping(input: ([unknown, unknown, unknown] | [unknown, unknown])[], context: unknown): unknown[]; +export type TExtendsMapping = Input extends ['extends', infer Type extends T.TSchema, '?', infer True extends T.TSchema, ':', infer False extends T.TSchema] ? [Type, True, False] : []; +export declare function ExtendsMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | [], context: unknown): unknown[]; +export type TBaseMapping = (Input extends ['(', infer Type extends T.TSchema, ')'] ? Type : Input extends infer Type extends T.TSchema ? Type : never); +export declare function BaseMapping(input: [unknown, unknown, unknown] | unknown, context: unknown): unknown; +type TFactorIndexArray = (IndexArray extends [...infer Left extends unknown[], infer Right extends T.TSchema[]] ? (Right extends [infer Indexer extends T.TSchema] ? T.TIndex, T.TIndexPropertyKeys> : Right extends [] ? T.TArray> : T.TNever) : Type); +type TFactorExtends = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ? T.TExtends : Type); +export type TFactorMapping = Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extends extends unknown[]] ? KeyOf extends true ? TFactorExtends>, Extends> : TFactorExtends, Extends> : never; +export declare function FactorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +type TExprBinaryMapping = (Rest extends [infer Operator extends unknown, infer Right extends T.TSchema, infer Next extends unknown[]] ? (TExprBinaryMapping extends infer Schema extends T.TSchema ? (Operator extends '&' ? (Schema extends T.TIntersect ? T.TIntersect<[Left, ...Types]> : T.TIntersect<[Left, Schema]>) : Operator extends '|' ? (Schema extends T.TUnion ? T.TUnion<[Left, ...Types]> : T.TUnion<[Left, Schema]>) : never) : never) : Left); +export type TExprTermTailMapping = Input; +export declare function ExprTermTailMapping(input: [unknown, unknown, unknown] | [], context: unknown): [] | [unknown, unknown, unknown]; +export type TExprTermMapping = (Input extends [infer Left extends T.TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping : []); +export declare function ExprTermMapping(input: [unknown, unknown], context: unknown): T.TSchema; +export type TExprTailMapping = Input; +export declare function ExprTailMapping(input: [unknown, unknown, unknown] | [], context: unknown): [] | [unknown, unknown, unknown]; +export type TExprMapping = Input extends [infer Left extends T.TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping : []; +export declare function ExprMapping(input: [unknown, unknown], context: unknown): T.TSchema; +export type TTypeMapping = Input; +export declare function TypeMapping(input: unknown, context: unknown): unknown; +export type TPropertyKeyMapping = Input; +export declare function PropertyKeyMapping(input: string, context: unknown): string; +export type TReadonlyMapping = Input extends [unknown] ? true : false; +export declare function ReadonlyMapping(input: [unknown] | [], context: unknown): boolean; +export type TOptionalMapping = Input extends [unknown] ? true : false; +export declare function OptionalMapping(input: [unknown] | [], context: unknown): boolean; +export type TPropertyMapping = Input extends [infer IsReadonly extends boolean, infer Key extends string, infer IsOptional extends boolean, string, infer Type extends T.TSchema] ? { + [_ in Key]: ([ + IsReadonly, + IsOptional + ] extends [true, true] ? T.TReadonlyOptional : [ + IsReadonly, + IsOptional + ] extends [true, false] ? T.TReadonly : [ + IsReadonly, + IsOptional + ] extends [false, true] ? T.TOptional : Type); +} : never; +export declare function PropertyMapping(input: [unknown, unknown, unknown, unknown, unknown], context: unknown): { + [x: string]: T.TSchema; +}; +export type TPropertyDelimiterMapping = Input; +export declare function PropertyDelimiterMapping(input: [unknown, unknown] | [unknown], context: unknown): [unknown] | [unknown, unknown]; +export type TPropertyListMapping = TDelimited; +export declare function PropertyListMapping(input: [unknown, unknown], context: unknown): unknown[]; +type TObjectMappingReduce = (PropertiesList extends [infer Left extends T.TProperties, ...infer Right extends T.TProperties[]] ? TObjectMappingReduce : { + [Key in keyof Result]: Result[Key]; +}); +export type TObjectMapping = Input extends ['{', infer PropertyList extends T.TProperties[], '}'] ? T.TObject> : never; +export declare function ObjectMapping(input: [unknown, unknown, unknown], context: unknown): T.TObject; +export type TElementListMapping = TDelimited; +export declare function ElementListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TTupleMapping = Input extends ['[', infer Types extends T.TSchema[], ']'] ? T.TTuple : never; +export declare function TupleMapping(input: [unknown, unknown, unknown], context: unknown): T.TTuple; +export type TParameterMapping = Input extends [string, ':', infer Type extends T.TSchema] ? Type : never; +export declare function ParameterMapping(input: [unknown, unknown, unknown], context: unknown): T.TSchema; +export type TParameterListMapping = TDelimited; +export declare function ParameterListMapping(input: [unknown, unknown], context: unknown): unknown[]; +export type TFunctionMapping = Input extends ['(', infer ParameterList extends T.TSchema[], ')', '=>', infer ReturnType extends T.TSchema] ? T.TFunction : never; +export declare function FunctionMapping(input: [unknown, unknown, unknown, unknown, unknown], context: unknown): T.TFunction; +export type TConstructorMapping = Input extends ['new', '(', infer ParameterList extends T.TSchema[], ')', '=>', infer InstanceType extends T.TSchema] ? T.TConstructor : never; +export declare function ConstructorMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TConstructor; +export type TMappedMapping = Input extends ['{', '[', infer _Key extends string, 'in', infer _Right extends T.TSchema, ']', ':', infer _Type extends T.TSchema, '}'] ? T.TLiteral<'Mapped types not supported'> : never; +export declare function MappedMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TLiteral<"Mapped types not supported">; +export type TAsyncIteratorMapping = Input extends ['AsyncIterator', '<', infer Type extends T.TSchema, '>'] ? T.TAsyncIterator : never; +export declare function AsyncIteratorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TAsyncIterator; +export type TIteratorMapping = Input extends ['Iterator', '<', infer Type extends T.TSchema, '>'] ? T.TIterator : never; +export declare function IteratorMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TIterator; +export type TArgumentMapping = Input extends ['Argument', '<', infer Type extends T.TSchema, '>'] ? Type extends T.TLiteral ? T.TArgument : T.TNever : never; +export declare function ArgumentMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever | T.TArgument; +export type TAwaitedMapping = Input extends ['Awaited', '<', infer Type extends T.TSchema, '>'] ? T.TAwaited : never; +export declare function AwaitedMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TArrayMapping = Input extends ['Array', '<', infer Type extends T.TSchema, '>'] ? T.TArray : never; +export declare function ArrayMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TArray; +export type TRecordMapping = Input extends ['Record', '<', infer Key extends T.TSchema, ',', infer Type extends T.TSchema, '>'] ? T.TRecordOrObject : never; +export declare function RecordMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TPromiseMapping = Input extends ['Promise', '<', infer Type extends T.TSchema, '>'] ? T.TPromise : never; +export declare function PromiseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TPromise; +export type TConstructorParametersMapping = Input extends ['ConstructorParameters', '<', infer Type extends T.TSchema, '>'] ? T.TConstructorParameters : never; +export declare function ConstructorParametersMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TFunctionParametersMapping = Input extends ['Parameters', '<', infer Type extends T.TSchema, '>'] ? T.TParameters : never; +export declare function FunctionParametersMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TInstanceTypeMapping = Input extends ['InstanceType', '<', infer Type extends T.TSchema, '>'] ? T.TInstanceType : never; +export declare function InstanceTypeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TReturnTypeMapping = Input extends ['ReturnType', '<', infer Type extends T.TSchema, '>'] ? T.TReturnType : never; +export declare function ReturnTypeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TPartialMapping = Input extends ['Partial', '<', infer Type extends T.TSchema, '>'] ? T.TPartial : never; +export declare function PartialMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TRequiredMapping = Input extends ['Required', '<', infer Type extends T.TSchema, '>'] ? T.TRequired : never; +export declare function RequiredMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TPickMapping = Input extends ['Pick', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TPick : never; +export declare function PickMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TOmitMapping = Input extends ['Omit', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TOmit : never; +export declare function OmitMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TObject<{}>; +export type TExcludeMapping = Input extends ['Exclude', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TExclude : never; +export declare function ExcludeMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TNever; +export type TExtractMapping = Input extends ['Extract', '<', infer Type extends T.TSchema, ',', infer Key extends T.TSchema, '>'] ? T.TExtract : never; +export declare function ExtractMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TUppercaseMapping = Input extends ['Uppercase', '<', infer Type extends T.TSchema, '>'] ? T.TUppercase : never; +export declare function UppercaseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TLowercaseMapping = Input extends ['Lowercase', '<', infer Type extends T.TSchema, '>'] ? T.TLowercase : never; +export declare function LowercaseMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TCapitalizeMapping = Input extends ['Capitalize', '<', infer Type extends T.TSchema, '>'] ? T.TCapitalize : never; +export declare function CapitalizeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TUncapitalizeMapping = Input extends ['Uncapitalize', '<', infer Type extends T.TSchema, '>'] ? T.TUncapitalize : never; +export declare function UncapitalizeMapping(input: [unknown, unknown, unknown, unknown], context: unknown): T.TSchema; +export type TDateMapping = T.TDate; +export declare function DateMapping(input: 'Date', context: unknown): T.TDate; +export type TUint8ArrayMapping = T.TUint8Array; +export declare function Uint8ArrayMapping(input: 'Uint8Array', context: unknown): T.TUint8Array; +export type TReferenceMapping = Context extends T.TProperties ? Input extends string ? TDereference : never : never; +export declare function ReferenceMapping(input: string, context: unknown): T.TSchema; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/mapping.mjs b/node_modules/@sinclair/typebox/build/esm/syntax/mapping.mjs new file mode 100644 index 00000000..7b95fda0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/mapping.mjs @@ -0,0 +1,386 @@ +import * as T from '../type/index.mjs'; +// prettier-ignore +const Dereference = (context, key) => { + return key in context ? context[key] : T.Ref(key); +}; +// prettier-ignore +const DelimitedDecode = (input, result = []) => { + return input.reduce((result, left) => { + return T.ValueGuard.IsArray(left) && left.length === 2 + ? [...result, left[0]] + : [...result, left]; + }, []); +}; +// prettier-ignore +const Delimited = (input) => { + const [left, right] = input; + return DelimitedDecode([...left, ...right]); +}; +// prettier-ignore +export function GenericReferenceParameterListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +export function GenericReferenceMapping(input, context) { + const type = Dereference(context, input[0]); + const args = input[2]; + return T.Instantiate(type, args); +} +// prettier-ignore +export function GenericArgumentsListMapping(input, context) { + return Delimited(input); +} +// ... +// prettier-ignore +const GenericArgumentsContext = (_arguments, context) => { + return _arguments.reduce((result, arg, index) => { + return { ...result, [arg]: T.Argument(index) }; + }, context); +}; +// prettier-ignore +export function GenericArgumentsMapping(input, context) { + return input.length === 3 + ? GenericArgumentsContext(input[1], context) + : {}; +} +// prettier-ignore +export function KeywordStringMapping(input, context) { + return T.String(); +} +// prettier-ignore +export function KeywordNumberMapping(input, context) { + return T.Number(); +} +// prettier-ignore +export function KeywordBooleanMapping(input, context) { + return T.Boolean(); +} +// prettier-ignore +export function KeywordUndefinedMapping(input, context) { + return T.Undefined(); +} +// prettier-ignore +export function KeywordNullMapping(input, context) { + return T.Null(); +} +// prettier-ignore +export function KeywordIntegerMapping(input, context) { + return T.Integer(); +} +// prettier-ignore +export function KeywordBigIntMapping(input, context) { + return T.BigInt(); +} +// prettier-ignore +export function KeywordUnknownMapping(input, context) { + return T.Unknown(); +} +// prettier-ignore +export function KeywordAnyMapping(input, context) { + return T.Any(); +} +// prettier-ignore +export function KeywordNeverMapping(input, context) { + return T.Never(); +} +// prettier-ignore +export function KeywordSymbolMapping(input, context) { + return T.Symbol(); +} +// prettier-ignore +export function KeywordVoidMapping(input, context) { + return T.Void(); +} +// prettier-ignore +export function KeywordMapping(input, context) { + return input; +} +// prettier-ignore +export function LiteralStringMapping(input, context) { + return T.Literal(input); +} +// prettier-ignore +export function LiteralNumberMapping(input, context) { + return T.Literal(parseFloat(input)); +} +// prettier-ignore +export function LiteralBooleanMapping(input, context) { + return T.Literal(input === 'true'); +} +// prettier-ignore +export function LiteralMapping(input, context) { + return input; +} +// prettier-ignore +export function KeyOfMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +export function IndexArrayMapping(input, context) { + return input.reduce((result, current) => { + return current.length === 3 + ? [...result, [current[1]]] + : [...result, []]; + }, []); +} +// prettier-ignore +export function ExtendsMapping(input, context) { + return input.length === 6 + ? [input[1], input[3], input[5]] + : []; +} +// prettier-ignore +export function BaseMapping(input, context) { + return T.ValueGuard.IsArray(input) && input.length === 3 ? input[1] : input; +} +// ... +// prettier-ignore +const FactorIndexArray = (Type, indexArray) => { + return indexArray.reduceRight((result, right) => { + const _right = right; + return (_right.length === 1 ? T.Index(result, _right[0]) : + _right.length === 0 ? T.Array(result, _right[0]) : + T.Never()); + }, Type); +}; +// prettier-ignore +const FactorExtends = (Type, Extends) => { + return Extends.length === 3 + ? T.Extends(Type, Extends[0], Extends[1], Extends[2]) + : Type; +}; +// prettier-ignore +export function FactorMapping(input, context) { + const [KeyOf, Type, IndexArray, Extends] = input; + return KeyOf + ? FactorExtends(T.KeyOf(FactorIndexArray(Type, IndexArray)), Extends) + : FactorExtends(FactorIndexArray(Type, IndexArray), Extends); +} +// prettier-ignore +function ExprBinaryMapping(Left, Rest) { + return (Rest.length === 3 ? (() => { + const [Operator, Right, Next] = Rest; + const Schema = ExprBinaryMapping(Right, Next); + if (Operator === '&') { + return T.TypeGuard.IsIntersect(Schema) + ? T.Intersect([Left, ...Schema.allOf]) + : T.Intersect([Left, Schema]); + } + if (Operator === '|') { + return T.TypeGuard.IsUnion(Schema) + ? T.Union([Left, ...Schema.anyOf]) + : T.Union([Left, Schema]); + } + throw 1; + })() : Left); +} +// prettier-ignore +export function ExprTermTailMapping(input, context) { + return input; +} +// prettier-ignore +export function ExprTermMapping(input, context) { + const [left, rest] = input; + return ExprBinaryMapping(left, rest); +} +// prettier-ignore +export function ExprTailMapping(input, context) { + return input; +} +// prettier-ignore +export function ExprMapping(input, context) { + const [left, rest] = input; + return ExprBinaryMapping(left, rest); +} +// prettier-ignore +export function TypeMapping(input, context) { + return input; +} +// prettier-ignore +export function PropertyKeyMapping(input, context) { + return input; +} +// prettier-ignore +export function ReadonlyMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +export function OptionalMapping(input, context) { + return input.length > 0; +} +// prettier-ignore +export function PropertyMapping(input, context) { + const [isReadonly, key, isOptional, _colon, type] = input; + return { + [key]: (isReadonly && isOptional ? T.ReadonlyOptional(type) : + isReadonly && !isOptional ? T.Readonly(type) : + !isReadonly && isOptional ? T.Optional(type) : + type) + }; +} +// prettier-ignore +export function PropertyDelimiterMapping(input, context) { + return input; +} +// prettier-ignore +export function PropertyListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +export function ObjectMapping(input, context) { + const propertyList = input[1]; + return T.Object(propertyList.reduce((result, property) => { + return { ...result, ...property }; + }, {})); +} +// prettier-ignore +export function ElementListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +export function TupleMapping(input, context) { + return T.Tuple(input[1]); +} +// prettier-ignore +export function ParameterMapping(input, context) { + const [_ident, _colon, type] = input; + return type; +} +// prettier-ignore +export function ParameterListMapping(input, context) { + return Delimited(input); +} +// prettier-ignore +export function FunctionMapping(input, context) { + const [_lparan, parameterList, _rparan, _arrow, returnType] = input; + return T.Function(parameterList, returnType); +} +// prettier-ignore +export function ConstructorMapping(input, context) { + const [_new, _lparan, parameterList, _rparan, _arrow, instanceType] = input; + return T.Constructor(parameterList, instanceType); +} +// prettier-ignore +export function MappedMapping(input, context) { + const [_lbrace, _lbracket, _key, _in, _right, _rbracket, _colon, _type] = input; + return T.Literal('Mapped types not supported'); +} +// prettier-ignore +export function AsyncIteratorMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.AsyncIterator(type); +} +// prettier-ignore +export function IteratorMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Iterator(type); +} +// prettier-ignore +export function ArgumentMapping(input, context) { + return T.KindGuard.IsLiteralNumber(input[2]) + ? T.Argument(Math.trunc(input[2].const)) + : T.Never(); +} +// prettier-ignore +export function AwaitedMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Awaited(type); +} +// prettier-ignore +export function ArrayMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Array(type); +} +// prettier-ignore +export function RecordMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Record(key, type); +} +// prettier-ignore +export function PromiseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Promise(type); +} +// prettier-ignore +export function ConstructorParametersMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.ConstructorParameters(type); +} +// prettier-ignore +export function FunctionParametersMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Parameters(type); +} +// prettier-ignore +export function InstanceTypeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.InstanceType(type); +} +// prettier-ignore +export function ReturnTypeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.ReturnType(type); +} +// prettier-ignore +export function PartialMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Partial(type); +} +// prettier-ignore +export function RequiredMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Required(type); +} +// prettier-ignore +export function PickMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Pick(key, type); +} +// prettier-ignore +export function OmitMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Omit(key, type); +} +// prettier-ignore +export function ExcludeMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Exclude(key, type); +} +// prettier-ignore +export function ExtractMapping(input, context) { + const [_name, _langle, key, _comma, type, _rangle] = input; + return T.Extract(key, type); +} +// prettier-ignore +export function UppercaseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Uppercase(type); +} +// prettier-ignore +export function LowercaseMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Lowercase(type); +} +// prettier-ignore +export function CapitalizeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Capitalize(type); +} +// prettier-ignore +export function UncapitalizeMapping(input, context) { + const [_name, _langle, type, _rangle] = input; + return T.Uncapitalize(type); +} +// prettier-ignore +export function DateMapping(input, context) { + return T.Date(); +} +// prettier-ignore +export function Uint8ArrayMapping(input, context) { + return T.Uint8Array(); +} +// prettier-ignore +export function ReferenceMapping(input, context) { + const target = Dereference(context, input); + return target; +} diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/parser.d.mts b/node_modules/@sinclair/typebox/build/esm/syntax/parser.d.mts new file mode 100644 index 00000000..7fcd5be5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/parser.d.mts @@ -0,0 +1,162 @@ +import { Static } from '../parser/index.mjs'; +import * as T from '../type/index.mjs'; +import * as S from './mapping.mjs'; +export type TGenericReferenceParameterList_0 = (TType extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericReferenceParameterList_0 : [Result, Input]; +export type TGenericReferenceParameterList = (TGenericReferenceParameterList_0 extends [infer _0, infer Input extends string] ? ((TType extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericReferenceParameterListMapping<_0, Context>, Input] : []; +export type TGenericReference = (Static.Token.Ident extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TGenericReferenceParameterList extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TGenericReferenceMapping<_0, Context>, Input] : []; +export type TGenericArgumentsList_0 = (Static.Token.Ident extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericArgumentsList_0 : [Result, Input]; +export type TGenericArgumentsList = (TGenericArgumentsList_0 extends [infer _0, infer Input extends string] ? ((Static.Token.Ident extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsListMapping<_0, Context>, Input] : []; +export type TGenericArguments = (Static.Token.Const<'<', Input> extends [infer _0, infer Input extends string] ? TGenericArgumentsList extends [infer _1, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsMapping<_0, Context>, Input] : []; +export type TKeywordString = Static.Token.Const<'string', Input> extends [infer _0 extends 'string', infer Input extends string] ? [S.TKeywordStringMapping<_0, Context>, Input] : []; +export type TKeywordNumber = Static.Token.Const<'number', Input> extends [infer _0 extends 'number', infer Input extends string] ? [S.TKeywordNumberMapping<_0, Context>, Input] : []; +export type TKeywordBoolean = Static.Token.Const<'boolean', Input> extends [infer _0 extends 'boolean', infer Input extends string] ? [S.TKeywordBooleanMapping<_0, Context>, Input] : []; +export type TKeywordUndefined = Static.Token.Const<'undefined', Input> extends [infer _0 extends 'undefined', infer Input extends string] ? [S.TKeywordUndefinedMapping<_0, Context>, Input] : []; +export type TKeywordNull = Static.Token.Const<'null', Input> extends [infer _0 extends 'null', infer Input extends string] ? [S.TKeywordNullMapping<_0, Context>, Input] : []; +export type TKeywordInteger = Static.Token.Const<'integer', Input> extends [infer _0 extends 'integer', infer Input extends string] ? [S.TKeywordIntegerMapping<_0, Context>, Input] : []; +export type TKeywordBigInt = Static.Token.Const<'bigint', Input> extends [infer _0 extends 'bigint', infer Input extends string] ? [S.TKeywordBigIntMapping<_0, Context>, Input] : []; +export type TKeywordUnknown = Static.Token.Const<'unknown', Input> extends [infer _0 extends 'unknown', infer Input extends string] ? [S.TKeywordUnknownMapping<_0, Context>, Input] : []; +export type TKeywordAny = Static.Token.Const<'any', Input> extends [infer _0 extends 'any', infer Input extends string] ? [S.TKeywordAnyMapping<_0, Context>, Input] : []; +export type TKeywordNever = Static.Token.Const<'never', Input> extends [infer _0 extends 'never', infer Input extends string] ? [S.TKeywordNeverMapping<_0, Context>, Input] : []; +export type TKeywordSymbol = Static.Token.Const<'symbol', Input> extends [infer _0 extends 'symbol', infer Input extends string] ? [S.TKeywordSymbolMapping<_0, Context>, Input] : []; +export type TKeywordVoid = Static.Token.Const<'void', Input> extends [infer _0 extends 'void', infer Input extends string] ? [S.TKeywordVoidMapping<_0, Context>, Input] : []; +export type TKeyword = (TKeywordString extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNumber extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBoolean extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUndefined extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNull extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordInteger extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBigInt extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUnknown extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordAny extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNever extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordSymbol extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordVoid extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TKeywordMapping<_0, Context>, Input] : []; +export type TLiteralString = Static.Token.String<["'", '"', '`'], Input> extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralStringMapping<_0, Context>, Input] : []; +export type TLiteralNumber = Static.Token.Number extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralNumberMapping<_0, Context>, Input] : []; +export type TLiteralBoolean = (Static.Token.Const<'true', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.Const<'false', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends 'true' | 'false', infer Input extends string] ? [S.TLiteralBooleanMapping<_0, Context>, Input] : []; +export type TLiteral = (TLiteralBoolean extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralNumber extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralString extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TLiteralMapping<_0, Context>, Input] : []; +export type TKeyOf = ((Static.Token.Const<'keyof', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TKeyOfMapping<_0, Context>, Input] : []; +export type TIndexArray_0 = ((Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<']', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : []) extends [infer _0, infer Input extends string] ? TIndexArray_0 : [Result, Input]; +export type TIndexArray = TIndexArray_0 extends [infer _0 extends ([unknown, unknown, unknown] | [unknown, unknown])[], infer Input extends string] ? [S.TIndexArrayMapping<_0, Context>, Input] : []; +export type TExtends = ((Static.Token.Const<'extends', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<'?', Input> extends [infer _2, infer Input extends string] ? TType extends [infer _3, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _4, infer Input extends string] ? TType extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExtendsMapping<_0, Context>, Input] : []; +export type TBase = ((Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TType extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : TKeyword extends [infer _0, infer Input extends string] ? [_0, Input] : TObject extends [infer _0, infer Input extends string] ? [_0, Input] : TTuple extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteral extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructor extends [infer _0, infer Input extends string] ? [_0, Input] : TFunction extends [infer _0, infer Input extends string] ? [_0, Input] : TMapped extends [infer _0, infer Input extends string] ? [_0, Input] : TAsyncIterator extends [infer _0, infer Input extends string] ? [_0, Input] : TIterator extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructorParameters extends [infer _0, infer Input extends string] ? [_0, Input] : TFunctionParameters extends [infer _0, infer Input extends string] ? [_0, Input] : TInstanceType extends [infer _0, infer Input extends string] ? [_0, Input] : TReturnType extends [infer _0, infer Input extends string] ? [_0, Input] : TArgument extends [infer _0, infer Input extends string] ? [_0, Input] : TAwaited extends [infer _0, infer Input extends string] ? [_0, Input] : TArray extends [infer _0, infer Input extends string] ? [_0, Input] : TRecord extends [infer _0, infer Input extends string] ? [_0, Input] : TPromise extends [infer _0, infer Input extends string] ? [_0, Input] : TPartial extends [infer _0, infer Input extends string] ? [_0, Input] : TRequired extends [infer _0, infer Input extends string] ? [_0, Input] : TPick extends [infer _0, infer Input extends string] ? [_0, Input] : TOmit extends [infer _0, infer Input extends string] ? [_0, Input] : TExclude extends [infer _0, infer Input extends string] ? [_0, Input] : TExtract extends [infer _0, infer Input extends string] ? [_0, Input] : TUppercase extends [infer _0, infer Input extends string] ? [_0, Input] : TLowercase extends [infer _0, infer Input extends string] ? [_0, Input] : TCapitalize extends [infer _0, infer Input extends string] ? [_0, Input] : TUncapitalize extends [infer _0, infer Input extends string] ? [_0, Input] : TDate extends [infer _0, infer Input extends string] ? [_0, Input] : TUint8Array extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericReference extends [infer _0, infer Input extends string] ? [_0, Input] : TReference extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | unknown, infer Input extends string] ? [S.TBaseMapping<_0, Context>, Input] : []; +export type TFactor = (TKeyOf extends [infer _0, infer Input extends string] ? TBase extends [infer _1, infer Input extends string] ? TIndexArray extends [infer _2, infer Input extends string] ? TExtends extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0, Context>, Input] : []; +export type TExprTermTail = ((Static.Token.Const<'&', Input> extends [infer _0, infer Input extends string] ? TFactor extends [infer _1, infer Input extends string] ? TExprTermTail extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTermTailMapping<_0, Context>, Input] : []; +export type TExprTerm = (TFactor extends [infer _0, infer Input extends string] ? (TExprTermTail extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprTermMapping<_0, Context>, Input] : []; +export type TExprTail = ((Static.Token.Const<'|', Input> extends [infer _0, infer Input extends string] ? TExprTerm extends [infer _1, infer Input extends string] ? TExprTail extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTailMapping<_0, Context>, Input] : []; +export type TExpr = (TExprTerm extends [infer _0, infer Input extends string] ? (TExprTail extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprMapping<_0, Context>, Input] : []; +export type TType = (TGenericArguments extends [infer _0 extends T.TProperties, infer Input extends string] ? TExpr : [] extends [infer _0, infer Input extends string] ? [_0, Input] : TExpr extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TTypeMapping<_0, Context>, Input] : []; +export type TPropertyKey = (Static.Token.Ident extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.String<["'", '"'], Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends string, infer Input extends string] ? [S.TPropertyKeyMapping<_0, Context>, Input] : []; +export type TReadonly = ((Static.Token.Const<'readonly', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TReadonlyMapping<_0, Context>, Input] : []; +export type TOptional = ((Static.Token.Const<'?', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TOptionalMapping<_0, Context>, Input] : []; +export type TProperty = (TReadonly extends [infer _0, infer Input extends string] ? TPropertyKey extends [infer _1, infer Input extends string] ? TOptional extends [infer _2, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPropertyMapping<_0, Context>, Input] : []; +export type TPropertyDelimiter = ((Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [ + infer _0, + infer Input extends string +] ? [_0, Input] : (Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'\n', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [unknown], infer Input extends string] ? [S.TPropertyDelimiterMapping<_0, Context>, Input] : []; +export type TPropertyList_0 = (TProperty extends [infer _0, infer Input extends string] ? (TPropertyDelimiter extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TPropertyList_0 : [Result, Input]; +export type TPropertyList = (TPropertyList_0 extends [infer _0, infer Input extends string] ? ((TProperty extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TPropertyListMapping<_0, Context>, Input] : []; +export type TObject = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? TPropertyList extends [infer _1, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TObjectMapping<_0, Context>, Input] : []; +export type TElementList_0 = (TType extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TElementList_0 : [Result, Input]; +export type TElementList = (TElementList_0 extends [infer _0, infer Input extends string] ? ((TType extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TElementListMapping<_0, Context>, Input] : []; +export type TTuple = (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TElementList extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TTupleMapping<_0, Context>, Input] : []; +export type TParameter = (Static.Token.Ident extends [infer _0, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TParameterMapping<_0, Context>, Input] : []; +export type TParameterList_0 = (TParameter extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TParameterList_0 : [Result, Input]; +export type TParameterList = (TParameterList_0 extends [infer _0, infer Input extends string] ? ((TParameter extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TParameterListMapping<_0, Context>, Input] : []; +export type TFunction = (Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TParameterList extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionMapping<_0, Context>, Input] : []; +export type TConstructor = (Static.Token.Const<'new', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'(', Input> extends [infer _1, infer Input extends string] ? TParameterList extends [infer _2, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _3, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _4, infer Input extends string] ? TType extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorMapping<_0, Context>, Input] : []; +export type TMapped = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'[', Input> extends [infer _1, infer Input extends string] ? Static.Token.Ident extends [infer _2, infer Input extends string] ? Static.Token.Const<'in', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _5, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _6, infer Input extends string] ? TType extends [infer _7, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _8, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8], Input] : [] : [] : [] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TMappedMapping<_0, Context>, Input] : []; +export type TAsyncIterator = (Static.Token.Const<'AsyncIterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAsyncIteratorMapping<_0, Context>, Input] : []; +export type TIterator = (Static.Token.Const<'Iterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TIteratorMapping<_0, Context>, Input] : []; +export type TArgument = (Static.Token.Const<'Argument', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArgumentMapping<_0, Context>, Input] : []; +export type TAwaited = (Static.Token.Const<'Awaited', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAwaitedMapping<_0, Context>, Input] : []; +export type TArray = (Static.Token.Const<'Array', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArrayMapping<_0, Context>, Input] : []; +export type TRecord = (Static.Token.Const<'Record', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRecordMapping<_0, Context>, Input] : []; +export type TPromise = (Static.Token.Const<'Promise', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPromiseMapping<_0, Context>, Input] : []; +export type TConstructorParameters = (Static.Token.Const<'ConstructorParameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorParametersMapping<_0, Context>, Input] : []; +export type TFunctionParameters = (Static.Token.Const<'Parameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionParametersMapping<_0, Context>, Input] : []; +export type TInstanceType = (Static.Token.Const<'InstanceType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TInstanceTypeMapping<_0, Context>, Input] : []; +export type TReturnType = (Static.Token.Const<'ReturnType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TReturnTypeMapping<_0, Context>, Input] : []; +export type TPartial = (Static.Token.Const<'Partial', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPartialMapping<_0, Context>, Input] : []; +export type TRequired = (Static.Token.Const<'Required', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRequiredMapping<_0, Context>, Input] : []; +export type TPick = (Static.Token.Const<'Pick', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPickMapping<_0, Context>, Input] : []; +export type TOmit = (Static.Token.Const<'Omit', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TOmitMapping<_0, Context>, Input] : []; +export type TExclude = (Static.Token.Const<'Exclude', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExcludeMapping<_0, Context>, Input] : []; +export type TExtract = (Static.Token.Const<'Extract', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExtractMapping<_0, Context>, Input] : []; +export type TUppercase = (Static.Token.Const<'Uppercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUppercaseMapping<_0, Context>, Input] : []; +export type TLowercase = (Static.Token.Const<'Lowercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TLowercaseMapping<_0, Context>, Input] : []; +export type TCapitalize = (Static.Token.Const<'Capitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TCapitalizeMapping<_0, Context>, Input] : []; +export type TUncapitalize = (Static.Token.Const<'Uncapitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUncapitalizeMapping<_0, Context>, Input] : []; +export type TDate = Static.Token.Const<'Date', Input> extends [infer _0 extends 'Date', infer Input extends string] ? [S.TDateMapping<_0, Context>, Input] : []; +export type TUint8Array = Static.Token.Const<'Uint8Array', Input> extends [infer _0 extends 'Uint8Array', infer Input extends string] ? [S.TUint8ArrayMapping<_0, Context>, Input] : []; +export type TReference = Static.Token.Ident extends [infer _0 extends string, infer Input extends string] ? [S.TReferenceMapping<_0, Context>, Input] : []; +export declare const GenericReferenceParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const GenericReferenceParameterList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericReference: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericArgumentsList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const GenericArgumentsList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const GenericArguments: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordString: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNumber: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordBoolean: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordUndefined: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNull: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordInteger: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordBigInt: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordUnknown: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordAny: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordNever: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordSymbol: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeywordVoid: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Keyword: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralString: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralNumber: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const LiteralBoolean: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Literal: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const KeyOf: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const IndexArray_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const IndexArray: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Extends: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Base: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Factor: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTermTail: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTerm: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ExprTail: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Expr: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Type: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyKey: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Readonly: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Optional: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Property: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyDelimiter: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const PropertyList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const PropertyList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const _Object: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ElementList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const ElementList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Tuple: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Parameter: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string]; +export declare const ParameterList: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Function: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Constructor: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Mapped: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const AsyncIterator: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Iterator: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Argument: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Awaited: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Array: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Record: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Promise: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ConstructorParameters: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const FunctionParameters: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const InstanceType: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const ReturnType: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Partial: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Required: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Pick: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Omit: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Exclude: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Extract: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uppercase: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Lowercase: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Capitalize: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uncapitalize: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Date: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Uint8Array: (input: string, context?: T.TProperties) => [unknown, string] | []; +export declare const Reference: (input: string, context?: T.TProperties) => [unknown, string] | []; diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/parser.mjs b/node_modules/@sinclair/typebox/build/esm/syntax/parser.mjs new file mode 100644 index 00000000..2d84f897 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/parser.mjs @@ -0,0 +1,78 @@ +import { Runtime } from '../parser/index.mjs'; +import * as S from './mapping.mjs'; +const If = (result, left, right = () => []) => (result.length === 2 ? left(result) : right()); +export const GenericReferenceParameterList_0 = (input, context, result = []) => If(If(Type(input, context), ([_0, input]) => If(Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericReferenceParameterList_0(input, context, [...result, _0]), () => [result, input]); +export const GenericReferenceParameterList = (input, context = {}) => If(If(GenericReferenceParameterList_0(input, context), ([_0, input]) => If(If(If(Type(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericReferenceParameterListMapping(_0, context), input]); +export const GenericReference = (input, context = {}) => If(If(Runtime.Token.Ident(input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(GenericReferenceParameterList(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.GenericReferenceMapping(_0, context), input]); +export const GenericArgumentsList_0 = (input, context, result = []) => If(If(Runtime.Token.Ident(input), ([_0, input]) => If(Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericArgumentsList_0(input, context, [...result, _0]), () => [result, input]); +export const GenericArgumentsList = (input, context = {}) => If(If(GenericArgumentsList_0(input, context), ([_0, input]) => If(If(If(Runtime.Token.Ident(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericArgumentsListMapping(_0, context), input]); +export const GenericArguments = (input, context = {}) => If(If(Runtime.Token.Const('<', input), ([_0, input]) => If(GenericArgumentsList(input, context), ([_1, input]) => If(Runtime.Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericArgumentsMapping(_0, context), input]); +export const KeywordString = (input, context = {}) => If(Runtime.Token.Const('string', input), ([_0, input]) => [S.KeywordStringMapping(_0, context), input]); +export const KeywordNumber = (input, context = {}) => If(Runtime.Token.Const('number', input), ([_0, input]) => [S.KeywordNumberMapping(_0, context), input]); +export const KeywordBoolean = (input, context = {}) => If(Runtime.Token.Const('boolean', input), ([_0, input]) => [S.KeywordBooleanMapping(_0, context), input]); +export const KeywordUndefined = (input, context = {}) => If(Runtime.Token.Const('undefined', input), ([_0, input]) => [S.KeywordUndefinedMapping(_0, context), input]); +export const KeywordNull = (input, context = {}) => If(Runtime.Token.Const('null', input), ([_0, input]) => [S.KeywordNullMapping(_0, context), input]); +export const KeywordInteger = (input, context = {}) => If(Runtime.Token.Const('integer', input), ([_0, input]) => [S.KeywordIntegerMapping(_0, context), input]); +export const KeywordBigInt = (input, context = {}) => If(Runtime.Token.Const('bigint', input), ([_0, input]) => [S.KeywordBigIntMapping(_0, context), input]); +export const KeywordUnknown = (input, context = {}) => If(Runtime.Token.Const('unknown', input), ([_0, input]) => [S.KeywordUnknownMapping(_0, context), input]); +export const KeywordAny = (input, context = {}) => If(Runtime.Token.Const('any', input), ([_0, input]) => [S.KeywordAnyMapping(_0, context), input]); +export const KeywordNever = (input, context = {}) => If(Runtime.Token.Const('never', input), ([_0, input]) => [S.KeywordNeverMapping(_0, context), input]); +export const KeywordSymbol = (input, context = {}) => If(Runtime.Token.Const('symbol', input), ([_0, input]) => [S.KeywordSymbolMapping(_0, context), input]); +export const KeywordVoid = (input, context = {}) => If(Runtime.Token.Const('void', input), ([_0, input]) => [S.KeywordVoidMapping(_0, context), input]); +export const Keyword = (input, context = {}) => If(If(KeywordString(input, context), ([_0, input]) => [_0, input], () => If(KeywordNumber(input, context), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input, context), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input, context), ([_0, input]) => [_0, input], () => If(KeywordNull(input, context), ([_0, input]) => [_0, input], () => If(KeywordInteger(input, context), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input, context), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input, context), ([_0, input]) => [_0, input], () => If(KeywordAny(input, context), ([_0, input]) => [_0, input], () => If(KeywordNever(input, context), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input, context), ([_0, input]) => [_0, input], () => If(KeywordVoid(input, context), ([_0, input]) => [_0, input], () => [])))))))))))), ([_0, input]) => [S.KeywordMapping(_0, context), input]); +export const LiteralString = (input, context = {}) => If(Runtime.Token.String(["'", '"', '`'], input), ([_0, input]) => [S.LiteralStringMapping(_0, context), input]); +export const LiteralNumber = (input, context = {}) => If(Runtime.Token.Number(input), ([_0, input]) => [S.LiteralNumberMapping(_0, context), input]); +export const LiteralBoolean = (input, context = {}) => If(If(Runtime.Token.Const('true', input), ([_0, input]) => [_0, input], () => If(Runtime.Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.LiteralBooleanMapping(_0, context), input]); +export const Literal = (input, context = {}) => If(If(LiteralBoolean(input, context), ([_0, input]) => [_0, input], () => If(LiteralNumber(input, context), ([_0, input]) => [_0, input], () => If(LiteralString(input, context), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.LiteralMapping(_0, context), input]); +export const KeyOf = (input, context = {}) => If(If(If(Runtime.Token.Const('keyof', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.KeyOfMapping(_0, context), input]); +export const IndexArray_0 = (input, context, result = []) => If(If(If(Runtime.Token.Const('[', input), ([_0, input]) => If(Type(input, context), ([_1, input]) => If(Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(Runtime.Token.Const('[', input), ([_0, input]) => If(Runtime.Token.Const(']', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => IndexArray_0(input, context, [...result, _0]), () => [result, input]); +export const IndexArray = (input, context = {}) => If(IndexArray_0(input, context), ([_0, input]) => [S.IndexArrayMapping(_0, context), input]); +export const Extends = (input, context = {}) => If(If(If(Runtime.Token.Const('extends', input), ([_0, input]) => If(Type(input, context), ([_1, input]) => If(Runtime.Token.Const('?', input), ([_2, input]) => If(Type(input, context), ([_3, input]) => If(Runtime.Token.Const(':', input), ([_4, input]) => If(Type(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0, context), input]); +export const Base = (input, context = {}) => If(If(If(Runtime.Token.Const('(', input), ([_0, input]) => If(Type(input, context), ([_1, input]) => If(Runtime.Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(Keyword(input, context), ([_0, input]) => [_0, input], () => If(_Object(input, context), ([_0, input]) => [_0, input], () => If(Tuple(input, context), ([_0, input]) => [_0, input], () => If(Literal(input, context), ([_0, input]) => [_0, input], () => If(Constructor(input, context), ([_0, input]) => [_0, input], () => If(Function(input, context), ([_0, input]) => [_0, input], () => If(Mapped(input, context), ([_0, input]) => [_0, input], () => If(AsyncIterator(input, context), ([_0, input]) => [_0, input], () => If(Iterator(input, context), ([_0, input]) => [_0, input], () => If(ConstructorParameters(input, context), ([_0, input]) => [_0, input], () => If(FunctionParameters(input, context), ([_0, input]) => [_0, input], () => If(InstanceType(input, context), ([_0, input]) => [_0, input], () => If(ReturnType(input, context), ([_0, input]) => [_0, input], () => If(Argument(input, context), ([_0, input]) => [_0, input], () => If(Awaited(input, context), ([_0, input]) => [_0, input], () => If(Array(input, context), ([_0, input]) => [_0, input], () => If(Record(input, context), ([_0, input]) => [_0, input], () => If(Promise(input, context), ([_0, input]) => [_0, input], () => If(Partial(input, context), ([_0, input]) => [_0, input], () => If(Required(input, context), ([_0, input]) => [_0, input], () => If(Pick(input, context), ([_0, input]) => [_0, input], () => If(Omit(input, context), ([_0, input]) => [_0, input], () => If(Exclude(input, context), ([_0, input]) => [_0, input], () => If(Extract(input, context), ([_0, input]) => [_0, input], () => If(Uppercase(input, context), ([_0, input]) => [_0, input], () => If(Lowercase(input, context), ([_0, input]) => [_0, input], () => If(Capitalize(input, context), ([_0, input]) => [_0, input], () => If(Uncapitalize(input, context), ([_0, input]) => [_0, input], () => If(Date(input, context), ([_0, input]) => [_0, input], () => If(Uint8Array(input, context), ([_0, input]) => [_0, input], () => If(GenericReference(input, context), ([_0, input]) => [_0, input], () => If(Reference(input, context), ([_0, input]) => [_0, input], () => []))))))))))))))))))))))))))))))))), ([_0, input]) => [S.BaseMapping(_0, context), input]); +export const Factor = (input, context = {}) => If(If(KeyOf(input, context), ([_0, input]) => If(Base(input, context), ([_1, input]) => If(IndexArray(input, context), ([_2, input]) => If(Extends(input, context), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FactorMapping(_0, context), input]); +export const ExprTermTail = (input, context = {}) => If(If(If(Runtime.Token.Const('&', input), ([_0, input]) => If(Factor(input, context), ([_1, input]) => If(ExprTermTail(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0, context), input]); +export const ExprTerm = (input, context = {}) => If(If(Factor(input, context), ([_0, input]) => If(ExprTermTail(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0, context), input]); +export const ExprTail = (input, context = {}) => If(If(If(Runtime.Token.Const('|', input), ([_0, input]) => If(ExprTerm(input, context), ([_1, input]) => If(ExprTail(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTailMapping(_0, context), input]); +export const Expr = (input, context = {}) => If(If(ExprTerm(input, context), ([_0, input]) => If(ExprTail(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprMapping(_0, context), input]); +export const Type = (input, context = {}) => If(If(If(GenericArguments(input, context), ([_0, input]) => Expr(input, _0), () => []), ([_0, input]) => [_0, input], () => If(Expr(input, context), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.TypeMapping(_0, context), input]); +export const PropertyKey = (input, context = {}) => If(If(Runtime.Token.Ident(input), ([_0, input]) => [_0, input], () => If(Runtime.Token.String(["'", '"'], input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PropertyKeyMapping(_0, context), input]); +export const Readonly = (input, context = {}) => If(If(If(Runtime.Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ReadonlyMapping(_0, context), input]); +export const Optional = (input, context = {}) => If(If(If(Runtime.Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalMapping(_0, context), input]); +export const Property = (input, context = {}) => If(If(Readonly(input, context), ([_0, input]) => If(PropertyKey(input, context), ([_1, input]) => If(Optional(input, context), ([_2, input]) => If(Runtime.Token.Const(':', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.PropertyMapping(_0, context), input]); +export const PropertyDelimiter = (input, context = {}) => If(If(If(Runtime.Token.Const(',', input), ([_0, input]) => If(Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Runtime.Token.Const(';', input), ([_0, input]) => If(Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Runtime.Token.Const(',', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Runtime.Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Runtime.Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.PropertyDelimiterMapping(_0, context), input]); +export const PropertyList_0 = (input, context, result = []) => If(If(Property(input, context), ([_0, input]) => If(PropertyDelimiter(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, context, [...result, _0]), () => [result, input]); +export const PropertyList = (input, context = {}) => If(If(PropertyList_0(input, context), ([_0, input]) => If(If(If(Property(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.PropertyListMapping(_0, context), input]); +export const _Object = (input, context = {}) => If(If(Runtime.Token.Const('{', input), ([_0, input]) => If(PropertyList(input, context), ([_1, input]) => If(Runtime.Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ObjectMapping(_0, context), input]); +export const ElementList_0 = (input, context, result = []) => If(If(Type(input, context), ([_0, input]) => If(Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, context, [...result, _0]), () => [result, input]); +export const ElementList = (input, context = {}) => If(If(ElementList_0(input, context), ([_0, input]) => If(If(If(Type(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementListMapping(_0, context), input]); +export const Tuple = (input, context = {}) => If(If(Runtime.Token.Const('[', input), ([_0, input]) => If(ElementList(input, context), ([_1, input]) => If(Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.TupleMapping(_0, context), input]); +export const Parameter = (input, context = {}) => If(If(Runtime.Token.Ident(input), ([_0, input]) => If(Runtime.Token.Const(':', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ParameterMapping(_0, context), input]); +export const ParameterList_0 = (input, context, result = []) => If(If(Parameter(input, context), ([_0, input]) => If(Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, context, [...result, _0]), () => [result, input]); +export const ParameterList = (input, context = {}) => If(If(ParameterList_0(input, context), ([_0, input]) => If(If(If(Parameter(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ParameterListMapping(_0, context), input]); +export const Function = (input, context = {}) => If(If(Runtime.Token.Const('(', input), ([_0, input]) => If(ParameterList(input, context), ([_1, input]) => If(Runtime.Token.Const(')', input), ([_2, input]) => If(Runtime.Token.Const('=>', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FunctionMapping(_0, context), input]); +export const Constructor = (input, context = {}) => If(If(Runtime.Token.Const('new', input), ([_0, input]) => If(Runtime.Token.Const('(', input), ([_1, input]) => If(ParameterList(input, context), ([_2, input]) => If(Runtime.Token.Const(')', input), ([_3, input]) => If(Runtime.Token.Const('=>', input), ([_4, input]) => If(Type(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ConstructorMapping(_0, context), input]); +export const Mapped = (input, context = {}) => If(If(Runtime.Token.Const('{', input), ([_0, input]) => If(Runtime.Token.Const('[', input), ([_1, input]) => If(Runtime.Token.Ident(input), ([_2, input]) => If(Runtime.Token.Const('in', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const(']', input), ([_5, input]) => If(Runtime.Token.Const(':', input), ([_6, input]) => If(Type(input, context), ([_7, input]) => If(Runtime.Token.Const('}', input), ([_8, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8], input]))))))))), ([_0, input]) => [S.MappedMapping(_0, context), input]); +export const AsyncIterator = (input, context = {}) => If(If(Runtime.Token.Const('AsyncIterator', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AsyncIteratorMapping(_0, context), input]); +export const Iterator = (input, context = {}) => If(If(Runtime.Token.Const('Iterator', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.IteratorMapping(_0, context), input]); +export const Argument = (input, context = {}) => If(If(Runtime.Token.Const('Argument', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArgumentMapping(_0, context), input]); +export const Awaited = (input, context = {}) => If(If(Runtime.Token.Const('Awaited', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AwaitedMapping(_0, context), input]); +export const Array = (input, context = {}) => If(If(Runtime.Token.Const('Array', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArrayMapping(_0, context), input]); +export const Record = (input, context = {}) => If(If(Runtime.Token.Const('Record', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const(',', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.RecordMapping(_0, context), input]); +export const Promise = (input, context = {}) => If(If(Runtime.Token.Const('Promise', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PromiseMapping(_0, context), input]); +export const ConstructorParameters = (input, context = {}) => If(If(Runtime.Token.Const('ConstructorParameters', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ConstructorParametersMapping(_0, context), input]); +export const FunctionParameters = (input, context = {}) => If(If(Runtime.Token.Const('Parameters', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FunctionParametersMapping(_0, context), input]); +export const InstanceType = (input, context = {}) => If(If(Runtime.Token.Const('InstanceType', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.InstanceTypeMapping(_0, context), input]); +export const ReturnType = (input, context = {}) => If(If(Runtime.Token.Const('ReturnType', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ReturnTypeMapping(_0, context), input]); +export const Partial = (input, context = {}) => If(If(Runtime.Token.Const('Partial', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PartialMapping(_0, context), input]); +export const Required = (input, context = {}) => If(If(Runtime.Token.Const('Required', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.RequiredMapping(_0, context), input]); +export const Pick = (input, context = {}) => If(If(Runtime.Token.Const('Pick', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const(',', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.PickMapping(_0, context), input]); +export const Omit = (input, context = {}) => If(If(Runtime.Token.Const('Omit', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const(',', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.OmitMapping(_0, context), input]); +export const Exclude = (input, context = {}) => If(If(Runtime.Token.Const('Exclude', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const(',', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExcludeMapping(_0, context), input]); +export const Extract = (input, context = {}) => If(If(Runtime.Token.Const('Extract', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const(',', input), ([_3, input]) => If(Type(input, context), ([_4, input]) => If(Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExtractMapping(_0, context), input]); +export const Uppercase = (input, context = {}) => If(If(Runtime.Token.Const('Uppercase', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UppercaseMapping(_0, context), input]); +export const Lowercase = (input, context = {}) => If(If(Runtime.Token.Const('Lowercase', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.LowercaseMapping(_0, context), input]); +export const Capitalize = (input, context = {}) => If(If(Runtime.Token.Const('Capitalize', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.CapitalizeMapping(_0, context), input]); +export const Uncapitalize = (input, context = {}) => If(If(Runtime.Token.Const('Uncapitalize', input), ([_0, input]) => If(Runtime.Token.Const('<', input), ([_1, input]) => If(Type(input, context), ([_2, input]) => If(Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UncapitalizeMapping(_0, context), input]); +export const Date = (input, context = {}) => If(Runtime.Token.Const('Date', input), ([_0, input]) => [S.DateMapping(_0, context), input]); +export const Uint8Array = (input, context = {}) => If(Runtime.Token.Const('Uint8Array', input), ([_0, input]) => [S.Uint8ArrayMapping(_0, context), input]); +export const Reference = (input, context = {}) => If(Runtime.Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0, context), input]); diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/syntax.d.mts b/node_modules/@sinclair/typebox/build/esm/syntax/syntax.d.mts new file mode 100644 index 00000000..096100b3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/syntax.d.mts @@ -0,0 +1,12 @@ +import * as t from '../type/index.mjs'; +import { TType } from './parser.mjs'; +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +export declare function NoInfer, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): t.TSchema; +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +export declare function NoInfer(input: Input, options?: t.SchemaOptions): t.TSchema; +/** `[Experimental]` Parses type expressions into TypeBox types */ +export type TSyntax, Code extends string> = (TType extends [infer Type extends t.TSchema, string] ? Type : t.TNever); +/** `[Experimental]` Parses type expressions into TypeBox types */ +export declare function Syntax, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): TSyntax; +/** `[Experimental]` Parses type expressions into TypeBox types */ +export declare function Syntax(annotation: Input, options?: t.SchemaOptions): TSyntax<{}, Input>; diff --git a/node_modules/@sinclair/typebox/build/esm/syntax/syntax.mjs b/node_modules/@sinclair/typebox/build/esm/syntax/syntax.mjs new file mode 100644 index 00000000..03e7a13d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/syntax/syntax.mjs @@ -0,0 +1,16 @@ +import * as t from '../type/index.mjs'; +import { Type } from './parser.mjs'; +/** `[Experimental]` Parses type expressions into TypeBox types but does not infer */ +// prettier-ignore +export function NoInfer(...args) { + const withContext = typeof args[0] === 'string' ? false : true; + const [context, code, options] = withContext ? [args[0], args[1], args[2] || {}] : [{}, args[0], args[1] || {}]; + const result = Type(code, context)[0]; + return t.KindGuard.IsSchema(result) + ? t.CloneType(result, options) + : t.Never(options); +} +/** `[Experimental]` Parses type expressions into TypeBox types */ +export function Syntax(...args) { + return NoInfer.apply(null, args); +} diff --git a/node_modules/@sinclair/typebox/build/esm/system/index.d.mts b/node_modules/@sinclair/typebox/build/esm/system/index.d.mts new file mode 100644 index 00000000..53239c3f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/index.d.mts @@ -0,0 +1,2 @@ +export * from './policy.mjs'; +export * from './system.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/system/index.mjs b/node_modules/@sinclair/typebox/build/esm/system/index.mjs new file mode 100644 index 00000000..53239c3f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/index.mjs @@ -0,0 +1,2 @@ +export * from './policy.mjs'; +export * from './system.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/system/policy.d.mts b/node_modules/@sinclair/typebox/build/esm/system/policy.d.mts new file mode 100644 index 00000000..bb6307f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/policy.d.mts @@ -0,0 +1,29 @@ +export declare namespace TypeSystemPolicy { + /** + * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript + * references for embedded types, which may cause side effects if type properties are explicitly updated + * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation, + * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making + * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the + * fastest way to instantiate types. The default setting is `default`. + */ + let InstanceMode: 'default' | 'clone' | 'freeze'; + /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ + let ExactOptionalPropertyTypes: boolean; + /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ + let AllowArrayObject: boolean; + /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ + let AllowNaN: boolean; + /** Sets whether `null` should validate for void types. The default is `false` */ + let AllowNullVoid: boolean; + /** Checks this value using the ExactOptionalPropertyTypes policy */ + function IsExactOptionalProperty(value: Record, key: string): boolean; + /** Checks this value using the AllowArrayObjects policy */ + function IsObjectLike(value: unknown): value is Record; + /** Checks this value as a record using the AllowArrayObjects policy */ + function IsRecordLike(value: unknown): value is Record; + /** Checks this value using the AllowNaN policy */ + function IsNumberLike(value: unknown): value is number; + /** Checks this value using the AllowVoidNull policy */ + function IsVoidLike(value: unknown): value is void; +} diff --git a/node_modules/@sinclair/typebox/build/esm/system/policy.mjs b/node_modules/@sinclair/typebox/build/esm/system/policy.mjs new file mode 100644 index 00000000..87db0a5c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/policy.mjs @@ -0,0 +1,54 @@ +import { IsObject, IsArray, IsNumber, IsUndefined } from '../value/guard/index.mjs'; +export var TypeSystemPolicy; +(function (TypeSystemPolicy) { + // ------------------------------------------------------------------ + // TypeSystemPolicy: Instancing + // ------------------------------------------------------------------ + /** + * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript + * references for embedded types, which may cause side effects if type properties are explicitly updated + * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation, + * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making + * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the + * fastest way to instantiate types. The default setting is `default`. + */ + TypeSystemPolicy.InstanceMode = 'default'; + // ------------------------------------------------------------------ + // TypeSystemPolicy: Checking + // ------------------------------------------------------------------ + /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ + TypeSystemPolicy.ExactOptionalPropertyTypes = false; + /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ + TypeSystemPolicy.AllowArrayObject = false; + /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ + TypeSystemPolicy.AllowNaN = false; + /** Sets whether `null` should validate for void types. The default is `false` */ + TypeSystemPolicy.AllowNullVoid = false; + /** Checks this value using the ExactOptionalPropertyTypes policy */ + function IsExactOptionalProperty(value, key) { + return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined; + } + TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty; + /** Checks this value using the AllowArrayObjects policy */ + function IsObjectLike(value) { + const isObject = IsObject(value); + return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !IsArray(value); + } + TypeSystemPolicy.IsObjectLike = IsObjectLike; + /** Checks this value as a record using the AllowArrayObjects policy */ + function IsRecordLike(value) { + return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array); + } + TypeSystemPolicy.IsRecordLike = IsRecordLike; + /** Checks this value using the AllowNaN policy */ + function IsNumberLike(value) { + return TypeSystemPolicy.AllowNaN ? IsNumber(value) : Number.isFinite(value); + } + TypeSystemPolicy.IsNumberLike = IsNumberLike; + /** Checks this value using the AllowVoidNull policy */ + function IsVoidLike(value) { + const isUndefined = IsUndefined(value); + return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined; + } + TypeSystemPolicy.IsVoidLike = IsVoidLike; +})(TypeSystemPolicy || (TypeSystemPolicy = {})); diff --git a/node_modules/@sinclair/typebox/build/esm/system/system.d.mts b/node_modules/@sinclair/typebox/build/esm/system/system.d.mts new file mode 100644 index 00000000..719dac13 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/system.d.mts @@ -0,0 +1,16 @@ +import { type TUnsafe } from '../type/unsafe/index.mjs'; +import { TypeBoxError } from '../type/error/index.mjs'; +export declare class TypeSystemDuplicateTypeKind extends TypeBoxError { + constructor(kind: string); +} +export declare class TypeSystemDuplicateFormat extends TypeBoxError { + constructor(kind: string); +} +export type TypeFactoryFunction> = (options?: Partial) => TUnsafe; +/** Creates user defined types and formats and provides overrides for value checking behaviours */ +export declare namespace TypeSystem { + /** Creates a new type */ + function Type>(kind: string, check: (options: Options, value: unknown) => boolean): TypeFactoryFunction; + /** Creates a new string format */ + function Format(format: F, check: (value: string) => boolean): F; +} diff --git a/node_modules/@sinclair/typebox/build/esm/system/system.mjs b/node_modules/@sinclair/typebox/build/esm/system/system.mjs new file mode 100644 index 00000000..a4352989 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/system/system.mjs @@ -0,0 +1,37 @@ +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs'; +import { Unsafe } from '../type/unsafe/index.mjs'; +import { Kind } from '../type/symbols/index.mjs'; +import { TypeBoxError } from '../type/error/index.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class TypeSystemDuplicateTypeKind extends TypeBoxError { + constructor(kind) { + super(`Duplicate type kind '${kind}' detected`); + } +} +export class TypeSystemDuplicateFormat extends TypeBoxError { + constructor(kind) { + super(`Duplicate string format '${kind}' detected`); + } +} +/** Creates user defined types and formats and provides overrides for value checking behaviours */ +export var TypeSystem; +(function (TypeSystem) { + /** Creates a new type */ + function Type(kind, check) { + if (TypeRegistry.Has(kind)) + throw new TypeSystemDuplicateTypeKind(kind); + TypeRegistry.Set(kind, check); + return (options = {}) => Unsafe({ ...options, [Kind]: kind }); + } + TypeSystem.Type = Type; + /** Creates a new string format */ + function Format(format, check) { + if (FormatRegistry.Has(format)) + throw new TypeSystemDuplicateFormat(format); + FormatRegistry.Set(format, check); + return format; + } + TypeSystem.Format = Format; +})(TypeSystem || (TypeSystem = {})); diff --git a/node_modules/@sinclair/typebox/build/esm/type/any/any.d.mts b/node_modules/@sinclair/typebox/build/esm/type/any/any.d.mts new file mode 100644 index 00000000..8555b647 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/any/any.d.mts @@ -0,0 +1,8 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TAny extends TSchema { + [Kind]: 'Any'; + static: any; +} +/** `[Json]` Creates an Any type */ +export declare function Any(options?: SchemaOptions): TAny; diff --git a/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs b/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs new file mode 100644 index 00000000..36fdcf3b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates an Any type */ +export function Any(options) { + return CreateType({ [Kind]: 'Any' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/any/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/any/index.d.mts new file mode 100644 index 00000000..c91a0a7b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/any/index.d.mts @@ -0,0 +1 @@ +export * from './any.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/any/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/any/index.mjs new file mode 100644 index 00000000..c91a0a7b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/any/index.mjs @@ -0,0 +1 @@ +export * from './any.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/argument/argument.d.mts b/node_modules/@sinclair/typebox/build/esm/type/argument/argument.d.mts new file mode 100644 index 00000000..37fcb9b4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/argument/argument.d.mts @@ -0,0 +1,9 @@ +import type { TSchema } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TArgument extends TSchema { + [Kind]: 'Argument'; + static: unknown; + index: Index; +} +/** `[JavaScript]` Creates an Argument Type. */ +export declare function Argument(index: Index): TArgument; diff --git a/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs b/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs new file mode 100644 index 00000000..1d396117 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates an Argument Type. */ +export function Argument(index) { + return CreateType({ [Kind]: 'Argument', index }); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/argument/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/argument/index.d.mts new file mode 100644 index 00000000..6b95405d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/argument/index.d.mts @@ -0,0 +1 @@ +export * from './argument.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/argument/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/argument/index.mjs new file mode 100644 index 00000000..6b95405d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/argument/index.mjs @@ -0,0 +1 @@ +export * from './argument.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/array/array.d.mts b/node_modules/@sinclair/typebox/build/esm/type/array/array.d.mts new file mode 100644 index 00000000..d19a035c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/array/array.d.mts @@ -0,0 +1,28 @@ +import { Ensure } from '../helpers/index.mjs'; +import type { SchemaOptions, TSchema } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface ArrayOptions extends SchemaOptions { + /** The minimum number of items in this array */ + minItems?: number; + /** The maximum number of items in this array */ + maxItems?: number; + /** Should this schema contain unique items */ + uniqueItems?: boolean; + /** A schema for which some elements should match */ + contains?: TSchema; + /** A minimum number of contains schema matches */ + minContains?: number; + /** A maximum number of contains schema matches */ + maxContains?: number; +} +type ArrayStatic = Ensure[]>; +export interface TArray extends TSchema, ArrayOptions { + [Kind]: 'Array'; + static: ArrayStatic; + type: 'array'; + items: T; +} +/** `[Json]` Creates an Array type */ +export declare function Array(items: Type, options?: ArrayOptions): TArray; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs b/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs new file mode 100644 index 00000000..8f593d70 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates an Array type */ +export function Array(items, options) { + return CreateType({ [Kind]: 'Array', type: 'array', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/array/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/array/index.d.mts new file mode 100644 index 00000000..76cd68fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/array/index.d.mts @@ -0,0 +1 @@ +export * from './array.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/array/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/array/index.mjs new file mode 100644 index 00000000..76cd68fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/array/index.mjs @@ -0,0 +1 @@ +export * from './array.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.d.mts b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.d.mts new file mode 100644 index 00000000..bbafa8ea --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.d.mts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TAsyncIterator extends TSchema { + [Kind]: 'AsyncIterator'; + static: AsyncIterableIterator>; + type: 'AsyncIterator'; + items: T; +} +/** `[JavaScript]` Creates a AsyncIterator type */ +export declare function AsyncIterator(items: T, options?: SchemaOptions): TAsyncIterator; diff --git a/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs new file mode 100644 index 00000000..5ff34411 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs @@ -0,0 +1,6 @@ +import { Kind } from '../symbols/index.mjs'; +import { CreateType } from '../create/type.mjs'; +/** `[JavaScript]` Creates a AsyncIterator type */ +export function AsyncIterator(items, options) { + return CreateType({ [Kind]: 'AsyncIterator', type: 'AsyncIterator', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.d.mts new file mode 100644 index 00000000..9977afac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.d.mts @@ -0,0 +1 @@ +export * from './async-iterator.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.mjs new file mode 100644 index 00000000..9977afac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.mjs @@ -0,0 +1 @@ +export * from './async-iterator.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.d.mts b/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.d.mts new file mode 100644 index 00000000..f06fca7b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.d.mts @@ -0,0 +1,14 @@ +import { Ensure } from '../helpers/index.mjs'; +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TComputed } from '../computed/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TPromise } from '../promise/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +type TFromComputed = Ensure<(TComputed<'Awaited', [TComputed]>)>; +type TFromRef = Ensure]>>; +type TFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest]> : Result); +export type TAwaited = (Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TPromise ? TAwaited : Type); +/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ +export declare function Awaited(type: T, options?: SchemaOptions): TAwaited; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs b/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs new file mode 100644 index 00000000..12af890c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs @@ -0,0 +1,37 @@ +import { CreateType } from '../create/type.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Union } from '../union/index.mjs'; +import { Ref } from '../ref/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsIntersect, IsUnion, IsPromise, IsRef, IsComputed } from '../guard/kind.mjs'; +// prettier-ignore +function FromComputed(target, parameters) { + return Computed('Awaited', [Computed(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return Computed('Awaited', [Ref($ref)]); +} +// prettier-ignore +function FromIntersect(types) { + return Intersect(FromRest(types)); +} +// prettier-ignore +function FromUnion(types) { + return Union(FromRest(types)); +} +// prettier-ignore +function FromPromise(type) { + return Awaited(type); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => Awaited(type)); +} +/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ +export function Awaited(type, options) { + return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/awaited/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/awaited/index.d.mts new file mode 100644 index 00000000..325c169d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/awaited/index.d.mts @@ -0,0 +1 @@ +export * from './awaited.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/awaited/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/awaited/index.mjs new file mode 100644 index 00000000..325c169d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/awaited/index.mjs @@ -0,0 +1 @@ +export * from './awaited.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.d.mts b/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.d.mts new file mode 100644 index 00000000..03f8adfc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface BigIntOptions extends SchemaOptions { + exclusiveMaximum?: bigint; + exclusiveMinimum?: bigint; + maximum?: bigint; + minimum?: bigint; + multipleOf?: bigint; +} +export interface TBigInt extends TSchema, BigIntOptions { + [Kind]: 'BigInt'; + static: bigint; + type: 'bigint'; +} +/** `[JavaScript]` Creates a BigInt type */ +export declare function BigInt(options?: BigIntOptions): TBigInt; diff --git a/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs b/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs new file mode 100644 index 00000000..52d81e00 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs @@ -0,0 +1,6 @@ +import { Kind } from '../symbols/index.mjs'; +import { CreateType } from '../create/index.mjs'; +/** `[JavaScript]` Creates a BigInt type */ +export function BigInt(options) { + return CreateType({ [Kind]: 'BigInt', type: 'bigint' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/bigint/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/bigint/index.d.mts new file mode 100644 index 00000000..27a80115 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/bigint/index.d.mts @@ -0,0 +1 @@ +export * from './bigint.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/bigint/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/bigint/index.mjs new file mode 100644 index 00000000..27a80115 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/bigint/index.mjs @@ -0,0 +1 @@ +export * from './bigint.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.d.mts b/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.d.mts new file mode 100644 index 00000000..d451cf82 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TBoolean extends TSchema { + [Kind]: 'Boolean'; + static: boolean; + type: 'boolean'; +} +/** `[Json]` Creates a Boolean type */ +export declare function Boolean(options?: SchemaOptions): TBoolean; diff --git a/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs b/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs new file mode 100644 index 00000000..a2691138 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs @@ -0,0 +1,6 @@ +import { Kind } from '../symbols/index.mjs'; +import { CreateType } from '../create/index.mjs'; +/** `[Json]` Creates a Boolean type */ +export function Boolean(options) { + return CreateType({ [Kind]: 'Boolean', type: 'boolean' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/boolean/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/boolean/index.d.mts new file mode 100644 index 00000000..32e45ffe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/boolean/index.d.mts @@ -0,0 +1 @@ +export * from './boolean.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/boolean/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/boolean/index.mjs new file mode 100644 index 00000000..32e45ffe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/boolean/index.mjs @@ -0,0 +1 @@ +export * from './boolean.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/clone/index.d.mts new file mode 100644 index 00000000..36ea11f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/index.d.mts @@ -0,0 +1,2 @@ +export * from './type.mjs'; +export * from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/clone/index.mjs new file mode 100644 index 00000000..36ea11f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/index.mjs @@ -0,0 +1,2 @@ +export * from './type.mjs'; +export * from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/clone/type.d.mts new file mode 100644 index 00000000..f9593b9a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/type.d.mts @@ -0,0 +1,5 @@ +import { TSchema, SchemaOptions } from '../schema/index.mjs'; +/** Clones a Rest */ +export declare function CloneRest(schemas: T): T; +/** Clones a Type */ +export declare function CloneType(schema: T, options?: SchemaOptions): T; diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs b/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs new file mode 100644 index 00000000..964c43c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs @@ -0,0 +1,9 @@ +import { Clone } from './value.mjs'; +/** Clones a Rest */ +export function CloneRest(schemas) { + return schemas.map((schema) => CloneType(schema)); +} +/** Clones a Type */ +export function CloneType(schema, options) { + return options === undefined ? Clone(schema) : Clone({ ...options, ...schema }); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/value.d.mts b/node_modules/@sinclair/typebox/build/esm/type/clone/value.d.mts new file mode 100644 index 00000000..30aa085a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/value.d.mts @@ -0,0 +1,2 @@ +/** Clones a value */ +export declare function Clone(value: T): T; diff --git a/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs b/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs new file mode 100644 index 00000000..82f971ca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs @@ -0,0 +1,36 @@ +import * as ValueGuard from '../guard/value.mjs'; +function ArrayType(value) { + return value.map((value) => Visit(value)); +} +function DateType(value) { + return new Date(value.getTime()); +} +function Uint8ArrayType(value) { + return new Uint8Array(value); +} +function RegExpType(value) { + return new RegExp(value.source, value.flags); +} +function ObjectType(value) { + const result = {}; + for (const key of Object.getOwnPropertyNames(value)) { + result[key] = Visit(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + result[key] = Visit(value[key]); + } + return result; +} +// prettier-ignore +function Visit(value) { + return (ValueGuard.IsArray(value) ? ArrayType(value) : + ValueGuard.IsDate(value) ? DateType(value) : + ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) : + ValueGuard.IsRegExp(value) ? RegExpType(value) : + ValueGuard.IsObject(value) ? ObjectType(value) : + value); +} +/** Clones a value */ +export function Clone(value) { + return Visit(value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/composite/composite.d.mts b/node_modules/@sinclair/typebox/build/esm/type/composite/composite.d.mts new file mode 100644 index 00000000..d1e632ef --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/composite/composite.d.mts @@ -0,0 +1,18 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Evaluate } from '../helpers/index.mjs'; +import { type TIntersectEvaluated } from '../intersect/index.mjs'; +import { type TIndexFromPropertyKeys } from '../indexed/index.mjs'; +import { type TKeyOfPropertyKeys } from '../keyof/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs'; +import { TSetDistinct } from '../sets/index.mjs'; +type TCompositeKeys = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeKeys]> : TSetDistinct); +type TFilterNever = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? TFilterNever : TFilterNever : Acc); +type TCompositeProperty = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeProperty]> : TFilterNever); +type TCompositeProperties = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TCompositeProperties>; +}> : Acc); +type TCompositeEvaluate, P extends TProperties = Evaluate>, R extends TSchema = TObject

> = R; +export type TComposite = TCompositeEvaluate; +export declare function Composite(T: [...T], options?: ObjectOptions): TComposite; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs b/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs new file mode 100644 index 00000000..bcad1f60 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs @@ -0,0 +1,42 @@ +import { IntersectEvaluated } from '../intersect/index.mjs'; +import { IndexFromPropertyKeys } from '../indexed/index.mjs'; +import { KeyOfPropertyKeys } from '../keyof/index.mjs'; +import { Object } from '../object/index.mjs'; +import { SetDistinct } from '../sets/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsNever } from '../guard/kind.mjs'; +// prettier-ignore +function CompositeKeys(T) { + const Acc = []; + for (const L of T) + Acc.push(...KeyOfPropertyKeys(L)); + return SetDistinct(Acc); +} +// prettier-ignore +function FilterNever(T) { + return T.filter(L => !IsNever(L)); +} +// prettier-ignore +function CompositeProperty(T, K) { + const Acc = []; + for (const L of T) + Acc.push(...IndexFromPropertyKeys(L, [K])); + return FilterNever(Acc); +} +// prettier-ignore +function CompositeProperties(T, K) { + const Acc = {}; + for (const L of K) { + Acc[L] = IntersectEvaluated(CompositeProperty(T, L)); + } + return Acc; +} +// prettier-ignore +export function Composite(T, options) { + const K = CompositeKeys(T); + const P = CompositeProperties(T, K); + const R = Object(P, options); + return R; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/composite/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/composite/index.d.mts new file mode 100644 index 00000000..cabb7e09 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/composite/index.d.mts @@ -0,0 +1 @@ +export * from './composite.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/composite/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/composite/index.mjs new file mode 100644 index 00000000..cabb7e09 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/composite/index.mjs @@ -0,0 +1 @@ +export * from './composite.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/computed/computed.d.mts b/node_modules/@sinclair/typebox/build/esm/type/computed/computed.d.mts new file mode 100644 index 00000000..7133497d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/computed/computed.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/symbols.mjs'; +export interface TComputed extends TSchema { + [Kind]: 'Computed'; + target: Target; + parameters: Parameters; +} +/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */ +export declare function Computed(target: Target, parameters: [...Parameters], options?: SchemaOptions): TComputed; diff --git a/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs b/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs new file mode 100644 index 00000000..2ac01076 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/index.mjs'; +import { Kind } from '../symbols/symbols.mjs'; +/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */ +export function Computed(target, parameters, options) { + return CreateType({ [Kind]: 'Computed', target, parameters }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/computed/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/computed/index.d.mts new file mode 100644 index 00000000..1954cbef --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/computed/index.d.mts @@ -0,0 +1 @@ +export * from './computed.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/computed/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/computed/index.mjs new file mode 100644 index 00000000..1954cbef --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/computed/index.mjs @@ -0,0 +1 @@ +export * from './computed.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/const/const.d.mts b/node_modules/@sinclair/typebox/build/esm/type/const/const.d.mts new file mode 100644 index 00000000..e424e51f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/const/const.d.mts @@ -0,0 +1,27 @@ +import type { AssertRest, Evaluate } from '../helpers/index.mjs'; +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TAny } from '../any/index.mjs'; +import { type TBigInt } from '../bigint/index.mjs'; +import { type TDate } from '../date/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TNull } from '../null/index.mjs'; +import { type TObject } from '../object/index.mjs'; +import { type TSymbol } from '../symbol/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TUndefined } from '../undefined/index.mjs'; +import { type TUint8Array } from '../uint8array/index.mjs'; +import { type TUnknown } from '../unknown/index.mjs'; +type TFromArray = T extends readonly [infer L extends unknown, ...infer R extends unknown[]] ? [FromValue, ...TFromArray] : T; +type TFromProperties> = { + -readonly [K in keyof T]: FromValue extends infer R extends TSchema ? TReadonly : TReadonly; +}; +type TConditionalReadonly = Root extends true ? T : TReadonly; +type FromValue = T extends AsyncIterableIterator ? TConditionalReadonly : T extends IterableIterator ? TConditionalReadonly : T extends readonly unknown[] ? TReadonly>>> : T extends Uint8Array ? TUint8Array : T extends Date ? TDate : T extends Record ? TConditionalReadonly>>, Root> : T extends Function ? TConditionalReadonly, Root> : T extends undefined ? TUndefined : T extends null ? TNull : T extends symbol ? TSymbol : T extends number ? TLiteral : T extends boolean ? TLiteral : T extends string ? TLiteral : T extends bigint ? TBigInt : TObject<{}>; +declare function FromValue(value: T, root: Root): FromValue; +export type TConst = FromValue; +/** `[JavaScript]` Creates a readonly const type from the given value. */ +export declare function Const(T: T, options?: SchemaOptions): TConst; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs b/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs new file mode 100644 index 00000000..831eb873 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs @@ -0,0 +1,54 @@ +import { Any } from '../any/index.mjs'; +import { BigInt } from '../bigint/index.mjs'; +import { Date } from '../date/index.mjs'; +import { Function as FunctionType } from '../function/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Null } from '../null/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Symbol } from '../symbol/index.mjs'; +import { Tuple } from '../tuple/index.mjs'; +import { Readonly } from '../readonly/index.mjs'; +import { Undefined } from '../undefined/index.mjs'; +import { Uint8Array } from '../uint8array/index.mjs'; +import { Unknown } from '../unknown/index.mjs'; +import { CreateType } from '../create/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsNumber, IsBigInt, IsUint8Array, IsDate, IsIterator, IsObject, IsAsyncIterator, IsFunction, IsUndefined, IsNull, IsSymbol, IsBoolean, IsString } from '../guard/value.mjs'; +// prettier-ignore +function FromArray(T) { + return T.map(L => FromValue(L, false)); +} +// prettier-ignore +function FromProperties(value) { + const Acc = {}; + for (const K of globalThis.Object.getOwnPropertyNames(value)) + Acc[K] = Readonly(FromValue(value[K], false)); + return Acc; +} +function ConditionalReadonly(T, root) { + return (root === true ? T : Readonly(T)); +} +// prettier-ignore +function FromValue(value, root) { + return (IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : + IsIterator(value) ? ConditionalReadonly(Any(), root) : + IsArray(value) ? Readonly(Tuple(FromArray(value))) : + IsUint8Array(value) ? Uint8Array() : + IsDate(value) ? Date() : + IsObject(value) ? ConditionalReadonly(Object(FromProperties(value)), root) : + IsFunction(value) ? ConditionalReadonly(FunctionType([], Unknown()), root) : + IsUndefined(value) ? Undefined() : + IsNull(value) ? Null() : + IsSymbol(value) ? Symbol() : + IsBigInt(value) ? BigInt() : + IsNumber(value) ? Literal(value) : + IsBoolean(value) ? Literal(value) : + IsString(value) ? Literal(value) : + Object({})); +} +/** `[JavaScript]` Creates a readonly const type from the given value. */ +export function Const(T, options) { + return CreateType(FromValue(T, true), options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/const/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/const/index.d.mts new file mode 100644 index 00000000..66ca700d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/const/index.d.mts @@ -0,0 +1 @@ +export * from './const.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/const/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/const/index.mjs new file mode 100644 index 00000000..66ca700d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/const/index.mjs @@ -0,0 +1 @@ +export * from './const.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.d.mts b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.d.mts new file mode 100644 index 00000000..fab65dac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.d.mts @@ -0,0 +1,7 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TConstructor } from '../constructor/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TNever } from '../never/index.mjs'; +export type TConstructorParameters = (Type extends TConstructor ? TTuple : TNever); +/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ +export declare function ConstructorParameters(schema: Type, options?: SchemaOptions): TConstructorParameters; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs new file mode 100644 index 00000000..8be5261a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs @@ -0,0 +1,7 @@ +import { Tuple } from '../tuple/index.mjs'; +import { Never } from '../never/index.mjs'; +import * as KindGuard from '../guard/kind.mjs'; +/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ +export function ConstructorParameters(schema, options) { + return (KindGuard.IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.d.mts new file mode 100644 index 00000000..b4153465 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.d.mts @@ -0,0 +1 @@ +export * from './constructor-parameters.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.mjs new file mode 100644 index 00000000..b4153465 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.mjs @@ -0,0 +1 @@ +export * from './constructor-parameters.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.d.mts b/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.d.mts new file mode 100644 index 00000000..242bbf08 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.d.mts @@ -0,0 +1,23 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import type { Ensure } from '../helpers/index.mjs'; +import type { TReadonlyOptional } from '../readonly-optional/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type StaticReturnType = Static; +type StaticParameter = T extends TReadonlyOptional ? [Readonly>?] : T extends TReadonly ? [Readonly>] : T extends TOptional ? [Static?] : [ + Static +]; +type StaticParameters = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters]> : Acc); +type StaticConstructor = Ensure) => StaticReturnType>; +export interface TConstructor extends TSchema { + [Kind]: 'Constructor'; + static: StaticConstructor; + type: 'Constructor'; + parameters: T; + returns: U; +} +/** `[JavaScript]` Creates a Constructor type */ +export declare function Constructor(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs b/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs new file mode 100644 index 00000000..aa86f734 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Constructor type */ +export function Constructor(parameters, returns, options) { + return CreateType({ [Kind]: 'Constructor', type: 'Constructor', parameters, returns }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/constructor/index.d.mts new file mode 100644 index 00000000..96f31edd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor/index.d.mts @@ -0,0 +1 @@ +export * from './constructor.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/constructor/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/constructor/index.mjs new file mode 100644 index 00000000..96f31edd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/constructor/index.mjs @@ -0,0 +1 @@ +export * from './constructor.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/immutable.d.mts b/node_modules/@sinclair/typebox/build/esm/type/create/immutable.d.mts new file mode 100644 index 00000000..8b90d402 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/immutable.d.mts @@ -0,0 +1,2 @@ +/** Specialized deep immutable value. Applies freeze recursively to the given value */ +export declare function Immutable(value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs b/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs new file mode 100644 index 00000000..3c212ee0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs @@ -0,0 +1,33 @@ +import * as ValueGuard from '../guard/value.mjs'; +function ImmutableArray(value) { + return globalThis.Object.freeze(value).map((value) => Immutable(value)); +} +function ImmutableDate(value) { + return value; +} +function ImmutableUint8Array(value) { + return value; +} +function ImmutableRegExp(value) { + return value; +} +function ImmutableObject(value) { + const result = {}; + for (const key of Object.getOwnPropertyNames(value)) { + result[key] = Immutable(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + result[key] = Immutable(value[key]); + } + return globalThis.Object.freeze(result); +} +/** Specialized deep immutable value. Applies freeze recursively to the given value */ +// prettier-ignore +export function Immutable(value) { + return (ValueGuard.IsArray(value) ? ImmutableArray(value) : + ValueGuard.IsDate(value) ? ImmutableDate(value) : + ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) : + ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) : + ValueGuard.IsObject(value) ? ImmutableObject(value) : + value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/create/index.d.mts new file mode 100644 index 00000000..52a09515 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/index.d.mts @@ -0,0 +1 @@ +export * from './type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/create/index.mjs new file mode 100644 index 00000000..52a09515 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/index.mjs @@ -0,0 +1 @@ +export * from './type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/create/type.d.mts new file mode 100644 index 00000000..792aa9f6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/type.d.mts @@ -0,0 +1,3 @@ +import { SchemaOptions } from '../schema/schema.mjs'; +/** Creates TypeBox schematics using the configured InstanceMode */ +export declare function CreateType(schema: Record, options?: SchemaOptions): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs b/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs new file mode 100644 index 00000000..cff15486 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs @@ -0,0 +1,15 @@ +import { TypeSystemPolicy } from '../../system/policy.mjs'; +import { Immutable } from './immutable.mjs'; +import { Clone } from '../clone/value.mjs'; +/** Creates TypeBox schematics using the configured InstanceMode */ +export function CreateType(schema, options) { + const result = options !== undefined ? { ...options, ...schema } : schema; + switch (TypeSystemPolicy.InstanceMode) { + case 'freeze': + return Immutable(result); + case 'clone': + return Clone(result); + default: + return result; + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/date/date.d.mts b/node_modules/@sinclair/typebox/build/esm/type/date/date.d.mts new file mode 100644 index 00000000..55495e93 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/date/date.d.mts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface DateOptions extends SchemaOptions { + /** The exclusive maximum timestamp value */ + exclusiveMaximumTimestamp?: number; + /** The exclusive minimum timestamp value */ + exclusiveMinimumTimestamp?: number; + /** The maximum timestamp value */ + maximumTimestamp?: number; + /** The minimum timestamp value */ + minimumTimestamp?: number; + /** The multiple of timestamp value */ + multipleOfTimestamp?: number; +} +export interface TDate extends TSchema, DateOptions { + [Kind]: 'Date'; + static: Date; + type: 'date'; +} +/** `[JavaScript]` Creates a Date type */ +export declare function Date(options?: DateOptions): TDate; diff --git a/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs b/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs new file mode 100644 index 00000000..bd764ec4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs @@ -0,0 +1,6 @@ +import { Kind } from '../symbols/index.mjs'; +import { CreateType } from '../create/type.mjs'; +/** `[JavaScript]` Creates a Date type */ +export function Date(options) { + return CreateType({ [Kind]: 'Date', type: 'Date' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/date/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/date/index.d.mts new file mode 100644 index 00000000..e1eb20c5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/date/index.d.mts @@ -0,0 +1 @@ +export * from './date.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/date/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/date/index.mjs new file mode 100644 index 00000000..e1eb20c5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/date/index.mjs @@ -0,0 +1 @@ +export * from './date.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/discard/discard.d.mts b/node_modules/@sinclair/typebox/build/esm/type/discard/discard.d.mts new file mode 100644 index 00000000..77e1c9ad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/discard/discard.d.mts @@ -0,0 +1,2 @@ +/** Discards property keys from the given value. This function returns a shallow Clone. */ +export declare function Discard(value: Record, keys: PropertyKey[]): Record; diff --git a/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs b/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs new file mode 100644 index 00000000..f2d8a67b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs @@ -0,0 +1,8 @@ +function DiscardKey(value, key) { + const { [key]: _, ...rest } = value; + return rest; +} +/** Discards property keys from the given value. This function returns a shallow Clone. */ +export function Discard(value, keys) { + return keys.reduce((acc, key) => DiscardKey(acc, key), value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/discard/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/discard/index.d.mts new file mode 100644 index 00000000..d88a3974 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/discard/index.d.mts @@ -0,0 +1 @@ +export * from './discard.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/discard/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/discard/index.mjs new file mode 100644 index 00000000..d88a3974 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/discard/index.mjs @@ -0,0 +1 @@ +export * from './discard.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/enum/enum.d.mts b/node_modules/@sinclair/typebox/build/esm/type/enum/enum.d.mts new file mode 100644 index 00000000..36de86f1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/enum/enum.d.mts @@ -0,0 +1,14 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +export type TEnumRecord = Record; +export type TEnumValue = string | number; +export type TEnumKey = string; +export interface TEnum = Record> extends TSchema { + [Kind]: 'Union'; + [Hint]: 'Enum'; + static: T[keyof T]; + anyOf: TLiteral[]; +} +/** `[Json]` Creates a Enum type */ +export declare function Enum>(item: T, options?: SchemaOptions): TEnum; diff --git a/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs b/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs new file mode 100644 index 00000000..fce6196f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs @@ -0,0 +1,18 @@ +import { Literal } from '../literal/index.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +import { Union } from '../union/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsUndefined } from '../guard/value.mjs'; +/** `[Json]` Creates a Enum type */ +export function Enum(item, options) { + if (IsUndefined(item)) + throw new Error('Enum undefined or empty'); + const values1 = globalThis.Object.getOwnPropertyNames(item) + .filter((key) => isNaN(key)) + .map((key) => item[key]); + const values2 = [...new Set(values1)]; + const anyOf = values2.map((value) => Literal(value)); + return Union(anyOf, { ...options, [Hint]: 'Enum' }); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/enum/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/enum/index.d.mts new file mode 100644 index 00000000..08010863 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/enum/index.d.mts @@ -0,0 +1 @@ +export * from './enum.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/enum/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/enum/index.mjs new file mode 100644 index 00000000..08010863 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/enum/index.mjs @@ -0,0 +1 @@ +export * from './enum.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/error/error.d.mts b/node_modules/@sinclair/typebox/build/esm/type/error/error.d.mts new file mode 100644 index 00000000..45605323 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/error/error.d.mts @@ -0,0 +1,4 @@ +/** The base Error type thrown for all TypeBox exceptions */ +export declare class TypeBoxError extends Error { + constructor(message: string); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs b/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs new file mode 100644 index 00000000..f035c35d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs @@ -0,0 +1,6 @@ +/** The base Error type thrown for all TypeBox exceptions */ +export class TypeBoxError extends Error { + constructor(message) { + super(message); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/error/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/error/index.d.mts new file mode 100644 index 00000000..428548b0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/error/index.d.mts @@ -0,0 +1 @@ +export * from './error.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/error/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/error/index.mjs new file mode 100644 index 00000000..428548b0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/error/index.mjs @@ -0,0 +1 @@ +export * from './error.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.d.mts new file mode 100644 index 00000000..a36cd5c9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.d.mts @@ -0,0 +1,11 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TExclude } from './exclude.mjs'; +type TFromProperties = ({ + [K2 in keyof K]: TExclude; +}); +type TFromMappedResult = (TFromProperties); +export type TExcludeFromMappedResult> = (TMappedResult

); +export declare function ExcludeFromMappedResult>(R: R, T: T): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs new file mode 100644 index 00000000..df637573 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs @@ -0,0 +1,18 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Exclude } from './exclude.mjs'; +// prettier-ignore +function FromProperties(P, U) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = Exclude(P[K2], U); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, T) { + return FromProperties(R.properties, T); +} +// prettier-ignore +export function ExcludeFromMappedResult(R, T) { + const P = FromMappedResult(R, T); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.d.mts b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.d.mts new file mode 100644 index 00000000..2e9f3a4c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.d.mts @@ -0,0 +1,5 @@ +import type { TSchema } from '../schema/index.mjs'; +import { TExclude } from './exclude.mjs'; +import { type TTemplateLiteral, type TTemplateLiteralToUnion } from '../template-literal/index.mjs'; +export type TExcludeFromTemplateLiteral = (TExclude, R>); +export declare function ExcludeFromTemplateLiteral(L: L, R: R): TExcludeFromTemplateLiteral; diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs new file mode 100644 index 00000000..f23ce32b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs @@ -0,0 +1,5 @@ +import { Exclude } from './exclude.mjs'; +import { TemplateLiteralToUnion } from '../template-literal/index.mjs'; +export function ExcludeFromTemplateLiteral(L, R) { + return Exclude(TemplateLiteralToUnion(L), R); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.d.mts b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.d.mts new file mode 100644 index 00000000..a8a289ae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.d.mts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { UnionToTuple, AssertRest, AssertType } from '../helpers/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TTemplateLiteral } from '../template-literal/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type Static } from '../static/index.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +import { type TExcludeFromMappedResult } from './exclude-from-mapped-result.mjs'; +import { type TExcludeFromTemplateLiteral } from './exclude-from-template-literal.mjs'; +type TExcludeRest = AssertRest> extends Static ? never : L[K]; +}[number]>> extends infer R extends TSchema[] ? TUnionEvaluated : never; +export type TExclude = (L extends TUnion ? TExcludeRest : L extends R ? TNever : L); +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromMappedResult; +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromTemplateLiteral; +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export declare function Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs new file mode 100644 index 00000000..34ca7794 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs @@ -0,0 +1,25 @@ +import { CreateType } from '../create/type.mjs'; +import { Union } from '../union/index.mjs'; +import { Never } from '../never/index.mjs'; +import { ExtendsCheck, ExtendsResult } from '../extends/index.mjs'; +import { ExcludeFromMappedResult } from './exclude-from-mapped-result.mjs'; +import { ExcludeFromTemplateLiteral } from './exclude-from-template-literal.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedResult, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs'; +function ExcludeRest(L, R) { + const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False); + return excluded.length === 1 ? excluded[0] : Union(excluded); +} +/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ +export function Exclude(L, R, options = {}) { + // overloads + if (IsTemplateLiteral(L)) + return CreateType(ExcludeFromTemplateLiteral(L, R), options); + if (IsMappedResult(L)) + return CreateType(ExcludeFromMappedResult(L, R), options); + // prettier-ignore + return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : + ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/exclude/index.d.mts new file mode 100644 index 00000000..2cef888d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/index.d.mts @@ -0,0 +1,3 @@ +export * from './exclude-from-mapped-result.mjs'; +export * from './exclude-from-template-literal.mjs'; +export * from './exclude.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/exclude/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/exclude/index.mjs new file mode 100644 index 00000000..2cef888d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/exclude/index.mjs @@ -0,0 +1,3 @@ +export * from './exclude-from-mapped-result.mjs'; +export * from './exclude-from-template-literal.mjs'; +export * from './exclude.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.d.mts new file mode 100644 index 00000000..f23524ca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.d.mts @@ -0,0 +1,10 @@ +import { type TSchema } from '../schema/index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +export declare class ExtendsResolverError extends TypeBoxError { +} +export declare enum ExtendsResult { + Union = 0, + True = 1, + False = 2 +} +export declare function ExtendsCheck(left: TSchema, right: TSchema): ExtendsResult; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs new file mode 100644 index 00000000..8d40622d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs @@ -0,0 +1,635 @@ +import { Any } from '../any/index.mjs'; +import { Function as FunctionType } from '../function/index.mjs'; +import { Number } from '../number/index.mjs'; +import { String } from '../string/index.mjs'; +import { Unknown } from '../unknown/index.mjs'; +import { TemplateLiteralToUnion } from '../template-literal/index.mjs'; +import { PatternNumberExact, PatternStringExact } from '../patterns/index.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +import { TypeGuard, ValueGuard } from '../guard/index.mjs'; +export class ExtendsResolverError extends TypeBoxError { +} +export var ExtendsResult; +(function (ExtendsResult) { + ExtendsResult[ExtendsResult["Union"] = 0] = "Union"; + ExtendsResult[ExtendsResult["True"] = 1] = "True"; + ExtendsResult[ExtendsResult["False"] = 2] = "False"; +})(ExtendsResult || (ExtendsResult = {})); +// ------------------------------------------------------------------ +// IntoBooleanResult +// ------------------------------------------------------------------ +// prettier-ignore +function IntoBooleanResult(result) { + return result === ExtendsResult.False ? result : ExtendsResult.True; +} +// ------------------------------------------------------------------ +// Throw +// ------------------------------------------------------------------ +// prettier-ignore +function Throw(message) { + throw new ExtendsResolverError(message); +} +// ------------------------------------------------------------------ +// StructuralRight +// ------------------------------------------------------------------ +// prettier-ignore +function IsStructuralRight(right) { + return (TypeGuard.IsNever(right) || + TypeGuard.IsIntersect(right) || + TypeGuard.IsUnion(right) || + TypeGuard.IsUnknown(right) || + TypeGuard.IsAny(right)); +} +// prettier-ignore +function StructuralRight(left, right) { + return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) : + TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : + TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + Throw('StructuralRight')); +} +// ------------------------------------------------------------------ +// Any +// ------------------------------------------------------------------ +// prettier-ignore +function FromAnyRight(left, right) { + return ExtendsResult.True; +} +// prettier-ignore +function FromAny(left, right) { + return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + (TypeGuard.IsUnion(right) && right.anyOf.some((schema) => TypeGuard.IsAny(schema) || TypeGuard.IsUnknown(schema))) ? ExtendsResult.True : + TypeGuard.IsUnion(right) ? ExtendsResult.Union : + TypeGuard.IsUnknown(right) ? ExtendsResult.True : + TypeGuard.IsAny(right) ? ExtendsResult.True : + ExtendsResult.Union); +} +// ------------------------------------------------------------------ +// Array +// ------------------------------------------------------------------ +// prettier-ignore +function FromArrayRight(left, right) { + return (TypeGuard.IsUnknown(left) ? ExtendsResult.False : + TypeGuard.IsAny(left) ? ExtendsResult.Union : + TypeGuard.IsNever(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromArray(left, right) { + return (TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.IsArray(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// AsyncIterator +// ------------------------------------------------------------------ +// prettier-ignore +function FromAsyncIterator(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// BigInt +// ------------------------------------------------------------------ +// prettier-ignore +function FromBigInt(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsBigInt(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Boolean +// ------------------------------------------------------------------ +// prettier-ignore +function FromBooleanRight(left, right) { + return (TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True : + TypeGuard.IsBoolean(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromBoolean(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsBoolean(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Constructor +// ------------------------------------------------------------------ +// prettier-ignore +function FromConstructor(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !TypeGuard.IsConstructor(right) ? ExtendsResult.False : + left.parameters.length > right.parameters.length ? ExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); +} +// ------------------------------------------------------------------ +// Date +// ------------------------------------------------------------------ +// prettier-ignore +function FromDate(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsDate(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Function +// ------------------------------------------------------------------ +// prettier-ignore +function FromFunction(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !TypeGuard.IsFunction(right) ? ExtendsResult.False : + left.parameters.length > right.parameters.length ? ExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); +} +// ------------------------------------------------------------------ +// Integer +// ------------------------------------------------------------------ +// prettier-ignore +function FromIntegerRight(left, right) { + return (TypeGuard.IsLiteral(left) && ValueGuard.IsNumber(left.const) ? ExtendsResult.True : + TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromInteger(left, right) { + return (TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Intersect +// ------------------------------------------------------------------ +// prettier-ignore +function FromIntersectRight(left, right) { + return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// prettier-ignore +function FromIntersect(left, right) { + return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// ------------------------------------------------------------------ +// Iterator +// ------------------------------------------------------------------ +// prettier-ignore +function FromIterator(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.IsIterator(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); +} +// ------------------------------------------------------------------ +// Literal +// ------------------------------------------------------------------ +// prettier-ignore +function FromLiteral(left, right) { + return (TypeGuard.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsString(right) ? FromStringRight(left, right) : + TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : + TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : + TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Never +// ------------------------------------------------------------------ +// prettier-ignore +function FromNeverRight(left, right) { + return ExtendsResult.False; +} +// prettier-ignore +function FromNever(left, right) { + return ExtendsResult.True; +} +// ------------------------------------------------------------------ +// Not +// ------------------------------------------------------------------ +// prettier-ignore +function UnwrapTNot(schema) { + let [current, depth] = [schema, 0]; + while (true) { + if (!TypeGuard.IsNot(current)) + break; + current = current.not; + depth += 1; + } + return depth % 2 === 0 ? current : Unknown(); +} +// prettier-ignore +function FromNot(left, right) { + // TypeScript has no concept of negated types, and attempts to correctly check the negated + // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer + // the type. Instead we unwrap to either unknown or T and continue evaluating. + // prettier-ignore + return (TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) : + TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) : + Throw('Invalid fallthrough for Not')); +} +// ------------------------------------------------------------------ +// Null +// ------------------------------------------------------------------ +// prettier-ignore +function FromNull(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsNull(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +// prettier-ignore +function FromNumberRight(left, right) { + return (TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True : + TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromNumber(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Object +// ------------------------------------------------------------------ +// prettier-ignore +function IsObjectPropertyCount(schema, count) { + return Object.getOwnPropertyNames(schema.properties).length === count; +} +// prettier-ignore +function IsObjectStringLike(schema) { + return IsObjectArrayLike(schema); +} +// prettier-ignore +function IsObjectSymbolLike(schema) { + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.IsString(schema.properties.description.anyOf[0]) && + TypeGuard.IsUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.IsString(schema.properties.description.anyOf[1]) && + TypeGuard.IsUndefined(schema.properties.description.anyOf[0])))); +} +// prettier-ignore +function IsObjectNumberLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectBooleanLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectBigIntLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectDateLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectUint8ArrayLike(schema) { + return IsObjectArrayLike(schema); +} +// prettier-ignore +function IsObjectFunctionLike(schema) { + const length = Number(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True); +} +// prettier-ignore +function IsObjectConstructorLike(schema) { + return IsObjectPropertyCount(schema, 0); +} +// prettier-ignore +function IsObjectArrayLike(schema) { + const length = Number(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True); +} +// prettier-ignore +function IsObjectPromiseLike(schema) { + const then = FunctionType([Any()], Any()); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True); +} +// ------------------------------------------------------------------ +// Property +// ------------------------------------------------------------------ +// prettier-ignore +function Property(left, right) { + return (Visit(left, right) === ExtendsResult.False ? ExtendsResult.False : + TypeGuard.IsOptional(left) && !TypeGuard.IsOptional(right) ? ExtendsResult.False : + ExtendsResult.True); +} +// prettier-ignore +function FromObjectRight(left, right) { + return (TypeGuard.IsUnknown(left) ? ExtendsResult.False : + TypeGuard.IsAny(left) ? ExtendsResult.Union : (TypeGuard.IsNever(left) || + (TypeGuard.IsLiteralString(left) && IsObjectStringLike(right)) || + (TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right)) || + (TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right)) || + (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) || + (TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right)) || + (TypeGuard.IsString(left) && IsObjectStringLike(right)) || + (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) || + (TypeGuard.IsNumber(left) && IsObjectNumberLike(right)) || + (TypeGuard.IsInteger(left) && IsObjectNumberLike(right)) || + (TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right)) || + (TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right)) || + (TypeGuard.IsDate(left) && IsObjectDateLike(right)) || + (TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right)) || + (TypeGuard.IsFunction(left) && IsObjectFunctionLike(right))) ? ExtendsResult.True : + (TypeGuard.IsRecord(left) && TypeGuard.IsString(RecordKey(left))) ? (() => { + // When expressing a Record with literal key values, the Record is converted into a Object with + // the Hint assigned as `Record`. This is used to invert the extends logic. + return right[Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False; + })() : + (TypeGuard.IsRecord(left) && TypeGuard.IsNumber(RecordKey(left))) ? (() => { + return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False; + })() : + ExtendsResult.False); +} +// prettier-ignore +function FromObject(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + !TypeGuard.IsObject(right) ? ExtendsResult.False : + (() => { + for (const key of Object.getOwnPropertyNames(right.properties)) { + if (!(key in left.properties) && !TypeGuard.IsOptional(right.properties[key])) { + return ExtendsResult.False; + } + if (TypeGuard.IsOptional(right.properties[key])) { + return ExtendsResult.True; + } + if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) { + return ExtendsResult.False; + } + } + return ExtendsResult.True; + })()); +} +// ------------------------------------------------------------------ +// Promise +// ------------------------------------------------------------------ +// prettier-ignore +function FromPromise(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : + !TypeGuard.IsPromise(right) ? ExtendsResult.False : + IntoBooleanResult(Visit(left.item, right.item))); +} +// ------------------------------------------------------------------ +// Record +// ------------------------------------------------------------------ +// prettier-ignore +function RecordKey(schema) { + return (PatternNumberExact in schema.patternProperties ? Number() : + PatternStringExact in schema.patternProperties ? String() : + Throw('Unknown record key pattern')); +} +// prettier-ignore +function RecordValue(schema) { + return (PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : + PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : + Throw('Unable to get record value schema')); +} +// prettier-ignore +function FromRecordRight(left, right) { + const [Key, Value] = [RecordKey(right), RecordValue(right)]; + return ((TypeGuard.IsLiteralString(left) && TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True) ? ExtendsResult.True : + TypeGuard.IsUint8Array(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) : + TypeGuard.IsString(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) : + TypeGuard.IsArray(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) : + TypeGuard.IsObject(left) ? (() => { + for (const key of Object.getOwnPropertyNames(left.properties)) { + if (Property(Value, left.properties[key]) === ExtendsResult.False) { + return ExtendsResult.False; + } + } + return ExtendsResult.True; + })() : + ExtendsResult.False); +} +// prettier-ignore +function FromRecord(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + !TypeGuard.IsRecord(right) ? ExtendsResult.False : + Visit(RecordValue(left), RecordValue(right))); +} +// ------------------------------------------------------------------ +// RegExp +// ------------------------------------------------------------------ +// prettier-ignore +function FromRegExp(left, right) { + // Note: RegExp types evaluate as strings, not RegExp objects. + // Here we remap either into string and continue evaluating. + const L = TypeGuard.IsRegExp(left) ? String() : left; + const R = TypeGuard.IsRegExp(right) ? String() : right; + return Visit(L, R); +} +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +// prettier-ignore +function FromStringRight(left, right) { + return (TypeGuard.IsLiteral(left) && ValueGuard.IsString(left.const) ? ExtendsResult.True : + TypeGuard.IsString(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromString(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsString(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Symbol +// ------------------------------------------------------------------ +// prettier-ignore +function FromSymbol(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsSymbol(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// TemplateLiteral +// ------------------------------------------------------------------ +// prettier-ignore +function FromTemplateLiteral(left, right) { + // TemplateLiteral types are resolved to either unions for finite expressions or string + // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for + // either type and continue evaluating. + return (TypeGuard.IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) : + TypeGuard.IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) : + Throw('Invalid fallthrough for TemplateLiteral')); +} +// ------------------------------------------------------------------ +// Tuple +// ------------------------------------------------------------------ +// prettier-ignore +function IsArrayOfTuple(left, right) { + return (TypeGuard.IsArray(right) && + left.items !== undefined && + left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True)); +} +// prettier-ignore +function FromTupleRight(left, right) { + return (TypeGuard.IsNever(left) ? ExtendsResult.True : + TypeGuard.IsUnknown(left) ? ExtendsResult.False : + TypeGuard.IsAny(left) ? ExtendsResult.Union : + ExtendsResult.False); +} +// prettier-ignore +function FromTuple(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : + TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : + !TypeGuard.IsTuple(right) ? ExtendsResult.False : + (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) || (!ValueGuard.IsUndefined(left.items) && ValueGuard.IsUndefined(right.items)) ? ExtendsResult.False : + (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) ? ExtendsResult.True : + left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Uint8Array +// ------------------------------------------------------------------ +// prettier-ignore +function FromUint8Array(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsUint8Array(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Undefined +// ------------------------------------------------------------------ +// prettier-ignore +function FromUndefined(left, right) { + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : + TypeGuard.IsVoid(right) ? FromVoidRight(left, right) : + TypeGuard.IsUndefined(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Union +// ------------------------------------------------------------------ +// prettier-ignore +function FromUnionRight(left, right) { + return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// prettier-ignore +function FromUnion(left, right) { + return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True) + ? ExtendsResult.True + : ExtendsResult.False; +} +// ------------------------------------------------------------------ +// Unknown +// ------------------------------------------------------------------ +// prettier-ignore +function FromUnknownRight(left, right) { + return ExtendsResult.True; +} +// prettier-ignore +function FromUnknown(left, right) { + return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) : + TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + TypeGuard.IsString(right) ? FromStringRight(left, right) : + TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : + TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : + TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : + TypeGuard.IsArray(right) ? FromArrayRight(left, right) : + TypeGuard.IsTuple(right) ? FromTupleRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsUnknown(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// ------------------------------------------------------------------ +// Void +// ------------------------------------------------------------------ +// prettier-ignore +function FromVoidRight(left, right) { + return (TypeGuard.IsUndefined(left) ? ExtendsResult.True : + TypeGuard.IsUndefined(left) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function FromVoid(left, right) { + return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : + TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : + TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : + TypeGuard.IsAny(right) ? FromAnyRight(left, right) : + TypeGuard.IsObject(right) ? FromObjectRight(left, right) : + TypeGuard.IsVoid(right) ? ExtendsResult.True : + ExtendsResult.False); +} +// prettier-ignore +function Visit(left, right) { + return ( + // resolvable + (TypeGuard.IsTemplateLiteral(left) || TypeGuard.IsTemplateLiteral(right)) ? FromTemplateLiteral(left, right) : + (TypeGuard.IsRegExp(left) || TypeGuard.IsRegExp(right)) ? FromRegExp(left, right) : + (TypeGuard.IsNot(left) || TypeGuard.IsNot(right)) ? FromNot(left, right) : + // standard + TypeGuard.IsAny(left) ? FromAny(left, right) : + TypeGuard.IsArray(left) ? FromArray(left, right) : + TypeGuard.IsBigInt(left) ? FromBigInt(left, right) : + TypeGuard.IsBoolean(left) ? FromBoolean(left, right) : + TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : + TypeGuard.IsConstructor(left) ? FromConstructor(left, right) : + TypeGuard.IsDate(left) ? FromDate(left, right) : + TypeGuard.IsFunction(left) ? FromFunction(left, right) : + TypeGuard.IsInteger(left) ? FromInteger(left, right) : + TypeGuard.IsIntersect(left) ? FromIntersect(left, right) : + TypeGuard.IsIterator(left) ? FromIterator(left, right) : + TypeGuard.IsLiteral(left) ? FromLiteral(left, right) : + TypeGuard.IsNever(left) ? FromNever(left, right) : + TypeGuard.IsNull(left) ? FromNull(left, right) : + TypeGuard.IsNumber(left) ? FromNumber(left, right) : + TypeGuard.IsObject(left) ? FromObject(left, right) : + TypeGuard.IsRecord(left) ? FromRecord(left, right) : + TypeGuard.IsString(left) ? FromString(left, right) : + TypeGuard.IsSymbol(left) ? FromSymbol(left, right) : + TypeGuard.IsTuple(left) ? FromTuple(left, right) : + TypeGuard.IsPromise(left) ? FromPromise(left, right) : + TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) : + TypeGuard.IsUndefined(left) ? FromUndefined(left, right) : + TypeGuard.IsUnion(left) ? FromUnion(left, right) : + TypeGuard.IsUnknown(left) ? FromUnknown(left, right) : + TypeGuard.IsVoid(left) ? FromVoid(left, right) : + Throw(`Unknown left type operand '${left[Kind]}'`)); +} +export function ExtendsCheck(left, right) { + return Visit(left, right); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.d.mts new file mode 100644 index 00000000..b8994bf2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.d.mts @@ -0,0 +1,14 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import type { Assert } from '../helpers/index.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TExtends } from './extends.mjs'; +type TFromPropertyKey = { + [_ in K]: TExtends>, U, L, R>; +}; +type TFromPropertyKeys = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys> : Acc); +type TFromMappedKey = (TFromPropertyKeys); +export type TExtendsFromMappedKey> = (TMappedResult

); +export declare function ExtendsFromMappedKey>(T: T, U: U, L: L, R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs new file mode 100644 index 00000000..ace359ff --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs @@ -0,0 +1,25 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Extends } from './extends.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromPropertyKey(K, U, L, R, options) { + return { + [K]: Extends(Literal(K), U, L, R, Clone(options)) + }; +} +// prettier-ignore +function FromPropertyKeys(K, U, L, R, options) { + return K.reduce((Acc, LK) => { + return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(K, U, L, R, options) { + return FromPropertyKeys(K.keys, U, L, R, options); +} +// prettier-ignore +export function ExtendsFromMappedKey(T, U, L, R, options) { + const P = FromMappedKey(T, U, L, R, options); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.d.mts new file mode 100644 index 00000000..44a49a57 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.d.mts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TExtends } from './extends.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TExtends; +}); +type TFromMappedResult = (TFromProperties); +export type TExtendsFromMappedResult> = (TMappedResult

); +export declare function ExtendsFromMappedResult>(Left: Left, Right: Right, True: True, False: False, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs new file mode 100644 index 00000000..9a11a4f7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs @@ -0,0 +1,19 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Extends } from './extends.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromProperties(P, Right, True, False, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = Extends(P[K2], Right, True, False, Clone(options)); + return Acc; +} +// prettier-ignore +function FromMappedResult(Left, Right, True, False, options) { + return FromProperties(Left.properties, Right, True, False, options); +} +// prettier-ignore +export function ExtendsFromMappedResult(Left, Right, True, False, options) { + const P = FromMappedResult(Left, Right, True, False, options); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.d.mts new file mode 100644 index 00000000..df9a7a4e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.d.mts @@ -0,0 +1,3 @@ +import type { TSchema } from '../schema/index.mjs'; +/** Fast undefined check used for properties of type undefined */ +export declare function ExtendsUndefinedCheck(schema: TSchema): boolean; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs new file mode 100644 index 00000000..4882eb36 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs @@ -0,0 +1,20 @@ +import { Kind } from '../symbols/index.mjs'; +/** Fast undefined check used for properties of type undefined */ +function Intersect(schema) { + return schema.allOf.every((schema) => ExtendsUndefinedCheck(schema)); +} +function Union(schema) { + return schema.anyOf.some((schema) => ExtendsUndefinedCheck(schema)); +} +function Not(schema) { + return !ExtendsUndefinedCheck(schema.not); +} +/** Fast undefined check used for properties of type undefined */ +// prettier-ignore +export function ExtendsUndefinedCheck(schema) { + return (schema[Kind] === 'Intersect' ? Intersect(schema) : + schema[Kind] === 'Union' ? Union(schema) : + schema[Kind] === 'Not' ? Not(schema) : + schema[Kind] === 'Undefined' ? true : + false); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/extends.d.mts new file mode 100644 index 00000000..8ce8e552 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { TMappedKey, TMappedResult } from '../mapped/index.mjs'; +import { UnionToTuple } from '../helpers/index.mjs'; +import { type TExtendsFromMappedKey } from './extends-from-mapped-key.mjs'; +import { type TExtendsFromMappedResult } from './extends-from-mapped-result.mjs'; +type TExtendsResolve = ((Static extends Static ? T : U) extends infer O extends TSchema ? UnionToTuple extends [infer X extends TSchema, infer Y extends TSchema] ? TUnion<[X, Y]> : O : never); +export type TExtends = TExtendsResolve; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey; +/** `[Json]` Creates a Conditional type */ +export declare function Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs new file mode 100644 index 00000000..5540d53d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs @@ -0,0 +1,23 @@ +import { CreateType } from '../create/type.mjs'; +import { Union } from '../union/index.mjs'; +import { ExtendsCheck, ExtendsResult } from './extends-check.mjs'; +import { ExtendsFromMappedKey } from './extends-from-mapped-key.mjs'; +import { ExtendsFromMappedResult } from './extends-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedKey, IsMappedResult } from '../guard/kind.mjs'; +// prettier-ignore +function ExtendsResolve(left, right, trueType, falseType) { + const R = ExtendsCheck(left, right); + return (R === ExtendsResult.Union ? Union([trueType, falseType]) : + R === ExtendsResult.True ? trueType : + falseType); +} +/** `[Json]` Creates a Conditional type */ +export function Extends(L, R, T, F, options) { + // prettier-ignore + return (IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : + IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : + CreateType(ExtendsResolve(L, R, T, F), options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extends/index.d.mts new file mode 100644 index 00000000..2dec0f2d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/index.d.mts @@ -0,0 +1,5 @@ +export * from './extends-check.mjs'; +export * from './extends-from-mapped-key.mjs'; +export * from './extends-from-mapped-result.mjs'; +export * from './extends-undefined.mjs'; +export * from './extends.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extends/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/extends/index.mjs new file mode 100644 index 00000000..2dec0f2d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extends/index.mjs @@ -0,0 +1,5 @@ +export * from './extends-check.mjs'; +export * from './extends-from-mapped-key.mjs'; +export * from './extends-from-mapped-result.mjs'; +export * from './extends-undefined.mjs'; +export * from './extends.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.d.mts new file mode 100644 index 00000000..cd190eba --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.d.mts @@ -0,0 +1,11 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TExtract } from './extract.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TExtract; +}); +type TFromMappedResult = (TFromProperties); +export type TExtractFromMappedResult> = (TMappedResult

); +export declare function ExtractFromMappedResult>(R: R, T: T): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs new file mode 100644 index 00000000..d89ef9a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs @@ -0,0 +1,18 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Extract } from './extract.mjs'; +// prettier-ignore +function FromProperties(P, T) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = Extract(P[K2], T); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, T) { + return FromProperties(R.properties, T); +} +// prettier-ignore +export function ExtractFromMappedResult(R, T) { + const P = FromMappedResult(R, T); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.d.mts new file mode 100644 index 00000000..c01b1380 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.d.mts @@ -0,0 +1,5 @@ +import type { TSchema } from '../schema/index.mjs'; +import { type TExtract } from './extract.mjs'; +import { type TTemplateLiteral, type TTemplateLiteralToUnion } from '../template-literal/index.mjs'; +export type TExtractFromTemplateLiteral = (TExtract, R>); +export declare function ExtractFromTemplateLiteral(L: L, R: R): TExtractFromTemplateLiteral; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs new file mode 100644 index 00000000..cd7e038c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs @@ -0,0 +1,5 @@ +import { Extract } from './extract.mjs'; +import { TemplateLiteralToUnion } from '../template-literal/index.mjs'; +export function ExtractFromTemplateLiteral(L, R) { + return Extract(TemplateLiteralToUnion(L), R); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extract/extract.d.mts new file mode 100644 index 00000000..644be01c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract.d.mts @@ -0,0 +1,21 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { AssertRest, AssertType, UnionToTuple } from '../helpers/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type Static } from '../static/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +import { type TTemplateLiteral } from '../template-literal/index.mjs'; +import { type TExtractFromMappedResult } from './extract-from-mapped-result.mjs'; +import { type TExtractFromTemplateLiteral } from './extract-from-template-literal.mjs'; +type TExtractRest = AssertRest> extends Static ? L[K] : never; +}[number]>> extends infer R extends TSchema[] ? TUnionEvaluated : never; +export type TExtract = (L extends TUnion ? TExtractRest : L extends U ? L : TNever); +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult; +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtractFromTemplateLiteral; +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export declare function Extract(type: L, union: R, options?: SchemaOptions): TExtract; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs b/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs new file mode 100644 index 00000000..224bc44b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs @@ -0,0 +1,25 @@ +import { CreateType } from '../create/type.mjs'; +import { Union } from '../union/index.mjs'; +import { Never } from '../never/index.mjs'; +import { ExtendsCheck, ExtendsResult } from '../extends/index.mjs'; +import { ExtractFromMappedResult } from './extract-from-mapped-result.mjs'; +import { ExtractFromTemplateLiteral } from './extract-from-template-literal.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedResult, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs'; +function ExtractRest(L, R) { + const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False); + return extracted.length === 1 ? extracted[0] : Union(extracted); +} +/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ +export function Extract(L, R, options) { + // overloads + if (IsTemplateLiteral(L)) + return CreateType(ExtractFromTemplateLiteral(L, R), options); + if (IsMappedResult(L)) + return CreateType(ExtractFromMappedResult(L, R), options); + // prettier-ignore + return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : + ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/extract/index.d.mts new file mode 100644 index 00000000..ef57e334 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/index.d.mts @@ -0,0 +1,3 @@ +export * from './extract-from-mapped-result.mjs'; +export * from './extract-from-template-literal.mjs'; +export * from './extract.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/extract/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/extract/index.mjs new file mode 100644 index 00000000..ef57e334 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/extract/index.mjs @@ -0,0 +1,3 @@ +export * from './extract-from-mapped-result.mjs'; +export * from './extract-from-template-literal.mjs'; +export * from './extract.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/function/function.d.mts b/node_modules/@sinclair/typebox/build/esm/type/function/function.d.mts new file mode 100644 index 00000000..11aa16bc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/function/function.d.mts @@ -0,0 +1,23 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import type { Ensure } from '../helpers/index.mjs'; +import type { TReadonlyOptional } from '../readonly-optional/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type StaticReturnType = Static; +type StaticParameter = T extends TReadonlyOptional ? [Readonly>?] : T extends TReadonly ? [Readonly>] : T extends TOptional ? [Static?] : [ + Static +]; +type StaticParameters = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters]> : Acc); +type StaticFunction = Ensure<(...param: StaticParameters) => StaticReturnType>; +export interface TFunction extends TSchema { + [Kind]: 'Function'; + static: StaticFunction; + type: 'Function'; + parameters: T; + returns: U; +} +/** `[JavaScript]` Creates a Function type */ +export declare function Function(parameters: [...T], returns: U, options?: SchemaOptions): TFunction; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs b/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs new file mode 100644 index 00000000..739e71d7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Function type */ +export function Function(parameters, returns, options) { + return CreateType({ [Kind]: 'Function', type: 'Function', parameters, returns }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/function/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/function/index.d.mts new file mode 100644 index 00000000..e2c3c853 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/function/index.d.mts @@ -0,0 +1 @@ +export * from './function.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/function/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/function/index.mjs new file mode 100644 index 00000000..e2c3c853 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/function/index.mjs @@ -0,0 +1 @@ +export * from './function.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/guard/index.d.mts new file mode 100644 index 00000000..cbfca843 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/index.d.mts @@ -0,0 +1,3 @@ +export * as KindGuard from './kind.mjs'; +export * as TypeGuard from './type.mjs'; +export * as ValueGuard from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/guard/index.mjs new file mode 100644 index 00000000..cbfca843 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/index.mjs @@ -0,0 +1,3 @@ +export * as KindGuard from './kind.mjs'; +export * as TypeGuard from './type.mjs'; +export * as ValueGuard from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/kind.d.mts b/node_modules/@sinclair/typebox/build/esm/type/guard/kind.d.mts new file mode 100644 index 00000000..cc9f97c3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/kind.d.mts @@ -0,0 +1,147 @@ +import { Kind, Hint, TransformKind } from '../symbols/index.mjs'; +import { TransformOptions } from '../transform/index.mjs'; +import type { TAny } from '../any/index.mjs'; +import type { TArgument } from '../argument/index.mjs'; +import type { TArray } from '../array/index.mjs'; +import type { TAsyncIterator } from '../async-iterator/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TComputed } from '../computed/index.mjs'; +import type { TBigInt } from '../bigint/index.mjs'; +import type { TConstructor } from '../constructor/index.mjs'; +import type { TFunction } from '../function/index.mjs'; +import type { TImport } from '../module/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TIterator } from '../iterator/index.mjs'; +import type { TLiteral, TLiteralValue } from '../literal/index.mjs'; +import type { TMappedKey, TMappedResult } from '../mapped/index.mjs'; +import type { TNever } from '../never/index.mjs'; +import type { TNot } from '../not/index.mjs'; +import type { TNull } from '../null/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TObject, TProperties } from '../object/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import type { TPromise } from '../promise/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TRecord } from '../record/index.mjs'; +import type { TRef } from '../ref/index.mjs'; +import type { TRegExp } from '../regexp/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import type { TString } from '../string/index.mjs'; +import type { TSymbol } from '../symbol/index.mjs'; +import type { TTemplateLiteral } from '../template-literal/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +import type { TUint8Array } from '../uint8array/index.mjs'; +import type { TUndefined } from '../undefined/index.mjs'; +import type { TUnknown } from '../unknown/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TUnsafe } from '../unsafe/index.mjs'; +import type { TVoid } from '../void/index.mjs'; +import type { TDate } from '../date/index.mjs'; +import type { TThis } from '../recursive/index.mjs'; +/** `[Kind-Only]` Returns true if this value has a Readonly symbol */ +export declare function IsReadonly(value: T): value is TReadonly; +/** `[Kind-Only]` Returns true if this value has a Optional symbol */ +export declare function IsOptional(value: T): value is TOptional; +/** `[Kind-Only]` Returns true if the given value is TAny */ +export declare function IsAny(value: unknown): value is TAny; +/** `[Kind-Only]` Returns true if the given value is TArgument */ +export declare function IsArgument(value: unknown): value is TArgument; +/** `[Kind-Only]` Returns true if the given value is TArray */ +export declare function IsArray(value: unknown): value is TArray; +/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */ +export declare function IsAsyncIterator(value: unknown): value is TAsyncIterator; +/** `[Kind-Only]` Returns true if the given value is TBigInt */ +export declare function IsBigInt(value: unknown): value is TBigInt; +/** `[Kind-Only]` Returns true if the given value is TBoolean */ +export declare function IsBoolean(value: unknown): value is TBoolean; +/** `[Kind-Only]` Returns true if the given value is TComputed */ +export declare function IsComputed(value: unknown): value is TComputed; +/** `[Kind-Only]` Returns true if the given value is TConstructor */ +export declare function IsConstructor(value: unknown): value is TConstructor; +/** `[Kind-Only]` Returns true if the given value is TDate */ +export declare function IsDate(value: unknown): value is TDate; +/** `[Kind-Only]` Returns true if the given value is TFunction */ +export declare function IsFunction(value: unknown): value is TFunction; +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export declare function IsImport(value: unknown): value is TImport; +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export declare function IsInteger(value: unknown): value is TInteger; +/** `[Kind-Only]` Returns true if the given schema is TProperties */ +export declare function IsProperties(value: unknown): value is TProperties; +/** `[Kind-Only]` Returns true if the given value is TIntersect */ +export declare function IsIntersect(value: unknown): value is TIntersect; +/** `[Kind-Only]` Returns true if the given value is TIterator */ +export declare function IsIterator(value: unknown): value is TIterator; +/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */ +export declare function IsKindOf(value: unknown, kind: T): value is Record & { + [Kind]: T; +}; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralString(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralNumber(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteralBoolean(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is TLiteralValue */ +export declare function IsLiteralValue(value: unknown): value is TLiteralValue; +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export declare function IsLiteral(value: unknown): value is TLiteral; +/** `[Kind-Only]` Returns true if the given value is a TMappedKey */ +export declare function IsMappedKey(value: unknown): value is TMappedKey; +/** `[Kind-Only]` Returns true if the given value is TMappedResult */ +export declare function IsMappedResult(value: unknown): value is TMappedResult; +/** `[Kind-Only]` Returns true if the given value is TNever */ +export declare function IsNever(value: unknown): value is TNever; +/** `[Kind-Only]` Returns true if the given value is TNot */ +export declare function IsNot(value: unknown): value is TNot; +/** `[Kind-Only]` Returns true if the given value is TNull */ +export declare function IsNull(value: unknown): value is TNull; +/** `[Kind-Only]` Returns true if the given value is TNumber */ +export declare function IsNumber(value: unknown): value is TNumber; +/** `[Kind-Only]` Returns true if the given value is TObject */ +export declare function IsObject(value: unknown): value is TObject; +/** `[Kind-Only]` Returns true if the given value is TPromise */ +export declare function IsPromise(value: unknown): value is TPromise; +/** `[Kind-Only]` Returns true if the given value is TRecord */ +export declare function IsRecord(value: unknown): value is TRecord; +/** `[Kind-Only]` Returns true if this value is TRecursive */ +export declare function IsRecursive(value: unknown): value is { + [Hint]: 'Recursive'; +}; +/** `[Kind-Only]` Returns true if the given value is TRef */ +export declare function IsRef(value: unknown): value is TRef; +/** `[Kind-Only]` Returns true if the given value is TRegExp */ +export declare function IsRegExp(value: unknown): value is TRegExp; +/** `[Kind-Only]` Returns true if the given value is TString */ +export declare function IsString(value: unknown): value is TString; +/** `[Kind-Only]` Returns true if the given value is TSymbol */ +export declare function IsSymbol(value: unknown): value is TSymbol; +/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */ +export declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral; +/** `[Kind-Only]` Returns true if the given value is TThis */ +export declare function IsThis(value: unknown): value is TThis; +/** `[Kind-Only]` Returns true of this value is TTransform */ +export declare function IsTransform(value: unknown): value is { + [TransformKind]: TransformOptions; +}; +/** `[Kind-Only]` Returns true if the given value is TTuple */ +export declare function IsTuple(value: unknown): value is TTuple; +/** `[Kind-Only]` Returns true if the given value is TUndefined */ +export declare function IsUndefined(value: unknown): value is TUndefined; +/** `[Kind-Only]` Returns true if the given value is TUnion */ +export declare function IsUnion(value: unknown): value is TUnion; +/** `[Kind-Only]` Returns true if the given value is TUint8Array */ +export declare function IsUint8Array(value: unknown): value is TUint8Array; +/** `[Kind-Only]` Returns true if the given value is TUnknown */ +export declare function IsUnknown(value: unknown): value is TUnknown; +/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */ +export declare function IsUnsafe(value: unknown): value is TUnsafe; +/** `[Kind-Only]` Returns true if the given value is TVoid */ +export declare function IsVoid(value: unknown): value is TVoid; +/** `[Kind-Only]` Returns true if the given value is TKind */ +export declare function IsKind(value: unknown): value is Record & { + [Kind]: string; +}; +/** `[Kind-Only]` Returns true if the given value is TSchema */ +export declare function IsSchema(value: unknown): value is TSchema; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs b/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs new file mode 100644 index 00000000..3ad56b29 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs @@ -0,0 +1,235 @@ +import * as ValueGuard from './value.mjs'; +import { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index.mjs'; +/** `[Kind-Only]` Returns true if this value has a Readonly symbol */ +export function IsReadonly(value) { + return ValueGuard.IsObject(value) && value[ReadonlyKind] === 'Readonly'; +} +/** `[Kind-Only]` Returns true if this value has a Optional symbol */ +export function IsOptional(value) { + return ValueGuard.IsObject(value) && value[OptionalKind] === 'Optional'; +} +/** `[Kind-Only]` Returns true if the given value is TAny */ +export function IsAny(value) { + return IsKindOf(value, 'Any'); +} +/** `[Kind-Only]` Returns true if the given value is TArgument */ +export function IsArgument(value) { + return IsKindOf(value, 'Argument'); +} +/** `[Kind-Only]` Returns true if the given value is TArray */ +export function IsArray(value) { + return IsKindOf(value, 'Array'); +} +/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */ +export function IsAsyncIterator(value) { + return IsKindOf(value, 'AsyncIterator'); +} +/** `[Kind-Only]` Returns true if the given value is TBigInt */ +export function IsBigInt(value) { + return IsKindOf(value, 'BigInt'); +} +/** `[Kind-Only]` Returns true if the given value is TBoolean */ +export function IsBoolean(value) { + return IsKindOf(value, 'Boolean'); +} +/** `[Kind-Only]` Returns true if the given value is TComputed */ +export function IsComputed(value) { + return IsKindOf(value, 'Computed'); +} +/** `[Kind-Only]` Returns true if the given value is TConstructor */ +export function IsConstructor(value) { + return IsKindOf(value, 'Constructor'); +} +/** `[Kind-Only]` Returns true if the given value is TDate */ +export function IsDate(value) { + return IsKindOf(value, 'Date'); +} +/** `[Kind-Only]` Returns true if the given value is TFunction */ +export function IsFunction(value) { + return IsKindOf(value, 'Function'); +} +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export function IsImport(value) { + return IsKindOf(value, 'Import'); +} +/** `[Kind-Only]` Returns true if the given value is TInteger */ +export function IsInteger(value) { + return IsKindOf(value, 'Integer'); +} +/** `[Kind-Only]` Returns true if the given schema is TProperties */ +export function IsProperties(value) { + return ValueGuard.IsObject(value); +} +/** `[Kind-Only]` Returns true if the given value is TIntersect */ +export function IsIntersect(value) { + return IsKindOf(value, 'Intersect'); +} +/** `[Kind-Only]` Returns true if the given value is TIterator */ +export function IsIterator(value) { + return IsKindOf(value, 'Iterator'); +} +/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */ +export function IsKindOf(value, kind) { + return ValueGuard.IsObject(value) && Kind in value && value[Kind] === kind; +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export function IsLiteralString(value) { + return IsLiteral(value) && ValueGuard.IsString(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export function IsLiteralNumber(value) { + return IsLiteral(value) && ValueGuard.IsNumber(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export function IsLiteralBoolean(value) { + return IsLiteral(value) && ValueGuard.IsBoolean(value.const); +} +/** `[Kind-Only]` Returns true if the given value is TLiteralValue */ +export function IsLiteralValue(value) { + return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value); +} +/** `[Kind-Only]` Returns true if the given value is TLiteral */ +export function IsLiteral(value) { + return IsKindOf(value, 'Literal'); +} +/** `[Kind-Only]` Returns true if the given value is a TMappedKey */ +export function IsMappedKey(value) { + return IsKindOf(value, 'MappedKey'); +} +/** `[Kind-Only]` Returns true if the given value is TMappedResult */ +export function IsMappedResult(value) { + return IsKindOf(value, 'MappedResult'); +} +/** `[Kind-Only]` Returns true if the given value is TNever */ +export function IsNever(value) { + return IsKindOf(value, 'Never'); +} +/** `[Kind-Only]` Returns true if the given value is TNot */ +export function IsNot(value) { + return IsKindOf(value, 'Not'); +} +/** `[Kind-Only]` Returns true if the given value is TNull */ +export function IsNull(value) { + return IsKindOf(value, 'Null'); +} +/** `[Kind-Only]` Returns true if the given value is TNumber */ +export function IsNumber(value) { + return IsKindOf(value, 'Number'); +} +/** `[Kind-Only]` Returns true if the given value is TObject */ +export function IsObject(value) { + return IsKindOf(value, 'Object'); +} +/** `[Kind-Only]` Returns true if the given value is TPromise */ +export function IsPromise(value) { + return IsKindOf(value, 'Promise'); +} +/** `[Kind-Only]` Returns true if the given value is TRecord */ +export function IsRecord(value) { + return IsKindOf(value, 'Record'); +} +/** `[Kind-Only]` Returns true if this value is TRecursive */ +export function IsRecursive(value) { + return ValueGuard.IsObject(value) && Hint in value && value[Hint] === 'Recursive'; +} +/** `[Kind-Only]` Returns true if the given value is TRef */ +export function IsRef(value) { + return IsKindOf(value, 'Ref'); +} +/** `[Kind-Only]` Returns true if the given value is TRegExp */ +export function IsRegExp(value) { + return IsKindOf(value, 'RegExp'); +} +/** `[Kind-Only]` Returns true if the given value is TString */ +export function IsString(value) { + return IsKindOf(value, 'String'); +} +/** `[Kind-Only]` Returns true if the given value is TSymbol */ +export function IsSymbol(value) { + return IsKindOf(value, 'Symbol'); +} +/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */ +export function IsTemplateLiteral(value) { + return IsKindOf(value, 'TemplateLiteral'); +} +/** `[Kind-Only]` Returns true if the given value is TThis */ +export function IsThis(value) { + return IsKindOf(value, 'This'); +} +/** `[Kind-Only]` Returns true of this value is TTransform */ +export function IsTransform(value) { + return ValueGuard.IsObject(value) && TransformKind in value; +} +/** `[Kind-Only]` Returns true if the given value is TTuple */ +export function IsTuple(value) { + return IsKindOf(value, 'Tuple'); +} +/** `[Kind-Only]` Returns true if the given value is TUndefined */ +export function IsUndefined(value) { + return IsKindOf(value, 'Undefined'); +} +/** `[Kind-Only]` Returns true if the given value is TUnion */ +export function IsUnion(value) { + return IsKindOf(value, 'Union'); +} +/** `[Kind-Only]` Returns true if the given value is TUint8Array */ +export function IsUint8Array(value) { + return IsKindOf(value, 'Uint8Array'); +} +/** `[Kind-Only]` Returns true if the given value is TUnknown */ +export function IsUnknown(value) { + return IsKindOf(value, 'Unknown'); +} +/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */ +export function IsUnsafe(value) { + return IsKindOf(value, 'Unsafe'); +} +/** `[Kind-Only]` Returns true if the given value is TVoid */ +export function IsVoid(value) { + return IsKindOf(value, 'Void'); +} +/** `[Kind-Only]` Returns true if the given value is TKind */ +export function IsKind(value) { + return ValueGuard.IsObject(value) && Kind in value && ValueGuard.IsString(value[Kind]); +} +/** `[Kind-Only]` Returns true if the given value is TSchema */ +export function IsSchema(value) { + // prettier-ignore + return (IsAny(value) || + IsArgument(value) || + IsArray(value) || + IsBoolean(value) || + IsBigInt(value) || + IsAsyncIterator(value) || + IsComputed(value) || + IsConstructor(value) || + IsDate(value) || + IsFunction(value) || + IsInteger(value) || + IsIntersect(value) || + IsIterator(value) || + IsLiteral(value) || + IsMappedKey(value) || + IsMappedResult(value) || + IsNever(value) || + IsNot(value) || + IsNull(value) || + IsNumber(value) || + IsObject(value) || + IsPromise(value) || + IsRecord(value) || + IsRef(value) || + IsRegExp(value) || + IsString(value) || + IsSymbol(value) || + IsTemplateLiteral(value) || + IsThis(value) || + IsTuple(value) || + IsUndefined(value) || + IsUnion(value) || + IsUint8Array(value) || + IsUnknown(value) || + IsUnsafe(value) || + IsVoid(value) || + IsKind(value)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/guard/type.d.mts new file mode 100644 index 00000000..c8896c77 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/type.d.mts @@ -0,0 +1,152 @@ +import { Kind, Hint, TransformKind } from '../symbols/index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +import { TransformOptions } from '../transform/index.mjs'; +import type { TAny } from '../any/index.mjs'; +import type { TArgument } from '../argument/index.mjs'; +import type { TArray } from '../array/index.mjs'; +import type { TAsyncIterator } from '../async-iterator/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TComputed } from '../computed/index.mjs'; +import type { TBigInt } from '../bigint/index.mjs'; +import type { TConstructor } from '../constructor/index.mjs'; +import type { TFunction } from '../function/index.mjs'; +import type { TImport } from '../module/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TIterator } from '../iterator/index.mjs'; +import type { TLiteral, TLiteralValue } from '../literal/index.mjs'; +import type { TMappedKey, TMappedResult } from '../mapped/index.mjs'; +import type { TNever } from '../never/index.mjs'; +import type { TNot } from '../not/index.mjs'; +import type { TNull } from '../null/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TObject, TProperties } from '../object/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import type { TPromise } from '../promise/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TRecord } from '../record/index.mjs'; +import type { TRef } from '../ref/index.mjs'; +import type { TRegExp } from '../regexp/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import type { TString } from '../string/index.mjs'; +import type { TSymbol } from '../symbol/index.mjs'; +import type { TTemplateLiteral } from '../template-literal/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +import type { TUint8Array } from '../uint8array/index.mjs'; +import type { TUndefined } from '../undefined/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TUnknown } from '../unknown/index.mjs'; +import type { TUnsafe } from '../unsafe/index.mjs'; +import type { TVoid } from '../void/index.mjs'; +import type { TDate } from '../date/index.mjs'; +import type { TThis } from '../recursive/index.mjs'; +export declare class TypeGuardUnknownTypeError extends TypeBoxError { +} +/** Returns true if this value has a Readonly symbol */ +export declare function IsReadonly(value: T): value is TReadonly; +/** Returns true if this value has a Optional symbol */ +export declare function IsOptional(value: T): value is TOptional; +/** Returns true if the given value is TAny */ +export declare function IsAny(value: unknown): value is TAny; +/** Returns true if the given value is TArgument */ +export declare function IsArgument(value: unknown): value is TArgument; +/** Returns true if the given value is TArray */ +export declare function IsArray(value: unknown): value is TArray; +/** Returns true if the given value is TAsyncIterator */ +export declare function IsAsyncIterator(value: unknown): value is TAsyncIterator; +/** Returns true if the given value is TBigInt */ +export declare function IsBigInt(value: unknown): value is TBigInt; +/** Returns true if the given value is TBoolean */ +export declare function IsBoolean(value: unknown): value is TBoolean; +/** Returns true if the given value is TComputed */ +export declare function IsComputed(value: unknown): value is TComputed; +/** Returns true if the given value is TConstructor */ +export declare function IsConstructor(value: unknown): value is TConstructor; +/** Returns true if the given value is TDate */ +export declare function IsDate(value: unknown): value is TDate; +/** Returns true if the given value is TFunction */ +export declare function IsFunction(value: unknown): value is TFunction; +/** Returns true if the given value is TImport */ +export declare function IsImport(value: unknown): value is TImport; +/** Returns true if the given value is TInteger */ +export declare function IsInteger(value: unknown): value is TInteger; +/** Returns true if the given schema is TProperties */ +export declare function IsProperties(value: unknown): value is TProperties; +/** Returns true if the given value is TIntersect */ +export declare function IsIntersect(value: unknown): value is TIntersect; +/** Returns true if the given value is TIterator */ +export declare function IsIterator(value: unknown): value is TIterator; +/** Returns true if the given value is a TKind with the given name. */ +export declare function IsKindOf(value: unknown, kind: T): value is Record & { + [Kind]: T; +}; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralString(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralNumber(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteralBoolean(value: unknown): value is TLiteral; +/** Returns true if the given value is TLiteral */ +export declare function IsLiteral(value: unknown): value is TLiteral; +/** Returns true if the given value is a TLiteralValue */ +export declare function IsLiteralValue(value: unknown): value is TLiteralValue; +/** Returns true if the given value is a TMappedKey */ +export declare function IsMappedKey(value: unknown): value is TMappedKey; +/** Returns true if the given value is TMappedResult */ +export declare function IsMappedResult(value: unknown): value is TMappedResult; +/** Returns true if the given value is TNever */ +export declare function IsNever(value: unknown): value is TNever; +/** Returns true if the given value is TNot */ +export declare function IsNot(value: unknown): value is TNot; +/** Returns true if the given value is TNull */ +export declare function IsNull(value: unknown): value is TNull; +/** Returns true if the given value is TNumber */ +export declare function IsNumber(value: unknown): value is TNumber; +/** Returns true if the given value is TObject */ +export declare function IsObject(value: unknown): value is TObject; +/** Returns true if the given value is TPromise */ +export declare function IsPromise(value: unknown): value is TPromise; +/** Returns true if the given value is TRecord */ +export declare function IsRecord(value: unknown): value is TRecord; +/** Returns true if this value is TRecursive */ +export declare function IsRecursive(value: unknown): value is { + [Hint]: 'Recursive'; +}; +/** Returns true if the given value is TRef */ +export declare function IsRef(value: unknown): value is TRef; +/** Returns true if the given value is TRegExp */ +export declare function IsRegExp(value: unknown): value is TRegExp; +/** Returns true if the given value is TString */ +export declare function IsString(value: unknown): value is TString; +/** Returns true if the given value is TSymbol */ +export declare function IsSymbol(value: unknown): value is TSymbol; +/** Returns true if the given value is TTemplateLiteral */ +export declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral; +/** Returns true if the given value is TThis */ +export declare function IsThis(value: unknown): value is TThis; +/** Returns true of this value is TTransform */ +export declare function IsTransform(value: unknown): value is { + [TransformKind]: TransformOptions; +}; +/** Returns true if the given value is TTuple */ +export declare function IsTuple(value: unknown): value is TTuple; +/** Returns true if the given value is TUndefined */ +export declare function IsUndefined(value: unknown): value is TUndefined; +/** Returns true if the given value is TUnion[]> */ +export declare function IsUnionLiteral(value: unknown): value is TUnion; +/** Returns true if the given value is TUnion */ +export declare function IsUnion(value: unknown): value is TUnion; +/** Returns true if the given value is TUint8Array */ +export declare function IsUint8Array(value: unknown): value is TUint8Array; +/** Returns true if the given value is TUnknown */ +export declare function IsUnknown(value: unknown): value is TUnknown; +/** Returns true if the given value is a raw TUnsafe */ +export declare function IsUnsafe(value: unknown): value is TUnsafe; +/** Returns true if the given value is TVoid */ +export declare function IsVoid(value: unknown): value is TVoid; +/** Returns true if the given value is TKind */ +export declare function IsKind(value: unknown): value is Record & { + [Kind]: string; +}; +/** Returns true if the given value is TSchema */ +export declare function IsSchema(value: unknown): value is TSchema; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs b/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs new file mode 100644 index 00000000..5ba3bc28 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs @@ -0,0 +1,509 @@ +import * as ValueGuard from './value.mjs'; +import { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +export class TypeGuardUnknownTypeError extends TypeBoxError { +} +const KnownTypes = [ + 'Argument', + 'Any', + 'Array', + 'AsyncIterator', + 'BigInt', + 'Boolean', + 'Computed', + 'Constructor', + 'Date', + 'Enum', + 'Function', + 'Integer', + 'Intersect', + 'Iterator', + 'Literal', + 'MappedKey', + 'MappedResult', + 'Not', + 'Null', + 'Number', + 'Object', + 'Promise', + 'Record', + 'Ref', + 'RegExp', + 'String', + 'Symbol', + 'TemplateLiteral', + 'This', + 'Tuple', + 'Undefined', + 'Union', + 'Uint8Array', + 'Unknown', + 'Void', +]; +function IsPattern(value) { + try { + new RegExp(value); + return true; + } + catch { + return false; + } +} +function IsControlCharacterFree(value) { + if (!ValueGuard.IsString(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + if ((code >= 7 && code <= 13) || code === 27 || code === 127) { + return false; + } + } + return true; +} +function IsAdditionalProperties(value) { + return IsOptionalBoolean(value) || IsSchema(value); +} +function IsOptionalBigInt(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBigInt(value); +} +function IsOptionalNumber(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsNumber(value); +} +function IsOptionalBoolean(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBoolean(value); +} +function IsOptionalString(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value); +} +function IsOptionalPattern(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value) && IsPattern(value)); +} +function IsOptionalFormat(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value)); +} +function IsOptionalSchema(value) { + return ValueGuard.IsUndefined(value) || IsSchema(value); +} +// ------------------------------------------------------------------ +// Modifiers +// ------------------------------------------------------------------ +/** Returns true if this value has a Readonly symbol */ +export function IsReadonly(value) { + return ValueGuard.IsObject(value) && value[ReadonlyKind] === 'Readonly'; +} +/** Returns true if this value has a Optional symbol */ +export function IsOptional(value) { + return ValueGuard.IsObject(value) && value[OptionalKind] === 'Optional'; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +/** Returns true if the given value is TAny */ +export function IsAny(value) { + // prettier-ignore + return (IsKindOf(value, 'Any') && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TArgument */ +export function IsArgument(value) { + // prettier-ignore + return (IsKindOf(value, 'Argument') && + ValueGuard.IsNumber(value.index)); +} +/** Returns true if the given value is TArray */ +export function IsArray(value) { + return (IsKindOf(value, 'Array') && + value.type === 'array' && + IsOptionalString(value.$id) && + IsSchema(value.items) && + IsOptionalNumber(value.minItems) && + IsOptionalNumber(value.maxItems) && + IsOptionalBoolean(value.uniqueItems) && + IsOptionalSchema(value.contains) && + IsOptionalNumber(value.minContains) && + IsOptionalNumber(value.maxContains)); +} +/** Returns true if the given value is TAsyncIterator */ +export function IsAsyncIterator(value) { + // prettier-ignore + return (IsKindOf(value, 'AsyncIterator') && + value.type === 'AsyncIterator' && + IsOptionalString(value.$id) && + IsSchema(value.items)); +} +/** Returns true if the given value is TBigInt */ +export function IsBigInt(value) { + // prettier-ignore + return (IsKindOf(value, 'BigInt') && + value.type === 'bigint' && + IsOptionalString(value.$id) && + IsOptionalBigInt(value.exclusiveMaximum) && + IsOptionalBigInt(value.exclusiveMinimum) && + IsOptionalBigInt(value.maximum) && + IsOptionalBigInt(value.minimum) && + IsOptionalBigInt(value.multipleOf)); +} +/** Returns true if the given value is TBoolean */ +export function IsBoolean(value) { + // prettier-ignore + return (IsKindOf(value, 'Boolean') && + value.type === 'boolean' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TComputed */ +export function IsComputed(value) { + // prettier-ignore + return (IsKindOf(value, 'Computed') && + ValueGuard.IsString(value.target) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every((schema) => IsSchema(schema))); +} +/** Returns true if the given value is TConstructor */ +export function IsConstructor(value) { + // prettier-ignore + return (IsKindOf(value, 'Constructor') && + value.type === 'Constructor' && + IsOptionalString(value.$id) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every(schema => IsSchema(schema)) && + IsSchema(value.returns)); +} +/** Returns true if the given value is TDate */ +export function IsDate(value) { + return (IsKindOf(value, 'Date') && + value.type === 'Date' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximumTimestamp) && + IsOptionalNumber(value.exclusiveMinimumTimestamp) && + IsOptionalNumber(value.maximumTimestamp) && + IsOptionalNumber(value.minimumTimestamp) && + IsOptionalNumber(value.multipleOfTimestamp)); +} +/** Returns true if the given value is TFunction */ +export function IsFunction(value) { + // prettier-ignore + return (IsKindOf(value, 'Function') && + value.type === 'Function' && + IsOptionalString(value.$id) && + ValueGuard.IsArray(value.parameters) && + value.parameters.every(schema => IsSchema(schema)) && + IsSchema(value.returns)); +} +/** Returns true if the given value is TImport */ +export function IsImport(value) { + // prettier-ignore + return (IsKindOf(value, 'Import') && + ValueGuard.HasPropertyKey(value, '$defs') && + ValueGuard.IsObject(value.$defs) && + IsProperties(value.$defs) && + ValueGuard.HasPropertyKey(value, '$ref') && + ValueGuard.IsString(value.$ref) && + value.$ref in value.$defs // required + ); +} +/** Returns true if the given value is TInteger */ +export function IsInteger(value) { + return (IsKindOf(value, 'Integer') && + value.type === 'integer' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximum) && + IsOptionalNumber(value.exclusiveMinimum) && + IsOptionalNumber(value.maximum) && + IsOptionalNumber(value.minimum) && + IsOptionalNumber(value.multipleOf)); +} +/** Returns true if the given schema is TProperties */ +export function IsProperties(value) { + // prettier-ignore + return (ValueGuard.IsObject(value) && + Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema(schema))); +} +/** Returns true if the given value is TIntersect */ +export function IsIntersect(value) { + // prettier-ignore + return (IsKindOf(value, 'Intersect') && + (ValueGuard.IsString(value.type) && value.type !== 'object' ? false : true) && + ValueGuard.IsArray(value.allOf) && + value.allOf.every(schema => IsSchema(schema) && !IsTransform(schema)) && + IsOptionalString(value.type) && + (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TIterator */ +export function IsIterator(value) { + // prettier-ignore + return (IsKindOf(value, 'Iterator') && + value.type === 'Iterator' && + IsOptionalString(value.$id) && + IsSchema(value.items)); +} +/** Returns true if the given value is a TKind with the given name. */ +export function IsKindOf(value, kind) { + return ValueGuard.IsObject(value) && Kind in value && value[Kind] === kind; +} +/** Returns true if the given value is TLiteral */ +export function IsLiteralString(value) { + return IsLiteral(value) && ValueGuard.IsString(value.const); +} +/** Returns true if the given value is TLiteral */ +export function IsLiteralNumber(value) { + return IsLiteral(value) && ValueGuard.IsNumber(value.const); +} +/** Returns true if the given value is TLiteral */ +export function IsLiteralBoolean(value) { + return IsLiteral(value) && ValueGuard.IsBoolean(value.const); +} +/** Returns true if the given value is TLiteral */ +export function IsLiteral(value) { + // prettier-ignore + return (IsKindOf(value, 'Literal') && + IsOptionalString(value.$id) && IsLiteralValue(value.const)); +} +/** Returns true if the given value is a TLiteralValue */ +export function IsLiteralValue(value) { + return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value); +} +/** Returns true if the given value is a TMappedKey */ +export function IsMappedKey(value) { + // prettier-ignore + return (IsKindOf(value, 'MappedKey') && + ValueGuard.IsArray(value.keys) && + value.keys.every(key => ValueGuard.IsNumber(key) || ValueGuard.IsString(key))); +} +/** Returns true if the given value is TMappedResult */ +export function IsMappedResult(value) { + // prettier-ignore + return (IsKindOf(value, 'MappedResult') && + IsProperties(value.properties)); +} +/** Returns true if the given value is TNever */ +export function IsNever(value) { + // prettier-ignore + return (IsKindOf(value, 'Never') && + ValueGuard.IsObject(value.not) && + Object.getOwnPropertyNames(value.not).length === 0); +} +/** Returns true if the given value is TNot */ +export function IsNot(value) { + // prettier-ignore + return (IsKindOf(value, 'Not') && + IsSchema(value.not)); +} +/** Returns true if the given value is TNull */ +export function IsNull(value) { + // prettier-ignore + return (IsKindOf(value, 'Null') && + value.type === 'null' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TNumber */ +export function IsNumber(value) { + return (IsKindOf(value, 'Number') && + value.type === 'number' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.exclusiveMaximum) && + IsOptionalNumber(value.exclusiveMinimum) && + IsOptionalNumber(value.maximum) && + IsOptionalNumber(value.minimum) && + IsOptionalNumber(value.multipleOf)); +} +/** Returns true if the given value is TObject */ +export function IsObject(value) { + // prettier-ignore + return (IsKindOf(value, 'Object') && + value.type === 'object' && + IsOptionalString(value.$id) && + IsProperties(value.properties) && + IsAdditionalProperties(value.additionalProperties) && + IsOptionalNumber(value.minProperties) && + IsOptionalNumber(value.maxProperties)); +} +/** Returns true if the given value is TPromise */ +export function IsPromise(value) { + // prettier-ignore + return (IsKindOf(value, 'Promise') && + value.type === 'Promise' && + IsOptionalString(value.$id) && + IsSchema(value.item)); +} +/** Returns true if the given value is TRecord */ +export function IsRecord(value) { + // prettier-ignore + return (IsKindOf(value, 'Record') && + value.type === 'object' && + IsOptionalString(value.$id) && + IsAdditionalProperties(value.additionalProperties) && + ValueGuard.IsObject(value.patternProperties) && + ((schema) => { + const keys = Object.getOwnPropertyNames(schema.patternProperties); + return (keys.length === 1 && + IsPattern(keys[0]) && + ValueGuard.IsObject(schema.patternProperties) && + IsSchema(schema.patternProperties[keys[0]])); + })(value)); +} +/** Returns true if this value is TRecursive */ +export function IsRecursive(value) { + return ValueGuard.IsObject(value) && Hint in value && value[Hint] === 'Recursive'; +} +/** Returns true if the given value is TRef */ +export function IsRef(value) { + // prettier-ignore + return (IsKindOf(value, 'Ref') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.$ref)); +} +/** Returns true if the given value is TRegExp */ +export function IsRegExp(value) { + // prettier-ignore + return (IsKindOf(value, 'RegExp') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.source) && + ValueGuard.IsString(value.flags) && + IsOptionalNumber(value.maxLength) && + IsOptionalNumber(value.minLength)); +} +/** Returns true if the given value is TString */ +export function IsString(value) { + // prettier-ignore + return (IsKindOf(value, 'String') && + value.type === 'string' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.minLength) && + IsOptionalNumber(value.maxLength) && + IsOptionalPattern(value.pattern) && + IsOptionalFormat(value.format)); +} +/** Returns true if the given value is TSymbol */ +export function IsSymbol(value) { + // prettier-ignore + return (IsKindOf(value, 'Symbol') && + value.type === 'symbol' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TTemplateLiteral */ +export function IsTemplateLiteral(value) { + // prettier-ignore + return (IsKindOf(value, 'TemplateLiteral') && + value.type === 'string' && + ValueGuard.IsString(value.pattern) && + value.pattern[0] === '^' && + value.pattern[value.pattern.length - 1] === '$'); +} +/** Returns true if the given value is TThis */ +export function IsThis(value) { + // prettier-ignore + return (IsKindOf(value, 'This') && + IsOptionalString(value.$id) && + ValueGuard.IsString(value.$ref)); +} +/** Returns true of this value is TTransform */ +export function IsTransform(value) { + return ValueGuard.IsObject(value) && TransformKind in value; +} +/** Returns true if the given value is TTuple */ +export function IsTuple(value) { + // prettier-ignore + return (IsKindOf(value, 'Tuple') && + value.type === 'array' && + IsOptionalString(value.$id) && + ValueGuard.IsNumber(value.minItems) && + ValueGuard.IsNumber(value.maxItems) && + value.minItems === value.maxItems && + (( // empty + ValueGuard.IsUndefined(value.items) && + ValueGuard.IsUndefined(value.additionalItems) && + value.minItems === 0) || (ValueGuard.IsArray(value.items) && + value.items.every(schema => IsSchema(schema))))); +} +/** Returns true if the given value is TUndefined */ +export function IsUndefined(value) { + // prettier-ignore + return (IsKindOf(value, 'Undefined') && + value.type === 'undefined' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TUnion[]> */ +export function IsUnionLiteral(value) { + return IsUnion(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema)); +} +/** Returns true if the given value is TUnion */ +export function IsUnion(value) { + // prettier-ignore + return (IsKindOf(value, 'Union') && + IsOptionalString(value.$id) && + ValueGuard.IsObject(value) && + ValueGuard.IsArray(value.anyOf) && + value.anyOf.every(schema => IsSchema(schema))); +} +/** Returns true if the given value is TUint8Array */ +export function IsUint8Array(value) { + // prettier-ignore + return (IsKindOf(value, 'Uint8Array') && + value.type === 'Uint8Array' && + IsOptionalString(value.$id) && + IsOptionalNumber(value.minByteLength) && + IsOptionalNumber(value.maxByteLength)); +} +/** Returns true if the given value is TUnknown */ +export function IsUnknown(value) { + // prettier-ignore + return (IsKindOf(value, 'Unknown') && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is a raw TUnsafe */ +export function IsUnsafe(value) { + return IsKindOf(value, 'Unsafe'); +} +/** Returns true if the given value is TVoid */ +export function IsVoid(value) { + // prettier-ignore + return (IsKindOf(value, 'Void') && + value.type === 'void' && + IsOptionalString(value.$id)); +} +/** Returns true if the given value is TKind */ +export function IsKind(value) { + return ValueGuard.IsObject(value) && Kind in value && ValueGuard.IsString(value[Kind]) && !KnownTypes.includes(value[Kind]); +} +/** Returns true if the given value is TSchema */ +export function IsSchema(value) { + // prettier-ignore + return (ValueGuard.IsObject(value)) && (IsAny(value) || + IsArgument(value) || + IsArray(value) || + IsBoolean(value) || + IsBigInt(value) || + IsAsyncIterator(value) || + IsComputed(value) || + IsConstructor(value) || + IsDate(value) || + IsFunction(value) || + IsInteger(value) || + IsIntersect(value) || + IsIterator(value) || + IsLiteral(value) || + IsMappedKey(value) || + IsMappedResult(value) || + IsNever(value) || + IsNot(value) || + IsNull(value) || + IsNumber(value) || + IsObject(value) || + IsPromise(value) || + IsRecord(value) || + IsRef(value) || + IsRegExp(value) || + IsString(value) || + IsSymbol(value) || + IsTemplateLiteral(value) || + IsThis(value) || + IsTuple(value) || + IsUndefined(value) || + IsUnion(value) || + IsUint8Array(value) || + IsUnknown(value) || + IsUnsafe(value) || + IsVoid(value) || + IsKind(value)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/value.d.mts b/node_modules/@sinclair/typebox/build/esm/type/guard/value.d.mts new file mode 100644 index 00000000..f3d18d10 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/value.d.mts @@ -0,0 +1,34 @@ +/** Returns true if this value has this property key */ +export declare function HasPropertyKey(value: Record, key: K): value is Record & { + [_ in K]: unknown; +}; +/** Returns true if this value is an async iterator */ +export declare function IsAsyncIterator(value: unknown): value is AsyncIterableIterator; +/** Returns true if this value is an array */ +export declare function IsArray(value: unknown): value is unknown[]; +/** Returns true if this value is bigint */ +export declare function IsBigInt(value: unknown): value is bigint; +/** Returns true if this value is a boolean */ +export declare function IsBoolean(value: unknown): value is boolean; +/** Returns true if this value is a Date object */ +export declare function IsDate(value: unknown): value is Date; +/** Returns true if this value is a function */ +export declare function IsFunction(value: unknown): value is Function; +/** Returns true if this value is an iterator */ +export declare function IsIterator(value: unknown): value is IterableIterator; +/** Returns true if this value is null */ +export declare function IsNull(value: unknown): value is null; +/** Returns true if this value is number */ +export declare function IsNumber(value: unknown): value is number; +/** Returns true if this value is an object */ +export declare function IsObject(value: unknown): value is Record; +/** Returns true if this value is RegExp */ +export declare function IsRegExp(value: unknown): value is RegExp; +/** Returns true if this value is string */ +export declare function IsString(value: unknown): value is string; +/** Returns true if this value is symbol */ +export declare function IsSymbol(value: unknown): value is symbol; +/** Returns true if this value is a Uint8Array */ +export declare function IsUint8Array(value: unknown): value is Uint8Array; +/** Returns true if this value is undefined */ +export declare function IsUndefined(value: unknown): value is undefined; diff --git a/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs b/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs new file mode 100644 index 00000000..dad437e3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs @@ -0,0 +1,70 @@ +// -------------------------------------------------------------------------- +// PropertyKey +// -------------------------------------------------------------------------- +/** Returns true if this value has this property key */ +export function HasPropertyKey(value, key) { + return key in value; +} +// -------------------------------------------------------------------------- +// Object Instances +// -------------------------------------------------------------------------- +/** Returns true if this value is an async iterator */ +export function IsAsyncIterator(value) { + return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value; +} +/** Returns true if this value is an array */ +export function IsArray(value) { + return Array.isArray(value); +} +/** Returns true if this value is bigint */ +export function IsBigInt(value) { + return typeof value === 'bigint'; +} +/** Returns true if this value is a boolean */ +export function IsBoolean(value) { + return typeof value === 'boolean'; +} +/** Returns true if this value is a Date object */ +export function IsDate(value) { + return value instanceof globalThis.Date; +} +/** Returns true if this value is a function */ +export function IsFunction(value) { + return typeof value === 'function'; +} +/** Returns true if this value is an iterator */ +export function IsIterator(value) { + return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value; +} +/** Returns true if this value is null */ +export function IsNull(value) { + return value === null; +} +/** Returns true if this value is number */ +export function IsNumber(value) { + return typeof value === 'number'; +} +/** Returns true if this value is an object */ +export function IsObject(value) { + return typeof value === 'object' && value !== null; +} +/** Returns true if this value is RegExp */ +export function IsRegExp(value) { + return value instanceof globalThis.RegExp; +} +/** Returns true if this value is string */ +export function IsString(value) { + return typeof value === 'string'; +} +/** Returns true if this value is symbol */ +export function IsSymbol(value) { + return typeof value === 'symbol'; +} +/** Returns true if this value is a Uint8Array */ +export function IsUint8Array(value) { + return value instanceof globalThis.Uint8Array; +} +/** Returns true if this value is undefined */ +export function IsUndefined(value) { + return value === undefined; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.d.mts b/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.d.mts new file mode 100644 index 00000000..7c9e3f73 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.d.mts @@ -0,0 +1,42 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import type { TNever } from '../never/index.mjs'; +export type TupleToIntersect = T extends [infer I] ? I : T extends [infer I, ...infer R] ? I & TupleToIntersect : never; +export type TupleToUnion = { + [K in keyof T]: T[K]; +}[number]; +export type UnionToIntersect = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never; +export type UnionLast = UnionToIntersect 0 : never> extends (x: infer L) => 0 ? L : never; +export type UnionToTuple> = [U] extends [never] ? Acc : UnionToTuple, [Extract, ...Acc]>; +export type Trim = T extends `${' '}${infer U}` ? Trim : T extends `${infer U}${' '}` ? Trim : T; +export type Assert = T extends E ? T : never; +export type Evaluate = T extends infer O ? { + [K in keyof O]: O[K]; +} : never; +export type Ensure = T extends infer U ? U : never; +export type EmptyString = ''; +export type ZeroString = '0'; +type IncrementBase = { + m: '9'; + t: '01'; + '0': '1'; + '1': '2'; + '2': '3'; + '3': '4'; + '4': '5'; + '5': '6'; + '6': '7'; + '7': '8'; + '8': '9'; + '9': '0'; +}; +type IncrementTake = IncrementBase[T]; +type IncrementStep = T extends IncrementBase['m'] ? IncrementBase['t'] : T extends `${infer L extends keyof IncrementBase}${infer R}` ? L extends IncrementBase['m'] ? `${IncrementTake}${IncrementStep}` : `${IncrementTake}${R}` : never; +type IncrementReverse = T extends `${infer L}${infer R}` ? `${IncrementReverse}${L}` : T; +export type TIncrement = IncrementReverse>>; +/** Increments the given string value + 1 */ +export declare function Increment(T: T): TIncrement; +export type AssertProperties = T extends TProperties ? T : TProperties; +export type AssertRest = T extends E ? T : []; +export type AssertType = T extends E ? T : TNever; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.mjs b/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.mjs new file mode 100644 index 00000000..90ebc48e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.mjs @@ -0,0 +1,4 @@ +/** Increments the given string value + 1 */ +export function Increment(T) { + return (parseInt(T) + 1).toString(); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/helpers/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/helpers/index.d.mts new file mode 100644 index 00000000..c5cfad82 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/helpers/index.d.mts @@ -0,0 +1 @@ +export * from './helpers.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/helpers/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/helpers/index.mjs new file mode 100644 index 00000000..c5cfad82 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/helpers/index.mjs @@ -0,0 +1 @@ +export * from './helpers.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/index.d.mts new file mode 100644 index 00000000..485eace3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/index.d.mts @@ -0,0 +1,71 @@ +export * from './any/index.mjs'; +export * from './argument/index.mjs'; +export * from './array/index.mjs'; +export * from './async-iterator/index.mjs'; +export * from './awaited/index.mjs'; +export * from './bigint/index.mjs'; +export * from './boolean/index.mjs'; +export * from './clone/index.mjs'; +export * from './composite/index.mjs'; +export * from './const/index.mjs'; +export * from './constructor/index.mjs'; +export * from './constructor-parameters/index.mjs'; +export * from './date/index.mjs'; +export * from './discard/index.mjs'; +export * from './enum/index.mjs'; +export * from './error/index.mjs'; +export * from './exclude/index.mjs'; +export * from './extends/index.mjs'; +export * from './extract/index.mjs'; +export * from './function/index.mjs'; +export * from './guard/index.mjs'; +export * from './helpers/index.mjs'; +export * from './indexed/index.mjs'; +export * from './instance-type/index.mjs'; +export * from './instantiate/index.mjs'; +export * from './integer/index.mjs'; +export * from './intersect/index.mjs'; +export * from './intrinsic/index.mjs'; +export * from './iterator/index.mjs'; +export * from './keyof/index.mjs'; +export * from './literal/index.mjs'; +export * from './mapped/index.mjs'; +export * from './module/index.mjs'; +export * from './never/index.mjs'; +export * from './not/index.mjs'; +export * from './null/index.mjs'; +export * from './number/index.mjs'; +export * from './object/index.mjs'; +export * from './omit/index.mjs'; +export * from './optional/index.mjs'; +export * from './parameters/index.mjs'; +export * from './partial/index.mjs'; +export * from './patterns/index.mjs'; +export * from './pick/index.mjs'; +export * from './promise/index.mjs'; +export * from './readonly/index.mjs'; +export * from './readonly-optional/index.mjs'; +export * from './record/index.mjs'; +export * from './recursive/index.mjs'; +export * from './ref/index.mjs'; +export * from './regexp/index.mjs'; +export * from './registry/index.mjs'; +export * from './required/index.mjs'; +export * from './rest/index.mjs'; +export * from './return-type/index.mjs'; +export * from './schema/index.mjs'; +export * from './sets/index.mjs'; +export * from './static/index.mjs'; +export * from './string/index.mjs'; +export * from './symbol/index.mjs'; +export * from './symbols/index.mjs'; +export * from './template-literal/index.mjs'; +export * from './transform/index.mjs'; +export * from './tuple/index.mjs'; +export * from './type/index.mjs'; +export * from './uint8array/index.mjs'; +export * from './undefined/index.mjs'; +export * from './union/index.mjs'; +export * from './unknown/index.mjs'; +export * from './unsafe/index.mjs'; +export * from './void/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/index.mjs new file mode 100644 index 00000000..485eace3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/index.mjs @@ -0,0 +1,71 @@ +export * from './any/index.mjs'; +export * from './argument/index.mjs'; +export * from './array/index.mjs'; +export * from './async-iterator/index.mjs'; +export * from './awaited/index.mjs'; +export * from './bigint/index.mjs'; +export * from './boolean/index.mjs'; +export * from './clone/index.mjs'; +export * from './composite/index.mjs'; +export * from './const/index.mjs'; +export * from './constructor/index.mjs'; +export * from './constructor-parameters/index.mjs'; +export * from './date/index.mjs'; +export * from './discard/index.mjs'; +export * from './enum/index.mjs'; +export * from './error/index.mjs'; +export * from './exclude/index.mjs'; +export * from './extends/index.mjs'; +export * from './extract/index.mjs'; +export * from './function/index.mjs'; +export * from './guard/index.mjs'; +export * from './helpers/index.mjs'; +export * from './indexed/index.mjs'; +export * from './instance-type/index.mjs'; +export * from './instantiate/index.mjs'; +export * from './integer/index.mjs'; +export * from './intersect/index.mjs'; +export * from './intrinsic/index.mjs'; +export * from './iterator/index.mjs'; +export * from './keyof/index.mjs'; +export * from './literal/index.mjs'; +export * from './mapped/index.mjs'; +export * from './module/index.mjs'; +export * from './never/index.mjs'; +export * from './not/index.mjs'; +export * from './null/index.mjs'; +export * from './number/index.mjs'; +export * from './object/index.mjs'; +export * from './omit/index.mjs'; +export * from './optional/index.mjs'; +export * from './parameters/index.mjs'; +export * from './partial/index.mjs'; +export * from './patterns/index.mjs'; +export * from './pick/index.mjs'; +export * from './promise/index.mjs'; +export * from './readonly/index.mjs'; +export * from './readonly-optional/index.mjs'; +export * from './record/index.mjs'; +export * from './recursive/index.mjs'; +export * from './ref/index.mjs'; +export * from './regexp/index.mjs'; +export * from './registry/index.mjs'; +export * from './required/index.mjs'; +export * from './rest/index.mjs'; +export * from './return-type/index.mjs'; +export * from './schema/index.mjs'; +export * from './sets/index.mjs'; +export * from './static/index.mjs'; +export * from './string/index.mjs'; +export * from './symbol/index.mjs'; +export * from './symbols/index.mjs'; +export * from './template-literal/index.mjs'; +export * from './transform/index.mjs'; +export * from './tuple/index.mjs'; +export * from './type/index.mjs'; +export * from './uint8array/index.mjs'; +export * from './undefined/index.mjs'; +export * from './union/index.mjs'; +export * from './unknown/index.mjs'; +export * from './unsafe/index.mjs'; +export * from './void/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/indexed/index.d.mts new file mode 100644 index 00000000..9be97fad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/index.d.mts @@ -0,0 +1,4 @@ +export * from './indexed-from-mapped-key.mjs'; +export * from './indexed-from-mapped-result.mjs'; +export * from './indexed-property-keys.mjs'; +export * from './indexed.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/indexed/index.mjs new file mode 100644 index 00000000..9be97fad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/index.mjs @@ -0,0 +1,4 @@ +export * from './indexed-from-mapped-key.mjs'; +export * from './indexed-from-mapped-result.mjs'; +export * from './indexed-property-keys.mjs'; +export * from './indexed.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.d.mts new file mode 100644 index 00000000..8431b129 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.d.mts @@ -0,0 +1,13 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TIndex } from './indexed.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +type TMappedIndexPropertyKey = { + [_ in Key]: TIndex; +}; +type TMappedIndexPropertyKeys = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TMappedIndexPropertyKeys> : Result); +type TMappedIndexProperties = Evaluate>; +export type TIndexFromMappedKey> = (Ensure>); +export declare function IndexFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs new file mode 100644 index 00000000..e28850fa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs @@ -0,0 +1,22 @@ +import { Index } from './indexed.mjs'; +import { MappedResult } from '../mapped/index.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function MappedIndexPropertyKey(type, key, options) { + return { [key]: Index(type, [key], Clone(options)) }; +} +// prettier-ignore +function MappedIndexPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((result, left) => { + return { ...result, ...MappedIndexPropertyKey(type, left, options) }; + }, {}); +} +// prettier-ignore +function MappedIndexProperties(type, mappedKey, options) { + return MappedIndexPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +export function IndexFromMappedKey(type, mappedKey, options) { + const properties = MappedIndexProperties(type, mappedKey, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.d.mts new file mode 100644 index 00000000..b8f57779 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TIndexPropertyKeys } from './indexed-property-keys.mjs'; +import { type TIndex } from './index.mjs'; +type TFromProperties = ({ + [K2 in keyof Properties]: TIndex>; +}); +type TFromMappedResult = (TFromProperties); +export type TIndexFromMappedResult> = (TMappedResult); +export declare function IndexFromMappedResult>(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs new file mode 100644 index 00000000..0045a098 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs @@ -0,0 +1,20 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { IndexPropertyKeys } from './indexed-property-keys.mjs'; +import { Index } from './index.mjs'; +// prettier-ignore +function FromProperties(type, properties, options) { + const result = {}; + for (const K2 of Object.getOwnPropertyNames(properties)) { + result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options); + } + return result; +} +// prettier-ignore +function FromMappedResult(type, mappedResult, options) { + return FromProperties(type, mappedResult.properties, options); +} +// prettier-ignore +export function IndexFromMappedResult(type, mappedResult, options) { + const properties = FromMappedResult(type, mappedResult, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.d.mts b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.d.mts new file mode 100644 index 00000000..cf5240d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.d.mts @@ -0,0 +1,14 @@ +import { type TTemplateLiteralGenerate, type TTemplateLiteral } from '../template-literal/index.mjs'; +import type { TLiteral, TLiteralValue } from '../literal/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +type TFromTemplateLiteral> = (Keys); +type TFromUnion = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion]> : Result); +type TFromLiteral = (LiteralValue extends PropertyKey ? [`${LiteralValue}`] : []); +export type TIndexPropertyKeys = (Type extends TTemplateLiteral ? TFromTemplateLiteral : Type extends TUnion ? TFromUnion : Type extends TLiteral ? TFromLiteral : Type extends TNumber ? ['[number]'] : Type extends TInteger ? ['[number]'] : [ +]); +/** Returns a tuple of PropertyKeys derived from the given TSchema */ +export declare function IndexPropertyKeys(type: Type): TIndexPropertyKeys; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs new file mode 100644 index 00000000..9df42857 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs @@ -0,0 +1,32 @@ +import { TemplateLiteralGenerate } from '../template-literal/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsTemplateLiteral, IsUnion, IsLiteral, IsNumber, IsInteger } from '../guard/kind.mjs'; +// prettier-ignore +function FromTemplateLiteral(templateLiteral) { + const keys = TemplateLiteralGenerate(templateLiteral); + return keys.map(key => key.toString()); +} +// prettier-ignore +function FromUnion(types) { + const result = []; + for (const type of types) + result.push(...IndexPropertyKeys(type)); + return result; +} +// prettier-ignore +function FromLiteral(literalValue) { + return ([literalValue.toString()] // TS 5.4 observes TLiteralValue as not having a toString() + ); +} +/** Returns a tuple of PropertyKeys derived from the given TSchema */ +// prettier-ignore +export function IndexPropertyKeys(type) { + return [...new Set((IsTemplateLiteral(type) ? FromTemplateLiteral(type) : + IsUnion(type) ? FromUnion(type.anyOf) : + IsLiteral(type) ? FromLiteral(type.const) : + IsNumber(type) ? ['[number]'] : + IsInteger(type) ? ['[number]'] : + []))]; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.d.mts b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.d.mts new file mode 100644 index 00000000..65e82795 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.d.mts @@ -0,0 +1,52 @@ +import { type TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type Assert } from '../helpers/index.mjs'; +import { type TComputed } from '../computed/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TArray } from '../array/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TRecursive } from '../recursive/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TIntersectEvaluated } from '../intersect/index.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +import { type TIndexPropertyKeys } from './indexed-property-keys.mjs'; +import { type TIndexFromMappedKey } from './indexed-from-mapped-key.mjs'; +import { type TIndexFromMappedResult } from './indexed-from-mapped-result.mjs'; +type TFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest, TSchema>]> : Result); +type TFromIntersectRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? TFromIntersectRest : TFromIntersectRest : Result); +type TFromIntersect = (TIntersectEvaluated>>); +type TFromUnionRest = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? [] : TFromUnionRest : Result; +type TFromUnion = (TUnionEvaluated>>); +type TFromTuple = (Key extends keyof Types ? Types[Key] : Key extends '[number]' ? TUnionEvaluated : TNever); +type TFromArray = (Key extends '[number]' ? Type : TNever); +type AssertPropertyKey = Assert; +type TFromProperty = (Key extends keyof Properties ? Properties[Key] : `${AssertPropertyKey}` extends `${AssertPropertyKey}` ? Properties[AssertPropertyKey] : TNever); +export type TIndexFromPropertyKey = (Type extends TRecursive ? TIndexFromPropertyKey : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TObject ? TFromProperty : TNever); +export declare function IndexFromPropertyKey(type: Type, propertyKey: Key): TIndexFromPropertyKey; +export type TIndexFromPropertyKeys = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TIndexFromPropertyKeys, TSchema>]> : Result); +export declare function IndexFromPropertyKeys(type: Type, propertyKeys: [...PropertyKeys]): TIndexFromPropertyKeys; +type FromSchema = (TUnionEvaluated>); +declare function FromSchema(type: Type, propertyKeys: [...PropertyKeys]): FromSchema; +export type TIndexFromComputed = (TComputed<'Index', [Type, Key]>); +export declare function IndexFromComputed(type: Type, key: Key): TIndexFromComputed; +export type TIndex = (FromSchema); +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TIndexFromMappedKey; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index>(T: Type, K: Key, options?: SchemaOptions): TIndex; +/** `[Json]` Returns an Indexed property type for the given keys */ +export declare function Index(type: Type, propertyKeys: readonly [...PropertyKeys], options?: SchemaOptions): TIndex; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs new file mode 100644 index 00000000..caf86d95 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs @@ -0,0 +1,91 @@ +import { CreateType } from '../create/type.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Never } from '../never/index.mjs'; +import { IntersectEvaluated } from '../intersect/index.mjs'; +import { UnionEvaluated } from '../union/index.mjs'; +import { IndexPropertyKeys } from './indexed-property-keys.mjs'; +import { IndexFromMappedKey } from './indexed-from-mapped-key.mjs'; +import { IndexFromMappedResult } from './indexed-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsArray, IsIntersect, IsObject, IsMappedKey, IsMappedResult, IsNever, IsSchema, IsTuple, IsUnion, IsRef } from '../guard/kind.mjs'; +// prettier-ignore +function FromRest(types, key) { + return types.map(type => IndexFromPropertyKey(type, key)); +} +// prettier-ignore +function FromIntersectRest(types) { + return types.filter(type => !IsNever(type)); +} +// prettier-ignore +function FromIntersect(types, key) { + return (IntersectEvaluated(FromIntersectRest(FromRest(types, key)))); +} +// prettier-ignore +function FromUnionRest(types) { + return (types.some(L => IsNever(L)) + ? [] + : types); +} +// prettier-ignore +function FromUnion(types, key) { + return (UnionEvaluated(FromUnionRest(FromRest(types, key)))); +} +// prettier-ignore +function FromTuple(types, key) { + return (key in types ? types[key] : + key === '[number]' ? UnionEvaluated(types) : + Never()); +} +// prettier-ignore +function FromArray(type, key) { + return (key === '[number]' + ? type + : Never()); +} +// prettier-ignore +function FromProperty(properties, propertyKey) { + return (propertyKey in properties ? properties[propertyKey] : Never()); +} +// prettier-ignore +export function IndexFromPropertyKey(type, propertyKey) { + return (IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : + IsUnion(type) ? FromUnion(type.anyOf, propertyKey) : + IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : + IsArray(type) ? FromArray(type.items, propertyKey) : + IsObject(type) ? FromProperty(type.properties, propertyKey) : + Never()); +} +// prettier-ignore +export function IndexFromPropertyKeys(type, propertyKeys) { + return propertyKeys.map(propertyKey => IndexFromPropertyKey(type, propertyKey)); +} +// prettier-ignore +function FromSchema(type, propertyKeys) { + return (UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys))); +} +// prettier-ignore +export function IndexFromComputed(type, key) { + return Computed('Index', [type, key]); +} +/** `[Json]` Returns an Indexed property type for the given keys */ +export function Index(type, key, options) { + // computed-type + if (IsRef(type) || IsRef(key)) { + const error = `Index types using Ref parameters require both Type and Key to be of TSchema`; + if (!IsSchema(type) || !IsSchema(key)) + throw new TypeBoxError(error); + return Computed('Index', [type, key]); + } + // mapped-types + if (IsMappedResult(key)) + return IndexFromMappedResult(type, key, options); + if (IsMappedKey(key)) + return IndexFromMappedKey(type, key, options); + // prettier-ignore + return CreateType(IsSchema(key) + ? FromSchema(type, IndexPropertyKeys(key)) + : FromSchema(type, key), options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.d.mts new file mode 100644 index 00000000..90bd2b97 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.d.mts @@ -0,0 +1 @@ +export * from './instance-type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.mjs new file mode 100644 index 00000000..90bd2b97 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.mjs @@ -0,0 +1 @@ +export * from './instance-type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.d.mts new file mode 100644 index 00000000..f2d87c90 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.d.mts @@ -0,0 +1,6 @@ +import { type TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TConstructor } from '../constructor/index.mjs'; +import { type TNever } from '../never/index.mjs'; +export type TInstanceType ? InstanceType : TNever> = Result; +/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ +export declare function InstanceType(schema: Type, options?: SchemaOptions): TInstanceType; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs b/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs new file mode 100644 index 00000000..a89c3d11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs @@ -0,0 +1,7 @@ +import { CreateType } from '../create/type.mjs'; +import { Never } from '../never/index.mjs'; +import * as KindGuard from '../guard/kind.mjs'; +/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ +export function InstanceType(schema, options) { + return (KindGuard.IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.d.mts new file mode 100644 index 00000000..51d53318 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.d.mts @@ -0,0 +1 @@ +export * from './instantiate.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.mjs new file mode 100644 index 00000000..51d53318 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.mjs @@ -0,0 +1 @@ +export * from './instantiate.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.d.mts b/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.d.mts new file mode 100644 index 00000000..4a223a4b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.d.mts @@ -0,0 +1,50 @@ +import { type TSchema } from '../schema/index.mjs'; +import { type TArgument } from '../argument/index.mjs'; +import { type TUnknown } from '../unknown/index.mjs'; +import { type TReadonlyOptional } from '../readonly-optional/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import { type TConstructor } from '../constructor/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TArray } from '../array/index.mjs'; +import { type TAsyncIterator } from '../async-iterator/index.mjs'; +import { type TIterator } from '../iterator/index.mjs'; +import { type TPromise } from '../promise/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TRecordOrObject, type TRecord } from '../record/index.mjs'; +type TFromConstructor, TFromType>> = Result; +type TFromFunction, TFromType>> = Result; +type TFromIntersect>> = Result; +type TFromUnion>> = Result; +type TFromTuple>> = Result; +type TFromArray>> = Result; +type TFromAsyncIterator>> = Result; +type TFromIterator>> = Result; +type TFromPromise>> = Result; +type TFromObject, Result extends TSchema = TObject> = Result; +type TFromRecord, MappedValue extends TSchema = TFromType, Result extends TSchema = TRecordOrObject> = Result; +type TFromArgument = Result; +type TFromProperty ? true : false, IsOptional extends boolean = Type extends TOptional ? true : false, Mapped extends TSchema = TFromType, Result extends TSchema = ([ + IsReadonly, + IsOptional +] extends [true, true] ? TReadonlyOptional : [ + IsReadonly, + IsOptional +] extends [true, false] ? TReadonly : [ + IsReadonly, + IsOptional +] extends [false, true] ? TOptional : Mapped)> = Result; +type TFromProperties; +}> = Result; +export type TFromTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes]> : Result); +export declare function FromTypes(args: [...Args], types: [...Types]): TFromTypes; +export type TFromType = (Type extends TConstructor ? TFromConstructor : Type extends TFunction ? TFromFunction : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TAsyncIterator ? TFromAsyncIterator : Type extends TIterator ? TFromIterator : Type extends TPromise ? TFromPromise : Type extends TObject ? TFromObject : Type extends TRecord ? TFromRecord : Type extends TArgument ? TFromArgument : Type); +/** `[JavaScript]` Instantiates a type with the given parameters */ +export type TInstantiate> = Result; +/** `[JavaScript]` Instantiates a type with the given parameters */ +export declare function Instantiate(type: Type, args: [...Args]): TInstantiate; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs b/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs new file mode 100644 index 00000000..c6a7d49c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs @@ -0,0 +1,115 @@ +import { CloneType } from '../clone/type.mjs'; +import { Unknown } from '../unknown/index.mjs'; +import { ReadonlyOptional } from '../readonly-optional/index.mjs'; +import { Readonly } from '../readonly/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Record, RecordKey, RecordValue } from '../record/index.mjs'; +import * as ValueGuard from '../guard/value.mjs'; +import * as KindGuard from '../guard/kind.mjs'; +// prettier-ignore +function FromConstructor(args, type) { + type.parameters = FromTypes(args, type.parameters); + type.returns = FromType(args, type.returns); + return type; +} +// prettier-ignore +function FromFunction(args, type) { + type.parameters = FromTypes(args, type.parameters); + type.returns = FromType(args, type.returns); + return type; +} +// prettier-ignore +function FromIntersect(args, type) { + type.allOf = FromTypes(args, type.allOf); + return type; +} +// prettier-ignore +function FromUnion(args, type) { + type.anyOf = FromTypes(args, type.anyOf); + return type; +} +// prettier-ignore +function FromTuple(args, type) { + if (ValueGuard.IsUndefined(type.items)) + return type; + type.items = FromTypes(args, type.items); + return type; +} +// prettier-ignore +function FromArray(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromAsyncIterator(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromIterator(args, type) { + type.items = FromType(args, type.items); + return type; +} +// prettier-ignore +function FromPromise(args, type) { + type.item = FromType(args, type.item); + return type; +} +// prettier-ignore +function FromObject(args, type) { + const mappedProperties = FromProperties(args, type.properties); + return { ...type, ...Object(mappedProperties) }; // retain options +} +// prettier-ignore +function FromRecord(args, type) { + const mappedKey = FromType(args, RecordKey(type)); + const mappedValue = FromType(args, RecordValue(type)); + const result = Record(mappedKey, mappedValue); + return { ...type, ...result }; // retain options +} +// prettier-ignore +function FromArgument(args, argument) { + return argument.index in args ? args[argument.index] : Unknown(); +} +// prettier-ignore +function FromProperty(args, type) { + const isReadonly = KindGuard.IsReadonly(type); + const isOptional = KindGuard.IsOptional(type); + const mapped = FromType(args, type); + return (isReadonly && isOptional ? ReadonlyOptional(mapped) : + isReadonly && !isOptional ? Readonly(mapped) : + !isReadonly && isOptional ? Optional(mapped) : + mapped); +} +// prettier-ignore +function FromProperties(args, properties) { + return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => { + return { ...result, [key]: FromProperty(args, properties[key]) }; + }, {}); +} +// prettier-ignore +export function FromTypes(args, types) { + return types.map(type => FromType(args, type)); +} +// prettier-ignore +function FromType(args, type) { + return (KindGuard.IsConstructor(type) ? FromConstructor(args, type) : + KindGuard.IsFunction(type) ? FromFunction(args, type) : + KindGuard.IsIntersect(type) ? FromIntersect(args, type) : + KindGuard.IsUnion(type) ? FromUnion(args, type) : + KindGuard.IsTuple(type) ? FromTuple(args, type) : + KindGuard.IsArray(type) ? FromArray(args, type) : + KindGuard.IsAsyncIterator(type) ? FromAsyncIterator(args, type) : + KindGuard.IsIterator(type) ? FromIterator(args, type) : + KindGuard.IsPromise(type) ? FromPromise(args, type) : + KindGuard.IsObject(type) ? FromObject(args, type) : + KindGuard.IsRecord(type) ? FromRecord(args, type) : + KindGuard.IsArgument(type) ? FromArgument(args, type) : + type); +} +/** `[JavaScript]` Instantiates a type with the given parameters */ +// prettier-ignore +export function Instantiate(type, args) { + return FromType(args, CloneType(type)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/integer/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/integer/index.d.mts new file mode 100644 index 00000000..6c678d7b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/integer/index.d.mts @@ -0,0 +1 @@ +export * from './integer.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/integer/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/integer/index.mjs new file mode 100644 index 00000000..6c678d7b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/integer/index.mjs @@ -0,0 +1 @@ +export * from './integer.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/integer/integer.d.mts b/node_modules/@sinclair/typebox/build/esm/type/integer/integer.d.mts new file mode 100644 index 00000000..52067c8e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/integer/integer.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface IntegerOptions extends SchemaOptions { + exclusiveMaximum?: number; + exclusiveMinimum?: number; + maximum?: number; + minimum?: number; + multipleOf?: number; +} +export interface TInteger extends TSchema, IntegerOptions { + [Kind]: 'Integer'; + static: number; + type: 'integer'; +} +/** `[Json]` Creates an Integer type */ +export declare function Integer(options?: IntegerOptions): TInteger; diff --git a/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs b/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs new file mode 100644 index 00000000..45f0961a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates an Integer type */ +export function Integer(options) { + return CreateType({ [Kind]: 'Integer', type: 'integer' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intersect/index.d.mts new file mode 100644 index 00000000..fdd2c197 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/index.d.mts @@ -0,0 +1,3 @@ +export * from './intersect-evaluated.mjs'; +export * from './intersect-type.mjs'; +export * from './intersect.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/intersect/index.mjs new file mode 100644 index 00000000..fdd2c197 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/index.mjs @@ -0,0 +1,3 @@ +export * from './intersect-evaluated.mjs'; +export * from './intersect-type.mjs'; +export * from './intersect.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.d.mts new file mode 100644 index 00000000..7e105647 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.d.mts @@ -0,0 +1,3 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TIntersect, IntersectOptions } from './intersect-type.mjs'; +export declare function IntersectCreate(T: [...T], options?: IntersectOptions): TIntersect; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs new file mode 100644 index 00000000..e39615db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs @@ -0,0 +1,19 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsObject, IsSchema } from '../guard/kind.mjs'; +// ------------------------------------------------------------------ +// IntersectCreate +// ------------------------------------------------------------------ +// prettier-ignore +export function IntersectCreate(T, options = {}) { + const allObjects = T.every((schema) => IsObject(schema)); + const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) + ? { unevaluatedProperties: options.unevaluatedProperties } + : {}; + return CreateType((options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects + ? { ...clonedUnevaluatedProperties, [Kind]: 'Intersect', type: 'object', allOf: T } + : { ...clonedUnevaluatedProperties, [Kind]: 'Intersect', allOf: T }), options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.d.mts new file mode 100644 index 00000000..60129c0f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.d.mts @@ -0,0 +1,13 @@ +import type { TSchema } from '../schema/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import { TIntersect, IntersectOptions } from './intersect-type.mjs'; +type TIsIntersectOptional = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TIsIntersectOptional : false : true); +type TRemoveOptionalFromType = (Type extends TReadonly ? TReadonly> : Type extends TOptional ? TRemoveOptionalFromType : Type); +type TRemoveOptionalFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TRemoveOptionalFromRest]> : TRemoveOptionalFromRest : Result); +type TResolveIntersect = (TIsIntersectOptional extends true ? TOptional>> : TIntersect>); +export type TIntersectEvaluated = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TResolveIntersect); +/** `[Json]` Creates an evaluated Intersect type */ +export declare function IntersectEvaluated>(types: [...Types], options?: IntersectOptions): Result; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs new file mode 100644 index 00000000..56403c65 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs @@ -0,0 +1,38 @@ +import { OptionalKind } from '../symbols/index.mjs'; +import { CreateType } from '../create/type.mjs'; +import { Discard } from '../discard/index.mjs'; +import { Never } from '../never/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { IntersectCreate } from './intersect-create.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsOptional, IsTransform } from '../guard/kind.mjs'; +// prettier-ignore +function IsIntersectOptional(types) { + return types.every(left => IsOptional(left)); +} +// prettier-ignore +function RemoveOptionalFromType(type) { + return (Discard(type, [OptionalKind])); +} +// prettier-ignore +function RemoveOptionalFromRest(types) { + return types.map(left => IsOptional(left) ? RemoveOptionalFromType(left) : left); +} +// prettier-ignore +function ResolveIntersect(types, options) { + return (IsIntersectOptional(types) + ? Optional(IntersectCreate(RemoveOptionalFromRest(types), options)) + : IntersectCreate(RemoveOptionalFromRest(types), options)); +} +/** `[Json]` Creates an evaluated Intersect type */ +export function IntersectEvaluated(types, options = {}) { + if (types.length === 1) + return CreateType(types[0], options); + if (types.length === 0) + return Never(options); + if (types.some((schema) => IsTransform(schema))) + throw new Error('Cannot intersect transform types'); + return ResolveIntersect(types, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.d.mts new file mode 100644 index 00000000..f7713bf9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.d.mts @@ -0,0 +1,15 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type TIntersectStatic = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TIntersectStatic> : Acc; +export type TUnevaluatedProperties = undefined | TSchema | boolean; +export interface IntersectOptions extends SchemaOptions { + unevaluatedProperties?: TUnevaluatedProperties; +} +export interface TIntersect extends TSchema, IntersectOptions { + [Kind]: 'Intersect'; + static: TIntersectStatic; + type?: 'object'; + allOf: [...T]; +} +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.mjs b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.mjs new file mode 100644 index 00000000..6d09727c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.mjs @@ -0,0 +1 @@ +import { Kind } from '../symbols/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.d.mts new file mode 100644 index 00000000..4e766289 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.d.mts @@ -0,0 +1,6 @@ +import type { TSchema } from '../schema/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { TIntersect, IntersectOptions } from './intersect-type.mjs'; +export type Intersect = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TIntersect); +/** `[Json]` Creates an evaluated Intersect type */ +export declare function Intersect(types: [...Types], options?: IntersectOptions): Intersect; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs new file mode 100644 index 00000000..16ee6663 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs @@ -0,0 +1,17 @@ +import { CreateType } from '../create/type.mjs'; +import { Never } from '../never/index.mjs'; +import { IntersectCreate } from './intersect-create.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsTransform } from '../guard/kind.mjs'; +/** `[Json]` Creates an evaluated Intersect type */ +export function Intersect(types, options) { + if (types.length === 1) + return CreateType(types[0], options); + if (types.length === 0) + return Never(options); + if (types.some((schema) => IsTransform(schema))) + throw new Error('Cannot intersect transform types'); + return IntersectCreate(types, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.d.mts new file mode 100644 index 00000000..fd1ea06b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.d.mts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TIntrinsic } from './intrinsic.mjs'; +export type TCapitalize = TIntrinsic; +/** `[Json]` Intrinsic function to Capitalize LiteralString types */ +export declare function Capitalize(T: T, options?: SchemaOptions): TCapitalize; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs new file mode 100644 index 00000000..78ec9c15 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs @@ -0,0 +1,5 @@ +import { Intrinsic } from './intrinsic.mjs'; +/** `[Json]` Intrinsic function to Capitalize LiteralString types */ +export function Capitalize(T, options = {}) { + return Intrinsic(T, 'Capitalize', options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.d.mts new file mode 100644 index 00000000..b65c8e54 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.d.mts @@ -0,0 +1,6 @@ +export * from './capitalize.mjs'; +export * from './intrinsic-from-mapped-key.mjs'; +export * from './intrinsic.mjs'; +export * from './lowercase.mjs'; +export * from './uncapitalize.mjs'; +export * from './uppercase.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.mjs new file mode 100644 index 00000000..b65c8e54 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.mjs @@ -0,0 +1,6 @@ +export * from './capitalize.mjs'; +export * from './intrinsic-from-mapped-key.mjs'; +export * from './intrinsic.mjs'; +export * from './lowercase.mjs'; +export * from './uncapitalize.mjs'; +export * from './uppercase.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts new file mode 100644 index 00000000..33e97c6f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts @@ -0,0 +1,14 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { Assert } from '../helpers/index.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +import { type TIntrinsic, type IntrinsicMode } from './intrinsic.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +type TMappedIntrinsicPropertyKey = { + [_ in K]: TIntrinsic>, M>; +}; +type TMappedIntrinsicPropertyKeys = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedIntrinsicPropertyKeys> : Acc); +type TMappedIntrinsicProperties = (TMappedIntrinsicPropertyKeys); +export type TIntrinsicFromMappedKey> = (TMappedResult

); +export declare function IntrinsicFromMappedKey>(T: K, M: M, options: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs new file mode 100644 index 00000000..94ae7889 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs @@ -0,0 +1,26 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Intrinsic } from './intrinsic.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function MappedIntrinsicPropertyKey(K, M, options) { + return { + [K]: Intrinsic(Literal(K), M, Clone(options)) + }; +} +// prettier-ignore +function MappedIntrinsicPropertyKeys(K, M, options) { + const result = K.reduce((Acc, L) => { + return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) }; + }, {}); + return result; +} +// prettier-ignore +function MappedIntrinsicProperties(T, M, options) { + return MappedIntrinsicPropertyKeys(T['keys'], M, options); +} +// prettier-ignore +export function IntrinsicFromMappedKey(T, M, options) { + const P = MappedIntrinsicProperties(T, M, options); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.d.mts new file mode 100644 index 00000000..d24980f1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TTemplateLiteral, type TTemplateLiteralKind } from '../template-literal/index.mjs'; +import { type TIntrinsicFromMappedKey } from './intrinsic-from-mapped-key.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TMappedKey } from '../mapped/index.mjs'; +export type IntrinsicMode = 'Uppercase' | 'Lowercase' | 'Capitalize' | 'Uncapitalize'; +type TFromTemplateLiteral = M extends IntrinsicMode ? T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? [TIntrinsic, ...TFromTemplateLiteral] : T : T; +type TFromLiteralValue = (T extends string ? M extends 'Uncapitalize' ? Uncapitalize : M extends 'Capitalize' ? Capitalize : M extends 'Uppercase' ? Uppercase : M extends 'Lowercase' ? Lowercase : string : T); +type TFromRest = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Acc; +export type TIntrinsic = T extends TMappedKey ? TIntrinsicFromMappedKey : T extends TTemplateLiteral ? TTemplateLiteral> : T extends TUnion ? TUnion> : T extends TLiteral ? TLiteral> : T; +/** Applies an intrinsic string manipulation to the given type. */ +export declare function Intrinsic(schema: T, mode: M, options?: SchemaOptions): TIntrinsicFromMappedKey; +/** Applies an intrinsic string manipulation to the given type. */ +export declare function Intrinsic(schema: T, mode: M, options?: SchemaOptions): TIntrinsic; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs new file mode 100644 index 00000000..96c3a7ba --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs @@ -0,0 +1,64 @@ +import { CreateType } from '../create/type.mjs'; +import { TemplateLiteral, TemplateLiteralParseExact, IsTemplateLiteralExpressionFinite, TemplateLiteralExpressionGenerate } from '../template-literal/index.mjs'; +import { IntrinsicFromMappedKey } from './intrinsic-from-mapped-key.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Union } from '../union/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedKey, IsTemplateLiteral, IsUnion, IsLiteral } from '../guard/kind.mjs'; +// ------------------------------------------------------------------ +// Apply +// ------------------------------------------------------------------ +function ApplyUncapitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return [first.toLowerCase(), rest].join(''); +} +function ApplyCapitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return [first.toUpperCase(), rest].join(''); +} +function ApplyUppercase(value) { + return value.toUpperCase(); +} +function ApplyLowercase(value) { + return value.toLowerCase(); +} +function FromTemplateLiteral(schema, mode, options) { + // note: template literals require special runtime handling as they are encoded in string patterns. + // This diverges from the mapped type which would otherwise map on the template literal kind. + const expression = TemplateLiteralParseExact(schema.pattern); + const finite = IsTemplateLiteralExpressionFinite(expression); + if (!finite) + return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) }; + const strings = [...TemplateLiteralExpressionGenerate(expression)]; + const literals = strings.map((value) => Literal(value)); + const mapped = FromRest(literals, mode); + const union = Union(mapped); + return TemplateLiteral([union], options); +} +// prettier-ignore +function FromLiteralValue(value, mode) { + return (typeof value === 'string' ? (mode === 'Uncapitalize' ? ApplyUncapitalize(value) : + mode === 'Capitalize' ? ApplyCapitalize(value) : + mode === 'Uppercase' ? ApplyUppercase(value) : + mode === 'Lowercase' ? ApplyLowercase(value) : + value) : value.toString()); +} +// prettier-ignore +function FromRest(T, M) { + return T.map(L => Intrinsic(L, M)); +} +/** Applies an intrinsic string manipulation to the given type. */ +export function Intrinsic(schema, mode, options = {}) { + // prettier-ignore + return ( + // Intrinsic-Mapped-Inference + IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : + // Standard-Inference + IsTemplateLiteral(schema) ? FromTemplateLiteral(schema, mode, options) : + IsUnion(schema) ? Union(FromRest(schema.anyOf, mode), options) : + IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : + // Default Type + CreateType(schema, options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.d.mts new file mode 100644 index 00000000..7c6f1fa5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.d.mts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TIntrinsic } from './intrinsic.mjs'; +export type TLowercase = TIntrinsic; +/** `[Json]` Intrinsic function to Lowercase LiteralString types */ +export declare function Lowercase(T: T, options?: SchemaOptions): TLowercase; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs new file mode 100644 index 00000000..a6250e05 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs @@ -0,0 +1,5 @@ +import { Intrinsic } from './intrinsic.mjs'; +/** `[Json]` Intrinsic function to Lowercase LiteralString types */ +export function Lowercase(T, options = {}) { + return Intrinsic(T, 'Lowercase', options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.d.mts new file mode 100644 index 00000000..ecaa8b31 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.d.mts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TIntrinsic } from './intrinsic.mjs'; +export type TUncapitalize = TIntrinsic; +/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ +export declare function Uncapitalize(T: T, options?: SchemaOptions): TUncapitalize; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs new file mode 100644 index 00000000..15024c70 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs @@ -0,0 +1,5 @@ +import { Intrinsic } from './intrinsic.mjs'; +/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ +export function Uncapitalize(T, options = {}) { + return Intrinsic(T, 'Uncapitalize', options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.d.mts b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.d.mts new file mode 100644 index 00000000..f916777c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.d.mts @@ -0,0 +1,5 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TIntrinsic } from './intrinsic.mjs'; +export type TUppercase = TIntrinsic; +/** `[Json]` Intrinsic function to Uppercase LiteralString types */ +export declare function Uppercase(T: T, options?: SchemaOptions): TUppercase; diff --git a/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs new file mode 100644 index 00000000..41752f9f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs @@ -0,0 +1,5 @@ +import { Intrinsic } from './intrinsic.mjs'; +/** `[Json]` Intrinsic function to Uppercase LiteralString types */ +export function Uppercase(T, options = {}) { + return Intrinsic(T, 'Uppercase', options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/iterator/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/iterator/index.d.mts new file mode 100644 index 00000000..99c6a9b0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/iterator/index.d.mts @@ -0,0 +1 @@ +export * from './iterator.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/iterator/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/iterator/index.mjs new file mode 100644 index 00000000..99c6a9b0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/iterator/index.mjs @@ -0,0 +1 @@ +export * from './iterator.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.d.mts b/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.d.mts new file mode 100644 index 00000000..9635d6eb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.d.mts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TIterator extends TSchema { + [Kind]: 'Iterator'; + static: IterableIterator>; + type: 'Iterator'; + items: T; +} +/** `[JavaScript]` Creates an Iterator type */ +export declare function Iterator(items: T, options?: SchemaOptions): TIterator; diff --git a/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs b/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs new file mode 100644 index 00000000..1fc8ed8a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates an Iterator type */ +export function Iterator(items, options) { + return CreateType({ [Kind]: 'Iterator', type: 'Iterator', items }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/keyof/index.d.mts new file mode 100644 index 00000000..84a5f971 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/index.d.mts @@ -0,0 +1,4 @@ +export * from './keyof-from-mapped-result.mjs'; +export * from './keyof-property-entries.mjs'; +export * from './keyof-property-keys.mjs'; +export * from './keyof.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/keyof/index.mjs new file mode 100644 index 00000000..84a5f971 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/index.mjs @@ -0,0 +1,4 @@ +export * from './keyof-from-mapped-result.mjs'; +export * from './keyof-property-entries.mjs'; +export * from './keyof-property-keys.mjs'; +export * from './keyof.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.d.mts new file mode 100644 index 00000000..0dcda774 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TKeyOfFromType } from './keyof.mjs'; +type TFromProperties = ({ + [K2 in keyof Properties]: TKeyOfFromType; +}); +type TFromMappedResult = (Evaluate>); +export type TKeyOfFromMappedResult> = (Ensure>); +export declare function KeyOfFromMappedResult>(mappedResult: MappedResult, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs new file mode 100644 index 00000000..86bed645 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs @@ -0,0 +1,19 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { KeyOf } from './keyof.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromProperties(properties, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = KeyOf(properties[K2], Clone(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, options) { + return FromProperties(mappedResult.properties, options); +} +// prettier-ignore +export function KeyOfFromMappedResult(mappedResult, options) { + const properties = FromMappedResult(mappedResult, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.d.mts b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.d.mts new file mode 100644 index 00000000..ae3314ad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.d.mts @@ -0,0 +1,7 @@ +import { TSchema } from '../schema/index.mjs'; +/** + * `[Utility]` Resolves an array of keys and schemas from the given schema. This method is faster + * than obtaining the keys and resolving each individually via indexing. This method was written + * accellerate Intersect and Union encoding. + */ +export declare function KeyOfPropertyEntries(schema: TSchema): [key: string, schema: TSchema][]; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs new file mode 100644 index 00000000..4533f760 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs @@ -0,0 +1,12 @@ +import { IndexFromPropertyKeys } from '../indexed/indexed.mjs'; +import { KeyOfPropertyKeys } from './keyof-property-keys.mjs'; +/** + * `[Utility]` Resolves an array of keys and schemas from the given schema. This method is faster + * than obtaining the keys and resolving each individually via indexing. This method was written + * accellerate Intersect and Union encoding. + */ +export function KeyOfPropertyEntries(schema) { + const keys = KeyOfPropertyKeys(schema); + const schemas = IndexFromPropertyKeys(schema, keys); + return keys.map((_, index) => [keys[index], schemas[index]]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.d.mts b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.d.mts new file mode 100644 index 00000000..66c0cacf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.d.mts @@ -0,0 +1,24 @@ +import type { TSchema } from '../schema/index.mjs'; +import { type ZeroString, type UnionToTuple, type TIncrement } from '../helpers/index.mjs'; +import type { TRecursive } from '../recursive/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +import type { TArray } from '../array/index.mjs'; +import type { TObject, TProperties } from '../object/index.mjs'; +import { type TSetUnionMany, type TSetIntersectMany } from '../sets/index.mjs'; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +type TFromIntersect, PropertyKeys extends PropertyKey[] = TSetUnionMany> = PropertyKeys; +type TFromUnion, PropertyKeys extends PropertyKey[] = TSetIntersectMany> = PropertyKeys; +type TFromTuple = Types extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple, [...Acc, Indexer]> : Acc; +type TFromArray<_ extends TSchema> = ([ + '[number]' +]); +type TFromProperties = (UnionToTuple); +export type TKeyOfPropertyKeys = (Type extends TRecursive ? TKeyOfPropertyKeys : Type extends TIntersect ? TFromIntersect : Type extends TUnion ? TFromUnion : Type extends TTuple ? TFromTuple : Type extends TArray ? TFromArray : Type extends TObject ? TFromProperties : [ +]); +/** Returns a tuple of PropertyKeys derived from the given TSchema. */ +export declare function KeyOfPropertyKeys(type: Type): TKeyOfPropertyKeys; +/** Returns a regular expression pattern derived from the given TSchema */ +export declare function KeyOfPattern(schema: TSchema): string; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs new file mode 100644 index 00000000..76ec6fa9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs @@ -0,0 +1,73 @@ +import { SetUnionMany, SetIntersectMany } from '../sets/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsIntersect, IsUnion, IsTuple, IsArray, IsObject, IsRecord } from '../guard/kind.mjs'; +// prettier-ignore +function FromRest(types) { + const result = []; + for (const L of types) + result.push(KeyOfPropertyKeys(L)); + return result; +} +// prettier-ignore +function FromIntersect(types) { + const propertyKeysArray = FromRest(types); + const propertyKeys = SetUnionMany(propertyKeysArray); + return propertyKeys; +} +// prettier-ignore +function FromUnion(types) { + const propertyKeysArray = FromRest(types); + const propertyKeys = SetIntersectMany(propertyKeysArray); + return propertyKeys; +} +// prettier-ignore +function FromTuple(types) { + return types.map((_, indexer) => indexer.toString()); +} +// prettier-ignore +function FromArray(_) { + return (['[number]']); +} +// prettier-ignore +function FromProperties(T) { + return (globalThis.Object.getOwnPropertyNames(T)); +} +// ------------------------------------------------------------------ +// FromPatternProperties +// ------------------------------------------------------------------ +// prettier-ignore +function FromPatternProperties(patternProperties) { + if (!includePatternProperties) + return []; + const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties); + return patternPropertyKeys.map(key => { + return (key[0] === '^' && key[key.length - 1] === '$') + ? key.slice(1, key.length - 1) + : key; + }); +} +/** Returns a tuple of PropertyKeys derived from the given TSchema. */ +// prettier-ignore +export function KeyOfPropertyKeys(type) { + return (IsIntersect(type) ? FromIntersect(type.allOf) : + IsUnion(type) ? FromUnion(type.anyOf) : + IsTuple(type) ? FromTuple(type.items ?? []) : + IsArray(type) ? FromArray(type.items) : + IsObject(type) ? FromProperties(type.properties) : + IsRecord(type) ? FromPatternProperties(type.patternProperties) : + []); +} +// ---------------------------------------------------------------- +// KeyOfPattern +// ---------------------------------------------------------------- +let includePatternProperties = false; +/** Returns a regular expression pattern derived from the given TSchema */ +export function KeyOfPattern(schema) { + includePatternProperties = true; + const keys = KeyOfPropertyKeys(schema); + includePatternProperties = false; + const pattern = keys.map((key) => `(${key})`); + return `^(${pattern.join('|')})$`; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.d.mts b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.d.mts new file mode 100644 index 00000000..c4f3479e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.d.mts @@ -0,0 +1,21 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Assert, Ensure } from '../helpers/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import type { SchemaOptions } from '../schema/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TNumber } from '../number/index.mjs'; +import { TComputed } from '../computed/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TKeyOfPropertyKeys } from './keyof-property-keys.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +import { type TKeyOfFromMappedResult } from './keyof-from-mapped-result.mjs'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +/** `[Internal]` Used by KeyOfFromMappedResult */ +export type TKeyOfFromType, PropertyKeyTypes extends TSchema[] = TKeyOfPropertyKeysToRest, Result = TUnionEvaluated> = Ensure; +export type TKeyOfPropertyKeysToRest = (PropertyKeys extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? L extends '[number]' ? TKeyOfPropertyKeysToRest : TKeyOfPropertyKeysToRest>]> : Result); +export declare function KeyOfPropertyKeysToRest(propertyKeys: [...PropertyKeys]): TKeyOfPropertyKeysToRest; +export type TKeyOf = (Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TMappedResult ? TKeyOfFromMappedResult : TKeyOfFromType); +/** `[Json]` Creates a KeyOf type */ +export declare function KeyOf(type: Type, options?: SchemaOptions): TKeyOf; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs new file mode 100644 index 00000000..0908e323 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs @@ -0,0 +1,35 @@ +import { CreateType } from '../create/type.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Number } from '../number/index.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Ref } from '../ref/index.mjs'; +import { KeyOfPropertyKeys } from './keyof-property-keys.mjs'; +import { UnionEvaluated } from '../union/index.mjs'; +import { KeyOfFromMappedResult } from './keyof-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedResult, IsRef, IsComputed } from '../guard/kind.mjs'; +// prettier-ignore +function FromComputed(target, parameters) { + return Computed('KeyOf', [Computed(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return Computed('KeyOf', [Ref($ref)]); +} +// prettier-ignore +function KeyOfFromType(type, options) { + const propertyKeys = KeyOfPropertyKeys(type); + const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys); + const result = UnionEvaluated(propertyKeyTypes); + return CreateType(result, options); +} +// prettier-ignore +export function KeyOfPropertyKeysToRest(propertyKeys) { + return propertyKeys.map(L => L === '[number]' ? Number() : Literal(L)); +} +/** `[Json]` Creates a KeyOf type */ +export function KeyOf(type, options) { + return (IsComputed(type) ? FromComputed(type.target, type.parameters) : IsRef(type) ? FromRef(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/literal/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/literal/index.d.mts new file mode 100644 index 00000000..83442388 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/literal/index.d.mts @@ -0,0 +1 @@ +export * from './literal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/literal/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/literal/index.mjs new file mode 100644 index 00000000..83442388 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/literal/index.mjs @@ -0,0 +1 @@ +export * from './literal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/literal/literal.d.mts b/node_modules/@sinclair/typebox/build/esm/type/literal/literal.d.mts new file mode 100644 index 00000000..5dd73d36 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/literal/literal.d.mts @@ -0,0 +1,10 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export type TLiteralValue = boolean | number | string; +export interface TLiteral extends TSchema { + [Kind]: 'Literal'; + static: T; + const: T; +} +/** `[Json]` Creates a Literal type */ +export declare function Literal(value: T, options?: SchemaOptions): TLiteral; diff --git a/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs b/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs new file mode 100644 index 00000000..13471358 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs @@ -0,0 +1,10 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Literal type */ +export function Literal(value, options) { + return CreateType({ + [Kind]: 'Literal', + const: value, + type: typeof value, + }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/mapped/index.d.mts new file mode 100644 index 00000000..b7c46deb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/index.d.mts @@ -0,0 +1,3 @@ +export * from './mapped-key.mjs'; +export * from './mapped-result.mjs'; +export * from './mapped.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/mapped/index.mjs new file mode 100644 index 00000000..b7c46deb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/index.mjs @@ -0,0 +1,3 @@ +export * from './mapped-key.mjs'; +export * from './mapped-result.mjs'; +export * from './mapped.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.d.mts new file mode 100644 index 00000000..884b5975 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.d.mts @@ -0,0 +1,8 @@ +import type { TSchema } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TMappedKey extends TSchema { + [Kind]: 'MappedKey'; + static: T[number]; + keys: T; +} +export declare function MappedKey(T: [...T]): TMappedKey; diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.mjs new file mode 100644 index 00000000..a59df645 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.mjs @@ -0,0 +1,9 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +// prettier-ignore +export function MappedKey(T) { + return CreateType({ + [Kind]: 'MappedKey', + keys: T + }); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.d.mts new file mode 100644 index 00000000..ee75d746 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.d.mts @@ -0,0 +1,9 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TMappedResult extends TSchema { + [Kind]: 'MappedResult'; + properties: T; + static: unknown; +} +export declare function MappedResult(properties: T): TMappedResult; diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs new file mode 100644 index 00000000..7dfa7253 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs @@ -0,0 +1,9 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +// prettier-ignore +export function MappedResult(properties) { + return CreateType({ + [Kind]: 'MappedResult', + properties + }); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.d.mts b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.d.mts new file mode 100644 index 00000000..ede5ee24 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.d.mts @@ -0,0 +1,47 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Ensure, Evaluate, Assert } from '../helpers/index.mjs'; +import { type TArray } from '../array/index.mjs'; +import { type TAsyncIterator } from '../async-iterator/index.mjs'; +import { type TConstructor } from '../constructor/index.mjs'; +import { type TEnum, type TEnumRecord } from '../enum/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TIndexPropertyKeys } from '../indexed/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TIterator } from '../iterator/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import { type TPromise } from '../promise/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TSetIncludes } from '../sets/index.mjs'; +import { type TMappedResult } from './mapped-result.mjs'; +import type { TMappedKey } from './mapped-key.mjs'; +type TFromMappedResult = (K extends keyof P ? FromSchemaType : TMappedResult

); +type TMappedKeyToKnownMappedResultProperties = { + [_ in K]: TLiteral>; +}; +type TMappedKeyToUnknownMappedResultProperties

= (P extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedKeyToUnknownMappedResultProperties>; +}> : Acc); +type TMappedKeyToMappedResultProperties = (TSetIncludes extends true ? TMappedKeyToKnownMappedResultProperties : TMappedKeyToUnknownMappedResultProperties

); +type TFromMappedKey> = (TFromMappedResult); +type TFromRest = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Acc); +type FromProperties; +}>> = R; +declare function FromProperties(K: K, T: T): FromProperties; +type FromSchemaType = (T extends TReadonly ? TReadonly> : T extends TOptional ? TOptional> : T extends TMappedResult ? TFromMappedResult : T extends TMappedKey ? TFromMappedKey : T extends TConstructor ? TConstructor, FromSchemaType> : T extends TFunction ? TFunction, FromSchemaType> : T extends TAsyncIterator ? TAsyncIterator> : T extends TIterator ? TIterator> : T extends TIntersect ? TIntersect> : T extends TEnum ? TEnum : T extends TUnion ? TUnion> : T extends TTuple ? TTuple> : T extends TObject ? TObject> : T extends TArray ? TArray> : T extends TPromise ? TPromise> : T); +declare function FromSchemaType(K: K, T: T): FromSchemaType; +export type TMappedFunctionReturnType = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedFunctionReturnType; +}> : Acc); +export declare function MappedFunctionReturnType(K: [...K], T: T): TMappedFunctionReturnType; +export type TMappedFunction> = (T: I) => TSchema; +export type TMapped, R extends TProperties = Evaluate>>> = Ensure>; +/** `[Json]` Creates a Mapped object type */ +export declare function Mapped, F extends TMappedFunction = TMappedFunction, R extends TMapped = TMapped>(key: K, map: F, options?: ObjectOptions): R; +/** `[Json]` Creates a Mapped object type */ +export declare function Mapped = TMappedFunction, R extends TMapped = TMapped>(key: [...K], map: F, options?: ObjectOptions): R; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs new file mode 100644 index 00000000..c48d4388 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs @@ -0,0 +1,102 @@ +import { Kind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs'; +import { Discard } from '../discard/index.mjs'; +// evaluation types +import { Array } from '../array/index.mjs'; +import { AsyncIterator } from '../async-iterator/index.mjs'; +import { Constructor } from '../constructor/index.mjs'; +import { Function as FunctionType } from '../function/index.mjs'; +import { IndexPropertyKeys } from '../indexed/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Iterator } from '../iterator/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { Promise } from '../promise/index.mjs'; +import { Readonly } from '../readonly/index.mjs'; +import { Tuple } from '../tuple/index.mjs'; +import { Union } from '../union/index.mjs'; +// operator +import { SetIncludes } from '../sets/index.mjs'; +// mapping types +import { MappedResult } from './mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsArray, IsAsyncIterator, IsConstructor, IsFunction, IsIntersect, IsIterator, IsReadonly, IsMappedResult, IsMappedKey, IsObject, IsOptional, IsPromise, IsSchema, IsTuple, IsUnion } from '../guard/kind.mjs'; +// prettier-ignore +function FromMappedResult(K, P) { + return (K in P + ? FromSchemaType(K, P[K]) + : MappedResult(P)); +} +// prettier-ignore +function MappedKeyToKnownMappedResultProperties(K) { + return { [K]: Literal(K) }; +} +// prettier-ignore +function MappedKeyToUnknownMappedResultProperties(P) { + const Acc = {}; + for (const L of P) + Acc[L] = Literal(L); + return Acc; +} +// prettier-ignore +function MappedKeyToMappedResultProperties(K, P) { + return (SetIncludes(P, K) + ? MappedKeyToKnownMappedResultProperties(K) + : MappedKeyToUnknownMappedResultProperties(P)); +} +// prettier-ignore +function FromMappedKey(K, P) { + const R = MappedKeyToMappedResultProperties(K, P); + return FromMappedResult(K, R); +} +// prettier-ignore +function FromRest(K, T) { + return T.map(L => FromSchemaType(K, L)); +} +// prettier-ignore +function FromProperties(K, T) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(T)) + Acc[K2] = FromSchemaType(K, T[K2]); + return Acc; +} +// prettier-ignore +function FromSchemaType(K, T) { + // required to retain user defined options for mapped type + const options = { ...T }; + return ( + // unevaluated modifier types + IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : + IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : + // unevaluated mapped types + IsMappedResult(T) ? FromMappedResult(K, T.properties) : + IsMappedKey(T) ? FromMappedKey(K, T.keys) : + // unevaluated types + IsConstructor(T) ? Constructor(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : + IsFunction(T) ? FunctionType(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : + IsAsyncIterator(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : + IsIterator(T) ? Iterator(FromSchemaType(K, T.items), options) : + IsIntersect(T) ? Intersect(FromRest(K, T.allOf), options) : + IsUnion(T) ? Union(FromRest(K, T.anyOf), options) : + IsTuple(T) ? Tuple(FromRest(K, T.items ?? []), options) : + IsObject(T) ? Object(FromProperties(K, T.properties), options) : + IsArray(T) ? Array(FromSchemaType(K, T.items), options) : + IsPromise(T) ? Promise(FromSchemaType(K, T.item), options) : + T); +} +// prettier-ignore +export function MappedFunctionReturnType(K, T) { + const Acc = {}; + for (const L of K) + Acc[L] = FromSchemaType(L, T); + return Acc; +} +/** `[Json]` Creates a Mapped object type */ +export function Mapped(key, map, options) { + const K = IsSchema(key) ? IndexPropertyKeys(key) : key; + const RT = map({ [Kind]: 'MappedKey', keys: K }); + const R = MappedFunctionReturnType(K, RT); + return Object(R, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/compute.d.mts b/node_modules/@sinclair/typebox/build/esm/type/module/compute.d.mts new file mode 100644 index 00000000..4f49330e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/compute.d.mts @@ -0,0 +1,59 @@ +import { Ensure, Evaluate } from '../helpers/index.mjs'; +import { type TSchema } from '../schema/index.mjs'; +import { type TArray } from '../array/index.mjs'; +import { type TAwaited } from '../awaited/index.mjs'; +import { type TAsyncIterator } from '../async-iterator/index.mjs'; +import { TComputed } from '../computed/index.mjs'; +import { type TConstructor } from '../constructor/index.mjs'; +import { type TIndex, type TIndexPropertyKeys } from '../indexed/index.mjs'; +import { TEnum, type TEnumRecord } from '../enum/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TIntersect, type TIntersectEvaluated } from '../intersect/index.mjs'; +import { type TIterator } from '../iterator/index.mjs'; +import { type TKeyOf } from '../keyof/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TOmit } from '../omit/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import { type TPick } from '../pick/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { TPartial } from '../partial/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TRecordOrObject, type TRecord } from '../record/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TRequired } from '../required/index.mjs'; +import { type TTransform } from '../transform/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TUnion, type TUnionEvaluated } from '../union/index.mjs'; +type TDereferenceParameters = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TRef ? TDereferenceParameters]> : TDereferenceParameters]> : Result); +type TDereference ? TDereference : TFromType : TNever)> = Result; +type TFromAwaited = (Parameters extends [infer T0 extends TSchema] ? TAwaited : never); +type TFromIndex = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TIndex> extends infer Result extends TSchema ? Result : never : never); +type TFromKeyOf = (Parameters extends [infer T0 extends TSchema] ? TKeyOf : never); +type TFromPartial = (Parameters extends [infer T0 extends TSchema] ? TPartial : never); +type TFromOmit = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TOmit : never); +type TFromPick = (Parameters extends [infer T0 extends TSchema, infer T1 extends TSchema] ? TPick : never); +type TFromRequired = (Parameters extends [infer T0 extends TSchema] ? TRequired : never); +type TFromComputed> = (Target extends 'Awaited' ? TFromAwaited : Target extends 'Index' ? TFromIndex : Target extends 'KeyOf' ? TFromKeyOf : Target extends 'Partial' ? TFromPartial : Target extends 'Omit' ? TFromOmit : Target extends 'Pick' ? TFromPick : Target extends 'Required' ? TFromRequired : TNever); +type TFromArray = (Ensure>>); +type TFromAsyncIterator = (TAsyncIterator>); +type TFromConstructor = (TConstructor, TFromType>); +type TFromFunction = Ensure, TFromType>>>; +type TFromIntersect = (Ensure>>); +type TFromIterator = (TIterator>); +type TFromObject = Ensure; +}>>>; +type TFromRecord>> = Result; +type TFromTransform ? TTransform, Output> : TTransform> = Result; +type TFromTuple = (Ensure>>); +type TFromUnion = (Ensure>>); +type TFromTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes]> : Result); +export type TFromType = (Type extends TOptional ? TOptional> : Type extends TReadonly ? TReadonly> : Type extends TTransform ? TFromTransform : Type extends TArray ? TFromArray : Type extends TAsyncIterator ? TFromAsyncIterator : Type extends TComputed ? TFromComputed : Type extends TConstructor ? TFromConstructor : Type extends TFunction ? TFromFunction : Type extends TIntersect ? TFromIntersect : Type extends TIterator ? TFromIterator : Type extends TObject ? TFromObject : Type extends TRecord ? TFromRecord : Type extends TTuple ? TFromTuple : Type extends TEnum ? Type : Type extends TUnion ? TFromUnion : Type); +export declare function FromType(moduleProperties: ModuleProperties, type: Type): TFromType; +export type TComputeType = (Key extends keyof ModuleProperties ? TFromType : TNever); +export declare function ComputeType(moduleProperties: ModuleProperties, key: Key): TComputeType; +export type TComputeModuleProperties = Evaluate<{ + [Key in keyof ModuleProperties]: TComputeType; +}>; +export declare function ComputeModuleProperties(moduleProperties: ModuleProperties): TComputeModuleProperties; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs b/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs new file mode 100644 index 00000000..a89d677b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs @@ -0,0 +1,166 @@ +import { CreateType } from '../create/index.mjs'; +import { CloneType } from '../clone/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { Array } from '../array/index.mjs'; +import { Awaited } from '../awaited/index.mjs'; +import { AsyncIterator } from '../async-iterator/index.mjs'; +import { Constructor } from '../constructor/index.mjs'; +import { Index } from '../indexed/index.mjs'; +import { Function as FunctionType } from '../function/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Iterator } from '../iterator/index.mjs'; +import { KeyOf } from '../keyof/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Omit } from '../omit/index.mjs'; +import { Pick } from '../pick/index.mjs'; +import { Never } from '../never/index.mjs'; +import { Partial } from '../partial/index.mjs'; +import { RecordValue, RecordPattern } from '../record/index.mjs'; +import { Required } from '../required/index.mjs'; +import { Tuple } from '../tuple/index.mjs'; +import { Union } from '../union/index.mjs'; +// ------------------------------------------------------------------ +// Symbols +// ------------------------------------------------------------------ +import { TransformKind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import * as KindGuard from '../guard/kind.mjs'; +// prettier-ignore +function DereferenceParameters(moduleProperties, types) { + return types.map((type) => { + return KindGuard.IsRef(type) + ? Dereference(moduleProperties, type.$ref) + : FromType(moduleProperties, type); + }); +} +// prettier-ignore +function Dereference(moduleProperties, ref) { + return (ref in moduleProperties + ? KindGuard.IsRef(moduleProperties[ref]) + ? Dereference(moduleProperties, moduleProperties[ref].$ref) + : FromType(moduleProperties, moduleProperties[ref]) + : Never()); +} +// prettier-ignore +function FromAwaited(parameters) { + return Awaited(parameters[0]); +} +// prettier-ignore +function FromIndex(parameters) { + return Index(parameters[0], parameters[1]); +} +// prettier-ignore +function FromKeyOf(parameters) { + return KeyOf(parameters[0]); +} +// prettier-ignore +function FromPartial(parameters) { + return Partial(parameters[0]); +} +// prettier-ignore +function FromOmit(parameters) { + return Omit(parameters[0], parameters[1]); +} +// prettier-ignore +function FromPick(parameters) { + return Pick(parameters[0], parameters[1]); +} +// prettier-ignore +function FromRequired(parameters) { + return Required(parameters[0]); +} +// prettier-ignore +function FromComputed(moduleProperties, target, parameters) { + const dereferenced = DereferenceParameters(moduleProperties, parameters); + return (target === 'Awaited' ? FromAwaited(dereferenced) : + target === 'Index' ? FromIndex(dereferenced) : + target === 'KeyOf' ? FromKeyOf(dereferenced) : + target === 'Partial' ? FromPartial(dereferenced) : + target === 'Omit' ? FromOmit(dereferenced) : + target === 'Pick' ? FromPick(dereferenced) : + target === 'Required' ? FromRequired(dereferenced) : + Never()); +} +function FromArray(moduleProperties, type) { + return Array(FromType(moduleProperties, type)); +} +function FromAsyncIterator(moduleProperties, type) { + return AsyncIterator(FromType(moduleProperties, type)); +} +// prettier-ignore +function FromConstructor(moduleProperties, parameters, instanceType) { + return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType)); +} +// prettier-ignore +function FromFunction(moduleProperties, parameters, returnType) { + return FunctionType(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType)); +} +function FromIntersect(moduleProperties, types) { + return Intersect(FromTypes(moduleProperties, types)); +} +function FromIterator(moduleProperties, type) { + return Iterator(FromType(moduleProperties, type)); +} +function FromObject(moduleProperties, properties) { + return Object(globalThis.Object.keys(properties).reduce((result, key) => { + return { ...result, [key]: FromType(moduleProperties, properties[key]) }; + }, {})); +} +// prettier-ignore +function FromRecord(moduleProperties, type) { + const [value, pattern] = [FromType(moduleProperties, RecordValue(type)), RecordPattern(type)]; + const result = CloneType(type); + result.patternProperties[pattern] = value; + return result; +} +// prettier-ignore +function FromTransform(moduleProperties, transform) { + return (KindGuard.IsRef(transform)) + ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } + : transform; +} +function FromTuple(moduleProperties, types) { + return Tuple(FromTypes(moduleProperties, types)); +} +function FromUnion(moduleProperties, types) { + return Union(FromTypes(moduleProperties, types)); +} +function FromTypes(moduleProperties, types) { + return types.map((type) => FromType(moduleProperties, type)); +} +// prettier-ignore +export function FromType(moduleProperties, type) { + return ( + // Modifiers + KindGuard.IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : + KindGuard.IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : + // Transform + KindGuard.IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : + // Types + KindGuard.IsArray(type) ? CreateType(FromArray(moduleProperties, type.items), type) : + KindGuard.IsAsyncIterator(type) ? CreateType(FromAsyncIterator(moduleProperties, type.items), type) : + KindGuard.IsComputed(type) ? CreateType(FromComputed(moduleProperties, type.target, type.parameters)) : + KindGuard.IsConstructor(type) ? CreateType(FromConstructor(moduleProperties, type.parameters, type.returns), type) : + KindGuard.IsFunction(type) ? CreateType(FromFunction(moduleProperties, type.parameters, type.returns), type) : + KindGuard.IsIntersect(type) ? CreateType(FromIntersect(moduleProperties, type.allOf), type) : + KindGuard.IsIterator(type) ? CreateType(FromIterator(moduleProperties, type.items), type) : + KindGuard.IsObject(type) ? CreateType(FromObject(moduleProperties, type.properties), type) : + KindGuard.IsRecord(type) ? CreateType(FromRecord(moduleProperties, type)) : + KindGuard.IsTuple(type) ? CreateType(FromTuple(moduleProperties, type.items || []), type) : + KindGuard.IsUnion(type) ? CreateType(FromUnion(moduleProperties, type.anyOf), type) : + type); +} +// prettier-ignore +export function ComputeType(moduleProperties, key) { + return (key in moduleProperties + ? FromType(moduleProperties, moduleProperties[key]) + : Never()); +} +// prettier-ignore +export function ComputeModuleProperties(moduleProperties) { + return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => { + return { ...result, [key]: ComputeType(moduleProperties, key) }; + }, {}); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/module/index.d.mts new file mode 100644 index 00000000..a8c597e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/index.d.mts @@ -0,0 +1 @@ +export * from './module.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/module/index.mjs new file mode 100644 index 00000000..a8c597e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/index.mjs @@ -0,0 +1 @@ +export * from './module.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/infer.d.mts b/node_modules/@sinclair/typebox/build/esm/type/module/infer.d.mts new file mode 100644 index 00000000..691c8292 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/infer.d.mts @@ -0,0 +1,49 @@ +import { Ensure, Evaluate } from '../helpers/index.mjs'; +import { TSchema } from '../schema/index.mjs'; +import { TArray } from '../array/index.mjs'; +import { TAsyncIterator } from '../async-iterator/index.mjs'; +import { TConstructor } from '../constructor/index.mjs'; +import { TEnum, TEnumRecord } from '../enum/index.mjs'; +import { TFunction } from '../function/index.mjs'; +import { TIntersect } from '../intersect/index.mjs'; +import { TIterator } from '../iterator/index.mjs'; +import { TObject, TProperties } from '../object/index.mjs'; +import { TOptional } from '../optional/index.mjs'; +import { TRecord } from '../record/index.mjs'; +import { TReadonly } from '../readonly/index.mjs'; +import { TRef } from '../ref/index.mjs'; +import { TTuple } from '../tuple/index.mjs'; +import { TUnion } from '../union/index.mjs'; +import { Static } from '../static/index.mjs'; +import { TRecursive } from '../recursive/index.mjs'; +type TInferArray = (Ensure>>); +type TInferAsyncIterator = (Ensure>>); +type TInferConstructor = Ensure) => TInfer>; +type TInferFunction = Ensure<(...args: TInferTuple) => TInfer>; +type TInferIterator = (Ensure>>); +type TInferIntersect = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TInferIntersect> : Result); +type ReadonlyOptionalPropertyKeys = { + [Key in keyof Properties]: Properties[Key] extends TReadonly ? (Properties[Key] extends TOptional ? Key : never) : never; +}[keyof Properties]; +type ReadonlyPropertyKeys = { + [Key in keyof Source]: Source[Key] extends TReadonly ? (Source[Key] extends TOptional ? never : Key) : never; +}[keyof Source]; +type OptionalPropertyKeys = { + [Key in keyof Source]: Source[Key] extends TOptional ? (Source[Key] extends TReadonly ? never : Key) : never; +}[keyof Source]; +type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; +type InferPropertiesWithModifiers> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; +type InferProperties = InferPropertiesWithModifiers; +}>; +type TInferObject = (InferProperties); +type TInferTuple = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferTuple]> : Result); +type TInferRecord extends infer Key extends PropertyKey ? Key : never, InferedType extends unknown = TInfer> = Ensure<{ + [_ in InferredKey]: InferedType; +}>; +type TInferRef = (Ref extends keyof ModuleProperties ? TInfer : unknown); +type TInferUnion = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferUnion> : Result); +type TInfer = (Type extends TArray ? TInferArray : Type extends TAsyncIterator ? TInferAsyncIterator : Type extends TConstructor ? TInferConstructor : Type extends TFunction ? TInferFunction : Type extends TIntersect ? TInferIntersect : Type extends TIterator ? TInferIterator : Type extends TObject ? TInferObject : Type extends TRecord ? TInferRecord : Type extends TRef ? TInferRef : Type extends TTuple ? TInferTuple : Type extends TEnum ? Static : Type extends TUnion ? TInferUnion : Type extends TRecursive ? TInfer : Static); +/** Inference Path for Imports. This type is used to compute TImport `static` */ +export type TInferFromModuleKey = (Key extends keyof ModuleProperties ? TInfer : never); +export {}; diff --git a/node_modules/fast-check/lib/esm/arbitrary/_shared/StringSharedConstraints.js b/node_modules/@sinclair/typebox/build/esm/type/module/infer.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/arbitrary/_shared/StringSharedConstraints.js rename to node_modules/@sinclair/typebox/build/esm/type/module/infer.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/module.d.mts b/node_modules/@sinclair/typebox/build/esm/type/module/module.d.mts new file mode 100644 index 00000000..52408923 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/module.d.mts @@ -0,0 +1,27 @@ +import { Kind } from '../symbols/index.mjs'; +import { SchemaOptions, TSchema } from '../schema/index.mjs'; +import { TProperties } from '../object/index.mjs'; +import { Static } from '../static/index.mjs'; +import { TComputeModuleProperties } from './compute.mjs'; +import { TInferFromModuleKey } from './infer.mjs'; +export interface TDefinitions extends TSchema { + static: { + [K in keyof ModuleProperties]: Static; + }; + $defs: ModuleProperties; +} +export interface TImport extends TSchema { + [Kind]: 'Import'; + static: TInferFromModuleKey; + $defs: ModuleProperties; + $ref: Key; +} +export declare class TModule> { + private readonly $defs; + constructor($defs: ModuleProperties); + /** `[Json]` Imports a Type by Key. */ + Import(key: Key, options?: SchemaOptions): TImport; + private WithIdentifiers; +} +/** `[Json]` Creates a Type Definition Module. */ +export declare function Module(properties: Properties): TModule; diff --git a/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs b/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs new file mode 100644 index 00000000..99f7d6c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs @@ -0,0 +1,32 @@ +import { CreateType } from '../create/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +// ------------------------------------------------------------------ +// Module Infrastructure Types +// ------------------------------------------------------------------ +import { ComputeModuleProperties } from './compute.mjs'; +// ------------------------------------------------------------------ +// Module +// ------------------------------------------------------------------ +// prettier-ignore +export class TModule { + constructor($defs) { + const computed = ComputeModuleProperties($defs); + const identified = this.WithIdentifiers(computed); + this.$defs = identified; + } + /** `[Json]` Imports a Type by Key. */ + Import(key, options) { + const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) }; + return CreateType({ [Kind]: 'Import', $defs, $ref: key }); + } + // prettier-ignore + WithIdentifiers($defs) { + return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => { + return { ...result, [key]: { ...$defs[key], $id: key } }; + }, {}); + } +} +/** `[Json]` Creates a Type Definition Module. */ +export function Module(properties) { + return new TModule(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/never/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/never/index.d.mts new file mode 100644 index 00000000..381a79e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/never/index.d.mts @@ -0,0 +1 @@ +export * from './never.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/never/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/never/index.mjs new file mode 100644 index 00000000..381a79e1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/never/index.mjs @@ -0,0 +1 @@ +export * from './never.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/never/never.d.mts b/node_modules/@sinclair/typebox/build/esm/type/never/never.d.mts new file mode 100644 index 00000000..c7c83e4b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/never/never.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TNever extends TSchema { + [Kind]: 'Never'; + static: never; + not: {}; +} +/** `[Json]` Creates a Never type */ +export declare function Never(options?: SchemaOptions): TNever; diff --git a/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs b/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs new file mode 100644 index 00000000..a1d49381 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Never type */ +export function Never(options) { + return CreateType({ [Kind]: 'Never', not: {} }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/not/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/not/index.d.mts new file mode 100644 index 00000000..7bce22b4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/not/index.d.mts @@ -0,0 +1 @@ +export * from './not.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/not/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/not/index.mjs new file mode 100644 index 00000000..7bce22b4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/not/index.mjs @@ -0,0 +1 @@ +export * from './not.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/not/not.d.mts b/node_modules/@sinclair/typebox/build/esm/type/not/not.d.mts new file mode 100644 index 00000000..1e7f2be4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/not/not.d.mts @@ -0,0 +1,10 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TNot extends TSchema { + [Kind]: 'Not'; + static: T extends TNot ? Static : unknown; + not: T; +} +/** `[Json]` Creates a Not type */ +export declare function Not(type: Type, options?: SchemaOptions): TNot; diff --git a/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs b/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs new file mode 100644 index 00000000..2d1ea6cb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Not type */ +export function Not(type, options) { + return CreateType({ [Kind]: 'Not', not: type }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/null/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/null/index.d.mts new file mode 100644 index 00000000..5b0152c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/null/index.d.mts @@ -0,0 +1 @@ +export * from './null.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/null/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/null/index.mjs new file mode 100644 index 00000000..5b0152c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/null/index.mjs @@ -0,0 +1 @@ +export * from './null.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/null/null.d.mts b/node_modules/@sinclair/typebox/build/esm/type/null/null.d.mts new file mode 100644 index 00000000..668b03ca --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/null/null.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TNull extends TSchema { + [Kind]: 'Null'; + static: null; + type: 'null'; +} +/** `[Json]` Creates a Null type */ +export declare function Null(options?: SchemaOptions): TNull; diff --git a/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs b/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs new file mode 100644 index 00000000..876e35ac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Null type */ +export function Null(options) { + return CreateType({ [Kind]: 'Null', type: 'null' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/number/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/number/index.d.mts new file mode 100644 index 00000000..8cdb1e17 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/number/index.d.mts @@ -0,0 +1 @@ +export * from './number.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/number/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/number/index.mjs new file mode 100644 index 00000000..8cdb1e17 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/number/index.mjs @@ -0,0 +1 @@ +export * from './number.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/number/number.d.mts b/node_modules/@sinclair/typebox/build/esm/type/number/number.d.mts new file mode 100644 index 00000000..d0e966a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/number/number.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface NumberOptions extends SchemaOptions { + exclusiveMaximum?: number; + exclusiveMinimum?: number; + maximum?: number; + minimum?: number; + multipleOf?: number; +} +export interface TNumber extends TSchema, NumberOptions { + [Kind]: 'Number'; + static: number; + type: 'number'; +} +/** `[Json]` Creates a Number type */ +export declare function Number(options?: NumberOptions): TNumber; diff --git a/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs b/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs new file mode 100644 index 00000000..8fecb552 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Number type */ +export function Number(options) { + return CreateType({ [Kind]: 'Number', type: 'number' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/object/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/object/index.d.mts new file mode 100644 index 00000000..e866a0fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/object/index.d.mts @@ -0,0 +1 @@ +export * from './object.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/object/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/object/index.mjs new file mode 100644 index 00000000..e866a0fe --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/object/index.mjs @@ -0,0 +1 @@ +export * from './object.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/object/object.d.mts b/node_modules/@sinclair/typebox/build/esm/type/object/object.d.mts new file mode 100644 index 00000000..9dcfbcac --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/object/object.d.mts @@ -0,0 +1,48 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import type { Evaluate, UnionToTuple } from '../helpers/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type ReadonlyOptionalPropertyKeys = { + [K in keyof T]: T[K] extends TReadonly ? (T[K] extends TOptional ? K : never) : never; +}[keyof T]; +type ReadonlyPropertyKeys = { + [K in keyof T]: T[K] extends TReadonly ? (T[K] extends TOptional ? never : K) : never; +}[keyof T]; +type OptionalPropertyKeys = { + [K in keyof T]: T[K] extends TOptional ? (T[K] extends TReadonly ? never : K) : never; +}[keyof T]; +type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; +type ObjectStaticProperties> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; +type ObjectStatic = ObjectStaticProperties; +}>; +export type TPropertyKey = string | number; +export type TProperties = Record; +/** Creates a RequiredArray derived from the given TProperties value. */ +type TRequiredArray ? never : Key]: Properties[Key]; +}, RequiredKeys extends string[] = UnionToTuple>, Result extends string[] | undefined = RequiredKeys extends [] ? undefined : RequiredKeys> = Result; +export type TAdditionalProperties = undefined | TSchema | boolean; +export interface ObjectOptions extends SchemaOptions { + /** Additional property constraints for this object */ + additionalProperties?: TAdditionalProperties; + /** The minimum number of properties allowed on this object */ + minProperties?: number; + /** The maximum number of properties allowed on this object */ + maxProperties?: number; +} +export interface TObject extends TSchema, ObjectOptions { + [Kind]: 'Object'; + static: ObjectStatic; + additionalProperties?: TAdditionalProperties; + type: 'object'; + properties: T; + required: TRequiredArray; +} +/** `[Json]` Creates an Object type */ +declare function _Object(properties: T, options?: ObjectOptions): TObject; +/** `[Json]` Creates an Object type */ +export declare var Object: typeof _Object; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs b/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs new file mode 100644 index 00000000..1730d52f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs @@ -0,0 +1,18 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsOptional } from '../guard/kind.mjs'; +/** Creates a RequiredArray derived from the given TProperties value. */ +function RequiredArray(properties) { + return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key])); +} +/** `[Json]` Creates an Object type */ +function _Object(properties, options) { + const required = RequiredArray(properties); + const schema = required.length > 0 ? { [Kind]: 'Object', type: 'object', required, properties } : { [Kind]: 'Object', type: 'object', properties }; + return CreateType(schema, options); +} +/** `[Json]` Creates an Object type */ +export var Object = _Object; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/omit/index.d.mts new file mode 100644 index 00000000..08869875 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/index.d.mts @@ -0,0 +1,3 @@ +export * from './omit-from-mapped-key.mjs'; +export * from './omit-from-mapped-result.mjs'; +export * from './omit.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/omit/index.mjs new file mode 100644 index 00000000..08869875 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/index.mjs @@ -0,0 +1,3 @@ +export * from './omit-from-mapped-key.mjs'; +export * from './omit-from-mapped-result.mjs'; +export * from './omit.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.d.mts new file mode 100644 index 00000000..10877e36 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.d.mts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +import { type TOmit } from './omit.mjs'; +type TFromPropertyKey = { + [_ in Key]: TOmit; +}; +type TFromPropertyKeys = (PropertyKeys extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys> : Result); +type TFromMappedKey = (TFromPropertyKeys); +export type TOmitFromMappedKey> = (TMappedResult); +export declare function OmitFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs new file mode 100644 index 00000000..dc3b0b63 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs @@ -0,0 +1,22 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Omit } from './omit.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromPropertyKey(type, key, options) { + return { [key]: Omit(type, [key], Clone(options)) }; +} +// prettier-ignore +function FromPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((Acc, LK) => { + return { ...Acc, ...FromPropertyKey(type, LK, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(type, mappedKey, options) { + return FromPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +export function OmitFromMappedKey(type, mappedKey, options) { + const properties = FromMappedKey(type, mappedKey, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.d.mts new file mode 100644 index 00000000..ffd94ef9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TOmit } from './omit.mjs'; +type TFromProperties = ({ + [K2 in keyof Properties]: TOmit; +}); +type TFromMappedResult = (Evaluate>); +export type TOmitFromMappedResult> = (Ensure>); +export declare function OmitFromMappedResult>(mappedResult: MappedResult, propertyKeys: [...PropertyKeys], options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs new file mode 100644 index 00000000..4e5859a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs @@ -0,0 +1,19 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Omit } from './omit.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromProperties(properties, propertyKeys, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = Omit(properties[K2], propertyKeys, Clone(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, propertyKeys, options) { + return FromProperties(mappedResult.properties, propertyKeys, options); +} +// prettier-ignore +export function OmitFromMappedResult(mappedResult, propertyKeys, options) { + const properties = FromMappedResult(mappedResult, propertyKeys, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit.d.mts b/node_modules/@sinclair/typebox/build/esm/type/omit/omit.d.mts new file mode 100644 index 00000000..3a00a9bb --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit.d.mts @@ -0,0 +1,36 @@ +import type { SchemaOptions, TSchema } from '../schema/index.mjs'; +import type { TupleToUnion, Evaluate } from '../helpers/index.mjs'; +import { type TRecursive } from '../recursive/index.mjs'; +import type { TMappedKey, TMappedResult } from '../mapped/index.mjs'; +import { TComputed } from '../computed/index.mjs'; +import { TLiteral, TLiteralValue } from '../literal/index.mjs'; +import { type TIndexPropertyKeys } from '../indexed/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TOmitFromMappedKey } from './omit-from-mapped-key.mjs'; +import { type TOmitFromMappedResult } from './omit-from-mapped-result.mjs'; +type TFromIntersect = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect]> : Result); +type TFromUnion = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion]> : Result); +type TFromProperties> = (Evaluate>); +type TFromObject<_Type extends TObject, PropertyKeys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TUnionFromPropertyKeys = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys]> : TUnionFromPropertyKeys : TUnion); +export type TOmitResolve = (Properties extends TRecursive ? TRecursive> : Properties extends TIntersect ? TIntersect> : Properties extends TUnion ? TUnion> : Properties extends TObject ? TFromObject : TObject<{}>); +type TResolvePropertyKeys = Key extends TSchema ? TIndexPropertyKeys : Key; +type TResolveTypeKey = Key extends PropertyKey[] ? TUnionFromPropertyKeys : Key; +export type TOmit = (Type extends TMappedResult ? TOmitFromMappedResult> : Key extends TMappedKey ? TOmitFromMappedKey : [ + IsTypeRef, + IsKeyRef +] extends [true, true] ? TComputed<'Omit', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [false, true] ? TComputed<'Omit', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [true, false] ? TComputed<'Omit', [Type, TResolveTypeKey]> : TOmitResolve>); +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Omit(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit; +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Omit(type: Type, key: Key, options?: SchemaOptions): TOmit; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs b/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs new file mode 100644 index 00000000..4f3a6428 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs @@ -0,0 +1,71 @@ +import { CreateType } from '../create/type.mjs'; +import { Discard } from '../discard/discard.mjs'; +import { TransformKind } from '../symbols/symbols.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { IndexPropertyKeys } from '../indexed/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Union } from '../union/index.mjs'; +import { Object } from '../object/index.mjs'; +// ------------------------------------------------------------------ +// Mapped +// ------------------------------------------------------------------ +import { OmitFromMappedKey } from './omit-from-mapped-key.mjs'; +import { OmitFromMappedResult } from './omit-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsMappedKey, IsIntersect, IsUnion, IsObject, IsSchema, IsMappedResult, IsLiteralValue, IsRef } from '../guard/kind.mjs'; +import { IsArray as IsArrayValue } from '../guard/value.mjs'; +// prettier-ignore +function FromIntersect(types, propertyKeys) { + return types.map((type) => OmitResolve(type, propertyKeys)); +} +// prettier-ignore +function FromUnion(types, propertyKeys) { + return types.map((type) => OmitResolve(type, propertyKeys)); +} +// ------------------------------------------------------------------ +// FromProperty +// ------------------------------------------------------------------ +// prettier-ignore +function FromProperty(properties, key) { + const { [key]: _, ...R } = properties; + return R; +} +// prettier-ignore +function FromProperties(properties, propertyKeys) { + return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties); +} +// prettier-ignore +function FromObject(type, propertyKeys, properties) { + const options = Discard(type, [TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties, propertyKeys); + return Object(mappedProperties, options); +} +// prettier-ignore +function UnionFromPropertyKeys(propertyKeys) { + const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []); + return Union(result); +} +// prettier-ignore +function OmitResolve(type, propertyKeys) { + return (IsIntersect(type) ? Intersect(FromIntersect(type.allOf, propertyKeys)) : + IsUnion(type) ? Union(FromUnion(type.anyOf, propertyKeys)) : + IsObject(type) ? FromObject(type, propertyKeys, type.properties) : + Object({})); +} +/** `[Json]` Constructs a type whose keys are picked from the given type */ +// prettier-ignore +export function Omit(type, key, options) { + const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key; + const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key; + const isTypeRef = IsRef(type); + const isKeyRef = IsRef(key); + return (IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : + IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : + (isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) : + (!isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) : + (isTypeRef && !isKeyRef) ? Computed('Omit', [type, typeKey], options) : + CreateType({ ...OmitResolve(type, propertyKeys), ...options })); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/optional/index.d.mts new file mode 100644 index 00000000..5b895376 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/index.d.mts @@ -0,0 +1,2 @@ +export * from './optional-from-mapped-result.mjs'; +export * from './optional.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/optional/index.mjs new file mode 100644 index 00000000..5b895376 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/index.mjs @@ -0,0 +1,2 @@ +export * from './optional-from-mapped-result.mjs'; +export * from './optional.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.d.mts new file mode 100644 index 00000000..d8f5fd3d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.d.mts @@ -0,0 +1,10 @@ +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TOptionalWithFlag } from './optional.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TOptionalWithFlag; +}); +type TFromMappedResult = (TFromProperties); +export type TOptionalFromMappedResult> = (TMappedResult

); +export declare function OptionalFromMappedResult>(R: R, F: F): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs new file mode 100644 index 00000000..4b473359 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs @@ -0,0 +1,18 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Optional } from './optional.mjs'; +// prettier-ignore +function FromProperties(P, F) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = Optional(P[K2], F); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, F) { + return FromProperties(R.properties, F); +} +// prettier-ignore +export function OptionalFromMappedResult(R, F) { + const P = FromMappedResult(R, F); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/optional.d.mts b/node_modules/@sinclair/typebox/build/esm/type/optional/optional.d.mts new file mode 100644 index 00000000..7e17a6c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/optional.d.mts @@ -0,0 +1,20 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Ensure } from '../helpers/index.mjs'; +import { OptionalKind } from '../symbols/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TOptionalFromMappedResult } from './optional-from-mapped-result.mjs'; +type TRemoveOptional = T extends TOptional ? S : T; +type TAddOptional = T extends TOptional ? TOptional : Ensure>; +export type TOptionalWithFlag = F extends false ? TRemoveOptional : TAddOptional; +export type TOptional = T & { + [OptionalKind]: 'Optional'; +}; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T, enable: F): TOptionalFromMappedResult; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T, enable: F): TOptionalWithFlag; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T): TOptionalFromMappedResult; +/** `[Json]` Creates a Optional property */ +export declare function Optional(schema: T): TOptionalWithFlag; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs b/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs new file mode 100644 index 00000000..90469a9e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs @@ -0,0 +1,22 @@ +import { CreateType } from '../create/type.mjs'; +import { OptionalKind } from '../symbols/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { OptionalFromMappedResult } from './optional-from-mapped-result.mjs'; +import { IsMappedResult } from '../guard/kind.mjs'; +function RemoveOptional(schema) { + return CreateType(Discard(schema, [OptionalKind])); +} +function AddOptional(schema) { + return CreateType({ ...schema, [OptionalKind]: 'Optional' }); +} +// prettier-ignore +function OptionalWithFlag(schema, F) { + return (F === false + ? RemoveOptional(schema) + : AddOptional(schema)); +} +/** `[Json]` Creates a Optional property */ +export function Optional(schema, enable) { + const F = enable ?? true; + return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/parameters/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/parameters/index.d.mts new file mode 100644 index 00000000..2684356f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/parameters/index.d.mts @@ -0,0 +1 @@ +export * from './parameters.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/parameters/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/parameters/index.mjs new file mode 100644 index 00000000..2684356f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/parameters/index.mjs @@ -0,0 +1 @@ +export * from './parameters.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.d.mts b/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.d.mts new file mode 100644 index 00000000..2a1318a0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.d.mts @@ -0,0 +1,7 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TFunction } from '../function/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { type TNever } from '../never/index.mjs'; +export type TParameters = (Type extends TFunction ? TTuple : TNever); +/** `[JavaScript]` Extracts the Parameters from the given Function type */ +export declare function Parameters(schema: Type, options?: SchemaOptions): TParameters; diff --git a/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs b/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs new file mode 100644 index 00000000..c680fbed --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs @@ -0,0 +1,7 @@ +import { Tuple } from '../tuple/index.mjs'; +import { Never } from '../never/index.mjs'; +import * as KindGuard from '../guard/kind.mjs'; +/** `[JavaScript]` Extracts the Parameters from the given Function type */ +export function Parameters(schema, options) { + return (KindGuard.IsFunction(schema) ? Tuple(schema.parameters, options) : Never()); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/partial/index.d.mts new file mode 100644 index 00000000..8ba941c5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/index.d.mts @@ -0,0 +1,2 @@ +export * from './partial-from-mapped-result.mjs'; +export * from './partial.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/partial/index.mjs new file mode 100644 index 00000000..8ba941c5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/index.mjs @@ -0,0 +1,2 @@ +export * from './partial-from-mapped-result.mjs'; +export * from './partial.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.d.mts new file mode 100644 index 00000000..1e0f8e03 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TPartial } from './partial.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TPartial; +}); +type TFromMappedResult = (Evaluate>); +export type TPartialFromMappedResult> = (Ensure>); +export declare function PartialFromMappedResult>(R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs new file mode 100644 index 00000000..191790db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs @@ -0,0 +1,19 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Partial } from './partial.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromProperties(K, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(K)) + Acc[K2] = Partial(K[K2], Clone(options)); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, options) { + return FromProperties(R.properties, options); +} +// prettier-ignore +export function PartialFromMappedResult(R, options) { + const P = FromMappedResult(R, options); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/partial.d.mts b/node_modules/@sinclair/typebox/build/esm/type/partial/partial.d.mts new file mode 100644 index 00000000..b165bd1e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/partial.d.mts @@ -0,0 +1,35 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Evaluate, Ensure } from '../helpers/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TReadonlyOptional } from '../readonly-optional/index.mjs'; +import { type TComputed } from '../computed/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TRecursive } from '../recursive/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TBigInt } from '../bigint/index.mjs'; +import { type TBoolean } from '../boolean/index.mjs'; +import { type TInteger } from '../integer/index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { type TNull } from '../null/index.mjs'; +import { type TNumber } from '../number/index.mjs'; +import { type TString } from '../string/index.mjs'; +import { type TSymbol } from '../symbol/index.mjs'; +import { type TUndefined } from '../undefined/index.mjs'; +import { type TPartialFromMappedResult } from './partial-from-mapped-result.mjs'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +type TFromProperties = Evaluate<{ + [K in keyof Properties]: Properties[K] extends (TReadonlyOptional) ? TReadonlyOptional : Properties[K] extends (TReadonly) ? TReadonlyOptional : Properties[K] extends (TOptional) ? TOptional : TOptional; +}>; +type TFromObject<_Type extends TObject, Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +export type TPartial = (Type extends TRecursive ? TRecursive> : Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : Type extends TBigInt ? Type : Type extends TBoolean ? Type : Type extends TInteger ? Type : Type extends TLiteral ? Type : Type extends TNull ? Type : Type extends TNumber ? Type : Type extends TString ? Type : Type extends TSymbol ? Type : Type extends TUndefined ? Type : TObject<{}>); +/** `[Json]` Constructs a type where all properties are optional */ +export declare function Partial(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult; +/** `[Json]` Constructs a type where all properties are optional */ +export declare function Partial(type: Type, options?: SchemaOptions): TPartial; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs b/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs new file mode 100644 index 00000000..0ba7ce91 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs @@ -0,0 +1,74 @@ +import { CreateType } from '../create/type.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Union } from '../union/index.mjs'; +import { Ref } from '../ref/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { TransformKind } from '../symbols/index.mjs'; +import { PartialFromMappedResult } from './partial-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import * as KindGuard from '../guard/kind.mjs'; +// prettier-ignore +function FromComputed(target, parameters) { + return Computed('Partial', [Computed(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return Computed('Partial', [Ref($ref)]); +} +// prettier-ignore +function FromProperties(properties) { + const partialProperties = {}; + for (const K of globalThis.Object.getOwnPropertyNames(properties)) + partialProperties[K] = Optional(properties[K]); + return partialProperties; +} +// prettier-ignore +function FromObject(type, properties) { + const options = Discard(type, [TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties); + return Object(mappedProperties, options); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => PartialResolve(type)); +} +// ------------------------------------------------------------------ +// PartialResolve +// ------------------------------------------------------------------ +// prettier-ignore +function PartialResolve(type) { + return ( + // Mappable + KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : + KindGuard.IsRef(type) ? FromRef(type.$ref) : + KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) : + KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) : + KindGuard.IsObject(type) ? FromObject(type, type.properties) : + // Intrinsic + KindGuard.IsBigInt(type) ? type : + KindGuard.IsBoolean(type) ? type : + KindGuard.IsInteger(type) ? type : + KindGuard.IsLiteral(type) ? type : + KindGuard.IsNull(type) ? type : + KindGuard.IsNumber(type) ? type : + KindGuard.IsString(type) ? type : + KindGuard.IsSymbol(type) ? type : + KindGuard.IsUndefined(type) ? type : + // Passthrough + Object({})); +} +/** `[Json]` Constructs a type where all properties are optional */ +export function Partial(type, options) { + if (KindGuard.IsMappedResult(type)) { + return PartialFromMappedResult(type, options); + } + else { + // special: mapping types require overridable options + return CreateType({ ...PartialResolve(type), ...options }); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/patterns/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/patterns/index.d.mts new file mode 100644 index 00000000..7a645c45 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/patterns/index.d.mts @@ -0,0 +1 @@ +export * from './patterns.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/patterns/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/patterns/index.mjs new file mode 100644 index 00000000..7a645c45 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/patterns/index.mjs @@ -0,0 +1 @@ +export * from './patterns.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.d.mts b/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.d.mts new file mode 100644 index 00000000..37e3ae2d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.d.mts @@ -0,0 +1,8 @@ +export declare const PatternBoolean = "(true|false)"; +export declare const PatternNumber = "(0|[1-9][0-9]*)"; +export declare const PatternString = "(.*)"; +export declare const PatternNever = "(?!.*)"; +export declare const PatternBooleanExact = "^(true|false)$"; +export declare const PatternNumberExact = "^(0|[1-9][0-9]*)$"; +export declare const PatternStringExact = "^(.*)$"; +export declare const PatternNeverExact = "^(?!.*)$"; diff --git a/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs b/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs new file mode 100644 index 00000000..52fa2c5d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs @@ -0,0 +1,8 @@ +export const PatternBoolean = '(true|false)'; +export const PatternNumber = '(0|[1-9][0-9]*)'; +export const PatternString = '(.*)'; +export const PatternNever = '(?!.*)'; +export const PatternBooleanExact = `^${PatternBoolean}$`; +export const PatternNumberExact = `^${PatternNumber}$`; +export const PatternStringExact = `^${PatternString}$`; +export const PatternNeverExact = `^${PatternNever}$`; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/pick/index.d.mts new file mode 100644 index 00000000..274be36f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/index.d.mts @@ -0,0 +1,3 @@ +export * from './pick-from-mapped-key.mjs'; +export * from './pick-from-mapped-result.mjs'; +export * from './pick.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/pick/index.mjs new file mode 100644 index 00000000..274be36f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/index.mjs @@ -0,0 +1,3 @@ +export * from './pick-from-mapped-key.mjs'; +export * from './pick-from-mapped-result.mjs'; +export * from './pick.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.d.mts b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.d.mts new file mode 100644 index 00000000..2fb955e4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.d.mts @@ -0,0 +1,12 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs'; +import { type TPick } from './pick.mjs'; +type TFromPropertyKey = { + [_ in Key]: TPick; +}; +type TFromPropertyKeys = (PropertyKeys extends [infer LeftKey extends PropertyKey, ...infer RightKeys extends PropertyKey[]] ? TFromPropertyKeys> : Result); +type TFromMappedKey = (TFromPropertyKeys); +export type TPickFromMappedKey> = (TMappedResult); +export declare function PickFromMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs new file mode 100644 index 00000000..2c59ee13 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs @@ -0,0 +1,24 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Pick } from './pick.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromPropertyKey(type, key, options) { + return { + [key]: Pick(type, [key], Clone(options)) + }; +} +// prettier-ignore +function FromPropertyKeys(type, propertyKeys, options) { + return propertyKeys.reduce((result, leftKey) => { + return { ...result, ...FromPropertyKey(type, leftKey, options) }; + }, {}); +} +// prettier-ignore +function FromMappedKey(type, mappedKey, options) { + return FromPropertyKeys(type, mappedKey.keys, options); +} +// prettier-ignore +export function PickFromMappedKey(type, mappedKey, options) { + const properties = FromMappedKey(type, mappedKey, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.d.mts new file mode 100644 index 00000000..1ae01640 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TPick } from './pick.mjs'; +type TFromProperties = ({ + [K2 in keyof Properties]: TPick; +}); +type TFromMappedResult = (Evaluate>); +export type TPickFromMappedResult> = (Ensure>); +export declare function PickFromMappedResult>(mappedResult: MappedResult, propertyKeys: [...PropertyKeys], options?: SchemaOptions): TMappedResult; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs new file mode 100644 index 00000000..0e4c688f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs @@ -0,0 +1,19 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Pick } from './pick.mjs'; +import { Clone } from '../clone/value.mjs'; +// prettier-ignore +function FromProperties(properties, propertyKeys, options) { + const result = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) + result[K2] = Pick(properties[K2], propertyKeys, Clone(options)); + return result; +} +// prettier-ignore +function FromMappedResult(mappedResult, propertyKeys, options) { + return FromProperties(mappedResult.properties, propertyKeys, options); +} +// prettier-ignore +export function PickFromMappedResult(mappedResult, propertyKeys, options) { + const properties = FromMappedResult(mappedResult, propertyKeys, options); + return MappedResult(properties); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick.d.mts b/node_modules/@sinclair/typebox/build/esm/type/pick/pick.d.mts new file mode 100644 index 00000000..8c272a8a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick.d.mts @@ -0,0 +1,36 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { TupleToUnion, Evaluate } from '../helpers/index.mjs'; +import { type TRecursive } from '../recursive/index.mjs'; +import { type TComputed } from '../computed/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TMappedKey, type TMappedResult } from '../mapped/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TIndexPropertyKeys } from '../indexed/index.mjs'; +import { type TPickFromMappedKey } from './pick-from-mapped-key.mjs'; +import { type TPickFromMappedResult } from './pick-from-mapped-result.mjs'; +type TFromIntersect = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect]> : Result; +type TFromUnion = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion]> : Result; +type TFromProperties> = (Evaluate>); +type TFromObject<_Type extends TObject, Keys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TUnionFromPropertyKeys = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys]> : TUnionFromPropertyKeys : TUnion); +export type TPickResolve = (Type extends TRecursive ? TRecursive> : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : TObject<{}>); +type TResolvePropertyKeys = Key extends TSchema ? TIndexPropertyKeys : Key; +type TResolveTypeKey = Key extends PropertyKey[] ? TUnionFromPropertyKeys : Key; +export type TPick = (Type extends TMappedResult ? TPickFromMappedResult> : Key extends TMappedKey ? TPickFromMappedKey : [ + IsTypeRef, + IsKeyRef +] extends [true, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [false, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ + IsTypeRef, + IsKeyRef +] extends [true, false] ? TComputed<'Pick', [Type, TResolveTypeKey]> : TPickResolve>); +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Pick(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick; +/** `[Json]` Constructs a type whose keys are picked from the given type */ +export declare function Pick(type: Type, key: Key, options?: SchemaOptions): TPick; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs b/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs new file mode 100644 index 00000000..2b459bd1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs @@ -0,0 +1,66 @@ +import { CreateType } from '../create/type.mjs'; +import { Discard } from '../discard/discard.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Union } from '../union/index.mjs'; +import { IndexPropertyKeys } from '../indexed/index.mjs'; +import { TransformKind } from '../symbols/symbols.mjs'; +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +import { IsMappedKey, IsMappedResult, IsIntersect, IsUnion, IsObject, IsSchema, IsLiteralValue, IsRef } from '../guard/kind.mjs'; +import { IsArray as IsArrayValue } from '../guard/value.mjs'; +// ------------------------------------------------------------------ +// Infrastructure +// ------------------------------------------------------------------ +import { PickFromMappedKey } from './pick-from-mapped-key.mjs'; +import { PickFromMappedResult } from './pick-from-mapped-result.mjs'; +function FromIntersect(types, propertyKeys) { + return types.map((type) => PickResolve(type, propertyKeys)); +} +// prettier-ignore +function FromUnion(types, propertyKeys) { + return types.map((type) => PickResolve(type, propertyKeys)); +} +// prettier-ignore +function FromProperties(properties, propertyKeys) { + const result = {}; + for (const K2 of propertyKeys) + if (K2 in properties) + result[K2] = properties[K2]; + return result; +} +// prettier-ignore +function FromObject(Type, keys, properties) { + const options = Discard(Type, [TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties, keys); + return Object(mappedProperties, options); +} +// prettier-ignore +function UnionFromPropertyKeys(propertyKeys) { + const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []); + return Union(result); +} +// prettier-ignore +function PickResolve(type, propertyKeys) { + return (IsIntersect(type) ? Intersect(FromIntersect(type.allOf, propertyKeys)) : + IsUnion(type) ? Union(FromUnion(type.anyOf, propertyKeys)) : + IsObject(type) ? FromObject(type, propertyKeys, type.properties) : + Object({})); +} +/** `[Json]` Constructs a type whose keys are picked from the given type */ +// prettier-ignore +export function Pick(type, key, options) { + const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key; + const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key; + const isTypeRef = IsRef(type); + const isKeyRef = IsRef(key); + return (IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : + IsMappedKey(key) ? PickFromMappedKey(type, key, options) : + (isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) : + (!isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) : + (isTypeRef && !isKeyRef) ? Computed('Pick', [type, typeKey], options) : + CreateType({ ...PickResolve(type, propertyKeys), ...options })); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/promise/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/promise/index.d.mts new file mode 100644 index 00000000..02a51fc9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/promise/index.d.mts @@ -0,0 +1 @@ +export * from './promise.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/promise/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/promise/index.mjs new file mode 100644 index 00000000..02a51fc9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/promise/index.mjs @@ -0,0 +1 @@ +export * from './promise.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/promise/promise.d.mts b/node_modules/@sinclair/typebox/build/esm/type/promise/promise.d.mts new file mode 100644 index 00000000..fb57d273 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/promise/promise.d.mts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TPromise extends TSchema { + [Kind]: 'Promise'; + static: Promise>; + type: 'Promise'; + item: TSchema; +} +/** `[JavaScript]` Creates a Promise type */ +export declare function Promise(item: T, options?: SchemaOptions): TPromise; diff --git a/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs b/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs new file mode 100644 index 00000000..c128ed5b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Promise type */ +export function Promise(item, options) { + return CreateType({ [Kind]: 'Promise', type: 'Promise', item }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.d.mts new file mode 100644 index 00000000..a42744c1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.d.mts @@ -0,0 +1 @@ +export * from './readonly-optional.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.mjs new file mode 100644 index 00000000..a42744c1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.mjs @@ -0,0 +1 @@ +export * from './readonly-optional.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.d.mts b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.d.mts new file mode 100644 index 00000000..b125361f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.d.mts @@ -0,0 +1,6 @@ +import type { TSchema } from '../schema/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +export type TReadonlyOptional = TOptional & TReadonly; +/** `[Json]` Creates a Readonly and Optional property */ +export declare function ReadonlyOptional(schema: T): TReadonly>; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs new file mode 100644 index 00000000..51dd5773 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs @@ -0,0 +1,6 @@ +import { Readonly } from '../readonly/index.mjs'; +import { Optional } from '../optional/index.mjs'; +/** `[Json]` Creates a Readonly and Optional property */ +export function ReadonlyOptional(schema) { + return Readonly(Optional(schema)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/readonly/index.d.mts new file mode 100644 index 00000000..d5964b8d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/index.d.mts @@ -0,0 +1,2 @@ +export * from './readonly-from-mapped-result.mjs'; +export * from './readonly.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/readonly/index.mjs new file mode 100644 index 00000000..d5964b8d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/index.mjs @@ -0,0 +1,2 @@ +export * from './readonly-from-mapped-result.mjs'; +export * from './readonly.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.d.mts new file mode 100644 index 00000000..4a5b3e63 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.d.mts @@ -0,0 +1,10 @@ +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TReadonlyWithFlag } from './readonly.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TReadonlyWithFlag; +}); +type TFromMappedResult = (TFromProperties); +export type TReadonlyFromMappedResult> = (TMappedResult

); +export declare function ReadonlyFromMappedResult>(R: R, F: F): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs new file mode 100644 index 00000000..4c9c050f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs @@ -0,0 +1,18 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Readonly } from './readonly.mjs'; +// prettier-ignore +function FromProperties(K, F) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(K)) + Acc[K2] = Readonly(K[K2], F); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, F) { + return FromProperties(R.properties, F); +} +// prettier-ignore +export function ReadonlyFromMappedResult(R, F) { + const P = FromMappedResult(R, F); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.d.mts b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.d.mts new file mode 100644 index 00000000..a2366c0d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.d.mts @@ -0,0 +1,20 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Ensure } from '../helpers/index.mjs'; +import { ReadonlyKind } from '../symbols/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TReadonlyFromMappedResult } from './readonly-from-mapped-result.mjs'; +type TRemoveReadonly = T extends TReadonly ? S : T; +type TAddReadonly = T extends TReadonly ? TReadonly : Ensure>; +export type TReadonlyWithFlag = F extends false ? TRemoveReadonly : TAddReadonly; +export type TReadonly = T & { + [ReadonlyKind]: 'Readonly'; +}; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T, enable: F): TReadonlyFromMappedResult; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T, enable: F): TReadonlyWithFlag; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T): TReadonlyFromMappedResult; +/** `[Json]` Creates a Readonly property */ +export declare function Readonly(schema: T): TReadonlyWithFlag; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs new file mode 100644 index 00000000..97a9c6fc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs @@ -0,0 +1,22 @@ +import { CreateType } from '../create/type.mjs'; +import { ReadonlyKind } from '../symbols/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { ReadonlyFromMappedResult } from './readonly-from-mapped-result.mjs'; +import { IsMappedResult } from '../guard/kind.mjs'; +function RemoveReadonly(schema) { + return CreateType(Discard(schema, [ReadonlyKind])); +} +function AddReadonly(schema) { + return CreateType({ ...schema, [ReadonlyKind]: 'Readonly' }); +} +// prettier-ignore +function ReadonlyWithFlag(schema, F) { + return (F === false + ? RemoveReadonly(schema) + : AddReadonly(schema)); +} +/** `[Json]` Creates a Readonly property */ +export function Readonly(schema, enable) { + const F = enable ?? true; + return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/record/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/record/index.d.mts new file mode 100644 index 00000000..6eff9eae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/record/index.d.mts @@ -0,0 +1 @@ +export * from './record.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/record/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/record/index.mjs new file mode 100644 index 00000000..6eff9eae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/record/index.mjs @@ -0,0 +1 @@ +export * from './record.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/record/record.d.mts b/node_modules/@sinclair/typebox/build/esm/type/record/record.d.mts new file mode 100644 index 00000000..720c44dc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/record/record.d.mts @@ -0,0 +1,71 @@ +import { Kind } from '../symbols/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import type { Evaluate, Ensure, Assert } from '../helpers/index.mjs'; +import { type TAny } from '../any/index.mjs'; +import { type TBoolean } from '../boolean/index.mjs'; +import { type TEnumRecord, type TEnum } from '../enum/index.mjs'; +import { type TInteger } from '../integer/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TNumber } from '../number/index.mjs'; +import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions } from '../object/index.mjs'; +import { type TRegExp } from '../regexp/index.mjs'; +import { type TString } from '../string/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { TIsTemplateLiteralFinite, type TTemplateLiteral } from '../template-literal/index.mjs'; +type TFromTemplateLiteralKeyInfinite = Ensure>; +type TFromTemplateLiteralKeyFinite> = (Ensure>>); +type TFromTemplateLiteralKey = TIsTemplateLiteralFinite extends false ? TFromTemplateLiteralKeyInfinite : TFromTemplateLiteralKeyFinite; +type TFromEnumKey, Type extends TSchema> = Ensure>; +type TFromUnionKeyLiteralString, Type extends TSchema> = { + [_ in Key['const']]: Type; +}; +type TFromUnionKeyLiteralNumber, Type extends TSchema> = { + [_ in Key['const']]: Type; +}; +type TFromUnionKeyVariants = Keys extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? (Left extends TUnion ? TFromUnionKeyVariants> : Left extends TLiteral ? TFromUnionKeyVariants> : Left extends TLiteral ? TFromUnionKeyVariants> : {}) : Result; +type TFromUnionKey> = (Ensure>>); +type TFromLiteralKey = (Ensure]: Type; +}>>); +type TFromRegExpKey<_Key extends TRegExp, Type extends TSchema> = (Ensure>); +type TFromStringKey<_Key extends TString, Type extends TSchema> = (Ensure>); +type TFromAnyKey<_Key extends TAny, Type extends TSchema> = (Ensure>); +type TFromNeverKey<_Key extends TNever, Type extends TSchema> = (Ensure>); +type TFromBooleanKey<_Key extends TBoolean, Type extends TSchema> = (Ensure>); +type TFromIntegerKey<_Key extends TSchema, Type extends TSchema> = (Ensure>); +type TFromNumberKey<_Key extends TSchema, Type extends TSchema> = (Ensure>); +type RecordStatic = (Evaluate<{ + [_ in Assert, PropertyKey>]: Static; +}>); +export interface TRecord extends TSchema { + [Kind]: 'Record'; + static: RecordStatic; + type: 'object'; + patternProperties: { + [pattern: string]: Type; + }; + additionalProperties: TAdditionalProperties; +} +export type TRecordOrObject = (Key extends TTemplateLiteral ? TFromTemplateLiteralKey : Key extends TEnum ? TFromEnumKey : Key extends TUnion ? TFromUnionKey : Key extends TLiteral ? TFromLiteralKey : Key extends TBoolean ? TFromBooleanKey : Key extends TInteger ? TFromIntegerKey : Key extends TNumber ? TFromNumberKey : Key extends TRegExp ? TFromRegExpKey : Key extends TString ? TFromStringKey : Key extends TAny ? TFromAnyKey : Key extends TNever ? TFromNeverKey : TNever); +/** `[Json]` Creates a Record type */ +export declare function Record(key: Key, type: Type, options?: ObjectOptions): TRecordOrObject; +/** Gets the Records Pattern */ +export declare function RecordPattern(record: TRecord): string; +/** Gets the Records Key Type */ +export type TRecordKey ? (Key extends TNumber ? TNumber : Key extends TString ? TString : TString) : TString> = Result; +/** Gets the Records Key Type */ +export declare function RecordKey(type: Type): TRecordKey; +/** Gets a Record Value Type */ +export type TRecordValue ? Value : TNever)> = Result; +/** Gets a Record Value Type */ +export declare function RecordValue(type: Type): TRecordValue; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs b/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs new file mode 100644 index 00000000..80dc8713 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs @@ -0,0 +1,116 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +import { Never } from '../never/index.mjs'; +import { Number } from '../number/index.mjs'; +import { Object } from '../object/index.mjs'; +import { String } from '../string/index.mjs'; +import { Union } from '../union/index.mjs'; +import { IsTemplateLiteralFinite } from '../template-literal/index.mjs'; +import { PatternStringExact, PatternNumberExact, PatternNeverExact } from '../patterns/index.mjs'; +import { IndexPropertyKeys } from '../indexed/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsUndefined } from '../guard/value.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsInteger, IsLiteral, IsAny, IsBoolean, IsNever, IsNumber, IsString, IsRegExp, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs'; +// ------------------------------------------------------------------ +// RecordCreateFromPattern +// ------------------------------------------------------------------ +// prettier-ignore +function RecordCreateFromPattern(pattern, T, options) { + return CreateType({ [Kind]: 'Record', type: 'object', patternProperties: { [pattern]: T } }, options); +} +// ------------------------------------------------------------------ +// RecordCreateFromKeys +// ------------------------------------------------------------------ +// prettier-ignore +function RecordCreateFromKeys(K, T, options) { + const result = {}; + for (const K2 of K) + result[K2] = T; + return Object(result, { ...options, [Hint]: 'Record' }); +} +// prettier-ignore +function FromTemplateLiteralKey(K, T, options) { + return (IsTemplateLiteralFinite(K) + ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) + : RecordCreateFromPattern(K.pattern, T, options)); +} +// prettier-ignore +function FromUnionKey(key, type, options) { + return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options); +} +// prettier-ignore +function FromLiteralKey(key, type, options) { + return RecordCreateFromKeys([key.toString()], type, options); +} +// prettier-ignore +function FromRegExpKey(key, type, options) { + return RecordCreateFromPattern(key.source, type, options); +} +// prettier-ignore +function FromStringKey(key, type, options) { + const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern; + return RecordCreateFromPattern(pattern, type, options); +} +// prettier-ignore +function FromAnyKey(_, type, options) { + return RecordCreateFromPattern(PatternStringExact, type, options); +} +// prettier-ignore +function FromNeverKey(_key, type, options) { + return RecordCreateFromPattern(PatternNeverExact, type, options); +} +// prettier-ignore +function FromBooleanKey(_key, type, options) { + return Object({ true: type, false: type }, options); +} +// prettier-ignore +function FromIntegerKey(_key, type, options) { + return RecordCreateFromPattern(PatternNumberExact, type, options); +} +// prettier-ignore +function FromNumberKey(_, type, options) { + return RecordCreateFromPattern(PatternNumberExact, type, options); +} +// ------------------------------------------------------------------ +// TRecordOrObject +// ------------------------------------------------------------------ +/** `[Json]` Creates a Record type */ +export function Record(key, type, options = {}) { + // prettier-ignore + return (IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : + IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : + IsLiteral(key) ? FromLiteralKey(key.const, type, options) : + IsBoolean(key) ? FromBooleanKey(key, type, options) : + IsInteger(key) ? FromIntegerKey(key, type, options) : + IsNumber(key) ? FromNumberKey(key, type, options) : + IsRegExp(key) ? FromRegExpKey(key, type, options) : + IsString(key) ? FromStringKey(key, type, options) : + IsAny(key) ? FromAnyKey(key, type, options) : + IsNever(key) ? FromNeverKey(key, type, options) : + Never(options)); +} +// ------------------------------------------------------------------ +// Record Utilities +// ------------------------------------------------------------------ +/** Gets the Records Pattern */ +export function RecordPattern(record) { + return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0]; +} +/** Gets the Records Key Type */ +// prettier-ignore +export function RecordKey(type) { + const pattern = RecordPattern(type); + return (pattern === PatternStringExact ? String() : + pattern === PatternNumberExact ? Number() : + String({ pattern })); +} +/** Gets a Record Value Type */ +// prettier-ignore +export function RecordValue(type) { + return type.patternProperties[RecordPattern(type)]; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/recursive/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/recursive/index.d.mts new file mode 100644 index 00000000..e492ca11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/recursive/index.d.mts @@ -0,0 +1 @@ +export * from './recursive.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/recursive/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/recursive/index.mjs new file mode 100644 index 00000000..e492ca11 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/recursive/index.mjs @@ -0,0 +1 @@ +export * from './recursive.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.d.mts b/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.d.mts new file mode 100644 index 00000000..c5f0dd99 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +import { Static } from '../static/index.mjs'; +export interface TThis extends TSchema { + [Kind]: 'This'; + static: this['params'][0]; + $ref: string; +} +type RecursiveStatic = Static]>; +export interface TRecursive extends TSchema { + [Hint]: 'Recursive'; + static: RecursiveStatic; +} +/** `[Json]` Creates a Recursive type */ +export declare function Recursive(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs b/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs new file mode 100644 index 00000000..566e4088 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs @@ -0,0 +1,15 @@ +import { CloneType } from '../clone/type.mjs'; +import { CreateType } from '../create/type.mjs'; +import { IsUndefined } from '../guard/value.mjs'; +import { Kind, Hint } from '../symbols/index.mjs'; +// Auto Tracked For Recursive Types without ID's +let Ordinal = 0; +/** `[Json]` Creates a Recursive type */ +export function Recursive(callback, options = {}) { + if (IsUndefined(options.$id)) + options.$id = `T${Ordinal++}`; + const thisType = CloneType(callback({ [Kind]: 'This', $ref: `${options.$id}` })); + thisType.$id = options.$id; + // prettier-ignore + return CreateType({ [Hint]: 'Recursive', ...thisType }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/ref/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/ref/index.d.mts new file mode 100644 index 00000000..b2ea0f99 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/ref/index.d.mts @@ -0,0 +1 @@ +export * from './ref.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/ref/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/ref/index.mjs new file mode 100644 index 00000000..b2ea0f99 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/ref/index.mjs @@ -0,0 +1 @@ +export * from './ref.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/ref/ref.d.mts b/node_modules/@sinclair/typebox/build/esm/type/ref/ref.d.mts new file mode 100644 index 00000000..8ceb787c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/ref/ref.d.mts @@ -0,0 +1,41 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +import { TUnsafe } from '../unsafe/index.mjs'; +import { Static } from '../static/index.mjs'; +export interface TRef extends TSchema { + [Kind]: 'Ref'; + static: unknown; + $ref: Ref; +} +export type TRefUnsafe = TUnsafe>; +/** `[Json]` Creates a Ref type.*/ +export declare function Ref($ref: Ref, options?: SchemaOptions): TRef; +/** + * @deprecated `[Json]` Creates a Ref type. This signature was deprecated in 0.34.0 where Ref requires callers to pass + * a `string` value for the reference (and not a schema). + * + * To adhere to the 0.34.0 signature, Ref implementations should be updated to the following. + * + * ```typescript + * // pre-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Ref(T) + * ``` + * should be changed to the following + * + * ```typescript + * // post-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Unsafe>(Type.Ref('T')) + * ``` + * You can also create a generic function to replicate the pre-0.34.0 signature if required + * + * ```typescript + * const LegacyRef = (schema: T) => Type.Unsafe>(Type.Ref(schema.$id!)) + * ``` + */ +export declare function Ref(type: Type, options?: SchemaOptions): TRefUnsafe; diff --git a/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs b/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs new file mode 100644 index 00000000..83a46946 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs @@ -0,0 +1,10 @@ +import { TypeBoxError } from '../error/index.mjs'; +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Ref type. The referenced type must contain a $id */ +export function Ref(...args) { + const [$ref, options] = typeof args[0] === 'string' ? [args[0], args[1]] : [args[0].$id, args[1]]; + if (typeof $ref !== 'string') + throw new TypeBoxError('Ref: $ref must be a string'); + return CreateType({ [Kind]: 'Ref', $ref }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/regexp/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/regexp/index.d.mts new file mode 100644 index 00000000..22cb4227 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/regexp/index.d.mts @@ -0,0 +1 @@ +export * from './regexp.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/regexp/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/regexp/index.mjs new file mode 100644 index 00000000..22cb4227 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/regexp/index.mjs @@ -0,0 +1 @@ +export * from './regexp.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.d.mts b/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.d.mts new file mode 100644 index 00000000..ba1ee3ee --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.d.mts @@ -0,0 +1,20 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface RegExpOptions extends SchemaOptions { + /** The maximum length of the string */ + maxLength?: number; + /** The minimum length of the string */ + minLength?: number; +} +export interface TRegExp extends TSchema { + [Kind]: 'RegExp'; + static: `${string}`; + type: 'RegExp'; + source: string; + flags: string; +} +/** `[JavaScript]` Creates a RegExp type */ +export declare function RegExp(pattern: string, options?: RegExpOptions): TRegExp; +/** `[JavaScript]` Creates a RegExp type */ +export declare function RegExp(regex: RegExp, options?: RegExpOptions): TRegExp; diff --git a/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs b/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs new file mode 100644 index 00000000..49d7ee33 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs @@ -0,0 +1,8 @@ +import { CreateType } from '../create/type.mjs'; +import { IsString } from '../guard/value.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a RegExp type */ +export function RegExp(unresolved, options) { + const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved; + return CreateType({ [Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/format.d.mts b/node_modules/@sinclair/typebox/build/esm/type/registry/format.d.mts new file mode 100644 index 00000000..6e7e2227 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/format.d.mts @@ -0,0 +1,13 @@ +export type FormatRegistryValidationFunction = (value: string) => boolean; +/** Returns the entries in this registry */ +export declare function Entries(): Map; +/** Clears all user defined string formats */ +export declare function Clear(): void; +/** Deletes a registered format */ +export declare function Delete(format: string): boolean; +/** Returns true if the user defined string format exists */ +export declare function Has(format: string): boolean; +/** Sets a validation function for a user defined string format */ +export declare function Set(format: string, func: FormatRegistryValidationFunction): void; +/** Gets a validation function for a user defined string format */ +export declare function Get(format: string): FormatRegistryValidationFunction | undefined; diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs b/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs new file mode 100644 index 00000000..efd11aa2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs @@ -0,0 +1,26 @@ +/** A registry for user defined string formats */ +const map = new Map(); +/** Returns the entries in this registry */ +export function Entries() { + return new Map(map); +} +/** Clears all user defined string formats */ +export function Clear() { + return map.clear(); +} +/** Deletes a registered format */ +export function Delete(format) { + return map.delete(format); +} +/** Returns true if the user defined string format exists */ +export function Has(format) { + return map.has(format); +} +/** Sets a validation function for a user defined string format */ +export function Set(format, func) { + map.set(format, func); +} +/** Gets a validation function for a user defined string format */ +export function Get(format) { + return map.get(format); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/registry/index.d.mts new file mode 100644 index 00000000..a45cbe50 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/index.d.mts @@ -0,0 +1,2 @@ +export * as FormatRegistry from './format.mjs'; +export * as TypeRegistry from './type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/registry/index.mjs new file mode 100644 index 00000000..a45cbe50 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/index.mjs @@ -0,0 +1,2 @@ +export * as FormatRegistry from './format.mjs'; +export * as TypeRegistry from './type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/registry/type.d.mts new file mode 100644 index 00000000..504cec7a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/type.d.mts @@ -0,0 +1,13 @@ +export type TypeRegistryValidationFunction = (schema: TSchema, value: unknown) => boolean; +/** Returns the entries in this registry */ +export declare function Entries(): Map>; +/** Clears all user defined types */ +export declare function Clear(): void; +/** Deletes a registered type */ +export declare function Delete(kind: string): boolean; +/** Returns true if this registry contains this kind */ +export declare function Has(kind: string): boolean; +/** Sets a validation function for a user defined type */ +export declare function Set(kind: string, func: TypeRegistryValidationFunction): void; +/** Gets a custom validation function for a user defined type */ +export declare function Get(kind: string): TypeRegistryValidationFunction | undefined; diff --git a/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs b/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs new file mode 100644 index 00000000..c6e50559 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs @@ -0,0 +1,26 @@ +/** A registry for user defined types */ +const map = new Map(); +/** Returns the entries in this registry */ +export function Entries() { + return new Map(map); +} +/** Clears all user defined types */ +export function Clear() { + return map.clear(); +} +/** Deletes a registered type */ +export function Delete(kind) { + return map.delete(kind); +} +/** Returns true if this registry contains this kind */ +export function Has(kind) { + return map.has(kind); +} +/** Sets a validation function for a user defined type */ +export function Set(kind, func) { + map.set(kind, func); +} +/** Gets a custom validation function for a user defined type */ +export function Get(kind) { + return map.get(kind); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/required/index.d.mts new file mode 100644 index 00000000..3732eab0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/index.d.mts @@ -0,0 +1,2 @@ +export * from './required-from-mapped-result.mjs'; +export * from './required.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/required/index.mjs new file mode 100644 index 00000000..3732eab0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/index.mjs @@ -0,0 +1,2 @@ +export * from './required-from-mapped-result.mjs'; +export * from './required.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.d.mts b/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.d.mts new file mode 100644 index 00000000..9e5db2d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.d.mts @@ -0,0 +1,12 @@ +import type { SchemaOptions } from '../schema/index.mjs'; +import type { Ensure, Evaluate } from '../helpers/index.mjs'; +import type { TProperties } from '../object/index.mjs'; +import { type TMappedResult } from '../mapped/index.mjs'; +import { type TRequired } from './required.mjs'; +type TFromProperties

= ({ + [K2 in keyof P]: TRequired; +}); +type TFromMappedResult = (Evaluate>); +export type TRequiredFromMappedResult> = (Ensure>); +export declare function RequiredFromMappedResult>(R: R, options?: SchemaOptions): TMappedResult

; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs b/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs new file mode 100644 index 00000000..b0e0e8db --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs @@ -0,0 +1,18 @@ +import { MappedResult } from '../mapped/index.mjs'; +import { Required } from './required.mjs'; +// prettier-ignore +function FromProperties(P, options) { + const Acc = {}; + for (const K2 of globalThis.Object.getOwnPropertyNames(P)) + Acc[K2] = Required(P[K2], options); + return Acc; +} +// prettier-ignore +function FromMappedResult(R, options) { + return FromProperties(R.properties, options); +} +// prettier-ignore +export function RequiredFromMappedResult(R, options) { + const P = FromMappedResult(R, options); + return MappedResult(P); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/required.d.mts b/node_modules/@sinclair/typebox/build/esm/type/required/required.d.mts new file mode 100644 index 00000000..bc80b777 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/required.d.mts @@ -0,0 +1,35 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Evaluate, Ensure } from '../helpers/index.mjs'; +import type { TMappedResult } from '../mapped/index.mjs'; +import { type TReadonlyOptional } from '../readonly-optional/index.mjs'; +import { type TComputed } from '../computed/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import { type TReadonly } from '../readonly/index.mjs'; +import { type TRecursive } from '../recursive/index.mjs'; +import { type TObject, type TProperties } from '../object/index.mjs'; +import { type TIntersect } from '../intersect/index.mjs'; +import { type TUnion } from '../union/index.mjs'; +import { type TRef } from '../ref/index.mjs'; +import { type TBigInt } from '../bigint/index.mjs'; +import { type TBoolean } from '../boolean/index.mjs'; +import { type TInteger } from '../integer/index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { type TNull } from '../null/index.mjs'; +import { type TNumber } from '../number/index.mjs'; +import { type TString } from '../string/index.mjs'; +import { type TSymbol } from '../symbol/index.mjs'; +import { type TUndefined } from '../undefined/index.mjs'; +import { type TRequiredFromMappedResult } from './required-from-mapped-result.mjs'; +type TFromComputed = Ensure]>>; +type TFromRef = Ensure]>>; +type TFromProperties = Evaluate<{ + [K in keyof Properties]: Properties[K] extends (TReadonlyOptional) ? TReadonly : Properties[K] extends (TReadonly) ? TReadonly : Properties[K] extends (TOptional) ? S : Properties[K]; +}>; +type TFromObject<_Type extends TObject, Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; +type TFromRest = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest]> : Result); +export type TRequired = (Type extends TRecursive ? TRecursive> : Type extends TComputed ? TFromComputed : Type extends TRef ? TFromRef : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : Type extends TBigInt ? Type : Type extends TBoolean ? Type : Type extends TInteger ? Type : Type extends TLiteral ? Type : Type extends TNull ? Type : Type extends TNumber ? Type : Type extends TString ? Type : Type extends TSymbol ? Type : Type extends TUndefined ? Type : TObject<{}>); +/** `[Json]` Constructs a type where all properties are required */ +export declare function Required(type: MappedResult, options?: SchemaOptions): TRequiredFromMappedResult; +/** `[Json]` Constructs a type where all properties are required */ +export declare function Required(type: Type, options?: SchemaOptions): TRequired; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs b/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs new file mode 100644 index 00000000..5e69e39c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs @@ -0,0 +1,73 @@ +import { CreateType } from '../create/type.mjs'; +import { Computed } from '../computed/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Union } from '../union/index.mjs'; +import { Ref } from '../ref/index.mjs'; +import { OptionalKind, TransformKind } from '../symbols/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { RequiredFromMappedResult } from './required-from-mapped-result.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import * as KindGuard from '../guard/kind.mjs'; +// prettier-ignore +function FromComputed(target, parameters) { + return Computed('Required', [Computed(target, parameters)]); +} +// prettier-ignore +function FromRef($ref) { + return Computed('Required', [Ref($ref)]); +} +// prettier-ignore +function FromProperties(properties) { + const requiredProperties = {}; + for (const K of globalThis.Object.getOwnPropertyNames(properties)) + requiredProperties[K] = Discard(properties[K], [OptionalKind]); + return requiredProperties; +} +// prettier-ignore +function FromObject(type, properties) { + const options = Discard(type, [TransformKind, '$id', 'required', 'properties']); + const mappedProperties = FromProperties(properties); + return Object(mappedProperties, options); +} +// prettier-ignore +function FromRest(types) { + return types.map(type => RequiredResolve(type)); +} +// ------------------------------------------------------------------ +// RequiredResolve +// ------------------------------------------------------------------ +// prettier-ignore +function RequiredResolve(type) { + return ( + // Mappable + KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : + KindGuard.IsRef(type) ? FromRef(type.$ref) : + KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) : + KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) : + KindGuard.IsObject(type) ? FromObject(type, type.properties) : + // Intrinsic + KindGuard.IsBigInt(type) ? type : + KindGuard.IsBoolean(type) ? type : + KindGuard.IsInteger(type) ? type : + KindGuard.IsLiteral(type) ? type : + KindGuard.IsNull(type) ? type : + KindGuard.IsNumber(type) ? type : + KindGuard.IsString(type) ? type : + KindGuard.IsSymbol(type) ? type : + KindGuard.IsUndefined(type) ? type : + // Passthrough + Object({})); +} +/** `[Json]` Constructs a type where all properties are required */ +export function Required(type, options) { + if (KindGuard.IsMappedResult(type)) { + return RequiredFromMappedResult(type, options); + } + else { + // special: mapping types require overridable options + return CreateType({ ...RequiredResolve(type), ...options }); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/rest/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/rest/index.d.mts new file mode 100644 index 00000000..46c9702b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/rest/index.d.mts @@ -0,0 +1 @@ +export * from './rest.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/rest/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/rest/index.mjs new file mode 100644 index 00000000..46c9702b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/rest/index.mjs @@ -0,0 +1 @@ +export * from './rest.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/rest/rest.d.mts b/node_modules/@sinclair/typebox/build/esm/type/rest/rest.d.mts new file mode 100644 index 00000000..48b567d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/rest/rest.d.mts @@ -0,0 +1,10 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +type TRestResolve = T extends TIntersect ? S : T extends TUnion ? S : T extends TTuple ? S : [ +]; +export type TRest = TRestResolve; +/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ +export declare function Rest(T: T): TRest; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs b/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs new file mode 100644 index 00000000..787e6ba7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs @@ -0,0 +1,15 @@ +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsIntersect, IsUnion, IsTuple } from '../guard/kind.mjs'; +// prettier-ignore +function RestResolve(T) { + return (IsIntersect(T) ? T.allOf : + IsUnion(T) ? T.anyOf : + IsTuple(T) ? T.items ?? [] : + []); +} +/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ +export function Rest(T) { + return RestResolve(T); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/return-type/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/return-type/index.d.mts new file mode 100644 index 00000000..56d6ed8f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/return-type/index.d.mts @@ -0,0 +1 @@ +export * from './return-type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/return-type/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/return-type/index.mjs new file mode 100644 index 00000000..56d6ed8f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/return-type/index.mjs @@ -0,0 +1 @@ +export * from './return-type.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.d.mts new file mode 100644 index 00000000..e35f38a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.d.mts @@ -0,0 +1,6 @@ +import { type TSchema, type SchemaOptions } from '../schema/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TNever } from '../never/index.mjs'; +export type TReturnType ? ReturnType : TNever> = Result; +/** `[JavaScript]` Extracts the ReturnType from the given Function type */ +export declare function ReturnType(schema: Type, options?: SchemaOptions): TReturnType; diff --git a/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs b/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs new file mode 100644 index 00000000..b580c01e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs @@ -0,0 +1,7 @@ +import { CreateType } from '../create/type.mjs'; +import { Never } from '../never/index.mjs'; +import * as KindGuard from '../guard/kind.mjs'; +/** `[JavaScript]` Extracts the ReturnType from the given Function type */ +export function ReturnType(schema, options) { + return (KindGuard.IsFunction(schema) ? CreateType(schema.returns, options) : Never(options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.d.mts b/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.d.mts new file mode 100644 index 00000000..06418ad8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.d.mts @@ -0,0 +1,33 @@ +import type { TAny } from '../any/index.mjs'; +import type { TArray } from '../array/index.mjs'; +import type { TAsyncIterator } from '../async-iterator/index.mjs'; +import type { TBigInt } from '../bigint/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TConstructor } from '../constructor/index.mjs'; +import type { TDate } from '../date/index.mjs'; +import type { TEnum } from '../enum/index.mjs'; +import type { TFunction } from '../function/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TIterator } from '../iterator/index.mjs'; +import type { TLiteral } from '../literal/index.mjs'; +import type { TNot } from '../not/index.mjs'; +import type { TNull } from '../null/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TObject } from '../object/index.mjs'; +import type { TPromise } from '../promise/index.mjs'; +import type { TRecord } from '../record/index.mjs'; +import type { TThis } from '../recursive/index.mjs'; +import type { TRef } from '../ref/index.mjs'; +import type { TRegExp } from '../regexp/index.mjs'; +import type { TString } from '../string/index.mjs'; +import type { TSymbol } from '../symbol/index.mjs'; +import type { TTemplateLiteral } from '../template-literal/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +import type { TUint8Array } from '../uint8array/index.mjs'; +import type { TUndefined } from '../undefined/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TUnknown } from '../unknown/index.mjs'; +import type { TVoid } from '../void/index.mjs'; +import type { TSchema } from './schema.mjs'; +export type TAnySchema = TSchema | TAny | TArray | TAsyncIterator | TBigInt | TBoolean | TConstructor | TDate | TEnum | TFunction | TInteger | TIntersect | TIterator | TLiteral | TNot | TNull | TNumber | TObject | TPromise | TRecord | TRef | TRegExp | TString | TSymbol | TTemplateLiteral | TThis | TTuple | TUndefined | TUnion | TUint8Array | TUnknown | TVoid; diff --git a/node_modules/fast-check/lib/esm/check/model/command/AsyncCommand.js b/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/check/model/command/AsyncCommand.js rename to node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/type/schema/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/schema/index.d.mts new file mode 100644 index 00000000..14aebade --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/schema/index.d.mts @@ -0,0 +1,2 @@ +export * from './anyschema.mjs'; +export * from './schema.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/schema/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/schema/index.mjs new file mode 100644 index 00000000..14aebade --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/schema/index.mjs @@ -0,0 +1,2 @@ +export * from './anyschema.mjs'; +export * from './schema.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/schema/schema.d.mts b/node_modules/@sinclair/typebox/build/esm/type/schema/schema.d.mts new file mode 100644 index 00000000..dc29ef3a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/schema/schema.d.mts @@ -0,0 +1,29 @@ +import { Kind, Hint, ReadonlyKind, OptionalKind } from '../symbols/index.mjs'; +export interface SchemaOptions { + $schema?: string; + /** Id for this schema */ + $id?: string; + /** Title of this schema */ + title?: string; + /** Description of this schema */ + description?: string; + /** Default value for this schema */ + default?: any; + /** Example values matching this schema */ + examples?: any; + /** Optional annotation for readOnly */ + readOnly?: boolean; + /** Optional annotation for writeOnly */ + writeOnly?: boolean; + [prop: string]: any; +} +export interface TKind { + [Kind]: string; +} +export interface TSchema extends TKind, SchemaOptions { + [ReadonlyKind]?: string; + [OptionalKind]?: string; + [Hint]?: string; + params: unknown[]; + static: unknown; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/schema/schema.mjs b/node_modules/@sinclair/typebox/build/esm/type/schema/schema.mjs new file mode 100644 index 00000000..25db1a1b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/schema/schema.mjs @@ -0,0 +1 @@ +import { Kind, Hint, ReadonlyKind, OptionalKind } from '../symbols/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/sets/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/sets/index.d.mts new file mode 100644 index 00000000..8167858e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/sets/index.d.mts @@ -0,0 +1 @@ +export * from './set.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/sets/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/sets/index.mjs new file mode 100644 index 00000000..8167858e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/sets/index.mjs @@ -0,0 +1 @@ +export * from './set.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/sets/set.d.mts b/node_modules/@sinclair/typebox/build/esm/type/sets/set.d.mts new file mode 100644 index 00000000..11d704cd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/sets/set.d.mts @@ -0,0 +1,28 @@ +export type TSetIncludes = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes : false); +/** Returns true if element right is in the set of left */ +export declare function SetIncludes(T: [...T], S: S): TSetIncludes; +export type TSetIsSubset = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetIsSubset : false : true); +/** Returns true if left is a subset of right */ +export declare function SetIsSubset(T: [...T], S: [...S]): TSetIsSubset; +export type TSetDistinct = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends false ? TSetDistinct : TSetDistinct : Acc; +/** Returns a distinct set of elements */ +export declare function SetDistinct(T: [...T]): TSetDistinct; +export type TSetIntersect = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetIntersect : TSetIntersect : Acc); +/** Returns the Intersect of the given sets */ +export declare function SetIntersect(T: [...T], S: [...S]): TSetIntersect; +export type TSetUnion = ([ + ...T, + ...S +]); +/** Returns the Union of the given sets */ +export declare function SetUnion(T: [...T], S: [...S]): TSetUnion; +export type TSetComplement = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes extends true ? TSetComplement : TSetComplement : Acc); +/** Returns the Complement by omitting elements in T that are in S */ +export declare function SetComplement(T: [...T], S: [...S]): TSetComplement; +type TSetIntersectManyResolve = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve> : Acc); +export type TSetIntersectMany = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve : []); +export declare function SetIntersectMany(T: [...T]): TSetIntersectMany; +export type TSetUnionMany = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany> : Acc); +/** Returns the Union of multiple sets */ +export declare function SetUnionMany(T: [...T]): TSetUnionMany; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs b/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs new file mode 100644 index 00000000..77838694 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs @@ -0,0 +1,48 @@ +/** Returns true if element right is in the set of left */ +// prettier-ignore +export function SetIncludes(T, S) { + return T.includes(S); +} +/** Returns true if left is a subset of right */ +export function SetIsSubset(T, S) { + return T.every((L) => SetIncludes(S, L)); +} +/** Returns a distinct set of elements */ +export function SetDistinct(T) { + return [...new Set(T)]; +} +/** Returns the Intersect of the given sets */ +export function SetIntersect(T, S) { + return T.filter((L) => S.includes(L)); +} +/** Returns the Union of the given sets */ +export function SetUnion(T, S) { + return [...T, ...S]; +} +/** Returns the Complement by omitting elements in T that are in S */ +// prettier-ignore +export function SetComplement(T, S) { + return T.filter(L => !S.includes(L)); +} +// prettier-ignore +function SetIntersectManyResolve(T, Init) { + return T.reduce((Acc, L) => { + return SetIntersect(Acc, L); + }, Init); +} +// prettier-ignore +export function SetIntersectMany(T) { + return (T.length === 1 + ? T[0] + // Use left to initialize the accumulator for resolve + : T.length > 1 + ? SetIntersectManyResolve(T.slice(1), T[0]) + : []); +} +/** Returns the Union of multiple sets */ +export function SetUnionMany(T) { + const Acc = []; + for (const L of T) + Acc.push(...L); + return Acc; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/static/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/static/index.d.mts new file mode 100644 index 00000000..8b47ca6b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/static/index.d.mts @@ -0,0 +1 @@ +export * from './static.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/static/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/static/index.mjs new file mode 100644 index 00000000..8b47ca6b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/static/index.mjs @@ -0,0 +1 @@ +export * from './static.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/static/static.d.mts b/node_modules/@sinclair/typebox/build/esm/type/static/static.d.mts new file mode 100644 index 00000000..9a26d961 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/static/static.d.mts @@ -0,0 +1,39 @@ +import type { Evaluate } from '../helpers/index.mjs'; +import type { TOptional } from '../optional/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TArray } from '../array/index.mjs'; +import type { TAsyncIterator } from '../async-iterator/index.mjs'; +import type { TConstructor } from '../constructor/index.mjs'; +import type { TEnum } from '../enum/index.mjs'; +import type { TFunction } from '../function/index.mjs'; +import type { TIntersect } from '../intersect/index.mjs'; +import type { TImport } from '../module/index.mjs'; +import type { TIterator } from '../iterator/index.mjs'; +import type { TNot } from '../not/index.mjs'; +import type { TObject, TProperties } from '../object/index.mjs'; +import type { TPromise } from '../promise/index.mjs'; +import type { TRecursive } from '../recursive/index.mjs'; +import type { TRecord } from '../record/index.mjs'; +import type { TRef } from '../ref/index.mjs'; +import type { TTuple } from '../tuple/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TUnsafe } from '../unsafe/index.mjs'; +import type { TSchema } from '../schema/index.mjs'; +import type { TTransform } from '../transform/index.mjs'; +import type { TNever } from '../never/index.mjs'; +type TDecodeImport = (Key extends keyof ModuleProperties ? TDecodeType extends infer Type extends TSchema ? Type extends TRef ? TDecodeImport : Type : TNever : TNever); +type TDecodeProperties = { + [Key in keyof Properties]: TDecodeType; +}; +type TDecodeTypes = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TDecodeTypes]> : Result); +export type TDecodeType = (Type extends TOptional ? TOptional> : Type extends TReadonly ? TReadonly> : Type extends TTransform ? TUnsafe : Type extends TArray ? TArray> : Type extends TAsyncIterator ? TAsyncIterator> : Type extends TConstructor ? TConstructor, TDecodeType> : Type extends TEnum ? TEnum : Type extends TFunction ? TFunction, TDecodeType> : Type extends TIntersect ? TIntersect> : Type extends TImport ? TDecodeImport : Type extends TIterator ? TIterator> : Type extends TNot ? TNot> : Type extends TObject ? TObject>> : Type extends TPromise ? TPromise> : Type extends TRecord ? TRecord> : Type extends TRecursive ? TRecursive> : Type extends TRef ? TRef : Type extends TTuple ? TTuple> : Type extends TUnion ? TUnion> : Type); +export type StaticDecodeIsAny = boolean extends (Type extends TSchema ? true : false) ? true : false; +/** Creates an decoded static type from a TypeBox type */ +export type StaticDecode extends true ? unknown : Static, Params>> = Result; +/** Creates an encoded static type from a TypeBox type */ +export type StaticEncode> = Result; +/** Creates a static type from a TypeBox type */ +export type Static = Result; +export {}; diff --git a/node_modules/fast-check/lib/esm/check/model/command/Command.js b/node_modules/@sinclair/typebox/build/esm/type/static/static.mjs similarity index 100% rename from node_modules/fast-check/lib/esm/check/model/command/Command.js rename to node_modules/@sinclair/typebox/build/esm/type/static/static.mjs diff --git a/node_modules/@sinclair/typebox/build/esm/type/string/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/string/index.d.mts new file mode 100644 index 00000000..dff22869 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/string/index.d.mts @@ -0,0 +1 @@ +export * from './string.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/string/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/string/index.mjs new file mode 100644 index 00000000..dff22869 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/string/index.mjs @@ -0,0 +1 @@ +export * from './string.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/string/string.d.mts b/node_modules/@sinclair/typebox/build/esm/type/string/string.d.mts new file mode 100644 index 00000000..6c2f9776 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/string/string.d.mts @@ -0,0 +1,25 @@ +import { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string); +export type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string); +export interface StringOptions extends SchemaOptions { + /** The maximum string length */ + maxLength?: number; + /** The minimum string length */ + minLength?: number; + /** A regular expression pattern this string should match */ + pattern?: string; + /** A format this string should match */ + format?: StringFormatOption; + /** The content encoding for this string */ + contentEncoding?: StringContentEncodingOption; + /** The content media type for this string */ + contentMediaType?: string; +} +export interface TString extends TSchema, StringOptions { + [Kind]: 'String'; + static: string; + type: 'string'; +} +/** `[Json]` Creates a String type */ +export declare function String(options?: StringOptions): TString; diff --git a/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs b/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs new file mode 100644 index 00000000..8e7fa35d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a String type */ +export function String(options) { + return CreateType({ [Kind]: 'String', type: 'string' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbol/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/symbol/index.d.mts new file mode 100644 index 00000000..4325a007 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbol/index.d.mts @@ -0,0 +1 @@ +export * from './symbol.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbol/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/symbol/index.mjs new file mode 100644 index 00000000..4325a007 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbol/index.mjs @@ -0,0 +1 @@ +export * from './symbol.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.d.mts b/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.d.mts new file mode 100644 index 00000000..a730bc45 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.d.mts @@ -0,0 +1,10 @@ +import { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export type TSymbolValue = string | number | undefined; +export interface TSymbol extends TSchema, SchemaOptions { + [Kind]: 'Symbol'; + static: symbol; + type: 'symbol'; +} +/** `[JavaScript]` Creates a Symbol type */ +export declare function Symbol(options?: SchemaOptions): TSymbol; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs b/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs new file mode 100644 index 00000000..119da268 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Symbol type */ +export function Symbol(options) { + return CreateType({ [Kind]: 'Symbol', type: 'symbol' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbols/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/symbols/index.d.mts new file mode 100644 index 00000000..74b73dba --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbols/index.d.mts @@ -0,0 +1 @@ +export * from './symbols.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbols/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/symbols/index.mjs new file mode 100644 index 00000000..74b73dba --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbols/index.mjs @@ -0,0 +1 @@ +export * from './symbols.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.d.mts b/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.d.mts new file mode 100644 index 00000000..2c0dad5a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.d.mts @@ -0,0 +1,10 @@ +/** Symbol key applied to transform types */ +export declare const TransformKind: unique symbol; +/** Symbol key applied to readonly types */ +export declare const ReadonlyKind: unique symbol; +/** Symbol key applied to optional types */ +export declare const OptionalKind: unique symbol; +/** Symbol key applied to types */ +export declare const Hint: unique symbol; +/** Symbol key applied to types */ +export declare const Kind: unique symbol; diff --git a/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs b/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs new file mode 100644 index 00000000..e0b28b0b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs @@ -0,0 +1,10 @@ +/** Symbol key applied to transform types */ +export const TransformKind = Symbol.for('TypeBox.Transform'); +/** Symbol key applied to readonly types */ +export const ReadonlyKind = Symbol.for('TypeBox.Readonly'); +/** Symbol key applied to optional types */ +export const OptionalKind = Symbol.for('TypeBox.Optional'); +/** Symbol key applied to types */ +export const Hint = Symbol.for('TypeBox.Hint'); +/** Symbol key applied to types */ +export const Kind = Symbol.for('TypeBox.Kind'); diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.d.mts new file mode 100644 index 00000000..8d03666d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.d.mts @@ -0,0 +1,19 @@ +import { TypeBoxError } from '../error/index.mjs'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TString } from '../string/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TBigInt } from '../bigint/index.mjs'; +import type { TLiteral } from '../literal/index.mjs'; +import type { Expression } from './parse.mjs'; +export declare class TemplateLiteralFiniteError extends TypeBoxError { +} +type TFromTemplateLiteralKind = T extends TTemplateLiteral ? TFromTemplateLiteralKinds : T extends TUnion ? TFromTemplateLiteralKinds : T extends TString ? false : T extends TNumber ? false : T extends TInteger ? false : T extends TBigInt ? false : T extends TBoolean ? true : T extends TLiteral ? true : false; +type TFromTemplateLiteralKinds = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? TFromTemplateLiteralKind extends false ? false : TFromTemplateLiteralKinds : true; +export declare function IsTemplateLiteralExpressionFinite(expression: Expression): boolean; +export type TIsTemplateLiteralFinite = T extends TTemplateLiteral ? TFromTemplateLiteralKinds : false; +/** Returns true if this TemplateLiteral resolves to a finite set of values */ +export declare function IsTemplateLiteralFinite(schema: T): boolean; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs new file mode 100644 index 00000000..b2a4e8a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs @@ -0,0 +1,49 @@ +import { TemplateLiteralParseExact } from './parse.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +// ------------------------------------------------------------------ +// TemplateLiteralFiniteError +// ------------------------------------------------------------------ +export class TemplateLiteralFiniteError extends TypeBoxError { +} +// ------------------------------------------------------------------ +// IsTemplateLiteralFiniteCheck +// ------------------------------------------------------------------ +// prettier-ignore +function IsNumberExpression(expression) { + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === '0' && + expression.expr[1].type === 'const' && + expression.expr[1].const === '[1-9][0-9]*'); +} +// prettier-ignore +function IsBooleanExpression(expression) { + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === 'true' && + expression.expr[1].type === 'const' && + expression.expr[1].const === 'false'); +} +// prettier-ignore +function IsStringExpression(expression) { + return expression.type === 'const' && expression.const === '.*'; +} +// ------------------------------------------------------------------ +// IsTemplateLiteralExpressionFinite +// ------------------------------------------------------------------ +// prettier-ignore +export function IsTemplateLiteralExpressionFinite(expression) { + return (IsNumberExpression(expression) || IsStringExpression(expression) ? false : + IsBooleanExpression(expression) ? true : + (expression.type === 'and') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : + (expression.type === 'or') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : + (expression.type === 'const') ? true : + (() => { throw new TemplateLiteralFiniteError(`Unknown expression type`); })()); +} +/** Returns true if this TemplateLiteral resolves to a finite set of values */ +export function IsTemplateLiteralFinite(schema) { + const expression = TemplateLiteralParseExact(schema.pattern); + return IsTemplateLiteralExpressionFinite(expression); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.d.mts new file mode 100644 index 00000000..aac45ae6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.d.mts @@ -0,0 +1,21 @@ +import { TIsTemplateLiteralFinite } from './finite.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +import type { Assert } from '../helpers/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs'; +import type { TLiteral, TLiteralValue } from '../literal/index.mjs'; +import type { Expression } from './parse.mjs'; +import type { TUnion } from '../union/index.mjs'; +export declare class TemplateLiteralGenerateError extends TypeBoxError { +} +type TStringReduceUnary = R extends [infer A extends string, ...infer B extends string[]] ? TStringReduceUnary : Acc; +type TStringReduceBinary = L extends [infer A extends string, ...infer B extends string[]] ? TStringReduceBinary]> : Acc; +type TStringReduceMany = T extends [infer L extends string[], infer R extends string[], ...infer Rest extends string[][]] ? TStringReduceMany<[TStringReduceBinary, ...Rest]> : T; +type TStringReduce> = 0 extends keyof O ? Assert : []; +type TFromTemplateLiteralUnionKinds = T extends [infer L extends TLiteral, ...infer R extends TLiteral[]] ? [`${L['const']}`, ...TFromTemplateLiteralUnionKinds] : []; +type TFromTemplateLiteralKinds = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? (L extends TTemplateLiteral ? TFromTemplateLiteralKinds<[...S, ...R], Acc> : L extends TLiteral ? TFromTemplateLiteralKinds : L extends TUnion ? TFromTemplateLiteralKinds]> : L extends TBoolean ? TFromTemplateLiteralKinds : Acc) : Acc; +export declare function TemplateLiteralExpressionGenerate(expression: Expression): IterableIterator; +export type TTemplateLiteralGenerate> = F extends true ? (T extends TTemplateLiteral ? TFromTemplateLiteralKinds extends infer R extends string[][] ? TStringReduce : [] : []) : []; +/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */ +export declare function TemplateLiteralGenerate(schema: T): TTemplateLiteralGenerate; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs new file mode 100644 index 00000000..5163273d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs @@ -0,0 +1,53 @@ +import { IsTemplateLiteralExpressionFinite } from './finite.mjs'; +import { TemplateLiteralParseExact } from './parse.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +// ------------------------------------------------------------------ +// TemplateLiteralGenerateError +// ------------------------------------------------------------------ +export class TemplateLiteralGenerateError extends TypeBoxError { +} +// ------------------------------------------------------------------ +// TemplateLiteralExpressionGenerate +// ------------------------------------------------------------------ +// prettier-ignore +function* GenerateReduce(buffer) { + if (buffer.length === 1) + return yield* buffer[0]; + for (const left of buffer[0]) { + for (const right of GenerateReduce(buffer.slice(1))) { + yield `${left}${right}`; + } + } +} +// prettier-ignore +function* GenerateAnd(expression) { + return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)])); +} +// prettier-ignore +function* GenerateOr(expression) { + for (const expr of expression.expr) + yield* TemplateLiteralExpressionGenerate(expr); +} +// prettier-ignore +function* GenerateConst(expression) { + return yield expression.const; +} +export function* TemplateLiteralExpressionGenerate(expression) { + return expression.type === 'and' + ? yield* GenerateAnd(expression) + : expression.type === 'or' + ? yield* GenerateOr(expression) + : expression.type === 'const' + ? yield* GenerateConst(expression) + : (() => { + throw new TemplateLiteralGenerateError('Unknown expression'); + })(); +} +/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */ +export function TemplateLiteralGenerate(schema) { + const expression = TemplateLiteralParseExact(schema.pattern); + // prettier-ignore + return (IsTemplateLiteralExpressionFinite(expression) + ? [...TemplateLiteralExpressionGenerate(expression)] + : []); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.d.mts new file mode 100644 index 00000000..421f636c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.d.mts @@ -0,0 +1,7 @@ +export * from './finite.mjs'; +export * from './generate.mjs'; +export * from './syntax.mjs'; +export * from './parse.mjs'; +export * from './pattern.mjs'; +export * from './union.mjs'; +export * from './template-literal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.mjs new file mode 100644 index 00000000..421f636c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.mjs @@ -0,0 +1,7 @@ +export * from './finite.mjs'; +export * from './generate.mjs'; +export * from './syntax.mjs'; +export * from './parse.mjs'; +export * from './pattern.mjs'; +export * from './union.mjs'; +export * from './template-literal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.d.mts new file mode 100644 index 00000000..bfc66b8d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.d.mts @@ -0,0 +1,20 @@ +import { TypeBoxError } from '../error/index.mjs'; +export declare class TemplateLiteralParserError extends TypeBoxError { +} +export type Expression = ExpressionAnd | ExpressionOr | ExpressionConst; +export type ExpressionConst = { + type: 'const'; + const: string; +}; +export type ExpressionAnd = { + type: 'and'; + expr: Expression[]; +}; +export type ExpressionOr = { + type: 'or'; + expr: Expression[]; +}; +/** Parses a pattern and returns an expression tree */ +export declare function TemplateLiteralParse(pattern: string): Expression; +/** Parses a pattern and strips forward and trailing ^ and $ */ +export declare function TemplateLiteralParseExact(pattern: string): Expression; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs new file mode 100644 index 00000000..15ee1fad --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs @@ -0,0 +1,167 @@ +import { TypeBoxError } from '../error/index.mjs'; +// ------------------------------------------------------------------ +// TemplateLiteralParserError +// ------------------------------------------------------------------ +export class TemplateLiteralParserError extends TypeBoxError { +} +// ------------------------------------------------------------------- +// Unescape +// +// Unescape for these control characters specifically. Note that this +// function is only called on non union group content, and where we +// still want to allow the user to embed control characters in that +// content. For review. +// ------------------------------------------------------------------- +// prettier-ignore +function Unescape(pattern) { + return pattern + .replace(/\\\$/g, '$') + .replace(/\\\*/g, '*') + .replace(/\\\^/g, '^') + .replace(/\\\|/g, '|') + .replace(/\\\(/g, '(') + .replace(/\\\)/g, ')'); +} +// ------------------------------------------------------------------- +// Control Characters +// ------------------------------------------------------------------- +function IsNonEscaped(pattern, index, char) { + return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92; +} +function IsOpenParen(pattern, index) { + return IsNonEscaped(pattern, index, '('); +} +function IsCloseParen(pattern, index) { + return IsNonEscaped(pattern, index, ')'); +} +function IsSeparator(pattern, index) { + return IsNonEscaped(pattern, index, '|'); +} +// ------------------------------------------------------------------- +// Control Groups +// ------------------------------------------------------------------- +function IsGroup(pattern) { + if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) + return false; + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (count === 0 && index !== pattern.length - 1) + return false; + } + return true; +} +// prettier-ignore +function InGroup(pattern) { + return pattern.slice(1, pattern.length - 1); +} +// prettier-ignore +function IsPrecedenceOr(pattern) { + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) + return true; + } + return false; +} +// prettier-ignore +function IsPrecedenceAnd(pattern) { + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + return true; + } + return false; +} +// prettier-ignore +function Or(pattern) { + let [count, start] = [0, 0]; + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) { + const range = pattern.slice(start, index); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + start = index + 1; + } + } + const range = pattern.slice(start); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + if (expressions.length === 0) + return { type: 'const', const: '' }; + if (expressions.length === 1) + return expressions[0]; + return { type: 'or', expr: expressions }; +} +// prettier-ignore +function And(pattern) { + function Group(value, index) { + if (!IsOpenParen(value, index)) + throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`); + let count = 0; + for (let scan = index; scan < value.length; scan++) { + if (IsOpenParen(value, scan)) + count += 1; + if (IsCloseParen(value, scan)) + count -= 1; + if (count === 0) + return [index, scan]; + } + throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`); + } + function Range(pattern, index) { + for (let scan = index; scan < pattern.length; scan++) { + if (IsOpenParen(pattern, scan)) + return [index, scan]; + } + return [index, pattern.length]; + } + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) { + const [start, end] = Group(pattern, index); + const range = pattern.slice(start, end + 1); + expressions.push(TemplateLiteralParse(range)); + index = end; + } + else { + const [start, end] = Range(pattern, index); + const range = pattern.slice(start, end); + if (range.length > 0) + expressions.push(TemplateLiteralParse(range)); + index = end - 1; + } + } + return ((expressions.length === 0) ? { type: 'const', const: '' } : + (expressions.length === 1) ? expressions[0] : + { type: 'and', expr: expressions }); +} +// ------------------------------------------------------------------ +// TemplateLiteralParse +// ------------------------------------------------------------------ +/** Parses a pattern and returns an expression tree */ +export function TemplateLiteralParse(pattern) { + // prettier-ignore + return (IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : + IsPrecedenceOr(pattern) ? Or(pattern) : + IsPrecedenceAnd(pattern) ? And(pattern) : + { type: 'const', const: Unescape(pattern) }); +} +// ------------------------------------------------------------------ +// TemplateLiteralParseExact +// ------------------------------------------------------------------ +/** Parses a pattern and strips forward and trailing ^ and $ */ +export function TemplateLiteralParseExact(pattern) { + return TemplateLiteralParse(pattern.slice(1, pattern.length - 1)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.d.mts new file mode 100644 index 00000000..3181fad8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.d.mts @@ -0,0 +1,5 @@ +import type { TTemplateLiteralKind } from './index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +export declare class TemplateLiteralPatternError extends TypeBoxError { +} +export declare function TemplateLiteralPattern(kinds: TTemplateLiteralKind[]): string; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs new file mode 100644 index 00000000..483ad024 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs @@ -0,0 +1,33 @@ +import { PatternNumber, PatternString, PatternBoolean } from '../patterns/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +import { TypeBoxError } from '../error/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsTemplateLiteral, IsUnion, IsNumber, IsInteger, IsBigInt, IsString, IsLiteral, IsBoolean } from '../guard/kind.mjs'; +// ------------------------------------------------------------------ +// TemplateLiteralPatternError +// ------------------------------------------------------------------ +export class TemplateLiteralPatternError extends TypeBoxError { +} +// ------------------------------------------------------------------ +// TemplateLiteralPattern +// ------------------------------------------------------------------ +function Escape(value) { + return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} +// prettier-ignore +function Visit(schema, acc) { + return (IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : + IsUnion(schema) ? `(${schema.anyOf.map((schema) => Visit(schema, acc)).join('|')})` : + IsNumber(schema) ? `${acc}${PatternNumber}` : + IsInteger(schema) ? `${acc}${PatternNumber}` : + IsBigInt(schema) ? `${acc}${PatternNumber}` : + IsString(schema) ? `${acc}${PatternString}` : + IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : + IsBoolean(schema) ? `${acc}${PatternBoolean}` : + (() => { throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`); })()); +} +export function TemplateLiteralPattern(kinds) { + return `^${kinds.map((schema) => Visit(schema, '')).join('')}\$`; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.d.mts new file mode 100644 index 00000000..82d6979c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.d.mts @@ -0,0 +1,20 @@ +import type { Assert, Trim } from '../helpers/index.mjs'; +import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +import { type TBoolean } from '../boolean/index.mjs'; +import { type TBigInt } from '../bigint/index.mjs'; +import { type TNumber } from '../number/index.mjs'; +import { type TString } from '../string/index.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +declare function FromUnion(syntax: string): IterableIterator; +declare function FromTerminal(syntax: string): IterableIterator; +type FromUnionLiteral = T extends `${infer L}|${infer R}` ? [TLiteral>, ...FromUnionLiteral] : T extends `${infer L}` ? [TLiteral>] : [ +]; +type FromUnion = TUnionEvaluated>; +type FromTerminal = T extends 'boolean' ? TBoolean : T extends 'bigint' ? TBigInt : T extends 'number' ? TNumber : T extends 'string' ? TString : FromUnion; +type FromString = T extends `{${infer L}}${infer R}` ? [FromTerminal, ...FromString] : T extends `${infer L}$\{${infer R1}\}${infer R2}` ? [TLiteral, ...FromString<`{${R1}}`>, ...FromString] : T extends `${infer L}$\{${infer R1}\}` ? [TLiteral, ...FromString<`{${R1}}`>] : T extends `${infer L}` ? [TLiteral] : [ +]; +export type TTemplateLiteralSyntax = (TTemplateLiteral, TTemplateLiteralKind[]>>); +/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */ +export declare function TemplateLiteralSyntax(syntax: string): TTemplateLiteralKind[]; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs new file mode 100644 index 00000000..583655a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs @@ -0,0 +1,55 @@ +import { Literal } from '../literal/index.mjs'; +import { Boolean } from '../boolean/index.mjs'; +import { BigInt } from '../bigint/index.mjs'; +import { Number } from '../number/index.mjs'; +import { String } from '../string/index.mjs'; +import { UnionEvaluated } from '../union/index.mjs'; +import { Never } from '../never/index.mjs'; +// ------------------------------------------------------------------ +// SyntaxParsers +// ------------------------------------------------------------------ +// prettier-ignore +function* FromUnion(syntax) { + const trim = syntax.trim().replace(/"|'/g, ''); + return (trim === 'boolean' ? yield Boolean() : + trim === 'number' ? yield Number() : + trim === 'bigint' ? yield BigInt() : + trim === 'string' ? yield String() : + yield (() => { + const literals = trim.split('|').map((literal) => Literal(literal.trim())); + return (literals.length === 0 ? Never() : + literals.length === 1 ? literals[0] : + UnionEvaluated(literals)); + })()); +} +// prettier-ignore +function* FromTerminal(syntax) { + if (syntax[1] !== '{') { + const L = Literal('$'); + const R = FromSyntax(syntax.slice(1)); + return yield* [L, ...R]; + } + for (let i = 2; i < syntax.length; i++) { + if (syntax[i] === '}') { + const L = FromUnion(syntax.slice(2, i)); + const R = FromSyntax(syntax.slice(i + 1)); + return yield* [...L, ...R]; + } + } + yield Literal(syntax); +} +// prettier-ignore +function* FromSyntax(syntax) { + for (let i = 0; i < syntax.length; i++) { + if (syntax[i] === '$') { + const L = Literal(syntax.slice(0, i)); + const R = FromTerminal(syntax.slice(i)); + return yield* [L, ...R]; + } + } + yield Literal(syntax); +} +/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */ +export function TemplateLiteralSyntax(syntax) { + return [...FromSyntax(syntax)]; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.d.mts new file mode 100644 index 00000000..b235c765 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.d.mts @@ -0,0 +1,30 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Assert } from '../helpers/index.mjs'; +import type { TUnion } from '../union/index.mjs'; +import type { TLiteral } from '../literal/index.mjs'; +import type { TInteger } from '../integer/index.mjs'; +import type { TNumber } from '../number/index.mjs'; +import type { TBigInt } from '../bigint/index.mjs'; +import type { TString } from '../string/index.mjs'; +import type { TBoolean } from '../boolean/index.mjs'; +import type { TNever } from '../never/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { type TTemplateLiteralSyntax } from './syntax.mjs'; +import { EmptyString } from '../helpers/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type TemplateLiteralStaticKind = T extends TUnion ? { + [K in keyof U]: TemplateLiteralStatic, Acc>; +}[number] : T extends TTemplateLiteral ? `${Static}` : T extends TLiteral ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never; +type TemplateLiteralStatic = T extends [infer L, ...infer R] ? `${TemplateLiteralStaticKind}${TemplateLiteralStatic, Acc>}` : Acc; +export type TTemplateLiteralKind = TTemplateLiteral | TUnion | TLiteral | TInteger | TNumber | TBigInt | TString | TBoolean | TNever; +export interface TTemplateLiteral extends TSchema { + [Kind]: 'TemplateLiteral'; + static: TemplateLiteralStatic; + type: 'string'; + pattern: string; +} +/** `[Json]` Creates a TemplateLiteral type from template dsl string */ +export declare function TemplateLiteral(syntax: T, options?: SchemaOptions): TTemplateLiteralSyntax; +/** `[Json]` Creates a TemplateLiteral type */ +export declare function TemplateLiteral(kinds: [...T], options?: SchemaOptions): TTemplateLiteral; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs new file mode 100644 index 00000000..b2ce48cf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs @@ -0,0 +1,13 @@ +import { CreateType } from '../create/type.mjs'; +import { TemplateLiteralSyntax } from './syntax.mjs'; +import { TemplateLiteralPattern } from './pattern.mjs'; +import { IsString } from '../guard/value.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a TemplateLiteral type */ +// prettier-ignore +export function TemplateLiteral(unresolved, options) { + const pattern = IsString(unresolved) + ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) + : TemplateLiteralPattern(unresolved); + return CreateType({ [Kind]: 'TemplateLiteral', type: 'string', pattern }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.d.mts b/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.d.mts new file mode 100644 index 00000000..1d2f5c9f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.d.mts @@ -0,0 +1,9 @@ +import type { Static } from '../static/index.mjs'; +import type { TTemplateLiteral } from './template-literal.mjs'; +import type { UnionToTuple } from '../helpers/index.mjs'; +import { type TUnionEvaluated } from '../union/index.mjs'; +import { type TLiteral } from '../literal/index.mjs'; +export type TTemplateLiteralToUnionLiteralArray = (T extends [infer L extends string, ...infer R extends string[]] ? TTemplateLiteralToUnionLiteralArray]> : Acc); +export type TTemplateLiteralToUnion>> = TUnionEvaluated>; +/** Returns a Union from the given TemplateLiteral */ +export declare function TemplateLiteralToUnion(schema: TTemplateLiteral): TTemplateLiteralToUnion; diff --git a/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs b/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs new file mode 100644 index 00000000..d90c1571 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs @@ -0,0 +1,9 @@ +import { UnionEvaluated } from '../union/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { TemplateLiteralGenerate } from './generate.mjs'; +/** Returns a Union from the given TemplateLiteral */ +export function TemplateLiteralToUnion(schema) { + const R = TemplateLiteralGenerate(schema); + const L = R.map((S) => Literal(S)); + return UnionEvaluated(L); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/transform/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/transform/index.d.mts new file mode 100644 index 00000000..8aa31eb4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/transform/index.d.mts @@ -0,0 +1 @@ +export * from './transform.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/transform/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/transform/index.mjs new file mode 100644 index 00000000..8aa31eb4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/transform/index.mjs @@ -0,0 +1 @@ +export * from './transform.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/transform/transform.d.mts b/node_modules/@sinclair/typebox/build/esm/type/transform/transform.d.mts new file mode 100644 index 00000000..d341cba9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/transform/transform.d.mts @@ -0,0 +1,30 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Static, StaticDecode } from '../static/index.mjs'; +import { TransformKind } from '../symbols/index.mjs'; +export declare class TransformDecodeBuilder { + private readonly schema; + constructor(schema: T); + Decode, U>>(decode: D): TransformEncodeBuilder; +} +export declare class TransformEncodeBuilder { + private readonly schema; + private readonly decode; + constructor(schema: T, decode: D); + private EncodeTransform; + private EncodeSchema; + Encode, StaticDecode>>(encode: E): TTransform>; +} +type TransformStatic = T extends TTransform ? S : Static; +export type TransformFunction = (value: T) => U; +export interface TransformOptions { + Decode: TransformFunction, O>; + Encode: TransformFunction>; +} +export interface TTransform extends TSchema { + static: TransformStatic; + [TransformKind]: TransformOptions; + [key: string]: any; +} +/** `[Json]` Creates a Transform type */ +export declare function Transform(schema: I): TransformDecodeBuilder; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs b/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs new file mode 100644 index 00000000..48e7cafd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs @@ -0,0 +1,40 @@ +import { TransformKind } from '../symbols/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsTransform } from '../guard/kind.mjs'; +// ------------------------------------------------------------------ +// TransformBuilders +// ------------------------------------------------------------------ +export class TransformDecodeBuilder { + constructor(schema) { + this.schema = schema; + } + Decode(decode) { + return new TransformEncodeBuilder(this.schema, decode); + } +} +// prettier-ignore +export class TransformEncodeBuilder { + constructor(schema, decode) { + this.schema = schema; + this.decode = decode; + } + EncodeTransform(encode, schema) { + const Encode = (value) => schema[TransformKind].Encode(encode(value)); + const Decode = (value) => this.decode(schema[TransformKind].Decode(value)); + const Codec = { Encode: Encode, Decode: Decode }; + return { ...schema, [TransformKind]: Codec }; + } + EncodeSchema(encode, schema) { + const Codec = { Decode: this.decode, Encode: encode }; + return { ...schema, [TransformKind]: Codec }; + } + Encode(encode) { + return (IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema)); + } +} +/** `[Json]` Creates a Transform type */ +export function Transform(schema) { + return new TransformDecodeBuilder(schema); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/tuple/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/tuple/index.d.mts new file mode 100644 index 00000000..f886af67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/tuple/index.d.mts @@ -0,0 +1 @@ +export * from './tuple.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/tuple/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/tuple/index.mjs new file mode 100644 index 00000000..f886af67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/tuple/index.mjs @@ -0,0 +1 @@ +export * from './tuple.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.d.mts b/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.d.mts new file mode 100644 index 00000000..5282aa7f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.d.mts @@ -0,0 +1,16 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type TupleStatic = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TupleStatic]> : Acc; +export interface TTuple extends TSchema { + [Kind]: 'Tuple'; + static: TupleStatic; + type: 'array'; + items: T; + additionalItems?: false; + minItems: T['length']; + maxItems: T['length']; +} +/** `[Json]` Creates a Tuple type */ +export declare function Tuple(types: [...Types], options?: SchemaOptions): TTuple; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs b/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs new file mode 100644 index 00000000..17e425a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs @@ -0,0 +1,9 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Tuple type */ +export function Tuple(types, options) { + // prettier-ignore + return CreateType(types.length > 0 ? + { [Kind]: 'Tuple', type: 'array', items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : + { [Kind]: 'Tuple', type: 'array', minItems: types.length, maxItems: types.length }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/type/index.d.mts new file mode 100644 index 00000000..7a8672d3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/index.d.mts @@ -0,0 +1,6 @@ +export { JsonTypeBuilder } from './json.mjs'; +import { JavaScriptTypeBuilder } from './javascript.mjs'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +declare const Type: InstanceType; +export { JavaScriptTypeBuilder }; +export { Type }; diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs new file mode 100644 index 00000000..dd6cd01b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs @@ -0,0 +1,13 @@ +// ------------------------------------------------------------------ +// JsonTypeBuilder +// ------------------------------------------------------------------ +export { JsonTypeBuilder } from './json.mjs'; +// ------------------------------------------------------------------ +// JavaScriptTypeBuilder +// ------------------------------------------------------------------ +import * as TypeBuilder from './type.mjs'; +import { JavaScriptTypeBuilder } from './javascript.mjs'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +const Type = TypeBuilder; +export { JavaScriptTypeBuilder }; +export { Type }; diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/javascript.d.mts b/node_modules/@sinclair/typebox/build/esm/type/type/javascript.d.mts new file mode 100644 index 00000000..a17cc345 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/javascript.d.mts @@ -0,0 +1,64 @@ +import { JsonTypeBuilder } from './json.mjs'; +import { type TArgument } from '../argument/index.mjs'; +import { type TAsyncIterator } from '../async-iterator/index.mjs'; +import { type TAwaited } from '../awaited/index.mjs'; +import { type TBigInt, type BigIntOptions } from '../bigint/index.mjs'; +import { type TConstructor } from '../constructor/index.mjs'; +import { type TConstructorParameters } from '../constructor-parameters/index.mjs'; +import { type TDate, type DateOptions } from '../date/index.mjs'; +import { type TFunction } from '../function/index.mjs'; +import { type TInstanceType } from '../instance-type/index.mjs'; +import { type TInstantiate } from '../instantiate/index.mjs'; +import { type TIterator } from '../iterator/index.mjs'; +import { type TParameters } from '../parameters/index.mjs'; +import { type TPromise } from '../promise/index.mjs'; +import { type TRegExp, RegExpOptions } from '../regexp/index.mjs'; +import { type TReturnType } from '../return-type/index.mjs'; +import { type TSchema, type SchemaOptions } from '../schema/index.mjs'; +import { type TSymbol } from '../symbol/index.mjs'; +import { type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index.mjs'; +import { type TUndefined } from '../undefined/index.mjs'; +import { type TVoid } from '../void/index.mjs'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +export declare class JavaScriptTypeBuilder extends JsonTypeBuilder { + /** `[JavaScript]` Creates a Generic Argument Type */ + Argument(index: Index): TArgument; + /** `[JavaScript]` Creates a AsyncIterator type */ + AsyncIterator(items: Type, options?: SchemaOptions): TAsyncIterator; + /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ + Awaited(schema: Type, options?: SchemaOptions): TAwaited; + /** `[JavaScript]` Creates a BigInt type */ + BigInt(options?: BigIntOptions): TBigInt; + /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ + ConstructorParameters(schema: Type, options?: SchemaOptions): TConstructorParameters; + /** `[JavaScript]` Creates a Constructor type */ + Constructor(parameters: [...Parameters], instanceType: InstanceType, options?: SchemaOptions): TConstructor; + /** `[JavaScript]` Creates a Date type */ + Date(options?: DateOptions): TDate; + /** `[JavaScript]` Creates a Function type */ + Function(parameters: [...Parameters], returnType: ReturnType, options?: SchemaOptions): TFunction; + /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ + InstanceType(schema: Type, options?: SchemaOptions): TInstanceType; + /** `[JavaScript]` Instantiates a type with the given parameters */ + Instantiate(schema: Type, parameters: [...Parameters]): TInstantiate; + /** `[JavaScript]` Creates an Iterator type */ + Iterator(items: Type, options?: SchemaOptions): TIterator; + /** `[JavaScript]` Extracts the Parameters from the given Function type */ + Parameters(schema: Type, options?: SchemaOptions): TParameters; + /** `[JavaScript]` Creates a Promise type */ + Promise(item: Type, options?: SchemaOptions): TPromise; + /** `[JavaScript]` Creates a RegExp type */ + RegExp(pattern: string, options?: RegExpOptions): TRegExp; + /** `[JavaScript]` Creates a RegExp type */ + RegExp(regex: RegExp, options?: RegExpOptions): TRegExp; + /** `[JavaScript]` Extracts the ReturnType from the given Function type */ + ReturnType(type: Type, options?: SchemaOptions): TReturnType; + /** `[JavaScript]` Creates a Symbol type */ + Symbol(options?: SchemaOptions): TSymbol; + /** `[JavaScript]` Creates a Undefined type */ + Undefined(options?: SchemaOptions): TUndefined; + /** `[JavaScript]` Creates a Uint8Array type */ + Uint8Array(options?: Uint8ArrayOptions): TUint8Array; + /** `[JavaScript]` Creates a Void type */ + Void(options?: SchemaOptions): TVoid; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/javascript.mjs b/node_modules/@sinclair/typebox/build/esm/type/type/javascript.mjs new file mode 100644 index 00000000..05c25579 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/javascript.mjs @@ -0,0 +1,99 @@ +import { JsonTypeBuilder } from './json.mjs'; +import { Argument } from '../argument/index.mjs'; +import { AsyncIterator } from '../async-iterator/index.mjs'; +import { Awaited } from '../awaited/index.mjs'; +import { BigInt } from '../bigint/index.mjs'; +import { Constructor } from '../constructor/index.mjs'; +import { ConstructorParameters } from '../constructor-parameters/index.mjs'; +import { Date } from '../date/index.mjs'; +import { Function as FunctionType } from '../function/index.mjs'; +import { InstanceType } from '../instance-type/index.mjs'; +import { Instantiate } from '../instantiate/index.mjs'; +import { Iterator } from '../iterator/index.mjs'; +import { Parameters } from '../parameters/index.mjs'; +import { Promise } from '../promise/index.mjs'; +import { RegExp } from '../regexp/index.mjs'; +import { ReturnType } from '../return-type/index.mjs'; +import { Symbol } from '../symbol/index.mjs'; +import { Uint8Array } from '../uint8array/index.mjs'; +import { Undefined } from '../undefined/index.mjs'; +import { Void } from '../void/index.mjs'; +/** JavaScript Type Builder with Static Resolution for TypeScript */ +export class JavaScriptTypeBuilder extends JsonTypeBuilder { + /** `[JavaScript]` Creates a Generic Argument Type */ + Argument(index) { + return Argument(index); + } + /** `[JavaScript]` Creates a AsyncIterator type */ + AsyncIterator(items, options) { + return AsyncIterator(items, options); + } + /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ + Awaited(schema, options) { + return Awaited(schema, options); + } + /** `[JavaScript]` Creates a BigInt type */ + BigInt(options) { + return BigInt(options); + } + /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ + ConstructorParameters(schema, options) { + return ConstructorParameters(schema, options); + } + /** `[JavaScript]` Creates a Constructor type */ + Constructor(parameters, instanceType, options) { + return Constructor(parameters, instanceType, options); + } + /** `[JavaScript]` Creates a Date type */ + Date(options = {}) { + return Date(options); + } + /** `[JavaScript]` Creates a Function type */ + Function(parameters, returnType, options) { + return FunctionType(parameters, returnType, options); + } + /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ + InstanceType(schema, options) { + return InstanceType(schema, options); + } + /** `[JavaScript]` Instantiates a type with the given parameters */ + Instantiate(schema, parameters) { + return Instantiate(schema, parameters); + } + /** `[JavaScript]` Creates an Iterator type */ + Iterator(items, options) { + return Iterator(items, options); + } + /** `[JavaScript]` Extracts the Parameters from the given Function type */ + Parameters(schema, options) { + return Parameters(schema, options); + } + /** `[JavaScript]` Creates a Promise type */ + Promise(item, options) { + return Promise(item, options); + } + /** `[JavaScript]` Creates a RegExp type */ + RegExp(unresolved, options) { + return RegExp(unresolved, options); + } + /** `[JavaScript]` Extracts the ReturnType from the given Function type */ + ReturnType(type, options) { + return ReturnType(type, options); + } + /** `[JavaScript]` Creates a Symbol type */ + Symbol(options) { + return Symbol(options); + } + /** `[JavaScript]` Creates a Undefined type */ + Undefined(options) { + return Undefined(options); + } + /** `[JavaScript]` Creates a Uint8Array type */ + Uint8Array(options) { + return Uint8Array(options); + } + /** `[JavaScript]` Creates a Void type */ + Void(options) { + return Void(options); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/json.d.mts b/node_modules/@sinclair/typebox/build/esm/type/type/json.d.mts new file mode 100644 index 00000000..032fc6e3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/json.d.mts @@ -0,0 +1,208 @@ +import { type TAny } from '../any/index.mjs'; +import { type TArray, type ArrayOptions } from '../array/index.mjs'; +import { type TBoolean } from '../boolean/index.mjs'; +import { type TComposite } from '../composite/index.mjs'; +import { type TConst } from '../const/index.mjs'; +import { type TEnum, type TEnumKey, type TEnumValue } from '../enum/index.mjs'; +import { type TExclude, type TExcludeFromMappedResult, type TExcludeFromTemplateLiteral } from '../exclude/index.mjs'; +import { type TExtends, type TExtendsFromMappedKey, type TExtendsFromMappedResult } from '../extends/index.mjs'; +import { type TExtract, type TExtractFromMappedResult, type TExtractFromTemplateLiteral } from '../extract/index.mjs'; +import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey, type TIndexFromMappedResult, type TIndexFromComputed } from '../indexed/index.mjs'; +import { type IntegerOptions, type TInteger } from '../integer/index.mjs'; +import { Intersect, type IntersectOptions } from '../intersect/index.mjs'; +import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index.mjs'; +import { type TKeyOf } from '../keyof/index.mjs'; +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs'; +import { type TMappedFunction, type TMapped, type TMappedResult } from '../mapped/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TNot } from '../not/index.mjs'; +import { type TNull } from '../null/index.mjs'; +import { type TMappedKey } from '../mapped/index.mjs'; +import { TModule } from '../module/index.mjs'; +import { type TNumber, type NumberOptions } from '../number/index.mjs'; +import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs'; +import { type TOmit } from '../omit/index.mjs'; +import { type TOptionalWithFlag, type TOptionalFromMappedResult } from '../optional/index.mjs'; +import { type TPartial, type TPartialFromMappedResult } from '../partial/index.mjs'; +import { type TPick } from '../pick/index.mjs'; +import { type TReadonlyWithFlag, type TReadonlyFromMappedResult } from '../readonly/index.mjs'; +import { type TReadonlyOptional } from '../readonly-optional/index.mjs'; +import { type TRecordOrObject } from '../record/index.mjs'; +import { type TRecursive, type TThis } from '../recursive/index.mjs'; +import { type TRef, type TRefUnsafe } from '../ref/index.mjs'; +import { type TRequired, type TRequiredFromMappedResult } from '../required/index.mjs'; +import { type TRest } from '../rest/index.mjs'; +import { type TSchema, type SchemaOptions } from '../schema/index.mjs'; +import { type TString, type StringOptions } from '../string/index.mjs'; +import { type TTemplateLiteral, type TTemplateLiteralKind, type TTemplateLiteralSyntax } from '../template-literal/index.mjs'; +import { TransformDecodeBuilder } from '../transform/index.mjs'; +import { type TTuple } from '../tuple/index.mjs'; +import { Union } from '../union/index.mjs'; +import { type TUnknown } from '../unknown/index.mjs'; +import { type TUnsafe, type UnsafeOptions } from '../unsafe/index.mjs'; +/** Json Type Builder with Static Resolution for TypeScript */ +export declare class JsonTypeBuilder { + /** `[Json]` Creates a Readonly and Optional property */ + ReadonlyOptional(type: Type): TReadonlyOptional; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type, enable: Flag): TReadonlyFromMappedResult; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type, enable: Flag): TReadonlyWithFlag; + /** `[Json]` Creates a Optional property */ + Readonly(type: Type): TReadonlyFromMappedResult; + /** `[Json]` Creates a Readonly property */ + Readonly(type: Type): TReadonlyWithFlag; + /** `[Json]` Creates a Optional property */ + Optional(type: Type, enable: Flag): TOptionalFromMappedResult; + /** `[Json]` Creates a Optional property */ + Optional(type: Type, enable: Flag): TOptionalWithFlag; + /** `[Json]` Creates a Optional property */ + Optional(type: Type): TOptionalFromMappedResult; + /** `[Json]` Creates a Optional property */ + Optional(type: Type): TOptionalWithFlag; + /** `[Json]` Creates an Any type */ + Any(options?: SchemaOptions): TAny; + /** `[Json]` Creates an Array type */ + Array(items: Type, options?: ArrayOptions): TArray; + /** `[Json]` Creates a Boolean type */ + Boolean(options?: SchemaOptions): TBoolean; + /** `[Json]` Intrinsic function to Capitalize LiteralString types */ + Capitalize(schema: T, options?: SchemaOptions): TCapitalize; + /** `[Json]` Creates a Composite object type */ + Composite(schemas: [...T], options?: ObjectOptions): TComposite; + /** `[JavaScript]` Creates a readonly const type from the given value. */ + Const(value: T, options?: SchemaOptions): TConst; + /** `[Json]` Creates a Enum type */ + Enum>(item: T, options?: SchemaOptions): TEnum; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromMappedResult; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromTemplateLiteral; + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey; + /** `[Json]` Creates a Conditional type */ + Extends(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtractFromTemplateLiteral; + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type: L, union: R, options?: SchemaOptions): TExtract; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TIndexFromMappedKey; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index>(T: Type, K: Key, options?: SchemaOptions): TIndex; + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type: Type, propertyKeys: readonly [...PropertyKeys], options?: SchemaOptions): TIndex; + /** `[Json]` Creates an Integer type */ + Integer(options?: IntegerOptions): TInteger; + /** `[Json]` Creates an Intersect type */ + Intersect(types: [...Types], options?: IntersectOptions): Intersect; + /** `[Json]` Creates a KeyOf type */ + KeyOf(type: Type, options?: SchemaOptions): TKeyOf; + /** `[Json]` Creates a Literal type */ + Literal(literalValue: LiteralValue, options?: SchemaOptions): TLiteral; + /** `[Json]` Intrinsic function to Lowercase LiteralString types */ + Lowercase(type: Type, options?: SchemaOptions): TLowercase; + /** `[Json]` Creates a Mapped object type */ + Mapped, F extends TMappedFunction = TMappedFunction, R extends TMapped = TMapped>(key: K, map: F, options?: ObjectOptions): R; + /** `[Json]` Creates a Mapped object type */ + Mapped = TMappedFunction, R extends TMapped = TMapped>(key: [...K], map: F, options?: ObjectOptions): R; + /** `[Json]` Creates a Type Definition Module. */ + Module(properties: Properties): TModule; + /** `[Json]` Creates a Never type */ + Never(options?: SchemaOptions): TNever; + /** `[Json]` Creates a Not type */ + Not(type: T, options?: SchemaOptions): TNot; + /** `[Json]` Creates a Null type */ + Null(options?: SchemaOptions): TNull; + /** `[Json]` Creates a Number type */ + Number(options?: NumberOptions): TNumber; + /** `[Json]` Creates an Object type */ + Object(properties: T, options?: ObjectOptions): TObject; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Omit(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Omit(type: Type, key: Key, options?: SchemaOptions): TOmit; + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult; + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type: Type, options?: SchemaOptions): TPartial; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick; + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type: Type, key: Key, options?: SchemaOptions): TPick; + /** `[Json]` Creates a Record type */ + Record(key: Key, value: Value, options?: ObjectOptions): TRecordOrObject; + /** `[Json]` Creates a Recursive type */ + Recursive(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive; + /** `[Json]` Creates a Ref type.*/ + Ref($ref: Ref, options?: SchemaOptions): TRef; + /** + * @deprecated `[Json]` Creates a Ref type. This signature was deprecated in 0.34.0 where Ref requires callers to pass + * a `string` value for the reference (and not a schema). + * + * To adhere to the 0.34.0 signature, Ref implementations should be updated to the following. + * + * ```typescript + * // pre-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Ref(T) + * ``` + * should be changed to the following + * + * ```typescript + * // post-0.34.0 + * + * const T = Type.String({ $id: 'T' }) + * + * const R = Type.Unsafe>(Type.Ref('T')) + * ``` + * You can also create a generic function to replicate the pre-0.34.0 signature if required + * + * ```typescript + * const LegacyRef = (schema: T) => Type.Unsafe>(Type.Ref(schema.$id!)) + * ``` + */ + Ref(type: Type, options?: SchemaOptions): TRefUnsafe; + /** `[Json]` Constructs a type where all properties are required */ + Required(type: MappedResult, options?: SchemaOptions): TRequiredFromMappedResult; + /** `[Json]` Constructs a type where all properties are required */ + Required(type: Type, options?: SchemaOptions): TRequired; + /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ + Rest(type: Type): TRest; + /** `[Json]` Creates a String type */ + String(options?: StringOptions): TString; + /** `[Json]` Creates a TemplateLiteral type from template dsl string */ + TemplateLiteral(syntax: Syntax, options?: SchemaOptions): TTemplateLiteralSyntax; + /** `[Json]` Creates a TemplateLiteral type */ + TemplateLiteral(kinds: [...Kinds], options?: SchemaOptions): TTemplateLiteral; + /** `[Json]` Creates a Transform type */ + Transform(type: Type): TransformDecodeBuilder; + /** `[Json]` Creates a Tuple type */ + Tuple(types: [...Types], options?: SchemaOptions): TTuple; + /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ + Uncapitalize(type: Type, options?: SchemaOptions): TUncapitalize; + /** `[Json]` Creates a Union type */ + Union(types: [...Types], options?: SchemaOptions): Union; + /** `[Json]` Creates an Unknown type */ + Unknown(options?: SchemaOptions): TUnknown; + /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ + Unsafe(options?: UnsafeOptions): TUnsafe; + /** `[Json]` Intrinsic function to Uppercase LiteralString types */ + Uppercase(schema: T, options?: SchemaOptions): TUppercase; +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/json.mjs b/node_modules/@sinclair/typebox/build/esm/type/type/json.mjs new file mode 100644 index 00000000..b5f341a5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/json.mjs @@ -0,0 +1,221 @@ +import { Any } from '../any/index.mjs'; +import { Array } from '../array/index.mjs'; +import { Boolean } from '../boolean/index.mjs'; +import { Composite } from '../composite/index.mjs'; +import { Const } from '../const/index.mjs'; +import { Enum } from '../enum/index.mjs'; +import { Exclude } from '../exclude/index.mjs'; +import { Extends } from '../extends/index.mjs'; +import { Extract } from '../extract/index.mjs'; +import { Index } from '../indexed/index.mjs'; +import { Integer } from '../integer/index.mjs'; +import { Intersect } from '../intersect/index.mjs'; +import { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index.mjs'; +import { KeyOf } from '../keyof/index.mjs'; +import { Literal } from '../literal/index.mjs'; +import { Mapped } from '../mapped/index.mjs'; +import { Never } from '../never/index.mjs'; +import { Not } from '../not/index.mjs'; +import { Null } from '../null/index.mjs'; +import { Module } from '../module/index.mjs'; +import { Number } from '../number/index.mjs'; +import { Object } from '../object/index.mjs'; +import { Omit } from '../omit/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { Partial } from '../partial/index.mjs'; +import { Pick } from '../pick/index.mjs'; +import { Readonly } from '../readonly/index.mjs'; +import { ReadonlyOptional } from '../readonly-optional/index.mjs'; +import { Record } from '../record/index.mjs'; +import { Recursive } from '../recursive/index.mjs'; +import { Ref } from '../ref/index.mjs'; +import { Required } from '../required/index.mjs'; +import { Rest } from '../rest/index.mjs'; +import { String } from '../string/index.mjs'; +import { TemplateLiteral } from '../template-literal/index.mjs'; +import { Transform } from '../transform/index.mjs'; +import { Tuple } from '../tuple/index.mjs'; +import { Union } from '../union/index.mjs'; +import { Unknown } from '../unknown/index.mjs'; +import { Unsafe } from '../unsafe/index.mjs'; +/** Json Type Builder with Static Resolution for TypeScript */ +export class JsonTypeBuilder { + // ------------------------------------------------------------------------ + // Modifiers + // ------------------------------------------------------------------------ + /** `[Json]` Creates a Readonly and Optional property */ + ReadonlyOptional(type) { + return ReadonlyOptional(type); + } + /** `[Json]` Creates a Readonly property */ + Readonly(type, enable) { + return Readonly(type, enable ?? true); + } + /** `[Json]` Creates a Optional property */ + Optional(type, enable) { + return Optional(type, enable ?? true); + } + // ------------------------------------------------------------------------ + // Types + // ------------------------------------------------------------------------ + /** `[Json]` Creates an Any type */ + Any(options) { + return Any(options); + } + /** `[Json]` Creates an Array type */ + Array(items, options) { + return Array(items, options); + } + /** `[Json]` Creates a Boolean type */ + Boolean(options) { + return Boolean(options); + } + /** `[Json]` Intrinsic function to Capitalize LiteralString types */ + Capitalize(schema, options) { + return Capitalize(schema, options); + } + /** `[Json]` Creates a Composite object type */ + Composite(schemas, options) { + return Composite(schemas, options); // (error) TS 5.4.0-dev - review TComposite implementation + } + /** `[JavaScript]` Creates a readonly const type from the given value. */ + Const(value, options) { + return Const(value, options); + } + /** `[Json]` Creates a Enum type */ + Enum(item, options) { + return Enum(item, options); + } + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType, excludedMembers, options) { + return Exclude(unionType, excludedMembers, options); + } + /** `[Json]` Creates a Conditional type */ + Extends(L, R, T, F, options) { + return Extends(L, R, T, F, options); + } + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type, union, options) { + return Extract(type, union, options); + } + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(type, key, options) { + return Index(type, key, options); + } + /** `[Json]` Creates an Integer type */ + Integer(options) { + return Integer(options); + } + /** `[Json]` Creates an Intersect type */ + Intersect(types, options) { + return Intersect(types, options); + } + /** `[Json]` Creates a KeyOf type */ + KeyOf(type, options) { + return KeyOf(type, options); + } + /** `[Json]` Creates a Literal type */ + Literal(literalValue, options) { + return Literal(literalValue, options); + } + /** `[Json]` Intrinsic function to Lowercase LiteralString types */ + Lowercase(type, options) { + return Lowercase(type, options); + } + /** `[Json]` Creates a Mapped object type */ + Mapped(key, map, options) { + return Mapped(key, map, options); + } + /** `[Json]` Creates a Type Definition Module. */ + Module(properties) { + return Module(properties); + } + /** `[Json]` Creates a Never type */ + Never(options) { + return Never(options); + } + /** `[Json]` Creates a Not type */ + Not(type, options) { + return Not(type, options); + } + /** `[Json]` Creates a Null type */ + Null(options) { + return Null(options); + } + /** `[Json]` Creates a Number type */ + Number(options) { + return Number(options); + } + /** `[Json]` Creates an Object type */ + Object(properties, options) { + return Object(properties, options); + } + /** `[Json]` Constructs a type whose keys are omitted from the given type */ + Omit(schema, selector, options) { + return Omit(schema, selector, options); + } + /** `[Json]` Constructs a type where all properties are optional */ + Partial(type, options) { + return Partial(type, options); + } + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(type, key, options) { + return Pick(type, key, options); + } + /** `[Json]` Creates a Record type */ + Record(key, value, options) { + return Record(key, value, options); + } + /** `[Json]` Creates a Recursive type */ + Recursive(callback, options) { + return Recursive(callback, options); + } + /** `[Json]` Creates a Ref type. The referenced type must contain a $id */ + Ref(...args) { + return Ref(args[0], args[1]); + } + /** `[Json]` Constructs a type where all properties are required */ + Required(type, options) { + return Required(type, options); + } + /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ + Rest(type) { + return Rest(type); + } + /** `[Json]` Creates a String type */ + String(options) { + return String(options); + } + /** `[Json]` Creates a TemplateLiteral type */ + TemplateLiteral(unresolved, options) { + return TemplateLiteral(unresolved, options); + } + /** `[Json]` Creates a Transform type */ + Transform(type) { + return Transform(type); + } + /** `[Json]` Creates a Tuple type */ + Tuple(types, options) { + return Tuple(types, options); + } + /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ + Uncapitalize(type, options) { + return Uncapitalize(type, options); + } + /** `[Json]` Creates a Union type */ + Union(types, options) { + return Union(types, options); + } + /** `[Json]` Creates an Unknown type */ + Unknown(options) { + return Unknown(options); + } + /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ + Unsafe(options) { + return Unsafe(options); + } + /** `[Json]` Intrinsic function to Uppercase LiteralString types */ + Uppercase(schema, options) { + return Uppercase(schema, options); + } +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/type/type.d.mts new file mode 100644 index 00000000..2a4e9e6a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/type.d.mts @@ -0,0 +1,59 @@ +export { Any } from '../any/index.mjs'; +export { Argument } from '../argument/index.mjs'; +export { Array } from '../array/index.mjs'; +export { AsyncIterator } from '../async-iterator/index.mjs'; +export { Awaited } from '../awaited/index.mjs'; +export { BigInt } from '../bigint/index.mjs'; +export { Boolean } from '../boolean/index.mjs'; +export { Composite } from '../composite/index.mjs'; +export { Const } from '../const/index.mjs'; +export { Constructor } from '../constructor/index.mjs'; +export { ConstructorParameters } from '../constructor-parameters/index.mjs'; +export { Date } from '../date/index.mjs'; +export { Enum } from '../enum/index.mjs'; +export { Exclude } from '../exclude/index.mjs'; +export { Extends } from '../extends/index.mjs'; +export { Extract } from '../extract/index.mjs'; +export { Function } from '../function/index.mjs'; +export { Index } from '../indexed/index.mjs'; +export { InstanceType } from '../instance-type/index.mjs'; +export { Instantiate } from '../instantiate/index.mjs'; +export { Integer } from '../integer/index.mjs'; +export { Intersect } from '../intersect/index.mjs'; +export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index.mjs'; +export { Iterator } from '../iterator/index.mjs'; +export { KeyOf } from '../keyof/index.mjs'; +export { Literal } from '../literal/index.mjs'; +export { Mapped } from '../mapped/index.mjs'; +export { Module } from '../module/index.mjs'; +export { Never } from '../never/index.mjs'; +export { Not } from '../not/index.mjs'; +export { Null } from '../null/index.mjs'; +export { Number } from '../number/index.mjs'; +export { Object } from '../object/index.mjs'; +export { Omit } from '../omit/index.mjs'; +export { Optional } from '../optional/index.mjs'; +export { Parameters } from '../parameters/index.mjs'; +export { Partial } from '../partial/index.mjs'; +export { Pick } from '../pick/index.mjs'; +export { Promise } from '../promise/index.mjs'; +export { Readonly } from '../readonly/index.mjs'; +export { ReadonlyOptional } from '../readonly-optional/index.mjs'; +export { Record } from '../record/index.mjs'; +export { Recursive } from '../recursive/index.mjs'; +export { Ref } from '../ref/index.mjs'; +export { RegExp } from '../regexp/index.mjs'; +export { Required } from '../required/index.mjs'; +export { Rest } from '../rest/index.mjs'; +export { ReturnType } from '../return-type/index.mjs'; +export { String } from '../string/index.mjs'; +export { Symbol } from '../symbol/index.mjs'; +export { TemplateLiteral } from '../template-literal/index.mjs'; +export { Transform } from '../transform/index.mjs'; +export { Tuple } from '../tuple/index.mjs'; +export { Uint8Array } from '../uint8array/index.mjs'; +export { Undefined } from '../undefined/index.mjs'; +export { Union } from '../union/index.mjs'; +export { Unknown } from '../unknown/index.mjs'; +export { Unsafe } from '../unsafe/index.mjs'; +export { Void } from '../void/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs b/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs new file mode 100644 index 00000000..116be264 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs @@ -0,0 +1,62 @@ +// ------------------------------------------------------------------ +// Type: Module +// ------------------------------------------------------------------ +export { Any } from '../any/index.mjs'; +export { Argument } from '../argument/index.mjs'; +export { Array } from '../array/index.mjs'; +export { AsyncIterator } from '../async-iterator/index.mjs'; +export { Awaited } from '../awaited/index.mjs'; +export { BigInt } from '../bigint/index.mjs'; +export { Boolean } from '../boolean/index.mjs'; +export { Composite } from '../composite/index.mjs'; +export { Const } from '../const/index.mjs'; +export { Constructor } from '../constructor/index.mjs'; +export { ConstructorParameters } from '../constructor-parameters/index.mjs'; +export { Date } from '../date/index.mjs'; +export { Enum } from '../enum/index.mjs'; +export { Exclude } from '../exclude/index.mjs'; +export { Extends } from '../extends/index.mjs'; +export { Extract } from '../extract/index.mjs'; +export { Function } from '../function/index.mjs'; +export { Index } from '../indexed/index.mjs'; +export { InstanceType } from '../instance-type/index.mjs'; +export { Instantiate } from '../instantiate/index.mjs'; +export { Integer } from '../integer/index.mjs'; +export { Intersect } from '../intersect/index.mjs'; +export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index.mjs'; +export { Iterator } from '../iterator/index.mjs'; +export { KeyOf } from '../keyof/index.mjs'; +export { Literal } from '../literal/index.mjs'; +export { Mapped } from '../mapped/index.mjs'; +export { Module } from '../module/index.mjs'; +export { Never } from '../never/index.mjs'; +export { Not } from '../not/index.mjs'; +export { Null } from '../null/index.mjs'; +export { Number } from '../number/index.mjs'; +export { Object } from '../object/index.mjs'; +export { Omit } from '../omit/index.mjs'; +export { Optional } from '../optional/index.mjs'; +export { Parameters } from '../parameters/index.mjs'; +export { Partial } from '../partial/index.mjs'; +export { Pick } from '../pick/index.mjs'; +export { Promise } from '../promise/index.mjs'; +export { Readonly } from '../readonly/index.mjs'; +export { ReadonlyOptional } from '../readonly-optional/index.mjs'; +export { Record } from '../record/index.mjs'; +export { Recursive } from '../recursive/index.mjs'; +export { Ref } from '../ref/index.mjs'; +export { RegExp } from '../regexp/index.mjs'; +export { Required } from '../required/index.mjs'; +export { Rest } from '../rest/index.mjs'; +export { ReturnType } from '../return-type/index.mjs'; +export { String } from '../string/index.mjs'; +export { Symbol } from '../symbol/index.mjs'; +export { TemplateLiteral } from '../template-literal/index.mjs'; +export { Transform } from '../transform/index.mjs'; +export { Tuple } from '../tuple/index.mjs'; +export { Uint8Array } from '../uint8array/index.mjs'; +export { Undefined } from '../undefined/index.mjs'; +export { Union } from '../union/index.mjs'; +export { Unknown } from '../unknown/index.mjs'; +export { Unsafe } from '../unsafe/index.mjs'; +export { Void } from '../void/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.d.mts new file mode 100644 index 00000000..3b4837ed --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.d.mts @@ -0,0 +1 @@ +export * from './uint8array.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.mjs new file mode 100644 index 00000000..3b4837ed --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.mjs @@ -0,0 +1 @@ +export * from './uint8array.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.d.mts b/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.d.mts new file mode 100644 index 00000000..0c8f4377 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.d.mts @@ -0,0 +1,13 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface Uint8ArrayOptions extends SchemaOptions { + maxByteLength?: number; + minByteLength?: number; +} +export interface TUint8Array extends TSchema, Uint8ArrayOptions { + [Kind]: 'Uint8Array'; + static: Uint8Array; + type: 'uint8array'; +} +/** `[JavaScript]` Creates a Uint8Array type */ +export declare function Uint8Array(options?: Uint8ArrayOptions): TUint8Array; diff --git a/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs b/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs new file mode 100644 index 00000000..d51201f1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Uint8Array type */ +export function Uint8Array(options) { + return CreateType({ [Kind]: 'Uint8Array', type: 'Uint8Array' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/undefined/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/undefined/index.d.mts new file mode 100644 index 00000000..beb6f6de --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/undefined/index.d.mts @@ -0,0 +1 @@ +export * from './undefined.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/undefined/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/undefined/index.mjs new file mode 100644 index 00000000..beb6f6de --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/undefined/index.mjs @@ -0,0 +1 @@ +export * from './undefined.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.d.mts b/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.d.mts new file mode 100644 index 00000000..c24efbdf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TUndefined extends TSchema { + [Kind]: 'Undefined'; + static: undefined; + type: 'undefined'; +} +/** `[JavaScript]` Creates a Undefined type */ +export declare function Undefined(options?: SchemaOptions): TUndefined; diff --git a/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs b/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs new file mode 100644 index 00000000..8ef98f0f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Undefined type */ +export function Undefined(options) { + return CreateType({ [Kind]: 'Undefined', type: 'undefined' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/union/index.d.mts new file mode 100644 index 00000000..22aca520 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/index.d.mts @@ -0,0 +1,3 @@ +export * from './union-evaluated.mjs'; +export * from './union-type.mjs'; +export * from './union.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/union/index.mjs new file mode 100644 index 00000000..22aca520 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/index.mjs @@ -0,0 +1,3 @@ +export * from './union-evaluated.mjs'; +export * from './union-type.mjs'; +export * from './union.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-create.d.mts b/node_modules/@sinclair/typebox/build/esm/type/union/union-create.d.mts new file mode 100644 index 00000000..b6e1ccb3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-create.d.mts @@ -0,0 +1,3 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { TUnion } from './union-type.mjs'; +export declare function UnionCreate(T: [...T], options?: SchemaOptions): TUnion; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs b/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs new file mode 100644 index 00000000..83567ae0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs @@ -0,0 +1,5 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +export function UnionCreate(T, options) { + return CreateType({ [Kind]: 'Union', anyOf: T }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.d.mts b/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.d.mts new file mode 100644 index 00000000..05e677c9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.d.mts @@ -0,0 +1,13 @@ +import type { SchemaOptions, TSchema } from '../schema/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import { type TOptional } from '../optional/index.mjs'; +import type { TReadonly } from '../readonly/index.mjs'; +import type { TUnion } from './union-type.mjs'; +type TIsUnionOptional = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? true : TIsUnionOptional : false); +type TRemoveOptionalFromRest = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional ? TRemoveOptionalFromRest]> : TRemoveOptionalFromRest : Result); +type TRemoveOptionalFromType = (Type extends TReadonly ? TReadonly> : Type extends TOptional ? TRemoveOptionalFromType : Type); +type TResolveUnion, IsOptional extends boolean = TIsUnionOptional> = (IsOptional extends true ? TOptional> : TUnion); +export type TUnionEvaluated = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TResolveUnion); +/** `[Json]` Creates an evaluated Union type */ +export declare function UnionEvaluated>(T: [...Types], options?: SchemaOptions): Result; +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs b/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs new file mode 100644 index 00000000..df8483b1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs @@ -0,0 +1,36 @@ +import { CreateType } from '../create/type.mjs'; +import { OptionalKind } from '../symbols/index.mjs'; +import { Discard } from '../discard/index.mjs'; +import { Never } from '../never/index.mjs'; +import { Optional } from '../optional/index.mjs'; +import { UnionCreate } from './union-create.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsOptional } from '../guard/kind.mjs'; +// prettier-ignore +function IsUnionOptional(types) { + return types.some(type => IsOptional(type)); +} +// prettier-ignore +function RemoveOptionalFromRest(types) { + return types.map(left => IsOptional(left) ? RemoveOptionalFromType(left) : left); +} +// prettier-ignore +function RemoveOptionalFromType(T) { + return (Discard(T, [OptionalKind])); +} +// prettier-ignore +function ResolveUnion(types, options) { + const isOptional = IsUnionOptional(types); + return (isOptional + ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) + : UnionCreate(RemoveOptionalFromRest(types), options)); +} +/** `[Json]` Creates an evaluated Union type */ +export function UnionEvaluated(T, options) { + // prettier-ignore + return (T.length === 1 ? CreateType(T[0], options) : + T.length === 0 ? Never(options) : + ResolveUnion(T, options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-type.d.mts b/node_modules/@sinclair/typebox/build/esm/type/union/union-type.d.mts new file mode 100644 index 00000000..aab00a48 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-type.d.mts @@ -0,0 +1,12 @@ +import type { TSchema } from '../schema/index.mjs'; +import type { Static } from '../static/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +type UnionStatic = { + [K in keyof T]: T[K] extends TSchema ? Static : never; +}[number]; +export interface TUnion extends TSchema { + [Kind]: 'Union'; + static: UnionStatic; + anyOf: T; +} +export {}; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union-type.mjs b/node_modules/@sinclair/typebox/build/esm/type/union/union-type.mjs new file mode 100644 index 00000000..6d09727c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union-type.mjs @@ -0,0 +1 @@ +import { Kind } from '../symbols/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union.d.mts b/node_modules/@sinclair/typebox/build/esm/type/union/union.d.mts new file mode 100644 index 00000000..ed1c44c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union.d.mts @@ -0,0 +1,6 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { type TNever } from '../never/index.mjs'; +import type { TUnion } from './union-type.mjs'; +export type Union = (T extends [] ? TNever : T extends [TSchema] ? T[0] : TUnion); +/** `[Json]` Creates a Union type */ +export declare function Union(types: [...Types], options?: SchemaOptions): Union; diff --git a/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs b/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs new file mode 100644 index 00000000..69118842 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs @@ -0,0 +1,10 @@ +import { Never } from '../never/index.mjs'; +import { CreateType } from '../create/type.mjs'; +import { UnionCreate } from './union-create.mjs'; +/** `[Json]` Creates a Union type */ +export function Union(types, options) { + // prettier-ignore + return (types.length === 0 ? Never(options) : + types.length === 1 ? CreateType(types[0], options) : + UnionCreate(types, options)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/unknown/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/unknown/index.d.mts new file mode 100644 index 00000000..10f321df --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unknown/index.d.mts @@ -0,0 +1 @@ +export * from './unknown.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unknown/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/unknown/index.mjs new file mode 100644 index 00000000..10f321df --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unknown/index.mjs @@ -0,0 +1 @@ +export * from './unknown.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.d.mts b/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.d.mts new file mode 100644 index 00000000..12c328c6 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.d.mts @@ -0,0 +1,8 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TUnknown extends TSchema { + [Kind]: 'Unknown'; + static: unknown; +} +/** `[Json]` Creates an Unknown type */ +export declare function Unknown(options?: SchemaOptions): TUnknown; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs b/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs new file mode 100644 index 00000000..4d1f1041 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates an Unknown type */ +export function Unknown(options) { + return CreateType({ [Kind]: 'Unknown' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.d.mts new file mode 100644 index 00000000..9643f610 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.d.mts @@ -0,0 +1 @@ +export * from './unsafe.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.mjs new file mode 100644 index 00000000..9643f610 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.mjs @@ -0,0 +1 @@ +export * from './unsafe.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.d.mts b/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.d.mts new file mode 100644 index 00000000..bb5e20d8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.d.mts @@ -0,0 +1,11 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface UnsafeOptions extends SchemaOptions { + [Kind]?: string; +} +export interface TUnsafe extends TSchema { + [Kind]: string; + static: T; +} +/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ +export declare function Unsafe(options?: UnsafeOptions): TUnsafe; diff --git a/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs b/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs new file mode 100644 index 00000000..15abb1b4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ +export function Unsafe(options = {}) { + return CreateType({ [Kind]: options[Kind] ?? 'Unsafe' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/type/void/index.d.mts b/node_modules/@sinclair/typebox/build/esm/type/void/index.d.mts new file mode 100644 index 00000000..f9933e31 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/void/index.d.mts @@ -0,0 +1 @@ +export * from './void.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/void/index.mjs b/node_modules/@sinclair/typebox/build/esm/type/void/index.mjs new file mode 100644 index 00000000..f9933e31 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/void/index.mjs @@ -0,0 +1 @@ +export * from './void.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/type/void/void.d.mts b/node_modules/@sinclair/typebox/build/esm/type/void/void.d.mts new file mode 100644 index 00000000..a48dad55 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/void/void.d.mts @@ -0,0 +1,9 @@ +import type { TSchema, SchemaOptions } from '../schema/index.mjs'; +import { Kind } from '../symbols/index.mjs'; +export interface TVoid extends TSchema { + [Kind]: 'Void'; + static: void; + type: 'void'; +} +/** `[JavaScript]` Creates a Void type */ +export declare function Void(options?: SchemaOptions): TVoid; diff --git a/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs b/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs new file mode 100644 index 00000000..f5bf7d91 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs @@ -0,0 +1,6 @@ +import { CreateType } from '../create/type.mjs'; +import { Kind } from '../symbols/index.mjs'; +/** `[JavaScript]` Creates a Void type */ +export function Void(options) { + return CreateType({ [Kind]: 'Void', type: 'void' }, options); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/assert/assert.d.mts b/node_modules/@sinclair/typebox/build/esm/value/assert/assert.d.mts new file mode 100644 index 00000000..57e13ca3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/assert/assert.d.mts @@ -0,0 +1,15 @@ +import { ValueErrorIterator, ValueError } from '../../errors/index.mjs'; +import { TypeBoxError } from '../../type/error/error.mjs'; +import { TSchema } from '../../type/schema/index.mjs'; +import { Static } from '../../type/static/index.mjs'; +export declare class AssertError extends TypeBoxError { + #private; + error: ValueError | undefined; + constructor(iterator: ValueErrorIterator); + /** Returns an iterator for each error in this value. */ + Errors(): ValueErrorIterator; +} +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +export declare function Assert(schema: T, references: TSchema[], value: unknown): asserts value is Static; +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +export declare function Assert(schema: T, value: unknown): asserts value is Static; diff --git a/node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs b/node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs new file mode 100644 index 00000000..93034f0f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs @@ -0,0 +1,49 @@ +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _AssertError_instances, _AssertError_iterator, _AssertError_Iterator; +import { Errors, ValueErrorIterator } from '../../errors/index.mjs'; +import { TypeBoxError } from '../../type/error/error.mjs'; +import { Check } from '../check/check.mjs'; +// ------------------------------------------------------------------ +// AssertError +// ------------------------------------------------------------------ +export class AssertError extends TypeBoxError { + constructor(iterator) { + const error = iterator.First(); + super(error === undefined ? 'Invalid Value' : error.message); + _AssertError_instances.add(this); + _AssertError_iterator.set(this, void 0); + __classPrivateFieldSet(this, _AssertError_iterator, iterator, "f"); + this.error = error; + } + /** Returns an iterator for each error in this value. */ + Errors() { + return new ValueErrorIterator(__classPrivateFieldGet(this, _AssertError_instances, "m", _AssertError_Iterator).call(this)); + } +} +_AssertError_iterator = new WeakMap(), _AssertError_instances = new WeakSet(), _AssertError_Iterator = function* _AssertError_Iterator() { + if (this.error) + yield this.error; + yield* __classPrivateFieldGet(this, _AssertError_iterator, "f"); +}; +// ------------------------------------------------------------------ +// AssertValue +// ------------------------------------------------------------------ +function AssertValue(schema, references, value) { + if (Check(schema, references, value)) + return; + throw new AssertError(Errors(schema, references, value)); +} +/** Asserts a value matches the given type or throws an `AssertError` if invalid */ +export function Assert(...args) { + return args.length === 3 ? AssertValue(args[0], args[1], args[2]) : AssertValue(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/assert/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/assert/index.d.mts new file mode 100644 index 00000000..d981f4c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/assert/index.d.mts @@ -0,0 +1 @@ +export * from './assert.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/assert/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/assert/index.mjs new file mode 100644 index 00000000..d981f4c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/assert/index.mjs @@ -0,0 +1 @@ +export * from './assert.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/cast/cast.d.mts b/node_modules/@sinclair/typebox/build/esm/value/cast/cast.d.mts new file mode 100644 index 00000000..ce46fa23 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/cast/cast.d.mts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import type { TSchema } from '../../type/schema/index.mjs'; +import type { Static } from '../../type/static/index.mjs'; +export declare class ValueCastError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema, message: string); +} +/** Casts a value into a given type and references. The return value will retain as much information of the original value as possible. */ +export declare function Cast(schema: T, references: TSchema[], value: unknown): Static; +/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ +export declare function Cast(schema: T, value: unknown): Static; diff --git a/node_modules/@sinclair/typebox/build/esm/value/cast/cast.mjs b/node_modules/@sinclair/typebox/build/esm/value/cast/cast.mjs new file mode 100644 index 00000000..cbe3c436 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/cast/cast.mjs @@ -0,0 +1,235 @@ +import { IsObject, IsArray, IsString, IsNumber, IsNull } from '../guard/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +import { Create } from '../create/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueCastError extends TypeBoxError { + constructor(schema, message) { + super(message); + this.schema = schema; + } +} +// ------------------------------------------------------------------ +// The following logic assigns a score to a schema based on how well +// it matches a given value. For object types, the score is calculated +// by evaluating each property of the value against the schema's +// properties. To avoid bias towards objects with many properties, +// each property contributes equally to the total score. Properties +// that exactly match literal values receive the highest possible +// score, as literals are often used as discriminators in union types. +// ------------------------------------------------------------------ +function ScoreUnion(schema, references, value) { + if (schema[Kind] === 'Object' && typeof value === 'object' && !IsNull(value)) { + const object = schema; + const keys = Object.getOwnPropertyNames(value); + const entries = Object.entries(object.properties); + return entries.reduce((acc, [key, schema]) => { + const literal = schema[Kind] === 'Literal' && schema.const === value[key] ? 100 : 0; + const checks = Check(schema, references, value[key]) ? 10 : 0; + const exists = keys.includes(key) ? 1 : 0; + return acc + (literal + checks + exists); + }, 0); + } + else if (schema[Kind] === 'Union') { + const schemas = schema.anyOf.map((schema) => Deref(schema, references)); + const scores = schemas.map((schema) => ScoreUnion(schema, references, value)); + return Math.max(...scores); + } + else { + return Check(schema, references, value) ? 1 : 0; + } +} +function SelectUnion(union, references, value) { + const schemas = union.anyOf.map((schema) => Deref(schema, references)); + let [select, best] = [schemas[0], 0]; + for (const schema of schemas) { + const score = ScoreUnion(schema, references, value); + if (score > best) { + select = schema; + best = score; + } + } + return select; +} +function CastUnion(union, references, value) { + if ('default' in union) { + return typeof value === 'function' ? union.default : Clone(union.default); + } + else { + const schema = SelectUnion(union, references, value); + return Cast(schema, references, value); + } +} +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function DefaultClone(schema, references, value) { + return Check(schema, references, value) ? Clone(value) : Create(schema, references); +} +function Default(schema, references, value) { + return Check(schema, references, value) ? value : Create(schema, references); +} +// ------------------------------------------------------------------ +// Cast +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + if (Check(schema, references, value)) + return Clone(value); + const created = IsArray(value) ? Clone(value) : Create(schema, references); + const minimum = IsNumber(schema.minItems) && created.length < schema.minItems ? [...created, ...Array.from({ length: schema.minItems - created.length }, () => null)] : created; + const maximum = IsNumber(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum; + const casted = maximum.map((value) => Visit(schema.items, references, value)); + if (schema.uniqueItems !== true) + return casted; + const unique = [...new Set(casted)]; + if (!Check(schema, references, unique)) + throw new ValueCastError(schema, 'Array cast produced invalid data due to uniqueItems constraint'); + return unique; +} +function FromConstructor(schema, references, value) { + if (Check(schema, references, value)) + return Create(schema, references); + const required = new Set(schema.returns.required || []); + const result = function () { }; + for (const [key, property] of Object.entries(schema.returns.properties)) { + if (!required.has(key) && value.prototype[key] === undefined) + continue; + result.prototype[key] = Visit(property, references, value.prototype[key]); + } + return result; +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +// ------------------------------------------------------------------ +// Intersect +// ------------------------------------------------------------------ +function IntersectAssign(correct, value) { + // trust correct on mismatch | value on non-object + if ((IsObject(correct) && !IsObject(value)) || (!IsObject(correct) && IsObject(value))) + return correct; + if (!IsObject(correct) || !IsObject(value)) + return value; + return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key) => { + const property = key in value ? IntersectAssign(correct[key], value[key]) : correct[key]; + return { ...result, [key]: property }; + }, {}); +} +function FromIntersect(schema, references, value) { + if (Check(schema, references, value)) + return value; + const correct = Create(schema, references); + const assigned = IntersectAssign(correct, value); + return Check(schema, references, assigned) ? assigned : correct; +} +function FromNever(schema, references, value) { + throw new ValueCastError(schema, 'Never types cannot be cast'); +} +function FromObject(schema, references, value) { + if (Check(schema, references, value)) + return value; + if (value === null || typeof value !== 'object') + return Create(schema, references); + const required = new Set(schema.required || []); + const result = {}; + for (const [key, property] of Object.entries(schema.properties)) { + if (!required.has(key) && value[key] === undefined) + continue; + result[key] = Visit(property, references, value[key]); + } + // additional schema properties + if (typeof schema.additionalProperties === 'object') { + const propertyNames = Object.getOwnPropertyNames(schema.properties); + for (const propertyName of Object.getOwnPropertyNames(value)) { + if (propertyNames.includes(propertyName)) + continue; + result[propertyName] = Visit(schema.additionalProperties, references, value[propertyName]); + } + } + return result; +} +function FromRecord(schema, references, value) { + if (Check(schema, references, value)) + return Clone(value); + if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) + return Create(schema, references); + const subschemaPropertyName = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const subschema = schema.patternProperties[subschemaPropertyName]; + const result = {}; + for (const [propKey, propValue] of Object.entries(value)) { + result[propKey] = Visit(subschema, references, propValue); + } + return result; +} +function FromRef(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromThis(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if (Check(schema, references, value)) + return Clone(value); + if (!IsArray(value)) + return Create(schema, references); + if (schema.items === undefined) + return []; + return schema.items.map((schema, index) => Visit(schema, references, value[index])); +} +function FromUnion(schema, references, value) { + return Check(schema, references, value) ? Clone(value) : CastUnion(schema, references, value); +} +function Visit(schema, references, value) { + const references_ = IsString(schema.$id) ? Pushref(schema, references) : references; + const schema_ = schema; + switch (schema[Kind]) { + // -------------------------------------------------------------- + // Structural + // -------------------------------------------------------------- + case 'Array': + return FromArray(schema_, references_, value); + case 'Constructor': + return FromConstructor(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Never': + return FromNever(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + // -------------------------------------------------------------- + // DefaultClone + // -------------------------------------------------------------- + case 'Date': + case 'Symbol': + case 'Uint8Array': + return DefaultClone(schema, references, value); + // -------------------------------------------------------------- + // Default + // -------------------------------------------------------------- + default: + return Default(schema_, references_, value); + } +} +/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ +export function Cast(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/cast/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/cast/index.d.mts new file mode 100644 index 00000000..f23796aa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/cast/index.d.mts @@ -0,0 +1 @@ +export * from './cast.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/cast/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/cast/index.mjs new file mode 100644 index 00000000..f23796aa --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/cast/index.mjs @@ -0,0 +1 @@ +export * from './cast.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/check/check.d.mts b/node_modules/@sinclair/typebox/build/esm/value/check/check.d.mts new file mode 100644 index 00000000..a9fe8ab3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/check/check.d.mts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import type { TSchema } from '../../type/schema/index.mjs'; +import type { Static } from '../../type/static/index.mjs'; +export declare class ValueCheckUnknownTypeError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema); +} +/** Returns true if the value matches the given type. */ +export declare function Check(schema: T, references: TSchema[], value: unknown): value is Static; +/** Returns true if the value matches the given type. */ +export declare function Check(schema: T, value: unknown): value is Static; diff --git a/node_modules/@sinclair/typebox/build/esm/value/check/check.mjs b/node_modules/@sinclair/typebox/build/esm/value/check/check.mjs new file mode 100644 index 00000000..bae317fc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/check/check.mjs @@ -0,0 +1,469 @@ +import { TypeSystemPolicy } from '../../system/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Hash } from '../hash/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +import { KeyOfPattern } from '../../type/keyof/index.mjs'; +import { ExtendsUndefinedCheck } from '../../type/extends/index.mjs'; +import { TypeRegistry, FormatRegistry } from '../../type/registry/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { Never } from '../../type/never/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import { IsSchema } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueCheckUnknownTypeError extends TypeBoxError { + constructor(schema) { + super(`Unknown type`); + this.schema = schema; + } +} +// ------------------------------------------------------------------ +// TypeGuards +// ------------------------------------------------------------------ +function IsAnyOrUnknown(schema) { + return schema[Kind] === 'Any' || schema[Kind] === 'Unknown'; +} +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +function IsDefined(value) { + return value !== undefined; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromAny(schema, references, value) { + return true; +} +function FromArgument(schema, references, value) { + return true; +} +function FromArray(schema, references, value) { + if (!IsArray(value)) + return false; + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + return false; + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + return false; + } + if (!value.every((value) => Visit(schema.items, references, value))) { + return false; + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = Hash(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + return false; + } + // contains + if (!(IsDefined(schema.contains) || IsNumber(schema.minContains) || IsNumber(schema.maxContains))) { + return true; // exit + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : Never(); + const containsCount = value.reduce((acc, value) => (Visit(containsSchema, references, value) ? acc + 1 : acc), 0); + if (containsCount === 0) { + return false; + } + if (IsNumber(schema.minContains) && containsCount < schema.minContains) { + return false; + } + if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) { + return false; + } + return true; +} +function FromAsyncIterator(schema, references, value) { + return IsAsyncIterator(value); +} +function FromBigInt(schema, references, value) { + if (!IsBigInt(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + return false; + } + return true; +} +function FromBoolean(schema, references, value) { + return IsBoolean(value); +} +function FromConstructor(schema, references, value) { + return Visit(schema.returns, references, value.prototype); +} +function FromDate(schema, references, value) { + if (!IsDate(value)) + return false; + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + return false; + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + return false; + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + return false; + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + return false; + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + return false; + } + return true; +} +function FromFunction(schema, references, value) { + return IsFunction(value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromInteger(schema, references, value) { + if (!IsInteger(value)) { + return false; + } + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function FromIntersect(schema, references, value) { + const check1 = schema.allOf.every((schema) => Visit(schema, references, value)); + if (schema.unevaluatedProperties === false) { + const keyPattern = new RegExp(KeyOfPattern(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key)); + return check1 && check2; + } + else if (IsSchema(schema.unevaluatedProperties)) { + const keyCheck = new RegExp(KeyOfPattern(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key])); + return check1 && check2; + } + else { + return check1; + } +} +function FromIterator(schema, references, value) { + return IsIterator(value); +} +function FromLiteral(schema, references, value) { + return value === schema.const; +} +function FromNever(schema, references, value) { + return false; +} +function FromNot(schema, references, value) { + return !Visit(schema.not, references, value); +} +function FromNull(schema, references, value) { + return IsNull(value); +} +function FromNumber(schema, references, value) { + if (!TypeSystemPolicy.IsNumberLike(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function FromObject(schema, references, value) { + if (!TypeSystemPolicy.IsObjectLike(value)) + return false; + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + if (!Visit(property, references, value[knownKey])) { + return false; + } + if ((ExtendsUndefinedCheck(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) { + return false; + } + } + else { + if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) { + return false; + } + } + } + if (schema.additionalProperties === false) { + const valueKeys = Object.getOwnPropertyNames(value); + // optimization: value is valid if schemaKey length matches the valueKey length + if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) { + return true; + } + else { + return valueKeys.every((valueKey) => knownKeys.includes(valueKey)); + } + } + else if (typeof schema.additionalProperties === 'object') { + const valueKeys = Object.getOwnPropertyNames(value); + return valueKeys.every((key) => knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key])); + } + else { + return true; + } +} +function FromPromise(schema, references, value) { + return IsPromise(value); +} +function FromRecord(schema, references, value) { + if (!TypeSystemPolicy.IsRecordLike(value)) { + return false; + } + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + // prettier-ignore + const check1 = Object.entries(value).every(([key, value]) => { + return (regex.test(key)) ? Visit(patternSchema, references, value) : true; + }); + // prettier-ignore + const check2 = typeof schema.additionalProperties === 'object' ? Object.entries(value).every(([key, value]) => { + return (!regex.test(key)) ? Visit(schema.additionalProperties, references, value) : true; + }) : true; + const check3 = schema.additionalProperties === false + ? Object.getOwnPropertyNames(value).every((key) => { + return regex.test(key); + }) + : true; + return check1 && check2 && check3; +} +function FromRef(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromRegExp(schema, references, value) { + const regex = new RegExp(schema.source, schema.flags); + if (IsDefined(schema.minLength)) { + if (!(value.length >= schema.minLength)) + return false; + } + if (IsDefined(schema.maxLength)) { + if (!(value.length <= schema.maxLength)) + return false; + } + return regex.test(value); +} +function FromString(schema, references, value) { + if (!IsString(value)) { + return false; + } + if (IsDefined(schema.minLength)) { + if (!(value.length >= schema.minLength)) + return false; + } + if (IsDefined(schema.maxLength)) { + if (!(value.length <= schema.maxLength)) + return false; + } + if (IsDefined(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) + return false; + } + if (IsDefined(schema.format)) { + if (!FormatRegistry.Has(schema.format)) + return false; + const func = FormatRegistry.Get(schema.format); + return func(value); + } + return true; +} +function FromSymbol(schema, references, value) { + return IsSymbol(value); +} +function FromTemplateLiteral(schema, references, value) { + return IsString(value) && new RegExp(schema.pattern).test(value); +} +function FromThis(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if (!IsArray(value)) { + return false; + } + if (schema.items === undefined && !(value.length === 0)) { + return false; + } + if (!(value.length === schema.maxItems)) { + return false; + } + if (!schema.items) { + return true; + } + for (let i = 0; i < schema.items.length; i++) { + if (!Visit(schema.items[i], references, value[i])) + return false; + } + return true; +} +function FromUndefined(schema, references, value) { + return IsUndefined(value); +} +function FromUnion(schema, references, value) { + return schema.anyOf.some((inner) => Visit(inner, references, value)); +} +function FromUint8Array(schema, references, value) { + if (!IsUint8Array(value)) { + return false; + } + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + return false; + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + return false; + } + return true; +} +function FromUnknown(schema, references, value) { + return true; +} +function FromVoid(schema, references, value) { + return TypeSystemPolicy.IsVoidLike(value); +} +function FromKind(schema, references, value) { + if (!TypeRegistry.Has(schema[Kind])) + return false; + const func = TypeRegistry.Get(schema[Kind]); + return func(schema, value); +} +function Visit(schema, references, value) { + const references_ = IsDefined(schema.$id) ? Pushref(schema, references) : references; + const schema_ = schema; + switch (schema_[Kind]) { + case 'Any': + return FromAny(schema_, references_, value); + case 'Argument': + return FromArgument(schema_, references_, value); + case 'Array': + return FromArray(schema_, references_, value); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_, value); + case 'BigInt': + return FromBigInt(schema_, references_, value); + case 'Boolean': + return FromBoolean(schema_, references_, value); + case 'Constructor': + return FromConstructor(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Function': + return FromFunction(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Integer': + return FromInteger(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Iterator': + return FromIterator(schema_, references_, value); + case 'Literal': + return FromLiteral(schema_, references_, value); + case 'Never': + return FromNever(schema_, references_, value); + case 'Not': + return FromNot(schema_, references_, value); + case 'Null': + return FromNull(schema_, references_, value); + case 'Number': + return FromNumber(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Promise': + return FromPromise(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'RegExp': + return FromRegExp(schema_, references_, value); + case 'String': + return FromString(schema_, references_, value); + case 'Symbol': + return FromSymbol(schema_, references_, value); + case 'TemplateLiteral': + return FromTemplateLiteral(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Undefined': + return FromUndefined(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + case 'Uint8Array': + return FromUint8Array(schema_, references_, value); + case 'Unknown': + return FromUnknown(schema_, references_, value); + case 'Void': + return FromVoid(schema_, references_, value); + default: + if (!TypeRegistry.Has(schema_[Kind])) + throw new ValueCheckUnknownTypeError(schema_); + return FromKind(schema_, references_, value); + } +} +/** Returns true if the value matches the given type. */ +export function Check(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/check/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/check/index.d.mts new file mode 100644 index 00000000..108d77f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/check/index.d.mts @@ -0,0 +1 @@ +export * from './check.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/check/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/check/index.mjs new file mode 100644 index 00000000..108d77f2 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/check/index.mjs @@ -0,0 +1 @@ +export * from './check.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clean/clean.d.mts b/node_modules/@sinclair/typebox/build/esm/value/clean/clean.d.mts new file mode 100644 index 00000000..102382c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clean/clean.d.mts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Clean(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clean/clean.mjs b/node_modules/@sinclair/typebox/build/esm/value/clean/clean.mjs new file mode 100644 index 00000000..77fc8136 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clean/clean.mjs @@ -0,0 +1,145 @@ +import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +// prettier-ignore +import { HasPropertyKey, IsString, IsObject, IsArray, IsUndefined } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +// prettier-ignore +import { IsKind } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// IsCheckable +// ------------------------------------------------------------------ +function IsCheckable(schema) { + return IsKind(schema) && schema[Kind] !== 'Unsafe'; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + if (!IsArray(value)) + return value; + return value.map((value) => Visit(schema.items, references, value)); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromIntersect(schema, references, value) { + const unevaluatedProperties = schema.unevaluatedProperties; + const intersections = schema.allOf.map((schema) => Visit(schema, references, Clone(value))); + const composite = intersections.reduce((acc, value) => (IsObject(value) ? { ...acc, ...value } : value), {}); + if (!IsObject(value) || !IsObject(composite) || !IsKind(unevaluatedProperties)) + return composite; + const knownkeys = KeyOfPropertyKeys(schema); + for (const key of Object.getOwnPropertyNames(value)) { + if (knownkeys.includes(key)) + continue; + if (Check(unevaluatedProperties, references, value[key])) { + composite[key] = Visit(unevaluatedProperties, references, value[key]); + } + } + return composite; +} +function FromObject(schema, references, value) { + if (!IsObject(value) || IsArray(value)) + return value; // Check IsArray for AllowArrayObject configuration + const additionalProperties = schema.additionalProperties; + for (const key of Object.getOwnPropertyNames(value)) { + if (HasPropertyKey(schema.properties, key)) { + value[key] = Visit(schema.properties[key], references, value[key]); + continue; + } + if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) { + value[key] = Visit(additionalProperties, references, value[key]); + continue; + } + delete value[key]; + } + return value; +} +function FromRecord(schema, references, value) { + if (!IsObject(value)) + return value; + const additionalProperties = schema.additionalProperties; + const propertyKeys = Object.getOwnPropertyNames(value); + const [propertyKey, propertySchema] = Object.entries(schema.patternProperties)[0]; + const propertyKeyTest = new RegExp(propertyKey); + for (const key of propertyKeys) { + if (propertyKeyTest.test(key)) { + value[key] = Visit(propertySchema, references, value[key]); + continue; + } + if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) { + value[key] = Visit(additionalProperties, references, value[key]); + continue; + } + delete value[key]; + } + return value; +} +function FromRef(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromThis(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromTuple(schema, references, value) { + if (!IsArray(value)) + return value; + if (IsUndefined(schema.items)) + return []; + const length = Math.min(value.length, schema.items.length); + for (let i = 0; i < length; i++) { + value[i] = Visit(schema.items[i], references, value[i]); + } + // prettier-ignore + return value.length > length + ? value.slice(0, length) + : value; +} +function FromUnion(schema, references, value) { + for (const inner of schema.anyOf) { + if (IsCheckable(inner) && Check(inner, references, value)) { + return Visit(inner, references, value); + } + } + return value; +} +function Visit(schema, references, value) { + const references_ = IsString(schema.$id) ? Pushref(schema, references) : references; + const schema_ = schema; + switch (schema_[Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return value; + } +} +/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */ +export function Clean(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/clean/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/clean/index.d.mts new file mode 100644 index 00000000..e4dfd7c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clean/index.d.mts @@ -0,0 +1 @@ +export * from './clean.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clean/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/clean/index.mjs new file mode 100644 index 00000000..e4dfd7c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clean/index.mjs @@ -0,0 +1 @@ +export * from './clean.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clone/clone.d.mts b/node_modules/@sinclair/typebox/build/esm/value/clone/clone.d.mts new file mode 100644 index 00000000..06a609ec --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clone/clone.d.mts @@ -0,0 +1,2 @@ +/** Returns a clone of the given value */ +export declare function Clone(value: T): T; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs b/node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs new file mode 100644 index 00000000..b746c590 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsDate, IsMap, IsSet, IsObject, IsTypedArray, IsValueType } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// Clonable +// ------------------------------------------------------------------ +function FromObject(value) { + const Acc = {}; + for (const key of Object.getOwnPropertyNames(value)) { + Acc[key] = Clone(value[key]); + } + for (const key of Object.getOwnPropertySymbols(value)) { + Acc[key] = Clone(value[key]); + } + return Acc; +} +function FromArray(value) { + return value.map((element) => Clone(element)); +} +function FromTypedArray(value) { + return value.slice(); +} +function FromMap(value) { + return new Map(Clone([...value.entries()])); +} +function FromSet(value) { + return new Set(Clone([...value.entries()])); +} +function FromDate(value) { + return new Date(value.toISOString()); +} +function FromValue(value) { + return value; +} +// ------------------------------------------------------------------ +// Clone +// ------------------------------------------------------------------ +/** Returns a clone of the given value */ +export function Clone(value) { + if (IsArray(value)) + return FromArray(value); + if (IsDate(value)) + return FromDate(value); + if (IsTypedArray(value)) + return FromTypedArray(value); + if (IsMap(value)) + return FromMap(value); + if (IsSet(value)) + return FromSet(value); + if (IsObject(value)) + return FromObject(value); + if (IsValueType(value)) + return FromValue(value); + throw new Error('ValueClone: Unable to clone value'); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/clone/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/clone/index.d.mts new file mode 100644 index 00000000..dc46ad5b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clone/index.d.mts @@ -0,0 +1 @@ +export * from './clone.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/clone/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/clone/index.mjs new file mode 100644 index 00000000..dc46ad5b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/clone/index.mjs @@ -0,0 +1 @@ +export * from './clone.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/convert/convert.d.mts b/node_modules/@sinclair/typebox/build/esm/value/convert/convert.d.mts new file mode 100644 index 00000000..5cdb07a1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/convert/convert.d.mts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +export declare function Convert(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/convert/convert.mjs b/node_modules/@sinclair/typebox/build/esm/value/convert/convert.mjs new file mode 100644 index 00000000..d23cce59 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/convert/convert.mjs @@ -0,0 +1,260 @@ +import { Clone } from '../clone/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsObject, IsDate, IsUndefined, IsString, IsNumber, IsBoolean, IsBigInt, IsSymbol, HasPropertyKey } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// Conversions +// ------------------------------------------------------------------ +function IsStringNumeric(value) { + return IsString(value) && !isNaN(value) && !isNaN(parseFloat(value)); +} +function IsValueToString(value) { + return IsBigInt(value) || IsBoolean(value) || IsNumber(value); +} +function IsValueTrue(value) { + return value === true || (IsNumber(value) && value === 1) || (IsBigInt(value) && value === BigInt('1')) || (IsString(value) && (value.toLowerCase() === 'true' || value === '1')); +} +function IsValueFalse(value) { + return value === false || (IsNumber(value) && (value === 0 || Object.is(value, -0))) || (IsBigInt(value) && value === BigInt('0')) || (IsString(value) && (value.toLowerCase() === 'false' || value === '0' || value === '-0')); +} +function IsTimeStringWithTimeZone(value) { + return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsTimeStringWithoutTimeZone(value) { + return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateTimeStringWithTimeZone(value) { + return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsDateTimeStringWithoutTimeZone(value) { + return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateString(value) { + return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value); +} +// ------------------------------------------------------------------ +// Convert +// ------------------------------------------------------------------ +function TryConvertLiteralString(value, target) { + const conversion = TryConvertString(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralNumber(value, target) { + const conversion = TryConvertNumber(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralBoolean(value, target) { + const conversion = TryConvertBoolean(value); + return conversion === target ? conversion : value; +} +// prettier-ignore +function TryConvertLiteral(schema, value) { + return (IsString(schema.const) ? TryConvertLiteralString(value, schema.const) : + IsNumber(schema.const) ? TryConvertLiteralNumber(value, schema.const) : + IsBoolean(schema.const) ? TryConvertLiteralBoolean(value, schema.const) : + value); +} +function TryConvertBoolean(value) { + return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value; +} +function TryConvertBigInt(value) { + const truncateInteger = (value) => value.split('.')[0]; + return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : IsNumber(value) ? BigInt(Math.trunc(value)) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value; +} +function TryConvertString(value) { + return IsSymbol(value) && value.description !== undefined ? value.description.toString() : IsValueToString(value) ? value.toString() : value; +} +function TryConvertNumber(value) { + return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertInteger(value) { + return IsStringNumeric(value) ? parseInt(value) : IsNumber(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertNull(value) { + return IsString(value) && value.toLowerCase() === 'null' ? null : value; +} +function TryConvertUndefined(value) { + return IsString(value) && value === 'undefined' ? undefined : value; +} +// ------------------------------------------------------------------ +// note: this function may return an invalid dates for the regex +// tests above. Invalid dates will however be checked during the +// casting function and will return a epoch date if invalid. +// Consider better string parsing for the iso dates in future +// revisions. +// ------------------------------------------------------------------ +// prettier-ignore +function TryConvertDate(value) { + return (IsDate(value) ? value : + IsNumber(value) ? new Date(value) : + IsValueTrue(value) ? new Date(1) : + IsValueFalse(value) ? new Date(0) : + IsStringNumeric(value) ? new Date(parseInt(value)) : + IsTimeStringWithoutTimeZone(value) ? new Date(`1970-01-01T${value}.000Z`) : + IsTimeStringWithTimeZone(value) ? new Date(`1970-01-01T${value}`) : + IsDateTimeStringWithoutTimeZone(value) ? new Date(`${value}.000Z`) : + IsDateTimeStringWithTimeZone(value) ? new Date(value) : + IsDateString(value) ? new Date(`${value}T00:00:00.000Z`) : + value); +} +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function Default(value) { + return value; +} +// ------------------------------------------------------------------ +// Convert +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + const elements = IsArray(value) ? value : [value]; + return elements.map((element) => Visit(schema.items, references, element)); +} +function FromBigInt(schema, references, value) { + return TryConvertBigInt(value); +} +function FromBoolean(schema, references, value) { + return TryConvertBoolean(value); +} +function FromDate(schema, references, value) { + return TryConvertDate(value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromInteger(schema, references, value) { + return TryConvertInteger(value); +} +function FromIntersect(schema, references, value) { + return schema.allOf.reduce((value, schema) => Visit(schema, references, value), value); +} +function FromLiteral(schema, references, value) { + return TryConvertLiteral(schema, value); +} +function FromNull(schema, references, value) { + return TryConvertNull(value); +} +function FromNumber(schema, references, value) { + return TryConvertNumber(value); +} +// prettier-ignore +function FromObject(schema, references, value) { + if (!IsObject(value) || IsArray(value)) + return value; + for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) { + if (!HasPropertyKey(value, propertyKey)) + continue; + value[propertyKey] = Visit(schema.properties[propertyKey], references, value[propertyKey]); + } + return value; +} +function FromRecord(schema, references, value) { + const isConvertable = IsObject(value) && !IsArray(value); + if (!isConvertable) + return value; + const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[propertyKey]; + for (const [propKey, propValue] of Object.entries(value)) { + value[propKey] = Visit(property, references, propValue); + } + return value; +} +function FromRef(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromString(schema, references, value) { + return TryConvertString(value); +} +function FromSymbol(schema, references, value) { + return IsString(value) || IsNumber(value) ? Symbol(value) : value; +} +function FromThis(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +// prettier-ignore +function FromTuple(schema, references, value) { + const isConvertable = IsArray(value) && !IsUndefined(schema.items); + if (!isConvertable) + return value; + return value.map((value, index) => { + return (index < schema.items.length) + ? Visit(schema.items[index], references, value) + : value; + }); +} +function FromUndefined(schema, references, value) { + return TryConvertUndefined(value); +} +function FromUnion(schema, references, value) { + // Check if original value already matches one of the union variants + for (const subschema of schema.anyOf) { + if (Check(subschema, references, value)) { + return value; + } + } + // Attempt conversion for each variant + for (const subschema of schema.anyOf) { + const converted = Visit(subschema, references, Clone(value)); + if (!Check(subschema, references, converted)) + continue; + return converted; + } + return value; +} +function Visit(schema, references, value) { + const references_ = Pushref(schema, references); + const schema_ = schema; + switch (schema[Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'BigInt': + return FromBigInt(schema_, references_, value); + case 'Boolean': + return FromBoolean(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Integer': + return FromInteger(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Literal': + return FromLiteral(schema_, references_, value); + case 'Null': + return FromNull(schema_, references_, value); + case 'Number': + return FromNumber(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'String': + return FromString(schema_, references_, value); + case 'Symbol': + return FromSymbol(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Undefined': + return FromUndefined(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return Default(value); + } +} +/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +// prettier-ignore +export function Convert(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/convert/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/convert/index.d.mts new file mode 100644 index 00000000..1af2acf3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/convert/index.d.mts @@ -0,0 +1 @@ +export * from './convert.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/convert/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/convert/index.mjs new file mode 100644 index 00000000..1af2acf3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/convert/index.mjs @@ -0,0 +1 @@ +export * from './convert.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/create/create.d.mts b/node_modules/@sinclair/typebox/build/esm/value/create/create.d.mts new file mode 100644 index 00000000..4824a1f9 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/create/create.d.mts @@ -0,0 +1,11 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import type { TSchema } from '../../type/schema/index.mjs'; +import type { Static } from '../../type/static/index.mjs'; +export declare class ValueCreateError extends TypeBoxError { + readonly schema: TSchema; + constructor(schema: TSchema, message: string); +} +/** Creates a value from the given schema and references */ +export declare function Create(schema: T, references: TSchema[]): Static; +/** Creates a value from the given schema */ +export declare function Create(schema: T): Static; diff --git a/node_modules/@sinclair/typebox/build/esm/value/create/create.mjs b/node_modules/@sinclair/typebox/build/esm/value/create/create.mjs new file mode 100644 index 00000000..96f5cf49 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/create/create.mjs @@ -0,0 +1,468 @@ +import { HasPropertyKey } from '../guard/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { TemplateLiteralGenerate, IsTemplateLiteralFinite } from '../../type/template-literal/index.mjs'; +import { TypeRegistry } from '../../type/registry/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { IsFunction } from '../guard/guard.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueCreateError extends TypeBoxError { + constructor(schema, message) { + super(message); + this.schema = schema; + } +} +// ------------------------------------------------------------------ +// Default +// ------------------------------------------------------------------ +function FromDefault(value) { + return IsFunction(value) ? value() : Clone(value); +} +// ------------------------------------------------------------------ +// Create +// ------------------------------------------------------------------ +function FromAny(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromArgument(schema, references) { + return {}; +} +function FromArray(schema, references) { + if (schema.uniqueItems === true && !HasPropertyKey(schema, 'default')) { + throw new ValueCreateError(schema, 'Array with the uniqueItems constraint requires a default value'); + } + else if ('contains' in schema && !HasPropertyKey(schema, 'default')) { + throw new ValueCreateError(schema, 'Array with the contains constraint requires a default value'); + } + else if ('default' in schema) { + return FromDefault(schema.default); + } + else if (schema.minItems !== undefined) { + return Array.from({ length: schema.minItems }).map((item) => { + return Visit(schema.items, references); + }); + } + else { + return []; + } +} +function FromAsyncIterator(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return (async function* () { })(); + } +} +function FromBigInt(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return BigInt(0); + } +} +function FromBoolean(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return false; + } +} +function FromConstructor(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + const value = Visit(schema.returns, references); + if (typeof value === 'object' && !Array.isArray(value)) { + return class { + constructor() { + for (const [key, val] of Object.entries(value)) { + const self = this; + self[key] = val; + } + } + }; + } + else { + return class { + }; + } + } +} +function FromDate(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimumTimestamp !== undefined) { + return new Date(schema.minimumTimestamp); + } + else { + return new Date(); + } +} +function FromFunction(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return () => Visit(schema.returns, references); + } +} +function FromImport(schema, references) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions]); +} +function FromInteger(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function FromIntersect(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + // -------------------------------------------------------------- + // Note: The best we can do here is attempt to instance each + // sub type and apply through object assign. For non-object + // sub types, we just escape the assignment and just return + // the value. In the latter case, this is typically going to + // be a consequence of an illogical intersection. + // -------------------------------------------------------------- + const value = schema.allOf.reduce((acc, schema) => { + const next = Visit(schema, references); + return typeof next === 'object' ? { ...acc, ...next } : next; + }, {}); + if (!Check(schema, references, value)) + throw new ValueCreateError(schema, 'Intersect produced invalid value. Consider using a default value.'); + return value; + } +} +function FromIterator(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return (function* () { })(); + } +} +function FromLiteral(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return schema.const; + } +} +function FromNever(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'Never types cannot be created. Consider using a default value.'); + } +} +function FromNot(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'Not types must have a default value'); + } +} +function FromNull(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return null; + } +} +function FromNumber(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function FromObject(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + const required = new Set(schema.required); + const Acc = {}; + for (const [key, subschema] of Object.entries(schema.properties)) { + if (!required.has(key)) + continue; + Acc[key] = Visit(subschema, references); + } + return Acc; + } +} +function FromPromise(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Promise.resolve(Visit(schema.item, references)); + } +} +function FromRecord(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromRef(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Visit(Deref(schema, references), references); + } +} +function FromRegExp(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new ValueCreateError(schema, 'RegExp types cannot be created. Consider using a default value.'); + } +} +function FromString(schema, references) { + if (schema.pattern !== undefined) { + if (!HasPropertyKey(schema, 'default')) { + throw new ValueCreateError(schema, 'String types with patterns must specify a default value'); + } + else { + return FromDefault(schema.default); + } + } + else if (schema.format !== undefined) { + if (!HasPropertyKey(schema, 'default')) { + throw new ValueCreateError(schema, 'String types with formats must specify a default value'); + } + else { + return FromDefault(schema.default); + } + } + else { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minLength !== undefined) { + // prettier-ignore + return Array.from({ length: schema.minLength }).map(() => ' ').join(''); + } + else { + return ''; + } + } +} +function FromSymbol(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if ('value' in schema) { + return Symbol.for(schema.value); + } + else { + return Symbol(); + } +} +function FromTemplateLiteral(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + if (!IsTemplateLiteralFinite(schema)) + throw new ValueCreateError(schema, 'Can only create template literals that produce a finite variants. Consider using a default value.'); + const generated = TemplateLiteralGenerate(schema); + return generated[0]; +} +function FromThis(schema, references) { + if (recursiveDepth++ > recursiveMaxDepth) + throw new ValueCreateError(schema, 'Cannot create recursive type as it appears possibly infinite. Consider using a default.'); + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return Visit(Deref(schema, references), references); + } +} +function FromTuple(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + if (schema.items === undefined) { + return []; + } + else { + return Array.from({ length: schema.minItems }).map((_, index) => Visit(schema.items[index], references)); + } +} +function FromUndefined(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return undefined; + } +} +function FromUnion(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.anyOf.length === 0) { + throw new Error('ValueCreate.Union: Cannot create Union with zero variants'); + } + else { + return Visit(schema.anyOf[0], references); + } +} +function FromUint8Array(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else if (schema.minByteLength !== undefined) { + return new Uint8Array(schema.minByteLength); + } + else { + return new Uint8Array(0); + } +} +function FromUnknown(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return {}; + } +} +function FromVoid(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + return void 0; + } +} +function FromKind(schema, references) { + if (HasPropertyKey(schema, 'default')) { + return FromDefault(schema.default); + } + else { + throw new Error('User defined types must specify a default value'); + } +} +function Visit(schema, references) { + const references_ = Pushref(schema, references); + const schema_ = schema; + switch (schema_[Kind]) { + case 'Any': + return FromAny(schema_, references_); + case 'Argument': + return FromArgument(schema_, references_); + case 'Array': + return FromArray(schema_, references_); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_); + case 'BigInt': + return FromBigInt(schema_, references_); + case 'Boolean': + return FromBoolean(schema_, references_); + case 'Constructor': + return FromConstructor(schema_, references_); + case 'Date': + return FromDate(schema_, references_); + case 'Function': + return FromFunction(schema_, references_); + case 'Import': + return FromImport(schema_, references_); + case 'Integer': + return FromInteger(schema_, references_); + case 'Intersect': + return FromIntersect(schema_, references_); + case 'Iterator': + return FromIterator(schema_, references_); + case 'Literal': + return FromLiteral(schema_, references_); + case 'Never': + return FromNever(schema_, references_); + case 'Not': + return FromNot(schema_, references_); + case 'Null': + return FromNull(schema_, references_); + case 'Number': + return FromNumber(schema_, references_); + case 'Object': + return FromObject(schema_, references_); + case 'Promise': + return FromPromise(schema_, references_); + case 'Record': + return FromRecord(schema_, references_); + case 'Ref': + return FromRef(schema_, references_); + case 'RegExp': + return FromRegExp(schema_, references_); + case 'String': + return FromString(schema_, references_); + case 'Symbol': + return FromSymbol(schema_, references_); + case 'TemplateLiteral': + return FromTemplateLiteral(schema_, references_); + case 'This': + return FromThis(schema_, references_); + case 'Tuple': + return FromTuple(schema_, references_); + case 'Undefined': + return FromUndefined(schema_, references_); + case 'Union': + return FromUnion(schema_, references_); + case 'Uint8Array': + return FromUint8Array(schema_, references_); + case 'Unknown': + return FromUnknown(schema_, references_); + case 'Void': + return FromVoid(schema_, references_); + default: + if (!TypeRegistry.Has(schema_[Kind])) + throw new ValueCreateError(schema_, 'Unknown type'); + return FromKind(schema_, references_); + } +} +// ------------------------------------------------------------------ +// State +// ------------------------------------------------------------------ +const recursiveMaxDepth = 512; +let recursiveDepth = 0; +/** Creates a value from the given schema */ +export function Create(...args) { + recursiveDepth = 0; + return args.length === 2 ? Visit(args[0], args[1]) : Visit(args[0], []); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/create/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/create/index.d.mts new file mode 100644 index 00000000..99805a0c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/create/index.d.mts @@ -0,0 +1 @@ +export * from './create.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/create/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/create/index.mjs new file mode 100644 index 00000000..99805a0c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/create/index.mjs @@ -0,0 +1 @@ +export * from './create.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/decode/decode.d.mts b/node_modules/@sinclair/typebox/build/esm/value/decode/decode.d.mts new file mode 100644 index 00000000..a7bd6a56 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/decode/decode.d.mts @@ -0,0 +1,6 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +import type { StaticDecode } from '../../type/static/index.mjs'; +/** Decodes a value or throws if error */ +export declare function Decode, Result extends Static = Static>(schema: T, references: TSchema[], value: unknown): Result; +/** Decodes a value or throws if error */ +export declare function Decode, Result extends Static = Static>(schema: T, value: unknown): Result; diff --git a/node_modules/@sinclair/typebox/build/esm/value/decode/decode.mjs b/node_modules/@sinclair/typebox/build/esm/value/decode/decode.mjs new file mode 100644 index 00000000..ee55a98e --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/decode/decode.mjs @@ -0,0 +1,10 @@ +import { HasTransform, TransformDecode, TransformDecodeCheckError } from '../transform/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Errors } from '../../errors/index.mjs'; +/** Decodes a value or throws if error */ +export function Decode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + if (!Check(schema, references, value)) + throw new TransformDecodeCheckError(schema, value, Errors(schema, references, value).First()); + return HasTransform(schema, references) ? TransformDecode(schema, references, value) : value; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/decode/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/decode/index.d.mts new file mode 100644 index 00000000..3d9cf5df --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/decode/index.d.mts @@ -0,0 +1 @@ +export * from './decode.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/decode/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/decode/index.mjs new file mode 100644 index 00000000..3d9cf5df --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/decode/index.mjs @@ -0,0 +1 @@ +export * from './decode.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/default/default.d.mts b/node_modules/@sinclair/typebox/build/esm/value/default/default.d.mts new file mode 100644 index 00000000..b33f8ec8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/default/default.d.mts @@ -0,0 +1,5 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown; +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +export declare function Default(schema: TSchema, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/default/default.mjs b/node_modules/@sinclair/typebox/build/esm/value/default/default.mjs new file mode 100644 index 00000000..52638d84 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/default/default.mjs @@ -0,0 +1,172 @@ +import { Check } from '../check/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsArray, IsDate, IsFunction, IsObject, IsUndefined, HasPropertyKey } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// TypeGuard +// ------------------------------------------------------------------ +import { IsKind } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// ValueOrDefault +// ------------------------------------------------------------------ +function ValueOrDefault(schema, value) { + const defaultValue = HasPropertyKey(schema, 'default') ? schema.default : undefined; + const clone = IsFunction(defaultValue) ? defaultValue() : Clone(defaultValue); + return IsUndefined(value) ? clone : IsObject(value) && IsObject(clone) ? Object.assign(clone, value) : value; +} +// ------------------------------------------------------------------ +// HasDefaultProperty +// ------------------------------------------------------------------ +function HasDefaultProperty(schema) { + return IsKind(schema) && 'default' in schema; +} +// ------------------------------------------------------------------ +// Types +// ------------------------------------------------------------------ +function FromArray(schema, references, value) { + // if the value is an array, we attempt to initialize it's elements + if (IsArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = Visit(schema.items, references, value[i]); + } + return value; + } + // ... otherwise use default initialization + const defaulted = ValueOrDefault(schema, value); + if (!IsArray(defaulted)) + return defaulted; + for (let i = 0; i < defaulted.length; i++) { + defaulted[i] = Visit(schema.items, references, defaulted[i]); + } + return defaulted; +} +function FromDate(schema, references, value) { + // special case intercept for dates + return IsDate(value) ? value : ValueOrDefault(schema, value); +} +function FromImport(schema, references, value) { + const definitions = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + return Visit(target, [...references, ...definitions], value); +} +function FromIntersect(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + return schema.allOf.reduce((acc, schema) => { + const next = Visit(schema, references, defaulted); + return IsObject(next) ? { ...acc, ...next } : next; + }, {}); +} +function FromObject(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + // return defaulted + if (!IsObject(defaulted)) + return defaulted; + const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties); + // properties + for (const key of knownPropertyKeys) { + // note: we need to traverse into the object and test if the return value + // yielded a non undefined result. Here we interpret an undefined result as + // a non assignable property and continue. + const propertyValue = Visit(schema.properties[key], references, defaulted[key]); + if (IsUndefined(propertyValue)) + continue; + defaulted[key] = Visit(schema.properties[key], references, defaulted[key]); + } + // return if not additional properties + if (!HasDefaultProperty(schema.additionalProperties)) + return defaulted; + // additional properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (knownPropertyKeys.includes(key)) + continue; + defaulted[key] = Visit(schema.additionalProperties, references, defaulted[key]); + } + return defaulted; +} +function FromRecord(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + if (!IsObject(defaulted)) + return defaulted; + const additionalPropertiesSchema = schema.additionalProperties; + const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0]; + const knownPropertyKey = new RegExp(propertyKeyPattern); + // properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema))) + continue; + defaulted[key] = Visit(propertySchema, references, defaulted[key]); + } + // return if not additional properties + if (!HasDefaultProperty(additionalPropertiesSchema)) + return defaulted; + // additional properties + for (const key of Object.getOwnPropertyNames(defaulted)) { + if (knownPropertyKey.test(key)) + continue; + defaulted[key] = Visit(additionalPropertiesSchema, references, defaulted[key]); + } + return defaulted; +} +function FromRef(schema, references, value) { + return Visit(Deref(schema, references), references, ValueOrDefault(schema, value)); +} +function FromThis(schema, references, value) { + return Visit(Deref(schema, references), references, value); +} +function FromTuple(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + if (!IsArray(defaulted) || IsUndefined(schema.items)) + return defaulted; + const [items, max] = [schema.items, Math.max(schema.items.length, defaulted.length)]; + for (let i = 0; i < max; i++) { + if (i < items.length) + defaulted[i] = Visit(items[i], references, defaulted[i]); + } + return defaulted; +} +function FromUnion(schema, references, value) { + const defaulted = ValueOrDefault(schema, value); + for (const inner of schema.anyOf) { + const result = Visit(inner, references, Clone(defaulted)); + if (Check(inner, references, result)) { + return result; + } + } + return defaulted; +} +function Visit(schema, references, value) { + const references_ = Pushref(schema, references); + const schema_ = schema; + switch (schema_[Kind]) { + case 'Array': + return FromArray(schema_, references_, value); + case 'Date': + return FromDate(schema_, references_, value); + case 'Import': + return FromImport(schema_, references_, value); + case 'Intersect': + return FromIntersect(schema_, references_, value); + case 'Object': + return FromObject(schema_, references_, value); + case 'Record': + return FromRecord(schema_, references_, value); + case 'Ref': + return FromRef(schema_, references_, value); + case 'This': + return FromThis(schema_, references_, value); + case 'Tuple': + return FromTuple(schema_, references_, value); + case 'Union': + return FromUnion(schema_, references_, value); + default: + return ValueOrDefault(schema_, value); + } +} +/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */ +export function Default(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/default/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/default/index.d.mts new file mode 100644 index 00000000..ffe4f1c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/default/index.d.mts @@ -0,0 +1 @@ +export * from './default.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/default/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/default/index.mjs new file mode 100644 index 00000000..ffe4f1c4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/default/index.mjs @@ -0,0 +1 @@ +export * from './default.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/delta/delta.d.mts b/node_modules/@sinclair/typebox/build/esm/value/delta/delta.d.mts new file mode 100644 index 00000000..caed1d3a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/delta/delta.d.mts @@ -0,0 +1,32 @@ +import type { Static } from '../../type/static/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { type TLiteral } from '../../type/literal/index.mjs'; +import { type TObject } from '../../type/object/index.mjs'; +import { type TString } from '../../type/string/index.mjs'; +import { type TUnknown } from '../../type/unknown/index.mjs'; +import { type TUnion } from '../../type/union/index.mjs'; +export type Insert = Static; +export declare const Insert: TObject<{ + type: TLiteral<'insert'>; + path: TString; + value: TUnknown; +}>; +export type Update = Static; +export declare const Update: TObject<{ + type: TLiteral<'update'>; + path: TString; + value: TUnknown; +}>; +export type Delete = Static; +export declare const Delete: TObject<{ + type: TLiteral<'delete'>; + path: TString; +}>; +export type Edit = Static; +export declare const Edit: TUnion<[typeof Insert, typeof Update, typeof Delete]>; +export declare class ValueDiffError extends TypeBoxError { + readonly value: unknown; + constructor(value: unknown, message: string); +} +export declare function Diff(current: unknown, next: unknown): Edit[]; +export declare function Patch(current: unknown, edits: Edit[]): T; diff --git a/node_modules/@sinclair/typebox/build/esm/value/delta/delta.mjs b/node_modules/@sinclair/typebox/build/esm/value/delta/delta.mjs new file mode 100644 index 00000000..024b6e32 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/delta/delta.mjs @@ -0,0 +1,171 @@ +import { HasPropertyKey, IsStandardObject, IsArray, IsTypedArray, IsValueType } from '../guard/index.mjs'; +import { ValuePointer } from '../pointer/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Equal } from '../equal/equal.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { Literal } from '../../type/literal/index.mjs'; +import { Object } from '../../type/object/index.mjs'; +import { String } from '../../type/string/index.mjs'; +import { Unknown } from '../../type/unknown/index.mjs'; +import { Union } from '../../type/union/index.mjs'; +export const Insert = Object({ + type: Literal('insert'), + path: String(), + value: Unknown(), +}); +export const Update = Object({ + type: Literal('update'), + path: String(), + value: Unknown(), +}); +export const Delete = Object({ + type: Literal('delete'), + path: String(), +}); +export const Edit = Union([Insert, Update, Delete]); +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueDiffError extends TypeBoxError { + constructor(value, message) { + super(message); + this.value = value; + } +} +// ------------------------------------------------------------------ +// Command Factory +// ------------------------------------------------------------------ +function CreateUpdate(path, value) { + return { type: 'update', path, value }; +} +function CreateInsert(path, value) { + return { type: 'insert', path, value }; +} +function CreateDelete(path) { + return { type: 'delete', path }; +} +// ------------------------------------------------------------------ +// AssertDiffable +// ------------------------------------------------------------------ +function AssertDiffable(value) { + if (globalThis.Object.getOwnPropertySymbols(value).length > 0) + throw new ValueDiffError(value, 'Cannot diff objects with symbols'); +} +// ------------------------------------------------------------------ +// Diffing Generators +// ------------------------------------------------------------------ +function* ObjectType(path, current, next) { + AssertDiffable(current); + AssertDiffable(next); + if (!IsStandardObject(next)) + return yield CreateUpdate(path, next); + const currentKeys = globalThis.Object.getOwnPropertyNames(current); + const nextKeys = globalThis.Object.getOwnPropertyNames(next); + // ---------------------------------------------------------------- + // inserts + // ---------------------------------------------------------------- + for (const key of nextKeys) { + if (HasPropertyKey(current, key)) + continue; + yield CreateInsert(`${path}/${key}`, next[key]); + } + // ---------------------------------------------------------------- + // updates + // ---------------------------------------------------------------- + for (const key of currentKeys) { + if (!HasPropertyKey(next, key)) + continue; + if (Equal(current, next)) + continue; + yield* Visit(`${path}/${key}`, current[key], next[key]); + } + // ---------------------------------------------------------------- + // deletes + // ---------------------------------------------------------------- + for (const key of currentKeys) { + if (HasPropertyKey(next, key)) + continue; + yield CreateDelete(`${path}/${key}`); + } +} +function* ArrayType(path, current, next) { + if (!IsArray(next)) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } + for (let i = 0; i < next.length; i++) { + if (i < current.length) + continue; + yield CreateInsert(`${path}/${i}`, next[i]); + } + for (let i = current.length - 1; i >= 0; i--) { + if (i < next.length) + continue; + yield CreateDelete(`${path}/${i}`); + } +} +function* TypedArrayType(path, current, next) { + if (!IsTypedArray(next) || current.length !== next.length || globalThis.Object.getPrototypeOf(current).constructor.name !== globalThis.Object.getPrototypeOf(next).constructor.name) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } +} +function* ValueType(path, current, next) { + if (current === next) + return; + yield CreateUpdate(path, next); +} +function* Visit(path, current, next) { + if (IsStandardObject(current)) + return yield* ObjectType(path, current, next); + if (IsArray(current)) + return yield* ArrayType(path, current, next); + if (IsTypedArray(current)) + return yield* TypedArrayType(path, current, next); + if (IsValueType(current)) + return yield* ValueType(path, current, next); + throw new ValueDiffError(current, 'Unable to diff value'); +} +// ------------------------------------------------------------------ +// Diff +// ------------------------------------------------------------------ +export function Diff(current, next) { + return [...Visit('', current, next)]; +} +// ------------------------------------------------------------------ +// Patch +// ------------------------------------------------------------------ +function IsRootUpdate(edits) { + return edits.length > 0 && edits[0].path === '' && edits[0].type === 'update'; +} +function IsIdentity(edits) { + return edits.length === 0; +} +export function Patch(current, edits) { + if (IsRootUpdate(edits)) { + return Clone(edits[0].value); + } + if (IsIdentity(edits)) { + return Clone(current); + } + const clone = Clone(current); + for (const edit of edits) { + switch (edit.type) { + case 'insert': { + ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'update': { + ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'delete': { + ValuePointer.Delete(clone, edit.path); + break; + } + } + } + return clone; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/delta/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/delta/index.d.mts new file mode 100644 index 00000000..bad11edd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/delta/index.d.mts @@ -0,0 +1 @@ +export * from './delta.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/delta/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/delta/index.mjs new file mode 100644 index 00000000..bad11edd --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/delta/index.mjs @@ -0,0 +1 @@ +export * from './delta.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/deref/deref.d.mts b/node_modules/@sinclair/typebox/build/esm/value/deref/deref.d.mts new file mode 100644 index 00000000..7b54e050 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/deref/deref.d.mts @@ -0,0 +1,12 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +import type { TRef } from '../../type/ref/index.mjs'; +import type { TThis } from '../../type/recursive/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +export declare class TypeDereferenceError extends TypeBoxError { + readonly schema: TRef | TThis; + constructor(schema: TRef | TThis); +} +/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */ +export declare function Pushref(schema: TSchema, references: TSchema[]): TSchema[]; +/** `[Internal]` Dereferences a schema from the references array or throws if not found */ +export declare function Deref(schema: TSchema, references: TSchema[]): TSchema; diff --git a/node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs b/node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs new file mode 100644 index 00000000..5de7851f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs @@ -0,0 +1,29 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +import { IsString } from '../guard/guard.mjs'; +export class TypeDereferenceError extends TypeBoxError { + constructor(schema) { + super(`Unable to dereference schema with $id '${schema.$ref}'`); + this.schema = schema; + } +} +function Resolve(schema, references) { + const target = references.find((target) => target.$id === schema.$ref); + if (target === undefined) + throw new TypeDereferenceError(schema); + return Deref(target, references); +} +/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */ +export function Pushref(schema, references) { + if (!IsString(schema.$id) || references.some((target) => target.$id === schema.$id)) + return references; + references.push(schema); + return references; +} +/** `[Internal]` Dereferences a schema from the references array or throws if not found */ +export function Deref(schema, references) { + // prettier-ignore + return (schema[Kind] === 'This' || schema[Kind] === 'Ref') + ? Resolve(schema, references) + : schema; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/deref/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/deref/index.d.mts new file mode 100644 index 00000000..91ea9f67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/deref/index.d.mts @@ -0,0 +1 @@ +export * from './deref.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/deref/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/deref/index.mjs new file mode 100644 index 00000000..91ea9f67 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/deref/index.mjs @@ -0,0 +1 @@ +export * from './deref.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/encode/encode.d.mts b/node_modules/@sinclair/typebox/build/esm/value/encode/encode.d.mts new file mode 100644 index 00000000..8a879236 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/encode/encode.d.mts @@ -0,0 +1,6 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +import type { StaticEncode } from '../../type/static/index.mjs'; +/** Encodes a value or throws if error */ +export declare function Encode, Result extends Static = Static>(schema: T, references: TSchema[], value: unknown): Result; +/** Encodes a value or throws if error */ +export declare function Encode, Result extends Static = Static>(schema: T, value: unknown): Result; diff --git a/node_modules/@sinclair/typebox/build/esm/value/encode/encode.mjs b/node_modules/@sinclair/typebox/build/esm/value/encode/encode.mjs new file mode 100644 index 00000000..a16198a0 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/encode/encode.mjs @@ -0,0 +1,11 @@ +import { HasTransform, TransformEncode, TransformEncodeCheckError } from '../transform/index.mjs'; +import { Check } from '../check/index.mjs'; +import { Errors } from '../../errors/index.mjs'; +/** Encodes a value or throws if error */ +export function Encode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + const encoded = HasTransform(schema, references) ? TransformEncode(schema, references, value) : value; + if (!Check(schema, references, encoded)) + throw new TransformEncodeCheckError(schema, encoded, Errors(schema, references, encoded).First()); + return encoded; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/encode/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/encode/index.d.mts new file mode 100644 index 00000000..6a2975a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/encode/index.d.mts @@ -0,0 +1 @@ +export * from './encode.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/encode/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/encode/index.mjs new file mode 100644 index 00000000..6a2975a4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/encode/index.mjs @@ -0,0 +1 @@ +export * from './encode.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/equal/equal.d.mts b/node_modules/@sinclair/typebox/build/esm/value/equal/equal.d.mts new file mode 100644 index 00000000..d1095c4c --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/equal/equal.d.mts @@ -0,0 +1,2 @@ +/** Returns true if the left value deep-equals the right */ +export declare function Equal(left: T, right: unknown): right is T; diff --git a/node_modules/@sinclair/typebox/build/esm/value/equal/equal.mjs b/node_modules/@sinclair/typebox/build/esm/value/equal/equal.mjs new file mode 100644 index 00000000..cfcb8ab3 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/equal/equal.mjs @@ -0,0 +1,46 @@ +import { IsObject, IsDate, IsArray, IsTypedArray, IsValueType } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// Equality Checks +// ------------------------------------------------------------------ +function ObjectType(left, right) { + if (!IsObject(right)) + return false; + const leftKeys = [...Object.keys(left), ...Object.getOwnPropertySymbols(left)]; + const rightKeys = [...Object.keys(right), ...Object.getOwnPropertySymbols(right)]; + if (leftKeys.length !== rightKeys.length) + return false; + return leftKeys.every((key) => Equal(left[key], right[key])); +} +function DateType(left, right) { + return IsDate(right) && left.getTime() === right.getTime(); +} +function ArrayType(left, right) { + if (!IsArray(right) || left.length !== right.length) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function TypedArrayType(left, right) { + if (!IsTypedArray(right) || left.length !== right.length || Object.getPrototypeOf(left).constructor.name !== Object.getPrototypeOf(right).constructor.name) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function ValueType(left, right) { + return left === right; +} +// ------------------------------------------------------------------ +// Equal +// ------------------------------------------------------------------ +/** Returns true if the left value deep-equals the right */ +export function Equal(left, right) { + if (IsDate(left)) + return DateType(left, right); + if (IsTypedArray(left)) + return TypedArrayType(left, right); + if (IsArray(left)) + return ArrayType(left, right); + if (IsObject(left)) + return ObjectType(left, right); + if (IsValueType(left)) + return ValueType(left, right); + throw new Error('ValueEquals: Unable to compare value'); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/equal/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/equal/index.d.mts new file mode 100644 index 00000000..a3cb0eea --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/equal/index.d.mts @@ -0,0 +1 @@ +export * from './equal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/equal/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/equal/index.mjs new file mode 100644 index 00000000..a3cb0eea --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/equal/index.mjs @@ -0,0 +1 @@ +export * from './equal.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/guard/guard.d.mts b/node_modules/@sinclair/typebox/build/esm/value/guard/guard.d.mts new file mode 100644 index 00000000..0a5f1151 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/guard/guard.d.mts @@ -0,0 +1,74 @@ +export type ObjectType = Record; +export type ArrayType = unknown[]; +export type ValueType = null | undefined | symbol | bigint | number | boolean | string; +export type TypedArrayType = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +/** Returns true if this value is an async iterator */ +export declare function IsAsyncIterator(value: unknown): value is AsyncIterableIterator; +/** Returns true if this value is an iterator */ +export declare function IsIterator(value: unknown): value is IterableIterator; +/** Returns true if this value is not an instance of a class */ +export declare function IsStandardObject(value: unknown): value is ObjectType; +/** Returns true if this value is an instance of a class */ +export declare function IsInstanceObject(value: unknown): value is ObjectType; +/** Returns true if this value is a Promise */ +export declare function IsPromise(value: unknown): value is Promise; +/** Returns true if this value is a Date */ +export declare function IsDate(value: unknown): value is Date; +/** Returns true if this value is an instance of Map */ +export declare function IsMap(value: unknown): value is Map; +/** Returns true if this value is an instance of Set */ +export declare function IsSet(value: unknown): value is Set; +/** Returns true if this value is RegExp */ +export declare function IsRegExp(value: unknown): value is RegExp; +/** Returns true if this value is a typed array */ +export declare function IsTypedArray(value: unknown): value is TypedArrayType; +/** Returns true if the value is a Int8Array */ +export declare function IsInt8Array(value: unknown): value is Int8Array; +/** Returns true if the value is a Uint8Array */ +export declare function IsUint8Array(value: unknown): value is Uint8Array; +/** Returns true if the value is a Uint8ClampedArray */ +export declare function IsUint8ClampedArray(value: unknown): value is Uint8ClampedArray; +/** Returns true if the value is a Int16Array */ +export declare function IsInt16Array(value: unknown): value is Int16Array; +/** Returns true if the value is a Uint16Array */ +export declare function IsUint16Array(value: unknown): value is Uint16Array; +/** Returns true if the value is a Int32Array */ +export declare function IsInt32Array(value: unknown): value is Int32Array; +/** Returns true if the value is a Uint32Array */ +export declare function IsUint32Array(value: unknown): value is Uint32Array; +/** Returns true if the value is a Float32Array */ +export declare function IsFloat32Array(value: unknown): value is Float32Array; +/** Returns true if the value is a Float64Array */ +export declare function IsFloat64Array(value: unknown): value is Float64Array; +/** Returns true if the value is a BigInt64Array */ +export declare function IsBigInt64Array(value: unknown): value is BigInt64Array; +/** Returns true if the value is a BigUint64Array */ +export declare function IsBigUint64Array(value: unknown): value is BigUint64Array; +/** Returns true if this value has this property key */ +export declare function HasPropertyKey(value: Record, key: K): value is Record & { + [_ in K]: unknown; +}; +/** Returns true of this value is an object type */ +export declare function IsObject(value: unknown): value is ObjectType; +/** Returns true if this value is an array, but not a typed array */ +export declare function IsArray(value: unknown): value is ArrayType; +/** Returns true if this value is an undefined */ +export declare function IsUndefined(value: unknown): value is undefined; +/** Returns true if this value is an null */ +export declare function IsNull(value: unknown): value is null; +/** Returns true if this value is an boolean */ +export declare function IsBoolean(value: unknown): value is boolean; +/** Returns true if this value is an number */ +export declare function IsNumber(value: unknown): value is number; +/** Returns true if this value is an integer */ +export declare function IsInteger(value: unknown): value is number; +/** Returns true if this value is bigint */ +export declare function IsBigInt(value: unknown): value is bigint; +/** Returns true if this value is string */ +export declare function IsString(value: unknown): value is string; +/** Returns true if this value is a function */ +export declare function IsFunction(value: unknown): value is Function; +/** Returns true if this value is a symbol */ +export declare function IsSymbol(value: unknown): value is symbol; +/** Returns true if this value is a value type such as number, string, boolean */ +export declare function IsValueType(value: unknown): value is ValueType; diff --git a/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs b/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs new file mode 100644 index 00000000..7364cf77 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs @@ -0,0 +1,158 @@ +// -------------------------------------------------------------------------- +// Iterators +// -------------------------------------------------------------------------- +/** Returns true if this value is an async iterator */ +export function IsAsyncIterator(value) { + return IsObject(value) && globalThis.Symbol.asyncIterator in value; +} +/** Returns true if this value is an iterator */ +export function IsIterator(value) { + return IsObject(value) && globalThis.Symbol.iterator in value; +} +// -------------------------------------------------------------------------- +// Object Instances +// -------------------------------------------------------------------------- +/** Returns true if this value is not an instance of a class */ +export function IsStandardObject(value) { + return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null); +} +/** Returns true if this value is an instance of a class */ +export function IsInstanceObject(value) { + return IsObject(value) && !IsArray(value) && IsFunction(value.constructor) && value.constructor.name !== 'Object'; +} +// -------------------------------------------------------------------------- +// JavaScript +// -------------------------------------------------------------------------- +/** Returns true if this value is a Promise */ +export function IsPromise(value) { + return value instanceof globalThis.Promise; +} +/** Returns true if this value is a Date */ +export function IsDate(value) { + return value instanceof Date && globalThis.Number.isFinite(value.getTime()); +} +/** Returns true if this value is an instance of Map */ +export function IsMap(value) { + return value instanceof globalThis.Map; +} +/** Returns true if this value is an instance of Set */ +export function IsSet(value) { + return value instanceof globalThis.Set; +} +/** Returns true if this value is RegExp */ +export function IsRegExp(value) { + return value instanceof globalThis.RegExp; +} +/** Returns true if this value is a typed array */ +export function IsTypedArray(value) { + return globalThis.ArrayBuffer.isView(value); +} +/** Returns true if the value is a Int8Array */ +export function IsInt8Array(value) { + return value instanceof globalThis.Int8Array; +} +/** Returns true if the value is a Uint8Array */ +export function IsUint8Array(value) { + return value instanceof globalThis.Uint8Array; +} +/** Returns true if the value is a Uint8ClampedArray */ +export function IsUint8ClampedArray(value) { + return value instanceof globalThis.Uint8ClampedArray; +} +/** Returns true if the value is a Int16Array */ +export function IsInt16Array(value) { + return value instanceof globalThis.Int16Array; +} +/** Returns true if the value is a Uint16Array */ +export function IsUint16Array(value) { + return value instanceof globalThis.Uint16Array; +} +/** Returns true if the value is a Int32Array */ +export function IsInt32Array(value) { + return value instanceof globalThis.Int32Array; +} +/** Returns true if the value is a Uint32Array */ +export function IsUint32Array(value) { + return value instanceof globalThis.Uint32Array; +} +/** Returns true if the value is a Float32Array */ +export function IsFloat32Array(value) { + return value instanceof globalThis.Float32Array; +} +/** Returns true if the value is a Float64Array */ +export function IsFloat64Array(value) { + return value instanceof globalThis.Float64Array; +} +/** Returns true if the value is a BigInt64Array */ +export function IsBigInt64Array(value) { + return value instanceof globalThis.BigInt64Array; +} +/** Returns true if the value is a BigUint64Array */ +export function IsBigUint64Array(value) { + return value instanceof globalThis.BigUint64Array; +} +// -------------------------------------------------------------------------- +// PropertyKey +// -------------------------------------------------------------------------- +/** Returns true if this value has this property key */ +export function HasPropertyKey(value, key) { + return key in value; +} +// -------------------------------------------------------------------------- +// Standard +// -------------------------------------------------------------------------- +/** Returns true of this value is an object type */ +export function IsObject(value) { + return value !== null && typeof value === 'object'; +} +/** Returns true if this value is an array, but not a typed array */ +export function IsArray(value) { + return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value); +} +/** Returns true if this value is an undefined */ +export function IsUndefined(value) { + return value === undefined; +} +/** Returns true if this value is an null */ +export function IsNull(value) { + return value === null; +} +/** Returns true if this value is an boolean */ +export function IsBoolean(value) { + return typeof value === 'boolean'; +} +/** Returns true if this value is an number */ +export function IsNumber(value) { + return typeof value === 'number'; +} +/** Returns true if this value is an integer */ +export function IsInteger(value) { + return globalThis.Number.isInteger(value); +} +/** Returns true if this value is bigint */ +export function IsBigInt(value) { + return typeof value === 'bigint'; +} +/** Returns true if this value is string */ +export function IsString(value) { + return typeof value === 'string'; +} +/** Returns true if this value is a function */ +export function IsFunction(value) { + return typeof value === 'function'; +} +/** Returns true if this value is a symbol */ +export function IsSymbol(value) { + return typeof value === 'symbol'; +} +/** Returns true if this value is a value type such as number, string, boolean */ +export function IsValueType(value) { + // prettier-ignore + return (IsBigInt(value) || + IsBoolean(value) || + IsNull(value) || + IsNumber(value) || + IsString(value) || + IsSymbol(value) || + IsUndefined(value)); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/guard/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/guard/index.d.mts new file mode 100644 index 00000000..c17e7ce4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/guard/index.d.mts @@ -0,0 +1 @@ +export * from './guard.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/guard/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/guard/index.mjs new file mode 100644 index 00000000..c17e7ce4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/guard/index.mjs @@ -0,0 +1 @@ +export * from './guard.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/hash/hash.d.mts b/node_modules/@sinclair/typebox/build/esm/value/hash/hash.d.mts new file mode 100644 index 00000000..9609e22a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/hash/hash.d.mts @@ -0,0 +1,7 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +export declare class ValueHashError extends TypeBoxError { + readonly value: unknown; + constructor(value: unknown); +} +/** Creates a FNV1A-64 non cryptographic hash of the given value */ +export declare function Hash(value: unknown): bigint; diff --git a/node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs b/node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs new file mode 100644 index 00000000..7cc9c491 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs @@ -0,0 +1,146 @@ +import { IsArray, IsBoolean, IsBigInt, IsDate, IsNull, IsNumber, IsObject, IsString, IsSymbol, IsUint8Array, IsUndefined } from '../guard/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueHashError extends TypeBoxError { + constructor(value) { + super(`Unable to hash value`); + this.value = value; + } +} +// ------------------------------------------------------------------ +// ByteMarker +// ------------------------------------------------------------------ +var ByteMarker; +(function (ByteMarker) { + ByteMarker[ByteMarker["Undefined"] = 0] = "Undefined"; + ByteMarker[ByteMarker["Null"] = 1] = "Null"; + ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean"; + ByteMarker[ByteMarker["Number"] = 3] = "Number"; + ByteMarker[ByteMarker["String"] = 4] = "String"; + ByteMarker[ByteMarker["Object"] = 5] = "Object"; + ByteMarker[ByteMarker["Array"] = 6] = "Array"; + ByteMarker[ByteMarker["Date"] = 7] = "Date"; + ByteMarker[ByteMarker["Uint8Array"] = 8] = "Uint8Array"; + ByteMarker[ByteMarker["Symbol"] = 9] = "Symbol"; + ByteMarker[ByteMarker["BigInt"] = 10] = "BigInt"; +})(ByteMarker || (ByteMarker = {})); +// ------------------------------------------------------------------ +// State +// ------------------------------------------------------------------ +let Accumulator = BigInt('14695981039346656037'); +const [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)]; +const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i)); +const F64 = new Float64Array(1); +const F64In = new DataView(F64.buffer); +const F64Out = new Uint8Array(F64.buffer); +// ------------------------------------------------------------------ +// NumberToBytes +// ------------------------------------------------------------------ +function* NumberToBytes(value) { + const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8); + for (let i = 0; i < byteCount; i++) { + yield (value >> (8 * (byteCount - 1 - i))) & 0xff; + } +} +// ------------------------------------------------------------------ +// Hashing Functions +// ------------------------------------------------------------------ +function ArrayType(value) { + FNV1A64(ByteMarker.Array); + for (const item of value) { + Visit(item); + } +} +function BooleanType(value) { + FNV1A64(ByteMarker.Boolean); + FNV1A64(value ? 1 : 0); +} +function BigIntType(value) { + FNV1A64(ByteMarker.BigInt); + F64In.setBigInt64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function DateType(value) { + FNV1A64(ByteMarker.Date); + Visit(value.getTime()); +} +function NullType(value) { + FNV1A64(ByteMarker.Null); +} +function NumberType(value) { + FNV1A64(ByteMarker.Number); + F64In.setFloat64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function ObjectType(value) { + FNV1A64(ByteMarker.Object); + for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) { + Visit(key); + Visit(value[key]); + } +} +function StringType(value) { + FNV1A64(ByteMarker.String); + for (let i = 0; i < value.length; i++) { + for (const byte of NumberToBytes(value.charCodeAt(i))) { + FNV1A64(byte); + } + } +} +function SymbolType(value) { + FNV1A64(ByteMarker.Symbol); + Visit(value.description); +} +function Uint8ArrayType(value) { + FNV1A64(ByteMarker.Uint8Array); + for (let i = 0; i < value.length; i++) { + FNV1A64(value[i]); + } +} +function UndefinedType(value) { + return FNV1A64(ByteMarker.Undefined); +} +function Visit(value) { + if (IsArray(value)) + return ArrayType(value); + if (IsBoolean(value)) + return BooleanType(value); + if (IsBigInt(value)) + return BigIntType(value); + if (IsDate(value)) + return DateType(value); + if (IsNull(value)) + return NullType(value); + if (IsNumber(value)) + return NumberType(value); + if (IsObject(value)) + return ObjectType(value); + if (IsString(value)) + return StringType(value); + if (IsSymbol(value)) + return SymbolType(value); + if (IsUint8Array(value)) + return Uint8ArrayType(value); + if (IsUndefined(value)) + return UndefinedType(value); + throw new ValueHashError(value); +} +function FNV1A64(byte) { + Accumulator = Accumulator ^ Bytes[byte]; + Accumulator = (Accumulator * Prime) % Size; +} +// ------------------------------------------------------------------ +// Hash +// ------------------------------------------------------------------ +/** Creates a FNV1A-64 non cryptographic hash of the given value */ +export function Hash(value) { + Accumulator = BigInt('14695981039346656037'); + Visit(value); + return Accumulator; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/hash/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/hash/index.d.mts new file mode 100644 index 00000000..cb66652b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/hash/index.d.mts @@ -0,0 +1 @@ +export * from './hash.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/hash/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/hash/index.mjs new file mode 100644 index 00000000..cb66652b --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/hash/index.mjs @@ -0,0 +1 @@ +export * from './hash.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/index.d.mts new file mode 100644 index 00000000..6b7d7fb5 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/index.d.mts @@ -0,0 +1,20 @@ +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index.mjs'; +export * from './guard/index.mjs'; +export * from './assert/index.mjs'; +export * from './cast/index.mjs'; +export * from './check/index.mjs'; +export * from './clean/index.mjs'; +export * from './clone/index.mjs'; +export * from './convert/index.mjs'; +export * from './create/index.mjs'; +export * from './decode/index.mjs'; +export * from './default/index.mjs'; +export * from './delta/index.mjs'; +export * from './encode/index.mjs'; +export * from './equal/index.mjs'; +export * from './hash/index.mjs'; +export * from './mutate/index.mjs'; +export * from './parse/index.mjs'; +export * from './pointer/index.mjs'; +export * from './transform/index.mjs'; +export { Value } from './value/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/index.mjs new file mode 100644 index 00000000..c3aaa739 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/index.mjs @@ -0,0 +1,32 @@ +// ------------------------------------------------------------------ +// Errors (re-export) +// ------------------------------------------------------------------ +export { ValueErrorType, ValueErrorIterator } from '../errors/index.mjs'; +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +export * from './guard/index.mjs'; +// ------------------------------------------------------------------ +// Operators +// ------------------------------------------------------------------ +export * from './assert/index.mjs'; +export * from './cast/index.mjs'; +export * from './check/index.mjs'; +export * from './clean/index.mjs'; +export * from './clone/index.mjs'; +export * from './convert/index.mjs'; +export * from './create/index.mjs'; +export * from './decode/index.mjs'; +export * from './default/index.mjs'; +export * from './delta/index.mjs'; +export * from './encode/index.mjs'; +export * from './equal/index.mjs'; +export * from './hash/index.mjs'; +export * from './mutate/index.mjs'; +export * from './parse/index.mjs'; +export * from './pointer/index.mjs'; +export * from './transform/index.mjs'; +// ------------------------------------------------------------------ +// Namespace +// ------------------------------------------------------------------ +export { Value } from './value/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/mutate/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/mutate/index.d.mts new file mode 100644 index 00000000..7e5a7ddf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/mutate/index.d.mts @@ -0,0 +1 @@ +export * from './mutate.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/mutate/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/mutate/index.mjs new file mode 100644 index 00000000..7e5a7ddf --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/mutate/index.mjs @@ -0,0 +1 @@ +export * from './mutate.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.d.mts b/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.d.mts new file mode 100644 index 00000000..30a322dc --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.d.mts @@ -0,0 +1,9 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +export declare class ValueMutateError extends TypeBoxError { + constructor(message: string); +} +export type Mutable = { + [key: string]: unknown; +} | unknown[]; +/** `[Mutable]` Performs a deep mutable value assignment while retaining internal references */ +export declare function Mutate(current: Mutable, next: Mutable): void; diff --git a/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.mjs b/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.mjs new file mode 100644 index 00000000..60eeb2c7 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.mjs @@ -0,0 +1,98 @@ +import { IsObject, IsArray, IsTypedArray, IsValueType } from '../guard/index.mjs'; +import { ValuePointer } from '../pointer/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +// ------------------------------------------------------------------ +// IsStandardObject +// ------------------------------------------------------------------ +function IsStandardObject(value) { + return IsObject(value) && !IsArray(value); +} +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValueMutateError extends TypeBoxError { + constructor(message) { + super(message); + } +} +function ObjectType(root, path, current, next) { + if (!IsStandardObject(current)) { + ValuePointer.Set(root, path, Clone(next)); + } + else { + const currentKeys = Object.getOwnPropertyNames(current); + const nextKeys = Object.getOwnPropertyNames(next); + for (const currentKey of currentKeys) { + if (!nextKeys.includes(currentKey)) { + delete current[currentKey]; + } + } + for (const nextKey of nextKeys) { + if (!currentKeys.includes(nextKey)) { + current[nextKey] = null; + } + } + for (const nextKey of nextKeys) { + Visit(root, `${path}/${nextKey}`, current[nextKey], next[nextKey]); + } + } +} +function ArrayType(root, path, current, next) { + if (!IsArray(current)) { + ValuePointer.Set(root, path, Clone(next)); + } + else { + for (let index = 0; index < next.length; index++) { + Visit(root, `${path}/${index}`, current[index], next[index]); + } + current.splice(next.length); + } +} +function TypedArrayType(root, path, current, next) { + if (IsTypedArray(current) && current.length === next.length) { + for (let i = 0; i < current.length; i++) { + current[i] = next[i]; + } + } + else { + ValuePointer.Set(root, path, Clone(next)); + } +} +function ValueType(root, path, current, next) { + if (current === next) + return; + ValuePointer.Set(root, path, next); +} +function Visit(root, path, current, next) { + if (IsArray(next)) + return ArrayType(root, path, current, next); + if (IsTypedArray(next)) + return TypedArrayType(root, path, current, next); + if (IsStandardObject(next)) + return ObjectType(root, path, current, next); + if (IsValueType(next)) + return ValueType(root, path, current, next); +} +// ------------------------------------------------------------------ +// IsNonMutableValue +// ------------------------------------------------------------------ +function IsNonMutableValue(value) { + return IsTypedArray(value) || IsValueType(value); +} +function IsMismatchedValue(current, next) { + // prettier-ignore + return ((IsStandardObject(current) && IsArray(next)) || + (IsArray(current) && IsStandardObject(next))); +} +// ------------------------------------------------------------------ +// Mutate +// ------------------------------------------------------------------ +/** `[Mutable]` Performs a deep mutable value assignment while retaining internal references */ +export function Mutate(current, next) { + if (IsNonMutableValue(current) || IsNonMutableValue(next)) + throw new ValueMutateError('Only object and array types can be mutated at the root level'); + if (IsMismatchedValue(current, next)) + throw new ValueMutateError('Cannot assign due type mismatch of assignable values'); + Visit(current, '', current, next); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/parse/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/parse/index.d.mts new file mode 100644 index 00000000..1fa0e7c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/parse/index.d.mts @@ -0,0 +1 @@ +export * from './parse.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/parse/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/parse/index.mjs new file mode 100644 index 00000000..1fa0e7c8 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/parse/index.mjs @@ -0,0 +1 @@ +export * from './parse.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/parse/parse.d.mts b/node_modules/@sinclair/typebox/build/esm/value/parse/parse.d.mts new file mode 100644 index 00000000..2c4d927d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/parse/parse.d.mts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import { TSchema } from '../../type/schema/index.mjs'; +import { StaticDecode } from '../../type/static/index.mjs'; +export declare class ParseError extends TypeBoxError { + constructor(message: string); +} +export type TParseOperation = 'Assert' | 'Cast' | 'Clean' | 'Clone' | 'Convert' | 'Decode' | 'Default' | 'Encode' | ({} & string); +export type TParseFunction = (type: TSchema, references: TSchema[], value: unknown) => unknown; +export declare namespace ParseRegistry { + function Delete(key: string): void; + function Set(key: string, callback: TParseFunction): void; + function Get(key: string): TParseFunction | undefined; +} +export declare const ParseDefault: readonly ["Clone", "Clean", "Default", "Convert", "Assert", "Decode"]; +/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */ +export declare function Parse, Result extends Output = Output>(schema: Type, references: TSchema[], value: unknown): Result; +/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */ +export declare function Parse, Result extends Output = Output>(schema: Type, value: unknown): Result; +/** Parses a value using the specified operations. */ +export declare function Parse(operations: TParseOperation[], schema: Type, references: TSchema[], value: unknown): unknown; +/** Parses a value using the specified operations. */ +export declare function Parse(operations: TParseOperation[], schema: Type, value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/parse/parse.mjs b/node_modules/@sinclair/typebox/build/esm/value/parse/parse.mjs new file mode 100644 index 00000000..05c7df20 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/parse/parse.mjs @@ -0,0 +1,81 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import { TransformDecode, TransformEncode, HasTransform } from '../transform/index.mjs'; +import { Assert } from '../assert/index.mjs'; +import { Cast } from '../cast/index.mjs'; +import { Clean } from '../clean/index.mjs'; +import { Clone } from '../clone/index.mjs'; +import { Convert } from '../convert/index.mjs'; +import { Default } from '../default/index.mjs'; +// ------------------------------------------------------------------ +// Guards +// ------------------------------------------------------------------ +import { IsArray, IsUndefined } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// Error +// ------------------------------------------------------------------ +export class ParseError extends TypeBoxError { + constructor(message) { + super(message); + } +} +// prettier-ignore +export var ParseRegistry; +(function (ParseRegistry) { + const registry = new Map([ + ['Assert', (type, references, value) => { Assert(type, references, value); return value; }], + ['Cast', (type, references, value) => Cast(type, references, value)], + ['Clean', (type, references, value) => Clean(type, references, value)], + ['Clone', (_type, _references, value) => Clone(value)], + ['Convert', (type, references, value) => Convert(type, references, value)], + ['Decode', (type, references, value) => (HasTransform(type, references) ? TransformDecode(type, references, value) : value)], + ['Default', (type, references, value) => Default(type, references, value)], + ['Encode', (type, references, value) => (HasTransform(type, references) ? TransformEncode(type, references, value) : value)], + ]); + // Deletes an entry from the registry + function Delete(key) { + registry.delete(key); + } + ParseRegistry.Delete = Delete; + // Sets an entry in the registry + function Set(key, callback) { + registry.set(key, callback); + } + ParseRegistry.Set = Set; + // Gets an entry in the registry + function Get(key) { + return registry.get(key); + } + ParseRegistry.Get = Get; +})(ParseRegistry || (ParseRegistry = {})); +// ------------------------------------------------------------------ +// Default Parse Pipeline +// ------------------------------------------------------------------ +// prettier-ignore +export const ParseDefault = [ + 'Clone', + 'Clean', + 'Default', + 'Convert', + 'Assert', + 'Decode' +]; +// ------------------------------------------------------------------ +// ParseValue +// ------------------------------------------------------------------ +function ParseValue(operations, type, references, value) { + return operations.reduce((value, operationKey) => { + const operation = ParseRegistry.Get(operationKey); + if (IsUndefined(operation)) + throw new ParseError(`Unable to find Parse operation '${operationKey}'`); + return operation(type, references, value); + }, value); +} +/** Parses a value */ +export function Parse(...args) { + // prettier-ignore + const [operations, schema, references, value] = (args.length === 4 ? [args[0], args[1], args[2], args[3]] : + args.length === 3 ? IsArray(args[0]) ? [args[0], args[1], [], args[2]] : [ParseDefault, args[0], args[1], args[2]] : + args.length === 2 ? [ParseDefault, args[0], [], args[1]] : + (() => { throw new ParseError('Invalid Arguments'); })()); + return ParseValue(operations, schema, references, value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/pointer/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/pointer/index.d.mts new file mode 100644 index 00000000..0d359eb4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/pointer/index.d.mts @@ -0,0 +1 @@ +export * as ValuePointer from './pointer.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/pointer/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/pointer/index.mjs new file mode 100644 index 00000000..0d359eb4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/pointer/index.mjs @@ -0,0 +1 @@ +export * as ValuePointer from './pointer.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.d.mts b/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.d.mts new file mode 100644 index 00000000..90031f71 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.d.mts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +export declare class ValuePointerRootSetError extends TypeBoxError { + readonly value: unknown; + readonly path: string; + readonly update: unknown; + constructor(value: unknown, path: string, update: unknown); +} +export declare class ValuePointerRootDeleteError extends TypeBoxError { + readonly value: unknown; + readonly path: string; + constructor(value: unknown, path: string); +} +/** Formats the given pointer into navigable key components */ +export declare function Format(pointer: string): IterableIterator; +/** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ +export declare function Set(value: any, pointer: string, update: unknown): void; +/** Deletes a value at the given pointer */ +export declare function Delete(value: any, pointer: string): void; +/** Returns true if a value exists at the given pointer */ +export declare function Has(value: any, pointer: string): boolean; +/** Gets the value at the given pointer */ +export declare function Get(value: any, pointer: string): any; diff --git a/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs b/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs new file mode 100644 index 00000000..67784d23 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs @@ -0,0 +1,115 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +export class ValuePointerRootSetError extends TypeBoxError { + constructor(value, path, update) { + super('Cannot set root value'); + this.value = value; + this.path = path; + this.update = update; + } +} +export class ValuePointerRootDeleteError extends TypeBoxError { + constructor(value, path) { + super('Cannot delete root value'); + this.value = value; + this.path = path; + } +} +// ------------------------------------------------------------------ +// ValuePointer +// ------------------------------------------------------------------ +/** Provides functionality to update values through RFC6901 string pointers */ +// prettier-ignore +function Escape(component) { + return component.indexOf('~') === -1 ? component : component.replace(/~1/g, '/').replace(/~0/g, '~'); +} +/** Formats the given pointer into navigable key components */ +// prettier-ignore +export function* Format(pointer) { + if (pointer === '') + return; + let [start, end] = [0, 0]; + for (let i = 0; i < pointer.length; i++) { + const char = pointer.charAt(i); + if (char === '/') { + if (i === 0) { + start = i + 1; + } + else { + end = i; + yield Escape(pointer.slice(start, end)); + start = i + 1; + } + } + else { + end = i; + } + } + yield Escape(pointer.slice(start)); +} +/** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ +// prettier-ignore +export function Set(value, pointer, update) { + if (pointer === '') + throw new ValuePointerRootSetError(value, pointer, update); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + next[component] = {}; + owner = next; + next = next[component]; + key = component; + } + owner[key] = update; +} +/** Deletes a value at the given pointer */ +// prettier-ignore +export function Delete(value, pointer) { + if (pointer === '') + throw new ValuePointerRootDeleteError(value, pointer); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined || next[component] === null) + return; + owner = next; + next = next[component]; + key = component; + } + if (Array.isArray(owner)) { + const index = parseInt(key); + owner.splice(index, 1); + } + else { + delete owner[key]; + } +} +/** Returns true if a value exists at the given pointer */ +// prettier-ignore +export function Has(value, pointer) { + if (pointer === '') + return true; + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + return false; + owner = next; + next = next[component]; + key = component; + } + return Object.getOwnPropertyNames(owner).includes(key); +} +/** Gets the value at the given pointer */ +// prettier-ignore +export function Get(value, pointer) { + if (pointer === '') + return value; + let current = value; + for (const component of Format(pointer)) { + if (current[component] === undefined) + return undefined; + current = current[component]; + } + return current; +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/decode.d.mts b/node_modules/@sinclair/typebox/build/esm/value/transform/decode.d.mts new file mode 100644 index 00000000..0b003ce4 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/decode.d.mts @@ -0,0 +1,22 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import { ValueError } from '../../errors/index.mjs'; +import type { TSchema } from '../../type/schema/index.mjs'; +export declare class TransformDecodeCheckError extends TypeBoxError { + readonly schema: TSchema; + readonly value: unknown; + readonly error: ValueError; + constructor(schema: TSchema, value: unknown, error: ValueError); +} +export declare class TransformDecodeError extends TypeBoxError { + readonly schema: TSchema; + readonly path: string; + readonly value: unknown; + readonly error: Error; + constructor(schema: TSchema, path: string, value: unknown, error: Error); +} +/** + * `[Internal]` Decodes the value and returns the result. This function requires that + * the caller `Check` the value before use. Passing unchecked values may result in + * undefined behavior. Refer to the `Value.Decode()` for implementation details. + */ +export declare function TransformDecode(schema: TSchema, references: TSchema[], value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs b/node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs new file mode 100644 index 00000000..83aedf28 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs @@ -0,0 +1,207 @@ +import { TypeSystemPolicy } from '../../system/policy.mjs'; +import { Kind, TransformKind } from '../../type/symbols/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { KeyOfPropertyKeys, KeyOfPropertyEntries } from '../../type/keyof/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Check } from '../check/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { HasPropertyKey, IsObject, IsArray, IsValueType, IsUndefined as IsUndefinedValue } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import { IsTransform, IsSchema, IsUndefined } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +// thrown externally +// prettier-ignore +export class TransformDecodeCheckError extends TypeBoxError { + constructor(schema, value, error) { + super(`Unable to decode value as it does not match the expected schema`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +// prettier-ignore +export class TransformDecodeError extends TypeBoxError { + constructor(schema, path, value, error) { + super(error instanceof Error ? error.message : 'Unknown error'); + this.schema = schema; + this.path = path; + this.value = value; + this.error = error; + } +} +// ------------------------------------------------------------------ +// Decode +// ------------------------------------------------------------------ +// prettier-ignore +function Default(schema, path, value) { + try { + return IsTransform(schema) ? schema[TransformKind].Decode(value) : value; + } + catch (error) { + throw new TransformDecodeError(schema, path, value, error); + } +} +// prettier-ignore +function FromArray(schema, references, path, value) { + return (IsArray(value)) + ? Default(schema, path, value.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value))) + : Default(schema, path, value); +} +// prettier-ignore +function FromIntersect(schema, references, path, value) { + if (!IsObject(value) || IsValueType(value)) + return Default(schema, path, value); + const knownEntries = KeyOfPropertyEntries(schema); + const knownKeys = knownEntries.map(entry => entry[0]); + const knownProperties = { ...value }; + for (const [knownKey, knownSchema] of knownEntries) + if (knownKey in knownProperties) { + knownProperties[knownKey] = Visit(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]); + } + if (!IsTransform(schema.unevaluatedProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const unevaluatedProperties = schema.unevaluatedProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + unknownProperties[key] = Default(unevaluatedProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromImport(schema, references, path, value) { + const additional = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + const result = Visit(target, [...references, ...additional], path, value); + return Default(schema, path, result); +} +function FromNot(schema, references, path, value) { + return Default(schema, path, Visit(schema.not, references, path, value)); +} +// prettier-ignore +function FromObject(schema, references, path, value) { + if (!IsObject(value)) + return Default(schema, path, value); + const knownKeys = KeyOfPropertyKeys(schema); + const knownProperties = { ...value }; + for (const key of knownKeys) { + if (!HasPropertyKey(knownProperties, key)) + continue; + // if the property value is undefined, but the target is not, nor does it satisfy exact optional + // property policy, then we need to continue. This is a special case for optional property handling + // where a transforms wrapped in a optional modifiers should not run. + if (IsUndefinedValue(knownProperties[key]) && (!IsUndefined(schema.properties[key]) || + TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) + continue; + // decode property + knownProperties[key] = Visit(schema.properties[key], references, `${path}/${key}`, knownProperties[key]); + } + if (!IsSchema(schema.additionalProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + unknownProperties[key] = Default(additionalProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromRecord(schema, references, path, value) { + if (!IsObject(value)) + return Default(schema, path, value); + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const knownKeys = new RegExp(pattern); + const knownProperties = { ...value }; + for (const key of Object.getOwnPropertyNames(value)) + if (knownKeys.test(key)) { + knownProperties[key] = Visit(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]); + } + if (!IsSchema(schema.additionalProperties)) { + return Default(schema, path, knownProperties); + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const unknownProperties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.test(key)) { + unknownProperties[key] = Default(additionalProperties, `${path}/${key}`, unknownProperties[key]); + } + return Default(schema, path, unknownProperties); +} +// prettier-ignore +function FromRef(schema, references, path, value) { + const target = Deref(schema, references); + return Default(schema, path, Visit(target, references, path, value)); +} +// prettier-ignore +function FromThis(schema, references, path, value) { + const target = Deref(schema, references); + return Default(schema, path, Visit(target, references, path, value)); +} +// prettier-ignore +function FromTuple(schema, references, path, value) { + return (IsArray(value) && IsArray(schema.items)) + ? Default(schema, path, schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value[index]))) + : Default(schema, path, value); +} +// prettier-ignore +function FromUnion(schema, references, path, value) { + for (const subschema of schema.anyOf) { + if (!Check(subschema, references, value)) + continue; + // note: ensure interior is decoded first + const decoded = Visit(subschema, references, path, value); + return Default(schema, path, decoded); + } + return Default(schema, path, value); +} +// prettier-ignore +function Visit(schema, references, path, value) { + const references_ = Pushref(schema, references); + const schema_ = schema; + switch (schema[Kind]) { + case 'Array': + return FromArray(schema_, references_, path, value); + case 'Import': + return FromImport(schema_, references_, path, value); + case 'Intersect': + return FromIntersect(schema_, references_, path, value); + case 'Not': + return FromNot(schema_, references_, path, value); + case 'Object': + return FromObject(schema_, references_, path, value); + case 'Record': + return FromRecord(schema_, references_, path, value); + case 'Ref': + return FromRef(schema_, references_, path, value); + case 'Symbol': + return Default(schema_, path, value); + case 'This': + return FromThis(schema_, references_, path, value); + case 'Tuple': + return FromTuple(schema_, references_, path, value); + case 'Union': + return FromUnion(schema_, references_, path, value); + default: + return Default(schema_, path, value); + } +} +/** + * `[Internal]` Decodes the value and returns the result. This function requires that + * the caller `Check` the value before use. Passing unchecked values may result in + * undefined behavior. Refer to the `Value.Decode()` for implementation details. + */ +export function TransformDecode(schema, references, value) { + return Visit(schema, references, '', value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/encode.d.mts b/node_modules/@sinclair/typebox/build/esm/value/transform/encode.d.mts new file mode 100644 index 00000000..ea95229d --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/encode.d.mts @@ -0,0 +1,23 @@ +import { TypeBoxError } from '../../type/error/index.mjs'; +import { ValueError } from '../../errors/index.mjs'; +import type { TSchema } from '../../type/schema/index.mjs'; +export declare class TransformEncodeCheckError extends TypeBoxError { + readonly schema: TSchema; + readonly value: unknown; + readonly error: ValueError; + constructor(schema: TSchema, value: unknown, error: ValueError); +} +export declare class TransformEncodeError extends TypeBoxError { + readonly schema: TSchema; + readonly path: string; + readonly value: unknown; + readonly error: Error; + constructor(schema: TSchema, path: string, value: unknown, error: Error); +} +/** + * `[Internal]` Encodes the value and returns the result. This function expects the + * caller to pass a statically checked value. This function does not check the encoded + * result, meaning the result should be passed to `Check` before use. Refer to the + * `Value.Encode()` function for implementation details. + */ +export declare function TransformEncode(schema: TSchema, references: TSchema[], value: unknown): unknown; diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs b/node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs new file mode 100644 index 00000000..7ec3c47f --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs @@ -0,0 +1,218 @@ +import { TypeSystemPolicy } from '../../system/policy.mjs'; +import { Kind, TransformKind } from '../../type/symbols/index.mjs'; +import { TypeBoxError } from '../../type/error/index.mjs'; +import { KeyOfPropertyKeys, KeyOfPropertyEntries } from '../../type/keyof/index.mjs'; +import { Deref, Pushref } from '../deref/index.mjs'; +import { Check } from '../check/index.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { HasPropertyKey, IsObject, IsArray, IsValueType, IsUndefined as IsUndefinedValue } from '../guard/index.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import { IsTransform, IsSchema, IsUndefined } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// Errors +// ------------------------------------------------------------------ +// prettier-ignore +export class TransformEncodeCheckError extends TypeBoxError { + constructor(schema, value, error) { + super(`The encoded value does not match the expected schema`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +// prettier-ignore +export class TransformEncodeError extends TypeBoxError { + constructor(schema, path, value, error) { + super(`${error instanceof Error ? error.message : 'Unknown error'}`); + this.schema = schema; + this.path = path; + this.value = value; + this.error = error; + } +} +// ------------------------------------------------------------------ +// Encode +// ------------------------------------------------------------------ +// prettier-ignore +function Default(schema, path, value) { + try { + return IsTransform(schema) ? schema[TransformKind].Encode(value) : value; + } + catch (error) { + throw new TransformEncodeError(schema, path, value, error); + } +} +// prettier-ignore +function FromArray(schema, references, path, value) { + const defaulted = Default(schema, path, value); + return IsArray(defaulted) + ? defaulted.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value)) + : defaulted; +} +// prettier-ignore +function FromImport(schema, references, path, value) { + const additional = globalThis.Object.values(schema.$defs); + const target = schema.$defs[schema.$ref]; + const result = Default(schema, path, value); + return Visit(target, [...references, ...additional], path, result); +} +// prettier-ignore +function FromIntersect(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!IsObject(value) || IsValueType(value)) + return defaulted; + const knownEntries = KeyOfPropertyEntries(schema); + const knownKeys = knownEntries.map(entry => entry[0]); + const knownProperties = { ...defaulted }; + for (const [knownKey, knownSchema] of knownEntries) + if (knownKey in knownProperties) { + knownProperties[knownKey] = Visit(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]); + } + if (!IsTransform(schema.unevaluatedProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const unevaluatedProperties = schema.unevaluatedProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + properties[key] = Default(unevaluatedProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromNot(schema, references, path, value) { + return Default(schema.not, path, Default(schema, path, value)); +} +// prettier-ignore +function FromObject(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!IsObject(defaulted)) + return defaulted; + const knownKeys = KeyOfPropertyKeys(schema); + const knownProperties = { ...defaulted }; + for (const key of knownKeys) { + if (!HasPropertyKey(knownProperties, key)) + continue; + // if the property value is undefined, but the target is not, nor does it satisfy exact optional + // property policy, then we need to continue. This is a special case for optional property handling + // where a transforms wrapped in a optional modifiers should not run. + if (IsUndefinedValue(knownProperties[key]) && (!IsUndefined(schema.properties[key]) || + TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) + continue; + // encode property + knownProperties[key] = Visit(schema.properties[key], references, `${path}/${key}`, knownProperties[key]); + } + if (!IsSchema(schema.additionalProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.includes(key)) { + properties[key] = Default(additionalProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromRecord(schema, references, path, value) { + const defaulted = Default(schema, path, value); + if (!IsObject(value)) + return defaulted; + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const knownKeys = new RegExp(pattern); + const knownProperties = { ...defaulted }; + for (const key of Object.getOwnPropertyNames(value)) + if (knownKeys.test(key)) { + knownProperties[key] = Visit(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]); + } + if (!IsSchema(schema.additionalProperties)) { + return knownProperties; + } + const unknownKeys = Object.getOwnPropertyNames(knownProperties); + const additionalProperties = schema.additionalProperties; + const properties = { ...knownProperties }; + for (const key of unknownKeys) + if (!knownKeys.test(key)) { + properties[key] = Default(additionalProperties, `${path}/${key}`, properties[key]); + } + return properties; +} +// prettier-ignore +function FromRef(schema, references, path, value) { + const target = Deref(schema, references); + const resolved = Visit(target, references, path, value); + return Default(schema, path, resolved); +} +// prettier-ignore +function FromThis(schema, references, path, value) { + const target = Deref(schema, references); + const resolved = Visit(target, references, path, value); + return Default(schema, path, resolved); +} +// prettier-ignore +function FromTuple(schema, references, path, value) { + const value1 = Default(schema, path, value); + return IsArray(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value1[index])) : []; +} +// prettier-ignore +function FromUnion(schema, references, path, value) { + // test value against union variants + for (const subschema of schema.anyOf) { + if (!Check(subschema, references, value)) + continue; + const value1 = Visit(subschema, references, path, value); + return Default(schema, path, value1); + } + // test transformed value against union variants + for (const subschema of schema.anyOf) { + const value1 = Visit(subschema, references, path, value); + if (!Check(schema, references, value1)) + continue; + return Default(schema, path, value1); + } + return Default(schema, path, value); +} +// prettier-ignore +function Visit(schema, references, path, value) { + const references_ = Pushref(schema, references); + const schema_ = schema; + switch (schema[Kind]) { + case 'Array': + return FromArray(schema_, references_, path, value); + case 'Import': + return FromImport(schema_, references_, path, value); + case 'Intersect': + return FromIntersect(schema_, references_, path, value); + case 'Not': + return FromNot(schema_, references_, path, value); + case 'Object': + return FromObject(schema_, references_, path, value); + case 'Record': + return FromRecord(schema_, references_, path, value); + case 'Ref': + return FromRef(schema_, references_, path, value); + case 'This': + return FromThis(schema_, references_, path, value); + case 'Tuple': + return FromTuple(schema_, references_, path, value); + case 'Union': + return FromUnion(schema_, references_, path, value); + default: + return Default(schema_, path, value); + } +} +/** + * `[Internal]` Encodes the value and returns the result. This function expects the + * caller to pass a statically checked value. This function does not check the encoded + * result, meaning the result should be passed to `Check` before use. Refer to the + * `Value.Encode()` function for implementation details. + */ +export function TransformEncode(schema, references, value) { + return Visit(schema, references, '', value); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/has.d.mts b/node_modules/@sinclair/typebox/build/esm/value/transform/has.d.mts new file mode 100644 index 00000000..4abf58ab --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/has.d.mts @@ -0,0 +1,3 @@ +import type { TSchema } from '../../type/schema/index.mjs'; +/** Returns true if this schema contains a transform codec */ +export declare function HasTransform(schema: TSchema, references: TSchema[]): boolean; diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs b/node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs new file mode 100644 index 00000000..7c3f48ae --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs @@ -0,0 +1,129 @@ +import { Deref, Pushref } from '../deref/index.mjs'; +import { Kind } from '../../type/symbols/index.mjs'; +// ------------------------------------------------------------------ +// KindGuard +// ------------------------------------------------------------------ +import { IsTransform, IsSchema } from '../../type/guard/kind.mjs'; +// ------------------------------------------------------------------ +// ValueGuard +// ------------------------------------------------------------------ +import { IsUndefined } from '../guard/index.mjs'; +// prettier-ignore +function FromArray(schema, references) { + return IsTransform(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromAsyncIterator(schema, references) { + return IsTransform(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromConstructor(schema, references) { + return IsTransform(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromFunction(schema, references) { + return IsTransform(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromIntersect(schema, references) { + return IsTransform(schema) || IsTransform(schema.unevaluatedProperties) || schema.allOf.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function FromImport(schema, references) { + const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => [...result, schema.$defs[key]], []); + const target = schema.$defs[schema.$ref]; + return IsTransform(schema) || Visit(target, [...additional, ...references]); +} +// prettier-ignore +function FromIterator(schema, references) { + return IsTransform(schema) || Visit(schema.items, references); +} +// prettier-ignore +function FromNot(schema, references) { + return IsTransform(schema) || Visit(schema.not, references); +} +// prettier-ignore +function FromObject(schema, references) { + return (IsTransform(schema) || + Object.values(schema.properties).some((schema) => Visit(schema, references)) || + (IsSchema(schema.additionalProperties) && Visit(schema.additionalProperties, references))); +} +// prettier-ignore +function FromPromise(schema, references) { + return IsTransform(schema) || Visit(schema.item, references); +} +// prettier-ignore +function FromRecord(schema, references) { + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[pattern]; + return IsTransform(schema) || Visit(property, references) || (IsSchema(schema.additionalProperties) && IsTransform(schema.additionalProperties)); +} +// prettier-ignore +function FromRef(schema, references) { + if (IsTransform(schema)) + return true; + return Visit(Deref(schema, references), references); +} +// prettier-ignore +function FromThis(schema, references) { + if (IsTransform(schema)) + return true; + return Visit(Deref(schema, references), references); +} +// prettier-ignore +function FromTuple(schema, references) { + return IsTransform(schema) || (!IsUndefined(schema.items) && schema.items.some((schema) => Visit(schema, references))); +} +// prettier-ignore +function FromUnion(schema, references) { + return IsTransform(schema) || schema.anyOf.some((schema) => Visit(schema, references)); +} +// prettier-ignore +function Visit(schema, references) { + const references_ = Pushref(schema, references); + const schema_ = schema; + if (schema.$id && visited.has(schema.$id)) + return false; + if (schema.$id) + visited.add(schema.$id); + switch (schema[Kind]) { + case 'Array': + return FromArray(schema_, references_); + case 'AsyncIterator': + return FromAsyncIterator(schema_, references_); + case 'Constructor': + return FromConstructor(schema_, references_); + case 'Function': + return FromFunction(schema_, references_); + case 'Import': + return FromImport(schema_, references_); + case 'Intersect': + return FromIntersect(schema_, references_); + case 'Iterator': + return FromIterator(schema_, references_); + case 'Not': + return FromNot(schema_, references_); + case 'Object': + return FromObject(schema_, references_); + case 'Promise': + return FromPromise(schema_, references_); + case 'Record': + return FromRecord(schema_, references_); + case 'Ref': + return FromRef(schema_, references_); + case 'This': + return FromThis(schema_, references_); + case 'Tuple': + return FromTuple(schema_, references_); + case 'Union': + return FromUnion(schema_, references_); + default: + return IsTransform(schema); + } +} +const visited = new Set(); +/** Returns true if this schema contains a transform codec */ +export function HasTransform(schema, references) { + visited.clear(); + return Visit(schema, references); +} diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/transform/index.d.mts new file mode 100644 index 00000000..ad9e40d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/index.d.mts @@ -0,0 +1,3 @@ +export * from './decode.mjs'; +export * from './encode.mjs'; +export * from './has.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/transform/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/transform/index.mjs new file mode 100644 index 00000000..ad9e40d1 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/transform/index.mjs @@ -0,0 +1,3 @@ +export * from './decode.mjs'; +export * from './encode.mjs'; +export * from './has.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/value/index.d.mts b/node_modules/@sinclair/typebox/build/esm/value/value/index.d.mts new file mode 100644 index 00000000..72674f49 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/value/index.d.mts @@ -0,0 +1 @@ +export * as Value from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/value/index.mjs b/node_modules/@sinclair/typebox/build/esm/value/value/index.mjs new file mode 100644 index 00000000..72674f49 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/value/index.mjs @@ -0,0 +1 @@ +export * as Value from './value.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/value/value.d.mts b/node_modules/@sinclair/typebox/build/esm/value/value/value.d.mts new file mode 100644 index 00000000..b604c612 --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/value/value.d.mts @@ -0,0 +1,16 @@ +export { Errors, ValueErrorIterator } from '../../errors/index.mjs'; +export { Assert } from '../assert/index.mjs'; +export { Cast } from '../cast/index.mjs'; +export { Check } from '../check/index.mjs'; +export { Clean } from '../clean/index.mjs'; +export { Clone } from '../clone/index.mjs'; +export { Convert } from '../convert/index.mjs'; +export { Create } from '../create/index.mjs'; +export { Decode } from '../decode/index.mjs'; +export { Default } from '../default/index.mjs'; +export { Diff, Patch, Edit } from '../delta/index.mjs'; +export { Encode } from '../encode/index.mjs'; +export { Equal } from '../equal/index.mjs'; +export { Hash } from '../hash/index.mjs'; +export { Mutate, type Mutable } from '../mutate/index.mjs'; +export { Parse } from '../parse/index.mjs'; diff --git a/node_modules/@sinclair/typebox/build/esm/value/value/value.mjs b/node_modules/@sinclair/typebox/build/esm/value/value/value.mjs new file mode 100644 index 00000000..0af3d52a --- /dev/null +++ b/node_modules/@sinclair/typebox/build/esm/value/value/value.mjs @@ -0,0 +1,16 @@ +export { Errors, ValueErrorIterator } from '../../errors/index.mjs'; +export { Assert } from '../assert/index.mjs'; +export { Cast } from '../cast/index.mjs'; +export { Check } from '../check/index.mjs'; +export { Clean } from '../clean/index.mjs'; +export { Clone } from '../clone/index.mjs'; +export { Convert } from '../convert/index.mjs'; +export { Create } from '../create/index.mjs'; +export { Decode } from '../decode/index.mjs'; +export { Default } from '../default/index.mjs'; +export { Diff, Patch, Edit } from '../delta/index.mjs'; +export { Encode } from '../encode/index.mjs'; +export { Equal } from '../equal/index.mjs'; +export { Hash } from '../hash/index.mjs'; +export { Mutate } from '../mutate/index.mjs'; +export { Parse } from '../parse/index.mjs'; diff --git a/node_modules/@sinclair/typebox/compiler/compiler.d.ts b/node_modules/@sinclair/typebox/compiler/compiler.d.ts deleted file mode 100644 index f35f75f5..00000000 --- a/node_modules/@sinclair/typebox/compiler/compiler.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as Types from '../typebox'; -import { ValueErrorIterator } from '../errors/index'; -export type CheckFunction = (value: unknown) => boolean; -export declare class TypeCheck { - private readonly schema; - private readonly references; - private readonly checkFunc; - private readonly code; - constructor(schema: T, references: Types.TSchema[], checkFunc: CheckFunction, code: string); - /** Returns the generated assertion code used to validate this type. */ - Code(): string; - /** Returns an iterator for each error in this value. */ - Errors(value: unknown): ValueErrorIterator; - /** Returns true if the value matches the compiled type. */ - Check(value: unknown): value is Types.Static; -} -export declare class TypeCompilerUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class TypeCompilerDereferenceError extends Error { - readonly schema: Types.TRef; - constructor(schema: Types.TRef); -} -export declare class TypeCompilerTypeGuardError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -/** Compiles Types for Runtime Type Checking */ -export declare namespace TypeCompiler { - /** Returns the generated assertion code used to validate this type. */ - function Code(schema: T, references?: Types.TSchema[]): string; - /** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */ - function Compile(schema: T, references?: Types.TSchema[]): TypeCheck; -} diff --git a/node_modules/@sinclair/typebox/compiler/compiler.js b/node_modules/@sinclair/typebox/compiler/compiler.js deleted file mode 100644 index b318e7d8..00000000 --- a/node_modules/@sinclair/typebox/compiler/compiler.js +++ /dev/null @@ -1,577 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/compiler - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypeCompiler = exports.TypeCompilerTypeGuardError = exports.TypeCompilerDereferenceError = exports.TypeCompilerUnknownTypeError = exports.TypeCheck = void 0; -const Types = require("../typebox"); -const index_1 = require("../errors/index"); -const index_2 = require("../system/index"); -const hash_1 = require("../value/hash"); -// ------------------------------------------------------------------- -// TypeCheck -// ------------------------------------------------------------------- -class TypeCheck { - constructor(schema, references, checkFunc, code) { - this.schema = schema; - this.references = references; - this.checkFunc = checkFunc; - this.code = code; - } - /** Returns the generated assertion code used to validate this type. */ - Code() { - return this.code; - } - /** Returns an iterator for each error in this value. */ - Errors(value) { - return index_1.ValueErrors.Errors(this.schema, this.references, value); - } - /** Returns true if the value matches the compiled type. */ - Check(value) { - return this.checkFunc(value); - } -} -exports.TypeCheck = TypeCheck; -// ------------------------------------------------------------------- -// Character -// ------------------------------------------------------------------- -var Character; -(function (Character) { - function DollarSign(code) { - return code === 36; - } - Character.DollarSign = DollarSign; - function IsUnderscore(code) { - return code === 95; - } - Character.IsUnderscore = IsUnderscore; - function IsAlpha(code) { - return (code >= 65 && code <= 90) || (code >= 97 && code <= 122); - } - Character.IsAlpha = IsAlpha; - function IsNumeric(code) { - return code >= 48 && code <= 57; - } - Character.IsNumeric = IsNumeric; -})(Character || (Character = {})); -// ------------------------------------------------------------------- -// MemberExpression -// ------------------------------------------------------------------- -var MemberExpression; -(function (MemberExpression) { - function IsFirstCharacterNumeric(value) { - if (value.length === 0) - return false; - return Character.IsNumeric(value.charCodeAt(0)); - } - function IsAccessor(value) { - if (IsFirstCharacterNumeric(value)) - return false; - for (let i = 0; i < value.length; i++) { - const code = value.charCodeAt(i); - const check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code); - if (!check) - return false; - } - return true; - } - function EscapeHyphen(key) { - return key.replace(/'/g, "\\'"); - } - function Encode(object, key) { - return IsAccessor(key) ? `${object}.${key}` : `${object}['${EscapeHyphen(key)}']`; - } - MemberExpression.Encode = Encode; -})(MemberExpression || (MemberExpression = {})); -// ------------------------------------------------------------------- -// Identifier -// ------------------------------------------------------------------- -var Identifier; -(function (Identifier) { - function Encode($id) { - const buffer = []; - for (let i = 0; i < $id.length; i++) { - const code = $id.charCodeAt(i); - if (Character.IsNumeric(code) || Character.IsAlpha(code)) { - buffer.push($id.charAt(i)); - } - else { - buffer.push(`_${code}_`); - } - } - return buffer.join('').replace(/__/g, '_'); - } - Identifier.Encode = Encode; -})(Identifier || (Identifier = {})); -// ------------------------------------------------------------------- -// TypeCompiler -// ------------------------------------------------------------------- -class TypeCompilerUnknownTypeError extends Error { - constructor(schema) { - super('TypeCompiler: Unknown type'); - this.schema = schema; - } -} -exports.TypeCompilerUnknownTypeError = TypeCompilerUnknownTypeError; -class TypeCompilerDereferenceError extends Error { - constructor(schema) { - super(`TypeCompiler: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.TypeCompilerDereferenceError = TypeCompilerDereferenceError; -class TypeCompilerTypeGuardError extends Error { - constructor(schema) { - super('TypeCompiler: Preflight validation check failed to guard for the given schema'); - this.schema = schema; - } -} -exports.TypeCompilerTypeGuardError = TypeCompilerTypeGuardError; -/** Compiles Types for Runtime Type Checking */ -var TypeCompiler; -(function (TypeCompiler) { - // ------------------------------------------------------------------- - // Guards - // ------------------------------------------------------------------- - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsNumber(value) { - return typeof value === 'number' && globalThis.Number.isFinite(value); - } - function IsString(value) { - return typeof value === 'string'; - } - // ------------------------------------------------------------------- - // Polices - // ------------------------------------------------------------------- - function IsExactOptionalProperty(value, key, expression) { - return index_2.TypeSystem.ExactOptionalPropertyTypes ? `('${key}' in ${value} ? ${expression} : true)` : `(${MemberExpression.Encode(value, key)} !== undefined ? ${expression} : true)`; - } - function IsObjectCheck(value) { - return !index_2.TypeSystem.AllowArrayObjects ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}))` : `(typeof ${value} === 'object' && ${value} !== null)`; - } - function IsRecordCheck(value) { - return !index_2.TypeSystem.AllowArrayObjects - ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}) && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))` - : `(typeof ${value} === 'object' && ${value} !== null && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`; - } - function IsNumberCheck(value) { - return !index_2.TypeSystem.AllowNaN ? `(typeof ${value} === 'number' && Number.isFinite(${value}))` : `typeof ${value} === 'number'`; - } - function IsVoidCheck(value) { - return index_2.TypeSystem.AllowVoidNull ? `(${value} === undefined || ${value} === null)` : `${value} === undefined`; - } - // ------------------------------------------------------------------- - // Types - // ------------------------------------------------------------------- - function* Any(schema, references, value) { - yield 'true'; - } - function* Array(schema, references, value) { - const expression = CreateExpression(schema.items, references, 'value'); - yield `Array.isArray(${value}) && ${value}.every(value => ${expression})`; - if (IsNumber(schema.minItems)) - yield `${value}.length >= ${schema.minItems}`; - if (IsNumber(schema.maxItems)) - yield `${value}.length <= ${schema.maxItems}`; - if (schema.uniqueItems === true) - yield `((function() { const set = new Set(); for(const element of ${value}) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true })())`; - } - function* BigInt(schema, references, value) { - yield `(typeof ${value} === 'bigint')`; - if (IsBigInt(schema.multipleOf)) - yield `(${value} % BigInt(${schema.multipleOf})) === 0`; - if (IsBigInt(schema.exclusiveMinimum)) - yield `${value} > BigInt(${schema.exclusiveMinimum})`; - if (IsBigInt(schema.exclusiveMaximum)) - yield `${value} < BigInt(${schema.exclusiveMaximum})`; - if (IsBigInt(schema.minimum)) - yield `${value} >= BigInt(${schema.minimum})`; - if (IsBigInt(schema.maximum)) - yield `${value} <= BigInt(${schema.maximum})`; - } - function* Boolean(schema, references, value) { - yield `typeof ${value} === 'boolean'`; - } - function* Constructor(schema, references, value) { - yield* Visit(schema.returns, references, `${value}.prototype`); - } - function* Date(schema, references, value) { - yield `(${value} instanceof Date) && Number.isFinite(${value}.getTime())`; - if (IsNumber(schema.exclusiveMinimumTimestamp)) - yield `${value}.getTime() > ${schema.exclusiveMinimumTimestamp}`; - if (IsNumber(schema.exclusiveMaximumTimestamp)) - yield `${value}.getTime() < ${schema.exclusiveMaximumTimestamp}`; - if (IsNumber(schema.minimumTimestamp)) - yield `${value}.getTime() >= ${schema.minimumTimestamp}`; - if (IsNumber(schema.maximumTimestamp)) - yield `${value}.getTime() <= ${schema.maximumTimestamp}`; - } - function* Function(schema, references, value) { - yield `typeof ${value} === 'function'`; - } - function* Integer(schema, references, value) { - yield `(typeof ${value} === 'number' && Number.isInteger(${value}))`; - if (IsNumber(schema.multipleOf)) - yield `(${value} % ${schema.multipleOf}) === 0`; - if (IsNumber(schema.exclusiveMinimum)) - yield `${value} > ${schema.exclusiveMinimum}`; - if (IsNumber(schema.exclusiveMaximum)) - yield `${value} < ${schema.exclusiveMaximum}`; - if (IsNumber(schema.minimum)) - yield `${value} >= ${schema.minimum}`; - if (IsNumber(schema.maximum)) - yield `${value} <= ${schema.maximum}`; - } - function* Intersect(schema, references, value) { - if (schema.unevaluatedProperties === undefined) { - const expressions = schema.allOf.map((schema) => CreateExpression(schema, references, value)); - yield `${expressions.join(' && ')}`; - } - else if (schema.unevaluatedProperties === false) { - // prettier-ignore - const schemaKeys = Types.KeyResolver.Resolve(schema).map((key) => `'${key}'`).join(', '); - const expressions = schema.allOf.map((schema) => CreateExpression(schema, references, value)); - const expression1 = `Object.getOwnPropertyNames(${value}).every(key => [${schemaKeys}].includes(key))`; - yield `${expressions.join(' && ')} && ${expression1}`; - } - else if (typeof schema.unevaluatedProperties === 'object') { - // prettier-ignore - const schemaKeys = Types.KeyResolver.Resolve(schema).map((key) => `'${key}'`).join(', '); - const expressions = schema.allOf.map((schema) => CreateExpression(schema, references, value)); - const expression1 = CreateExpression(schema.unevaluatedProperties, references, 'value[key]'); - const expression2 = `Object.getOwnPropertyNames(${value}).every(key => [${schemaKeys}].includes(key) || ${expression1})`; - yield `${expressions.join(' && ')} && ${expression2}`; - } - } - function* Literal(schema, references, value) { - if (typeof schema.const === 'number' || typeof schema.const === 'boolean') { - yield `${value} === ${schema.const}`; - } - else { - yield `${value} === '${schema.const}'`; - } - } - function* Never(schema, references, value) { - yield `false`; - } - function* Not(schema, references, value) { - const left = CreateExpression(schema.allOf[0].not, references, value); - const right = CreateExpression(schema.allOf[1], references, value); - yield `!${left} && ${right}`; - } - function* Null(schema, references, value) { - yield `${value} === null`; - } - function* Number(schema, references, value) { - yield IsNumberCheck(value); - if (IsNumber(schema.multipleOf)) - yield `(${value} % ${schema.multipleOf}) === 0`; - if (IsNumber(schema.exclusiveMinimum)) - yield `${value} > ${schema.exclusiveMinimum}`; - if (IsNumber(schema.exclusiveMaximum)) - yield `${value} < ${schema.exclusiveMaximum}`; - if (IsNumber(schema.minimum)) - yield `${value} >= ${schema.minimum}`; - if (IsNumber(schema.maximum)) - yield `${value} <= ${schema.maximum}`; - } - function* Object(schema, references, value) { - yield IsObjectCheck(value); - if (IsNumber(schema.minProperties)) - yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; - if (IsNumber(schema.maxProperties)) - yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; - const knownKeys = globalThis.Object.getOwnPropertyNames(schema.properties); - for (const knownKey of knownKeys) { - const memberExpression = MemberExpression.Encode(value, knownKey); - const property = schema.properties[knownKey]; - if (schema.required && schema.required.includes(knownKey)) { - yield* Visit(property, references, memberExpression); - if (Types.ExtendsUndefined.Check(property)) - yield `('${knownKey}' in ${value})`; - } - else { - const expression = CreateExpression(property, references, memberExpression); - yield IsExactOptionalProperty(value, knownKey, expression); - } - } - if (schema.additionalProperties === false) { - if (schema.required && schema.required.length === knownKeys.length) { - yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`; - } - else { - const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; - yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`; - } - } - if (typeof schema.additionalProperties === 'object') { - const expression = CreateExpression(schema.additionalProperties, references, 'value[key]'); - const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; - yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`; - } - } - function* Promise(schema, references, value) { - yield `(typeof value === 'object' && typeof ${value}.then === 'function')`; - } - function* Record(schema, references, value) { - yield IsRecordCheck(value); - if (IsNumber(schema.minProperties)) - yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; - if (IsNumber(schema.maxProperties)) - yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; - const [keyPattern, valueSchema] = globalThis.Object.entries(schema.patternProperties)[0]; - const local = PushLocal(`new RegExp(/${keyPattern}/)`); - yield `(Object.getOwnPropertyNames(${value}).every(key => ${local}.test(key)))`; - const expression = CreateExpression(valueSchema, references, 'value'); - yield `Object.values(${value}).every(value => ${expression})`; - } - function* Ref(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new TypeCompilerDereferenceError(schema); - const target = references[index]; - // Reference: If we have seen this reference before we can just yield and return - // the function call. If this isn't the case we defer to visit to generate and - // set the function for subsequent passes. Consider for refactor. - if (state_local_function_names.has(schema.$ref)) - return yield `${CreateFunctionName(schema.$ref)}(${value})`; - yield* Visit(target, references, value); - } - function* String(schema, references, value) { - yield `(typeof ${value} === 'string')`; - if (IsNumber(schema.minLength)) - yield `${value}.length >= ${schema.minLength}`; - if (IsNumber(schema.maxLength)) - yield `${value}.length <= ${schema.maxLength}`; - if (schema.pattern !== undefined) { - const local = PushLocal(`${new RegExp(schema.pattern)};`); - yield `${local}.test(${value})`; - } - if (schema.format !== undefined) { - yield `format('${schema.format}', ${value})`; - } - } - function* Symbol(schema, references, value) { - yield `(typeof ${value} === 'symbol')`; - } - function* TemplateLiteral(schema, references, value) { - yield `(typeof ${value} === 'string')`; - const local = PushLocal(`${new RegExp(schema.pattern)};`); - yield `${local}.test(${value})`; - } - function* This(schema, references, value) { - const func = CreateFunctionName(schema.$ref); - yield `${func}(${value})`; - } - function* Tuple(schema, references, value) { - yield `(Array.isArray(${value}))`; - if (schema.items === undefined) - return yield `${value}.length === 0`; - yield `(${value}.length === ${schema.maxItems})`; - for (let i = 0; i < schema.items.length; i++) { - const expression = CreateExpression(schema.items[i], references, `${value}[${i}]`); - yield `${expression}`; - } - } - function* Undefined(schema, references, value) { - yield `${value} === undefined`; - } - function* Union(schema, references, value) { - const expressions = schema.anyOf.map((schema) => CreateExpression(schema, references, value)); - yield `(${expressions.join(' || ')})`; - } - function* Uint8Array(schema, references, value) { - yield `${value} instanceof Uint8Array`; - if (IsNumber(schema.maxByteLength)) - yield `(${value}.length <= ${schema.maxByteLength})`; - if (IsNumber(schema.minByteLength)) - yield `(${value}.length >= ${schema.minByteLength})`; - } - function* Unknown(schema, references, value) { - yield 'true'; - } - function* Void(schema, references, value) { - yield IsVoidCheck(value); - } - function* UserDefined(schema, references, value) { - const schema_key = `schema_key_${state_remote_custom_types.size}`; - state_remote_custom_types.set(schema_key, schema); - yield `custom('${schema[Types.Kind]}', '${schema_key}', ${value})`; - } - function* Visit(schema, references, value) { - const references_ = IsString(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - // Reference: Referenced schemas can originate from either additional schemas - // or inline in the schema itself. Ideally the recursive path should align to - // reference path. Consider for refactor. - if (IsString(schema.$id) && !state_local_function_names.has(schema.$id)) { - state_local_function_names.add(schema.$id); - const name = CreateFunctionName(schema.$id); - const body = CreateFunction(name, schema, references, 'value'); - PushFunction(body); - yield `${name}(${value})`; - return; - } - switch (schema_[Types.Kind]) { - case 'Any': - return yield* Any(schema_, references_, value); - case 'Array': - return yield* Array(schema_, references_, value); - case 'BigInt': - return yield* BigInt(schema_, references_, value); - case 'Boolean': - return yield* Boolean(schema_, references_, value); - case 'Constructor': - return yield* Constructor(schema_, references_, value); - case 'Date': - return yield* Date(schema_, references_, value); - case 'Function': - return yield* Function(schema_, references_, value); - case 'Integer': - return yield* Integer(schema_, references_, value); - case 'Intersect': - return yield* Intersect(schema_, references_, value); - case 'Literal': - return yield* Literal(schema_, references_, value); - case 'Never': - return yield* Never(schema_, references_, value); - case 'Not': - return yield* Not(schema_, references_, value); - case 'Null': - return yield* Null(schema_, references_, value); - case 'Number': - return yield* Number(schema_, references_, value); - case 'Object': - return yield* Object(schema_, references_, value); - case 'Promise': - return yield* Promise(schema_, references_, value); - case 'Record': - return yield* Record(schema_, references_, value); - case 'Ref': - return yield* Ref(schema_, references_, value); - case 'String': - return yield* String(schema_, references_, value); - case 'Symbol': - return yield* Symbol(schema_, references_, value); - case 'TemplateLiteral': - return yield* TemplateLiteral(schema_, references_, value); - case 'This': - return yield* This(schema_, references_, value); - case 'Tuple': - return yield* Tuple(schema_, references_, value); - case 'Undefined': - return yield* Undefined(schema_, references_, value); - case 'Union': - return yield* Union(schema_, references_, value); - case 'Uint8Array': - return yield* Uint8Array(schema_, references_, value); - case 'Unknown': - return yield* Unknown(schema_, references_, value); - case 'Void': - return yield* Void(schema_, references_, value); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new TypeCompilerUnknownTypeError(schema); - return yield* UserDefined(schema_, references_, value); - } - } - // ------------------------------------------------------------------- - // Compiler State - // ------------------------------------------------------------------- - const state_local_variables = new Set(); // local variables and functions - const state_local_function_names = new Set(); // local function names used call ref validators - const state_remote_custom_types = new Map(); // remote custom types used during compilation - function ResetCompiler() { - state_local_variables.clear(); - state_local_function_names.clear(); - state_remote_custom_types.clear(); - } - function CreateExpression(schema, references, value) { - return `(${[...Visit(schema, references, value)].join(' && ')})`; - } - function CreateFunctionName($id) { - return `check_${Identifier.Encode($id)}`; - } - function CreateFunction(name, schema, references, value) { - const expression = [...Visit(schema, references, value)].map((condition) => ` ${condition}`).join(' &&\n'); - return `function ${name}(value) {\n return (\n${expression}\n )\n}`; - } - function PushFunction(functionBody) { - state_local_variables.add(functionBody); - } - function PushLocal(expression) { - const local = `local_${state_local_variables.size}`; - state_local_variables.add(`const ${local} = ${expression}`); - return local; - } - function GetLocals() { - return [...state_local_variables.values()]; - } - // ------------------------------------------------------------------- - // Compile - // ------------------------------------------------------------------- - function Build(schema, references) { - ResetCompiler(); - const check = CreateFunction('check', schema, references, 'value'); - const locals = GetLocals(); - return `${locals.join('\n')}\nreturn ${check}`; - } - /** Returns the generated assertion code used to validate this type. */ - function Code(schema, references = []) { - if (!Types.TypeGuard.TSchema(schema)) - throw new TypeCompilerTypeGuardError(schema); - for (const schema of references) - if (!Types.TypeGuard.TSchema(schema)) - throw new TypeCompilerTypeGuardError(schema); - return Build(schema, references); - } - TypeCompiler.Code = Code; - /** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */ - function Compile(schema, references = []) { - const code = Code(schema, references); - const custom_schemas = new Map(state_remote_custom_types); - const compiledFunction = globalThis.Function('custom', 'format', 'hash', code); - const checkFunction = compiledFunction((kind, schema_key, value) => { - if (!Types.TypeRegistry.Has(kind) || !custom_schemas.has(schema_key)) - return false; - const schema = custom_schemas.get(schema_key); - const func = Types.TypeRegistry.Get(kind); - return func(schema, value); - }, (format, value) => { - if (!Types.FormatRegistry.Has(format)) - return false; - const func = Types.FormatRegistry.Get(format); - return func(value); - }, (value) => { - return hash_1.ValueHash.Create(value); - }); - return new TypeCheck(schema, references, checkFunction, code); - } - TypeCompiler.Compile = Compile; -})(TypeCompiler = exports.TypeCompiler || (exports.TypeCompiler = {})); diff --git a/node_modules/@sinclair/typebox/compiler/index.d.ts b/node_modules/@sinclair/typebox/compiler/index.d.ts deleted file mode 100644 index 4062a62f..00000000 --- a/node_modules/@sinclair/typebox/compiler/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ValueError, ValueErrorType } from '../errors/index'; -export * from './compiler'; diff --git a/node_modules/@sinclair/typebox/compiler/index.js b/node_modules/@sinclair/typebox/compiler/index.js deleted file mode 100644 index 7a013c3e..00000000 --- a/node_modules/@sinclair/typebox/compiler/index.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/compiler - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueErrorType = void 0; -var index_1 = require("../errors/index"); -Object.defineProperty(exports, "ValueErrorType", { enumerable: true, get: function () { return index_1.ValueErrorType; } }); -__exportStar(require("./compiler"), exports); diff --git a/node_modules/@sinclair/typebox/compiler/package.json b/node_modules/@sinclair/typebox/compiler/package.json new file mode 100644 index 00000000..75254db4 --- /dev/null +++ b/node_modules/@sinclair/typebox/compiler/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/compiler/index.js", + "types": "../build/cjs/compiler/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/errors/errors.d.ts b/node_modules/@sinclair/typebox/errors/errors.d.ts deleted file mode 100644 index 89786c61..00000000 --- a/node_modules/@sinclair/typebox/errors/errors.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as Types from '../typebox'; -export declare enum ValueErrorType { - Array = 0, - ArrayMinItems = 1, - ArrayMaxItems = 2, - ArrayUniqueItems = 3, - BigInt = 4, - BigIntMultipleOf = 5, - BigIntExclusiveMinimum = 6, - BigIntExclusiveMaximum = 7, - BigIntMinimum = 8, - BigIntMaximum = 9, - Boolean = 10, - Date = 11, - DateExclusiveMinimumTimestamp = 12, - DateExclusiveMaximumTimestamp = 13, - DateMinimumTimestamp = 14, - DateMaximumTimestamp = 15, - Function = 16, - Integer = 17, - IntegerMultipleOf = 18, - IntegerExclusiveMinimum = 19, - IntegerExclusiveMaximum = 20, - IntegerMinimum = 21, - IntegerMaximum = 22, - Intersect = 23, - IntersectUnevaluatedProperties = 24, - Literal = 25, - Never = 26, - Not = 27, - Null = 28, - Number = 29, - NumberMultipleOf = 30, - NumberExclusiveMinimum = 31, - NumberExclusiveMaximum = 32, - NumberMinumum = 33, - NumberMaximum = 34, - Object = 35, - ObjectMinProperties = 36, - ObjectMaxProperties = 37, - ObjectAdditionalProperties = 38, - ObjectRequiredProperties = 39, - Promise = 40, - RecordKeyNumeric = 41, - RecordKeyString = 42, - String = 43, - StringMinLength = 44, - StringMaxLength = 45, - StringPattern = 46, - StringFormatUnknown = 47, - StringFormat = 48, - Symbol = 49, - TupleZeroLength = 50, - TupleLength = 51, - Undefined = 52, - Union = 53, - Uint8Array = 54, - Uint8ArrayMinByteLength = 55, - Uint8ArrayMaxByteLength = 56, - Void = 57, - Custom = 58 -} -export interface ValueError { - type: ValueErrorType; - schema: Types.TSchema; - path: string; - value: unknown; - message: string; -} -export declare class ValueErrorIterator { - private readonly iterator; - constructor(iterator: IterableIterator); - [Symbol.iterator](): IterableIterator; - /** Returns the first value error or undefined if no errors */ - First(): ValueError | undefined; -} -export declare class ValueErrorsUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueErrorsDereferenceError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -/** Provides functionality to generate a sequence of errors against a TypeBox type. */ -export declare namespace ValueErrors { - function Errors(schema: T, references: Types.TSchema[], value: any): ValueErrorIterator; -} diff --git a/node_modules/@sinclair/typebox/errors/errors.js b/node_modules/@sinclair/typebox/errors/errors.js deleted file mode 100644 index 4f7210ba..00000000 --- a/node_modules/@sinclair/typebox/errors/errors.js +++ /dev/null @@ -1,609 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueErrors = exports.ValueErrorsDereferenceError = exports.ValueErrorsUnknownTypeError = exports.ValueErrorIterator = exports.ValueErrorType = void 0; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/errors - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -const Types = require("../typebox"); -const index_1 = require("../system/index"); -const hash_1 = require("../value/hash"); -// ------------------------------------------------------------------- -// ValueErrorType -// ------------------------------------------------------------------- -var ValueErrorType; -(function (ValueErrorType) { - ValueErrorType[ValueErrorType["Array"] = 0] = "Array"; - ValueErrorType[ValueErrorType["ArrayMinItems"] = 1] = "ArrayMinItems"; - ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems"; - ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 3] = "ArrayUniqueItems"; - ValueErrorType[ValueErrorType["BigInt"] = 4] = "BigInt"; - ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 5] = "BigIntMultipleOf"; - ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 6] = "BigIntExclusiveMinimum"; - ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 7] = "BigIntExclusiveMaximum"; - ValueErrorType[ValueErrorType["BigIntMinimum"] = 8] = "BigIntMinimum"; - ValueErrorType[ValueErrorType["BigIntMaximum"] = 9] = "BigIntMaximum"; - ValueErrorType[ValueErrorType["Boolean"] = 10] = "Boolean"; - ValueErrorType[ValueErrorType["Date"] = 11] = "Date"; - ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 12] = "DateExclusiveMinimumTimestamp"; - ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 13] = "DateExclusiveMaximumTimestamp"; - ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 14] = "DateMinimumTimestamp"; - ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 15] = "DateMaximumTimestamp"; - ValueErrorType[ValueErrorType["Function"] = 16] = "Function"; - ValueErrorType[ValueErrorType["Integer"] = 17] = "Integer"; - ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 18] = "IntegerMultipleOf"; - ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 19] = "IntegerExclusiveMinimum"; - ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 20] = "IntegerExclusiveMaximum"; - ValueErrorType[ValueErrorType["IntegerMinimum"] = 21] = "IntegerMinimum"; - ValueErrorType[ValueErrorType["IntegerMaximum"] = 22] = "IntegerMaximum"; - ValueErrorType[ValueErrorType["Intersect"] = 23] = "Intersect"; - ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 24] = "IntersectUnevaluatedProperties"; - ValueErrorType[ValueErrorType["Literal"] = 25] = "Literal"; - ValueErrorType[ValueErrorType["Never"] = 26] = "Never"; - ValueErrorType[ValueErrorType["Not"] = 27] = "Not"; - ValueErrorType[ValueErrorType["Null"] = 28] = "Null"; - ValueErrorType[ValueErrorType["Number"] = 29] = "Number"; - ValueErrorType[ValueErrorType["NumberMultipleOf"] = 30] = "NumberMultipleOf"; - ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 31] = "NumberExclusiveMinimum"; - ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 32] = "NumberExclusiveMaximum"; - ValueErrorType[ValueErrorType["NumberMinumum"] = 33] = "NumberMinumum"; - ValueErrorType[ValueErrorType["NumberMaximum"] = 34] = "NumberMaximum"; - ValueErrorType[ValueErrorType["Object"] = 35] = "Object"; - ValueErrorType[ValueErrorType["ObjectMinProperties"] = 36] = "ObjectMinProperties"; - ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 37] = "ObjectMaxProperties"; - ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 38] = "ObjectAdditionalProperties"; - ValueErrorType[ValueErrorType["ObjectRequiredProperties"] = 39] = "ObjectRequiredProperties"; - ValueErrorType[ValueErrorType["Promise"] = 40] = "Promise"; - ValueErrorType[ValueErrorType["RecordKeyNumeric"] = 41] = "RecordKeyNumeric"; - ValueErrorType[ValueErrorType["RecordKeyString"] = 42] = "RecordKeyString"; - ValueErrorType[ValueErrorType["String"] = 43] = "String"; - ValueErrorType[ValueErrorType["StringMinLength"] = 44] = "StringMinLength"; - ValueErrorType[ValueErrorType["StringMaxLength"] = 45] = "StringMaxLength"; - ValueErrorType[ValueErrorType["StringPattern"] = 46] = "StringPattern"; - ValueErrorType[ValueErrorType["StringFormatUnknown"] = 47] = "StringFormatUnknown"; - ValueErrorType[ValueErrorType["StringFormat"] = 48] = "StringFormat"; - ValueErrorType[ValueErrorType["Symbol"] = 49] = "Symbol"; - ValueErrorType[ValueErrorType["TupleZeroLength"] = 50] = "TupleZeroLength"; - ValueErrorType[ValueErrorType["TupleLength"] = 51] = "TupleLength"; - ValueErrorType[ValueErrorType["Undefined"] = 52] = "Undefined"; - ValueErrorType[ValueErrorType["Union"] = 53] = "Union"; - ValueErrorType[ValueErrorType["Uint8Array"] = 54] = "Uint8Array"; - ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 55] = "Uint8ArrayMinByteLength"; - ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 56] = "Uint8ArrayMaxByteLength"; - ValueErrorType[ValueErrorType["Void"] = 57] = "Void"; - ValueErrorType[ValueErrorType["Custom"] = 58] = "Custom"; -})(ValueErrorType = exports.ValueErrorType || (exports.ValueErrorType = {})); -// ------------------------------------------------------------------- -// ValueErrorIterator -// ------------------------------------------------------------------- -class ValueErrorIterator { - constructor(iterator) { - this.iterator = iterator; - } - [Symbol.iterator]() { - return this.iterator; - } - /** Returns the first value error or undefined if no errors */ - First() { - const next = this.iterator.next(); - return next.done ? undefined : next.value; - } -} -exports.ValueErrorIterator = ValueErrorIterator; -// ------------------------------------------------------------------- -// ValueErrors -// ------------------------------------------------------------------- -class ValueErrorsUnknownTypeError extends Error { - constructor(schema) { - super('ValueErrors: Unknown type'); - this.schema = schema; - } -} -exports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError; -class ValueErrorsDereferenceError extends Error { - constructor(schema) { - super(`ValueErrors: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueErrorsDereferenceError = ValueErrorsDereferenceError; -/** Provides functionality to generate a sequence of errors against a TypeBox type. */ -var ValueErrors; -(function (ValueErrors) { - // ---------------------------------------------------------------------- - // Guards - // ---------------------------------------------------------------------- - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsInteger(value) { - return globalThis.Number.isInteger(value); - } - function IsString(value) { - return typeof value === 'string'; - } - function IsDefined(value) { - return value !== undefined; - } - // ---------------------------------------------------------------------- - // Policies - // ---------------------------------------------------------------------- - function IsExactOptionalProperty(value, key) { - return index_1.TypeSystem.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined; - } - function IsObject(value) { - const result = typeof value === 'object' && value !== null; - return index_1.TypeSystem.AllowArrayObjects ? result : result && !globalThis.Array.isArray(value); - } - function IsRecordObject(value) { - return IsObject(value) && !(value instanceof globalThis.Date) && !(value instanceof globalThis.Uint8Array); - } - function IsNumber(value) { - const result = typeof value === 'number'; - return index_1.TypeSystem.AllowNaN ? result : result && globalThis.Number.isFinite(value); - } - function IsVoid(value) { - const result = value === undefined; - return index_1.TypeSystem.AllowVoidNull ? result || value === null : result; - } - // ---------------------------------------------------------------------- - // Types - // ---------------------------------------------------------------------- - function* Any(schema, references, path, value) { } - function* Array(schema, references, path, value) { - if (!globalThis.Array.isArray(value)) { - return yield { type: ValueErrorType.Array, schema, path, value, message: `Expected array` }; - } - if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { - yield { type: ValueErrorType.ArrayMinItems, schema, path, value, message: `Expected array length to be greater or equal to ${schema.minItems}` }; - } - if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { - yield { type: ValueErrorType.ArrayMinItems, schema, path, value, message: `Expected array length to be less or equal to ${schema.maxItems}` }; - } - // prettier-ignore - if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { - const hashed = hash_1.ValueHash.Create(element); - if (set.has(hashed)) { - return false; - } - else { - set.add(hashed); - } - } return true; })())) { - yield { type: ValueErrorType.ArrayUniqueItems, schema, path, value, message: `Expected array elements to be unique` }; - } - for (let i = 0; i < value.length; i++) { - yield* Visit(schema.items, references, `${path}/${i}`, value[i]); - } - } - function* BigInt(schema, references, path, value) { - if (!IsBigInt(value)) { - return yield { type: ValueErrorType.BigInt, schema, path, value, message: `Expected bigint` }; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === globalThis.BigInt(0))) { - yield { type: ValueErrorType.BigIntMultipleOf, schema, path, value, message: `Expected bigint to be a multiple of ${schema.multipleOf}` }; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - yield { type: ValueErrorType.BigIntExclusiveMinimum, schema, path, value, message: `Expected bigint to be greater than ${schema.exclusiveMinimum}` }; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - yield { type: ValueErrorType.BigIntExclusiveMaximum, schema, path, value, message: `Expected bigint to be less than ${schema.exclusiveMaximum}` }; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - yield { type: ValueErrorType.BigIntMinimum, schema, path, value, message: `Expected bigint to be greater or equal to ${schema.minimum}` }; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - yield { type: ValueErrorType.BigIntMaximum, schema, path, value, message: `Expected bigint to be less or equal to ${schema.maximum}` }; - } - } - function* Boolean(schema, references, path, value) { - if (!(typeof value === 'boolean')) { - return yield { type: ValueErrorType.Boolean, schema, path, value, message: `Expected boolean` }; - } - } - function* Constructor(schema, references, path, value) { - yield* Visit(schema.returns, references, path, value.prototype); - } - function* Date(schema, references, path, value) { - if (!(value instanceof globalThis.Date)) { - return yield { type: ValueErrorType.Date, schema, path, value, message: `Expected Date object` }; - } - if (!globalThis.isFinite(value.getTime())) { - return yield { type: ValueErrorType.Date, schema, path, value, message: `Invalid Date` }; - } - if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { - yield { type: ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value, message: `Expected Date timestamp to be greater than ${schema.exclusiveMinimum}` }; - } - if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { - yield { type: ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value, message: `Expected Date timestamp to be less than ${schema.exclusiveMaximum}` }; - } - if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { - yield { type: ValueErrorType.DateMinimumTimestamp, schema, path, value, message: `Expected Date timestamp to be greater or equal to ${schema.minimum}` }; - } - if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { - yield { type: ValueErrorType.DateMaximumTimestamp, schema, path, value, message: `Expected Date timestamp to be less or equal to ${schema.maximum}` }; - } - } - function* Function(schema, references, path, value) { - if (!(typeof value === 'function')) { - return yield { type: ValueErrorType.Function, schema, path, value, message: `Expected function` }; - } - } - function* Integer(schema, references, path, value) { - if (!IsInteger(value)) { - return yield { type: ValueErrorType.Integer, schema, path, value, message: `Expected integer` }; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { - yield { type: ValueErrorType.IntegerMultipleOf, schema, path, value, message: `Expected integer to be a multiple of ${schema.multipleOf}` }; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - yield { type: ValueErrorType.IntegerExclusiveMinimum, schema, path, value, message: `Expected integer to be greater than ${schema.exclusiveMinimum}` }; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - yield { type: ValueErrorType.IntegerExclusiveMaximum, schema, path, value, message: `Expected integer to be less than ${schema.exclusiveMaximum}` }; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - yield { type: ValueErrorType.IntegerMinimum, schema, path, value, message: `Expected integer to be greater or equal to ${schema.minimum}` }; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - yield { type: ValueErrorType.IntegerMaximum, schema, path, value, message: `Expected integer to be less or equal to ${schema.maximum}` }; - } - } - function* Intersect(schema, references, path, value) { - for (const subschema of schema.allOf) { - const next = Visit(subschema, references, path, value).next(); - if (!next.done) { - yield next.value; - yield { type: ValueErrorType.Intersect, schema, path, value, message: `Expected all sub schemas to be valid` }; - return; - } - } - if (schema.unevaluatedProperties === false) { - const schemaKeys = Types.KeyResolver.Resolve(schema); - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - for (const valueKey of valueKeys) { - if (!schemaKeys.includes(valueKey)) { - yield { type: ValueErrorType.IntersectUnevaluatedProperties, schema, path: `${path}/${valueKey}`, value, message: `Unexpected property` }; - } - } - } - if (typeof schema.unevaluatedProperties === 'object') { - const schemaKeys = Types.KeyResolver.Resolve(schema); - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - for (const valueKey of valueKeys) { - if (!schemaKeys.includes(valueKey)) { - const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next(); - if (!next.done) { - yield next.value; - yield { type: ValueErrorType.IntersectUnevaluatedProperties, schema, path: `${path}/${valueKey}`, value, message: `Invalid additional property` }; - return; - } - } - } - } - } - function* Literal(schema, references, path, value) { - if (!(value === schema.const)) { - const error = typeof schema.const === 'string' ? `'${schema.const}'` : schema.const; - return yield { type: ValueErrorType.Literal, schema, path, value, message: `Expected ${error}` }; - } - } - function* Never(schema, references, path, value) { - yield { type: ValueErrorType.Never, schema, path, value, message: `Value cannot be validated` }; - } - function* Not(schema, references, path, value) { - if (Visit(schema.allOf[0].not, references, path, value).next().done === true) { - yield { type: ValueErrorType.Not, schema, path, value, message: `Value should not validate` }; - } - yield* Visit(schema.allOf[1], references, path, value); - } - function* Null(schema, references, path, value) { - if (!(value === null)) { - return yield { type: ValueErrorType.Null, schema, path, value, message: `Expected null` }; - } - } - function* Number(schema, references, path, value) { - if (!IsNumber(value)) { - return yield { type: ValueErrorType.Number, schema, path, value, message: `Expected number` }; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { - yield { type: ValueErrorType.NumberMultipleOf, schema, path, value, message: `Expected number to be a multiple of ${schema.multipleOf}` }; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - yield { type: ValueErrorType.NumberExclusiveMinimum, schema, path, value, message: `Expected number to be greater than ${schema.exclusiveMinimum}` }; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - yield { type: ValueErrorType.NumberExclusiveMaximum, schema, path, value, message: `Expected number to be less than ${schema.exclusiveMaximum}` }; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - yield { type: ValueErrorType.NumberMaximum, schema, path, value, message: `Expected number to be greater or equal to ${schema.minimum}` }; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - yield { type: ValueErrorType.NumberMinumum, schema, path, value, message: `Expected number to be less or equal to ${schema.maximum}` }; - } - } - function* Object(schema, references, path, value) { - if (!IsObject(value)) { - return yield { type: ValueErrorType.Object, schema, path, value, message: `Expected object` }; - } - if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) { - yield { type: ValueErrorType.ObjectMinProperties, schema, path, value, message: `Expected object to have at least ${schema.minProperties} properties` }; - } - if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { - yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.minProperties} properties` }; - } - const requiredKeys = globalThis.Array.isArray(schema.required) ? schema.required : []; - const knownKeys = globalThis.Object.getOwnPropertyNames(schema.properties); - const unknownKeys = globalThis.Object.getOwnPropertyNames(value); - for (const knownKey of knownKeys) { - const property = schema.properties[knownKey]; - if (schema.required && schema.required.includes(knownKey)) { - yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]); - if (Types.ExtendsUndefined.Check(schema) && !(knownKey in value)) { - yield { type: ValueErrorType.ObjectRequiredProperties, schema: property, path: `${path}/${knownKey}`, value: undefined, message: `Expected required property` }; - } - } - else { - if (IsExactOptionalProperty(value, knownKey)) { - yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]); - } - } - } - for (const requiredKey of requiredKeys) { - if (unknownKeys.includes(requiredKey)) - continue; - yield { type: ValueErrorType.ObjectRequiredProperties, schema: schema.properties[requiredKey], path: `${path}/${requiredKey}`, value: undefined, message: `Expected required property` }; - } - if (schema.additionalProperties === false) { - for (const valueKey of unknownKeys) { - if (!knownKeys.includes(valueKey)) { - yield { type: ValueErrorType.ObjectAdditionalProperties, schema, path: `${path}/${valueKey}`, value: value[valueKey], message: `Unexpected property` }; - } - } - } - if (typeof schema.additionalProperties === 'object') { - for (const valueKey of unknownKeys) { - if (knownKeys.includes(valueKey)) - continue; - yield* Visit(schema.additionalProperties, references, `${path}/${valueKey}`, value[valueKey]); - } - } - } - function* Promise(schema, references, path, value) { - if (!(typeof value === 'object' && typeof value.then === 'function')) { - yield { type: ValueErrorType.Promise, schema, path, value, message: `Expected Promise` }; - } - } - function* Record(schema, references, path, value) { - if (!IsRecordObject(value)) { - return yield { type: ValueErrorType.Object, schema, path, value, message: `Expected record object` }; - } - if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) { - yield { type: ValueErrorType.ObjectMinProperties, schema, path, value, message: `Expected object to have at least ${schema.minProperties} properties` }; - } - if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { - yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.minProperties} properties` }; - } - const [keyPattern, valueSchema] = globalThis.Object.entries(schema.patternProperties)[0]; - const regex = new RegExp(keyPattern); - if (!globalThis.Object.getOwnPropertyNames(value).every((key) => regex.test(key))) { - const numeric = keyPattern === Types.PatternNumberExact; - const type = numeric ? ValueErrorType.RecordKeyNumeric : ValueErrorType.RecordKeyString; - const message = numeric ? 'Expected all object property keys to be numeric' : 'Expected all object property keys to be strings'; - return yield { type, schema, path, value, message }; - } - for (const [propKey, propValue] of globalThis.Object.entries(value)) { - yield* Visit(valueSchema, references, `${path}/${propKey}`, propValue); - } - } - function* Ref(schema, references, path, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueErrorsDereferenceError(schema); - const target = references[index]; - yield* Visit(target, references, path, value); - } - function* String(schema, references, path, value) { - if (!IsString(value)) { - return yield { type: ValueErrorType.String, schema, path, value, message: 'Expected string' }; - } - if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { - yield { type: ValueErrorType.StringMinLength, schema, path, value, message: `Expected string length greater or equal to ${schema.minLength}` }; - } - if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { - yield { type: ValueErrorType.StringMaxLength, schema, path, value, message: `Expected string length less or equal to ${schema.maxLength}` }; - } - if (schema.pattern !== undefined) { - const regex = new RegExp(schema.pattern); - if (!regex.test(value)) { - yield { type: ValueErrorType.StringPattern, schema, path, value, message: `Expected string to match pattern ${schema.pattern}` }; - } - } - if (schema.format !== undefined) { - if (!Types.FormatRegistry.Has(schema.format)) { - yield { type: ValueErrorType.StringFormatUnknown, schema, path, value, message: `Unknown string format '${schema.format}'` }; - } - else { - const format = Types.FormatRegistry.Get(schema.format); - if (!format(value)) { - yield { type: ValueErrorType.StringFormat, schema, path, value, message: `Expected string to match format '${schema.format}'` }; - } - } - } - } - function* Symbol(schema, references, path, value) { - if (!(typeof value === 'symbol')) { - return yield { type: ValueErrorType.Symbol, schema, path, value, message: 'Expected symbol' }; - } - } - function* TemplateLiteral(schema, references, path, value) { - if (!IsString(value)) { - return yield { type: ValueErrorType.String, schema, path, value, message: 'Expected string' }; - } - const regex = new RegExp(schema.pattern); - if (!regex.test(value)) { - yield { type: ValueErrorType.StringPattern, schema, path, value, message: `Expected string to match pattern ${schema.pattern}` }; - } - } - function* This(schema, references, path, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueErrorsDereferenceError(schema); - const target = references[index]; - yield* Visit(target, references, path, value); - } - function* Tuple(schema, references, path, value) { - if (!globalThis.Array.isArray(value)) { - return yield { type: ValueErrorType.Array, schema, path, value, message: 'Expected Array' }; - } - if (schema.items === undefined && !(value.length === 0)) { - return yield { type: ValueErrorType.TupleZeroLength, schema, path, value, message: 'Expected tuple to have 0 elements' }; - } - if (!(value.length === schema.maxItems)) { - yield { type: ValueErrorType.TupleLength, schema, path, value, message: `Expected tuple to have ${schema.maxItems} elements` }; - } - if (!schema.items) { - return; - } - for (let i = 0; i < schema.items.length; i++) { - yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]); - } - } - function* Undefined(schema, references, path, value) { - if (!(value === undefined)) { - yield { type: ValueErrorType.Undefined, schema, path, value, message: `Expected undefined` }; - } - } - function* Union(schema, references, path, value) { - const errors = []; - for (const inner of schema.anyOf) { - const variantErrors = [...Visit(inner, references, path, value)]; - if (variantErrors.length === 0) - return; - errors.push(...variantErrors); - } - if (errors.length > 0) { - yield { type: ValueErrorType.Union, schema, path, value, message: 'Expected value of union' }; - } - for (const error of errors) { - yield error; - } - } - function* Uint8Array(schema, references, path, value) { - if (!(value instanceof globalThis.Uint8Array)) { - return yield { type: ValueErrorType.Uint8Array, schema, path, value, message: `Expected Uint8Array` }; - } - if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { - yield { type: ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value, message: `Expected Uint8Array to have a byte length less or equal to ${schema.maxByteLength}` }; - } - if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { - yield { type: ValueErrorType.Uint8ArrayMinByteLength, schema, path, value, message: `Expected Uint8Array to have a byte length greater or equal to ${schema.maxByteLength}` }; - } - } - function* Unknown(schema, references, path, value) { } - function* Void(schema, references, path, value) { - if (!IsVoid(value)) { - return yield { type: ValueErrorType.Void, schema, path, value, message: `Expected void` }; - } - } - function* UserDefined(schema, references, path, value) { - const check = Types.TypeRegistry.Get(schema[Types.Kind]); - if (!check(schema, value)) { - return yield { type: ValueErrorType.Custom, schema, path, value, message: `Expected kind ${schema[Types.Kind]}` }; - } - } - function* Visit(schema, references, path, value) { - const references_ = IsDefined(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - switch (schema_[Types.Kind]) { - case 'Any': - return yield* Any(schema_, references_, path, value); - case 'Array': - return yield* Array(schema_, references_, path, value); - case 'BigInt': - return yield* BigInt(schema_, references_, path, value); - case 'Boolean': - return yield* Boolean(schema_, references_, path, value); - case 'Constructor': - return yield* Constructor(schema_, references_, path, value); - case 'Date': - return yield* Date(schema_, references_, path, value); - case 'Function': - return yield* Function(schema_, references_, path, value); - case 'Integer': - return yield* Integer(schema_, references_, path, value); - case 'Intersect': - return yield* Intersect(schema_, references_, path, value); - case 'Literal': - return yield* Literal(schema_, references_, path, value); - case 'Never': - return yield* Never(schema_, references_, path, value); - case 'Not': - return yield* Not(schema_, references_, path, value); - case 'Null': - return yield* Null(schema_, references_, path, value); - case 'Number': - return yield* Number(schema_, references_, path, value); - case 'Object': - return yield* Object(schema_, references_, path, value); - case 'Promise': - return yield* Promise(schema_, references_, path, value); - case 'Record': - return yield* Record(schema_, references_, path, value); - case 'Ref': - return yield* Ref(schema_, references_, path, value); - case 'String': - return yield* String(schema_, references_, path, value); - case 'Symbol': - return yield* Symbol(schema_, references_, path, value); - case 'TemplateLiteral': - return yield* TemplateLiteral(schema_, references_, path, value); - case 'This': - return yield* This(schema_, references_, path, value); - case 'Tuple': - return yield* Tuple(schema_, references_, path, value); - case 'Undefined': - return yield* Undefined(schema_, references_, path, value); - case 'Union': - return yield* Union(schema_, references_, path, value); - case 'Uint8Array': - return yield* Uint8Array(schema_, references_, path, value); - case 'Unknown': - return yield* Unknown(schema_, references_, path, value); - case 'Void': - return yield* Void(schema_, references_, path, value); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new ValueErrorsUnknownTypeError(schema); - return yield* UserDefined(schema_, references_, path, value); - } - } - function Errors(schema, references, value) { - const iterator = Visit(schema, references, '', value); - return new ValueErrorIterator(iterator); - } - ValueErrors.Errors = Errors; -})(ValueErrors = exports.ValueErrors || (exports.ValueErrors = {})); diff --git a/node_modules/@sinclair/typebox/errors/index.d.ts b/node_modules/@sinclair/typebox/errors/index.d.ts deleted file mode 100644 index f72bc43e..00000000 --- a/node_modules/@sinclair/typebox/errors/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './errors'; diff --git a/node_modules/@sinclair/typebox/errors/index.js b/node_modules/@sinclair/typebox/errors/index.js deleted file mode 100644 index 9637155f..00000000 --- a/node_modules/@sinclair/typebox/errors/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/errors - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./errors"), exports); diff --git a/node_modules/@sinclair/typebox/errors/package.json b/node_modules/@sinclair/typebox/errors/package.json new file mode 100644 index 00000000..39ae3d02 --- /dev/null +++ b/node_modules/@sinclair/typebox/errors/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/errors/index.js", + "types": "../build/cjs/errors/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/license b/node_modules/@sinclair/typebox/license index 08641fd6..5737c52e 100644 --- a/node_modules/@sinclair/typebox/license +++ b/node_modules/@sinclair/typebox/license @@ -1,8 +1,10 @@ -TypeBox: JSON Schema Type Builder with Static Type Resolution for TypeScript +TypeBox + +Json Schema Type Builder with Static Type Resolution for TypeScript The MIT License (MIT) -Copyright (c) 2017-2023 Haydn Paterson (sinclair) +Copyright (c) 2017-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/@sinclair/typebox/package.json b/node_modules/@sinclair/typebox/package.json index eeff01d9..ada9e971 100644 --- a/node_modules/@sinclair/typebox/package.json +++ b/node_modules/@sinclair/typebox/package.json @@ -1,7 +1,7 @@ { "name": "@sinclair/typebox", - "version": "0.27.8", - "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", + "version": "0.34.45", + "description": "Json Schema Type Builder with Static Type Resolution for TypeScript", "keywords": [ "typescript", "json-schema", @@ -10,38 +10,107 @@ ], "author": "sinclairzx81", "license": "MIT", - "main": "./typebox.js", - "types": "./typebox.d.ts", - "exports": { - "./compiler": "./compiler/index.js", - "./errors": "./errors/index.js", - "./system": "./system/index.js", - "./value": "./value/index.js", - ".": "./typebox.js" - }, "repository": { "type": "git", - "url": "https://github.com/sinclairzx81/typebox" + "url": "https://github.com/sinclairzx81/typebox-legacy" }, "scripts": { - "clean": "hammer task clean", - "format": "hammer task format", - "start": "hammer task start", - "test": "hammer task test", - "benchmark": "hammer task benchmark", - "build": "hammer task build", - "publish": "hammer task publish" + "test": "echo test" + }, + "types": "./build/cjs/index.d.ts", + "main": "./build/cjs/index.js", + "module": "./build/esm/index.mjs", + "esm.sh": { + "bundle": false }, - "devDependencies": { - "@sinclair/hammer": "^0.17.1", - "@types/chai": "^4.3.3", - "@types/mocha": "^9.1.1", - "@types/node": "^18.11.9", - "ajv": "^8.12.0", - "ajv-formats": "^2.1.1", - "chai": "^4.3.6", - "mocha": "^9.2.2", - "prettier": "^2.7.1", - "typescript": "^5.0.2" + "sideEffects": [ + "./build/esm/type/registry/format.mjs", + "./build/esm/type/registry/type.mjs", + "./build/esm/type/system/policy.mjs", + "./build/cjs/type/registry/format.js", + "./build/cjs/type/registry/type.js", + "./build/cjs/type/system/policy.js" + ], + "exports": { + ".": { + "require": { + "types": "./build/cjs/index.d.ts", + "default": "./build/cjs/index.js" + }, + "import": { + "types": "./build/esm/index.d.mts", + "default": "./build/esm/index.mjs" + } + }, + "./compiler": { + "require": { + "types": "./build/cjs/compiler/index.d.ts", + "default": "./build/cjs/compiler/index.js" + }, + "import": { + "types": "./build/esm/compiler/index.d.mts", + "default": "./build/esm/compiler/index.mjs" + } + }, + "./errors": { + "require": { + "types": "./build/cjs/errors/index.d.ts", + "default": "./build/cjs/errors/index.js" + }, + "import": { + "types": "./build/esm/errors/index.d.mts", + "default": "./build/esm/errors/index.mjs" + } + }, + "./parser": { + "require": { + "types": "./build/cjs/parser/index.d.ts", + "default": "./build/cjs/parser/index.js" + }, + "import": { + "types": "./build/esm/parser/index.d.mts", + "default": "./build/esm/parser/index.mjs" + } + }, + "./syntax": { + "require": { + "types": "./build/cjs/syntax/index.d.ts", + "default": "./build/cjs/syntax/index.js" + }, + "import": { + "types": "./build/esm/syntax/index.d.mts", + "default": "./build/esm/syntax/index.mjs" + } + }, + "./system": { + "require": { + "types": "./build/cjs/system/index.d.ts", + "default": "./build/cjs/system/index.js" + }, + "import": { + "types": "./build/esm/system/index.d.mts", + "default": "./build/esm/system/index.mjs" + } + }, + "./type": { + "require": { + "types": "./build/cjs/type/index.d.ts", + "default": "./build/cjs/type/index.js" + }, + "import": { + "types": "./build/esm/type/index.d.mts", + "default": "./build/esm/type/index.mjs" + } + }, + "./value": { + "require": { + "types": "./build/cjs/value/index.d.ts", + "default": "./build/cjs/value/index.js" + }, + "import": { + "types": "./build/esm/value/index.d.mts", + "default": "./build/esm/value/index.mjs" + } + } } -} +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/parser/package.json b/node_modules/@sinclair/typebox/parser/package.json new file mode 100644 index 00000000..6f4c9815 --- /dev/null +++ b/node_modules/@sinclair/typebox/parser/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/parser/index.js", + "types": "../build/cjs/parser/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/readme.md b/node_modules/@sinclair/typebox/readme.md index c5120a9d..3f1253cc 100644 --- a/node_modules/@sinclair/typebox/readme.md +++ b/node_modules/@sinclair/typebox/readme.md @@ -1,17 +1,18 @@

-

TypeBox

+

TypeBox 0.34.x

-

JSON Schema Type Builder with Static Type Resolution for TypeScript

- - +

Json Schema Type Builder with Static Type Resolution for TypeScript

+ +

[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox.svg)](https://badge.fury.io/js/%40sinclair%2Ftypebox) [![Downloads](https://img.shields.io/npm/dm/%40sinclair%2Ftypebox.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypebox) -[![GitHub CI](https://github.com/sinclairzx81/typebox/workflows/GitHub%20CI/badge.svg)](https://github.com/sinclairzx81/typebox/actions) +[![Build](https://github.com/sinclairzx81/typebox/actions/workflows/build.yml/badge.svg)](https://github.com/sinclairzx81/typebox/actions/workflows/build.yml) +[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -19,26 +20,16 @@ ## Install -#### Npm ```bash -$ npm install @sinclair/typebox --save -``` +$ npm install @sinclair/typebox # TypeBox-Legacy | 0.34.x -#### Deno -```typescript -import { Static, Type } from 'npm:@sinclair/typebox' -``` - -#### Esm - -```typescript -import { Static, Type } from 'https://esm.sh/@sinclair/typebox' +$ npm install typebox # TypeBox | 1.0.x ``` ## Example ```typescript -import { Static, Type } from '@sinclair/typebox' +import { Type, type Static } from '@sinclair/typebox' const T = Type.Object({ // const T = { x: Type.Number(), // type: 'object', @@ -62,9 +53,11 @@ type T = Static // type T = { ## Overview -TypeBox is a runtime type builder that creates in-memory JSON Schema objects that can be statically inferred as TypeScript types. The schemas produced by this library are designed to match the static type assertion rules of the TypeScript compiler. TypeBox enables one to create a unified type that can be statically checked by TypeScript and runtime asserted using standard JSON Schema validation. +> ⚠️ TypeBox versions (pre-1.0) will continue active maintenance through 2026 and beyond. This repository services as the OIDC publishing environment for the `@sinclair/typebox` package scope on NPM. For TypeBox versions 1.0 and above, refer to https://github.com/sinclairzx81/typebox -This library is designed to enable JSON schema to compose with the same flexibility as TypeScript's type system. It can be used as a simple tool to build up complex schemas or integrated into REST or RPC services to help validate data received over the wire. +TypeBox is a runtime type builder that creates in-memory Json Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime asserted using standard Json Schema validation. + +This library is designed to allow Json Schema to compose similar to how types compose within TypeScript's type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire. License MIT @@ -73,24 +66,32 @@ License MIT - [Overview](#overview) - [Usage](#usage) - [Types](#types) - - [Standard](#types-standard) - - [Extended](#types-extended) - - [Modifiers](#types-modifiers) + - [Json](#types-json) + - [JavaScript](#types-javascript) - [Options](#types-options) + - [Properties](#types-properties) - [Generics](#types-generics) - - [References](#types-references) - [Recursive](#types-recursive) - - [Conditional](#types-conditional) + - [Modules](#types-modules) - [Template Literal](#types-template-literal) - - [Guards](#types-guards) + - [Indexed](#types-indexed) + - [Mapped](#types-mapped) + - [Conditional](#types-conditional) + - [Transform](#types-transform) + - [Guard](#types-guard) - [Unsafe](#types-unsafe) - - [Strict](#types-strict) - [Values](#values) + - [Assert](#values-assert) - [Create](#values-create) - [Clone](#values-clone) - [Check](#values-check) - [Convert](#values-convert) + - [Default](#values-default) + - [Clean](#values-clean) - [Cast](#values-cast) + - [Decode](#values-decode) + - [Encode](#values-decode) + - [Parse](#values-parse) - [Equal](#values-equal) - [Hash](#values-hash) - [Diff](#values-diff) @@ -98,13 +99,26 @@ License MIT - [Errors](#values-errors) - [Mutate](#values-mutate) - [Pointer](#values-pointer) +- [Syntax](#syntax) + - [Create](#syntax-create) + - [Parameters](#syntax-parameters) + - [Generics](#syntax-generics) + - [Options](#syntax-options) + - [NoInfer](#syntax-no-infer) +- [TypeRegistry](#typeregistry) + - [Type](#typeregistry-type) + - [Format](#typeregistry-format) - [TypeCheck](#typecheck) - [Ajv](#typecheck-ajv) - [TypeCompiler](#typecheck-typecompiler) +- [TypeMap](#typemap) + - [Usage](#typemap-usage) - [TypeSystem](#typesystem) - - [Types](#typesystem-types) - - [Formats](#typesystem-formats) - [Policies](#typesystem-policies) +- [Error Function](#error-function) +- [Workbench](#workbench) +- [Codegen](#codegen) +- [Ecosystem](#ecosystem) - [Benchmark](#benchmark) - [Compile](#benchmark-compile) - [Validate](#benchmark-validate) @@ -118,7 +132,7 @@ License MIT The following shows general usage. ```typescript -import { Static, Type } from '@sinclair/typebox' +import { Type, type Static } from '@sinclair/typebox' //-------------------------------------------------------------------------------------------- // @@ -140,23 +154,23 @@ type T = { const T = Type.Object({ // const T = { id: Type.String(), // type: 'object', - name: Type.String(), // properties: { - timestamp: Type.Integer() // id: { -}) // type: 'string' + name: Type.String(), // properties: { + timestamp: Type.Integer() // id: { +}) // type: 'string' // }, - // name: { - // type: 'string' + // name: { + // type: 'string' // }, - // timestamp: { - // type: 'integer' + // timestamp: { + // type: 'integer' // } - // }, + // }, // required: [ // 'id', // 'name', // 'timestamp' // ] - // } + // } //-------------------------------------------------------------------------------------------- // @@ -172,36 +186,34 @@ type T = Static // type T = { //-------------------------------------------------------------------------------------------- // -// ... then use the type both as JSON schema and as a TypeScript type. +// ... or use the type to parse JavaScript values. // //-------------------------------------------------------------------------------------------- import { Value } from '@sinclair/typebox/value' -function receive(value: T) { // ... as a Static Type - - if(Value.Check(T, value)) { // ... as a JSON Schema - - // ok... - } -} +const R = Value.Parse(T, value) // const R: { + // id: string, + // name: string, + // timestamp: number + // } ``` ## Types -TypeBox types are JSON schema fragments that can be composed into more complex types. Each fragment is structured such that a JSON schema compliant validator can runtime assert a value the same way TypeScript will statically assert a type. TypeBox provides a set of Standard types which are used create JSON schema compliant schematics as well as an Extended type set used to create schematics for constructs native to JavaScript. +TypeBox types are Json Schema fragments that compose into more complex types. Each fragment is structured such that any Json Schema compliant validator can runtime assert a value the same way TypeScript will statically assert a type. TypeBox offers a set of Json Types which are used to create Json Schema compliant schematics as well as a JavaScript type set used to create schematics for constructs native to JavaScript. - + -### Standard Types +### Json Types -The following table lists the Standard TypeBox types. These types are fully compatible with the JSON Schema Draft 6 specification. +The following table lists the supported Json types. These types are fully compatible with the Json Schema Draft 7 specification. ```typescript ┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ -│ TypeBox │ TypeScript │ JSON Schema │ +│ TypeBox │ TypeScript │ Json Schema │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Any() │ type T = any │ const T = { } │ @@ -255,7 +267,8 @@ The following table lists the Standard TypeBox types. These types are fully comp │ }) │ } │ properties: { │ │ │ │ x: { │ │ │ │ type: 'number' │ -│ │ │ }, { │ +│ │ │ }, │ +│ │ │ y: { │ │ │ │ type: 'number' │ │ │ │ } │ │ │ │ } │ @@ -265,7 +278,7 @@ The following table lists the Standard TypeBox types. These types are fully comp │ const T = Type.Tuple([ │ type T = [number, number] │ const T = { │ │ Type.Number(), │ │ type: 'array', │ │ Type.Number() │ │ items: [{ │ -│ ]) │ │ type: 'number' │ +│ ]) │ │ type: 'number' │ │ │ │ }, { │ │ │ │ type: 'number' │ │ │ │ }], │ @@ -287,6 +300,22 @@ The following table lists the Standard TypeBox types. These types are fully comp │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Const({ │ type T = { │ const T = { │ +│ x: 1, │ readonly x: 1, │ type: 'object', │ +│ y: 2, │ readonly y: 2 │ required: ['x', 'y'], │ +│ } as const) │ } │ properties: { │ +│ │ │ x: { │ +│ │ │ type: 'number', │ +│ │ │ const: 1 │ +│ │ │ }, │ +│ │ │ y: { │ +│ │ │ type: 'number', │ +│ │ │ const: 2 │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.KeyOf( │ type T = keyof { │ const T = { │ │ Type.Object({ │ x: number, │ anyOf: [{ │ │ x: Type.Number(), │ y: number │ type: 'string', │ @@ -300,9 +329,9 @@ The following table lists the Standard TypeBox types. These types are fully comp ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Union([ │ type T = string | number │ const T = { │ │ Type.String(), │ │ anyOf: [{ │ -│ Type.Number() │ │ type: 'string' │ +│ Type.Number() │ │ type: 'string' │ │ ]) │ │ }, { │ -│ │ │ type: 'number' │ +│ │ │ type: 'number' │ │ │ │ }] │ │ │ │ } │ │ │ │ │ @@ -313,7 +342,7 @@ The following table lists the Standard TypeBox types. These types are fully comp │ }), │ y: number │ required: ['x'], │ │ Type.Object({ │ } │ properties: { │ │ y: Type.Number() │ │ x: { │ -│ ]) │ │ type: 'number' │ +│ }) │ │ type: 'number' │ │ ]) │ │ } │ │ │ │ } │ │ │ │ }, { │ @@ -328,15 +357,15 @@ The following table lists the Standard TypeBox types. These types are fully comp │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Composite([ │ type I = { │ const T = { │ -│ Type.Object({ │ x: number │ type: 'object', │ -│ x: Type.Number() │ } & { │ required: ['x', 'y'], │ -│ }), │ y: number │ properties: { │ -│ Type.Object({ │ } │ x: { │ +│ const T = Type.Composite([ │ type T = { │ const T = { │ +│ Type.Object({ │ x: number, │ type: 'object', │ +│ x: Type.Number() │ y: number │ required: ['x', 'y'], │ +│ }), │ } │ properties: { │ +│ Type.Object({ │ │ x: { │ │ y: Type.Number() │ │ type: 'number' │ -│ }) │ type T = { │ }, │ -│ ]) │ [K in keyof I]: I[K] │ y: { │ -│ │ } │ type: 'number' │ +│ }) │ │ }, │ +│ ]) │ │ y: { │ +│ │ │ type: 'number' │ │ │ │ } │ │ │ │ } │ │ │ │ } │ @@ -347,25 +376,16 @@ The following table lists the Standard TypeBox types. These types are fully comp │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Not( | type T = string │ const T = { │ -| Type.Union([ │ │ allOf: [{ │ -│ Type.Literal('x'), │ │ not: { │ -│ Type.Literal('y'), │ │ anyOf: [ │ -│ Type.Literal('z') │ │ { const: 'x' }, │ -│ ]), │ │ { const: 'y' }, │ -│ Type.String() │ │ { const: 'z' } │ -│ ) │ │ ] │ -│ │ │ } │ -│ │ │ }, { │ -│ │ │ type: 'string' │ -│ │ │ }] │ +│ const T = Type.Not( | type T = unknown │ const T = { │ +│ Type.String() │ │ not: { │ +│ ) │ │ type: 'string' │ +│ │ │ } │ │ │ │ } │ -│ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Extends( │ type T = │ const T = { │ │ Type.String(), │ string extends number │ const: false, │ -│ Type.Number(), │ true : false │ type: 'boolean' │ -│ Type.Literal(true), │ │ } │ +│ Type.Number(), │ ? true │ type: 'boolean' │ +│ Type.Literal(true), │ : false │ } │ │ Type.Literal(false) │ │ │ │ ) │ │ │ │ │ │ │ @@ -388,6 +408,20 @@ The following table lists the Standard TypeBox types. These types are fully comp │ ) │ │ │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Mapped( │ type T = { │ const T = { │ +│ Type.Union([ │ [_ in 'x' | 'y'] : number │ type: 'object', │ +│ Type.Literal('x'), │ } │ required: ['x', 'y'], │ +│ Type.Literal('y') │ │ properties: { │ +│ ]), │ │ x: { │ +│ () => Type.Number() │ │ type: 'number' │ +│ ) │ │ }, │ +│ │ │ y: { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const U = Type.Union([ │ type U = 'open' | 'close' │ const T = { │ │ Type.Literal('open'), │ │ type: 'string', │ │ Type.Literal('close') │ type T = `on${U}` │ pattern: '^on(open|close)$' │ @@ -459,24 +493,62 @@ The following table lists the Standard TypeBox types. These types are fully comp │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const R = { │ -│ x: Type.Number(), │ x: number, │ $ref: 'T' │ -│ y: Type.Number() │ y: number │ } │ -│ }, { $id: 'T' }) | } │ │ +│ const T = Type.Index( │ type T = { │ const T = { │ +│ Type.Object({ │ x: number, │ type: 'number' │ +│ x: Type.Number(), │ y: string │ } │ +│ y: Type.String() │ }['x'] │ │ +│ }), ['x'] │ │ │ +│ ) │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const A = Type.Tuple([ │ type A = [0, 1] │ const T = { │ +│ Type.Literal(0), │ type B = [2, 3] │ type: 'array', │ +│ Type.Literal(1) │ type T = [ │ items: [ │ +│ ]) │ ...A, │ { const: 0 }, │ +│ const B = Type.Tuple([ │ ...B │ { const: 1 }, │ +| Type.Literal(2), │ ] │ { const: 2 }, │ +| Type.Literal(3) │ │ { const: 3 } │ +│ ]) │ │ ], │ +│ const T = Type.Tuple([ │ │ additionalItems: false, │ +| ...Type.Rest(A), │ │ minItems: 4, │ +| ...Type.Rest(B) │ │ maxItems: 4 │ +│ ]) │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Uncapitalize( │ type T = Uncapitalize< │ const T = { │ +│ Type.Literal('Hello') │ 'Hello' │ type: 'string', │ +│ ) │ > │ const: 'hello' │ +│ │ │ } │ │ │ │ │ -│ const R = Type.Ref(T) │ type R = T │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Capitalize( │ type T = Capitalize< │ const T = { │ +│ Type.Literal('hello') │ 'hello' │ type: 'string', │ +│ ) │ > │ const: 'Hello' │ +│ │ │ } │ │ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Uppercase( │ type T = Uppercase< │ const T = { │ +│ Type.Literal('hello') │ 'hello' │ type: 'string', │ +│ ) │ > │ const: 'HELLO' │ +│ │ │ } │ │ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Lowercase( │ type T = Lowercase< │ const T = { │ +│ Type.Literal('HELLO') │ 'HELLO' │ type: 'string', │ +│ ) │ > │ const: 'hello' │ +│ │ │ } │ │ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const R = Type.Ref('T') │ type R = unknown │ const R = { $ref: 'T' } │ │ │ │ │ └────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ ``` - + -### Extended Types +### JavaScript Types -TypeBox provides several extended types that can be used to produce schematics for common JavaScript constructs. These types can not be used with standard JSON schema validators; but are useful to help frame schematics for RPC interfaces that may receive JSON validated data. Extended types are prefixed with the `[Extended]` doc comment for convenience. The following table lists the supported types. +TypeBox provides an extended type set that can be used to create schematics for common JavaScript constructs. These types can not be used with any standard Json Schema validator; but can be used to frame schematics for interfaces that may receive Json validated data. JavaScript types are prefixed with the `[JavaScript]` JSDoc comment for convenience. The following table lists the supported types. ```typescript ┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ @@ -484,100 +556,136 @@ TypeBox provides several extended types that can be used to produce schematics f │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Constructor([ │ type T = new ( │ const T = { │ -│ Type.String(), │ arg0: string, │ type: 'object', │ -│ Type.Number() │ arg1: number │ instanceOf: 'Constructor', │ -│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ -│ │ │ type: 'string' │ +│ Type.String(), │ arg0: string, │ type: 'Constructor', │ +│ Type.Number() │ arg0: number │ parameters: [{ │ +│ ], Type.Boolean()) │ ) => boolean │ type: 'string' │ │ │ │ }, { │ │ │ │ type: 'number' │ │ │ │ }], │ -│ │ │ return: { │ +│ │ │ returns: { │ │ │ │ type: 'boolean' │ │ │ │ } │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Function([ │ type T = ( │ const T = { │ -| Type.String(), │ arg0: string, │ type : 'object', │ -│ Type.Number() │ arg1: number │ instanceOf: 'Function', │ -│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ -│ │ │ type: 'string' │ +| Type.String(), │ arg0: string, │ type: 'Function', │ +│ Type.Number() │ arg1: number │ parameters: [{ │ +│ ], Type.Boolean()) │ ) => boolean │ type: 'string' │ │ │ │ }, { │ │ │ │ type: 'number' │ │ │ │ }], │ -│ │ │ return: { │ +│ │ │ returns: { │ │ │ │ type: 'boolean' │ │ │ │ } │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Promise( │ type T = Promise │ const T = { │ -│ Type.String() │ │ type: 'object', │ -│ ) │ │ instanceOf: 'Promise', │ -│ │ │ item: { │ +│ Type.String() │ │ type: 'Promise', │ +│ ) │ │ item: { │ +│ │ │ type: 'string' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = │ type T = │ const T = { │ +│ Type.AsyncIterator( │ AsyncIterableIterator< │ type: 'AsyncIterator', │ +│ Type.String() │ string │ items: { │ +│ ) │ > │ type: 'string' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Iterator( │ type T = │ const T = { │ +│ Type.String() │ IterableIterator │ type: 'Iterator', │ +│ ) │ │ items: { │ │ │ │ type: 'string' │ │ │ │ } │ │ │ │ } │ │ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.RegExp(/abc/i) │ type T = string │ const T = { │ +│ │ │ type: 'RegExp' │ +│ │ │ source: 'abc' │ +│ │ │ flags: 'i' │ +│ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Uint8Array() │ type T = Uint8Array │ const T = { │ -│ │ │ type: 'object', │ -│ │ │ instanceOf: 'Uint8Array' │ +│ │ │ type: 'Uint8Array' │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Date() │ type T = Date │ const T = { │ -│ │ │ type: 'object', │ -│ │ │ instanceOf: 'Date' │ +│ │ │ type: 'Date' │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Undefined() │ type T = undefined │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'Undefined' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.RegEx(/foo/) │ type T = string │ const T = { │ -│ │ │ type: 'string', │ -│ │ │ pattern: 'foo' │ +│ │ │ type: 'undefined' │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Symbol() │ type T = symbol │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'Symbol' │ +│ │ │ type: 'symbol' │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.BigInt() │ type T = bigint │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'BigInt' │ +│ │ │ type: 'bigint' │ │ │ │ } │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Void() │ type T = void │ const T = { │ -│ │ │ type: 'null' │ -│ │ │ typeOf: 'Void' │ +│ │ │ type: 'void' │ │ │ │ } │ │ │ │ │ └────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ ``` - + + +### Options + +You can pass Json Schema options on the last argument of any given type. Option hints specific to each type are provided for convenience. + +```typescript +// String must be an email +const T = Type.String({ // const T = { + format: 'email' // type: 'string', +}) // format: 'email' + // } + +// Number must be a multiple of 2 +const T = Type.Number({ // const T = { + multipleOf: 2 // type: 'number', +}) // multipleOf: 2 + // } + +// Array must have at least 5 integer values +const T = Type.Array(Type.Integer(), { // const T = { + minItems: 5 // type: 'array', +}) // minItems: 5, + // items: { + // type: 'integer' + // } + // } +``` + + -### Modifiers +### Properties -TypeBox provides modifiers that allow schema properties to be statically inferred as `readonly` or `optional`. The following table shows the supported modifiers and how they map between TypeScript and JSON Schema. +Object properties can be modified with Readonly and Optional. The following table shows how these modifiers map between TypeScript and Json Schema. ```typescript ┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ -│ TypeBox │ TypeScript │ JSON Schema │ +│ TypeBox │ TypeScript │ Json Schema │ │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Object({ │ type T = { │ const T = { │ -│ name: Type.Optional( │ name?: string │ type: 'object', │ +│ name: Type.ReadonlyOptional( │ readonly name?: string │ type: 'object', │ │ Type.String() │ } │ properties: { │ │ ) │ │ name: { │ │ }) │ │ type: 'string' │ @@ -598,7 +706,7 @@ TypeBox provides modifiers that allow schema properties to be statically inferre │ │ │ │ ├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ │ const T = Type.Object({ │ type T = { │ const T = { │ -│ name: Type.ReadonlyOptional( │ readonly name?: string │ type: 'object', │ +│ name: Type.Optional( │ name?: string │ type: 'object', │ │ Type.String() │ } │ properties: { │ │ ) │ │ name: { │ │ }) │ │ type: 'string' │ @@ -609,122 +717,30 @@ TypeBox provides modifiers that allow schema properties to be statically inferre └────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ ``` - - -### Options - -You can pass JSON Schema options on the last argument of any type. Option hints specific to each type are provided for convenience. - -```typescript -// String must be an email -const T = Type.String({ // const T = { - format: 'email' // type: 'string', -}) // format: 'email' - // } - -// Mumber must be a multiple of 2 -const T = Type.Number({ // const T = { - multipleOf: 2 // type: 'number', -}) // multipleOf: 2 - // } - -// Array must have at least 5 integer values -const T = Type.Array(Type.Integer(), { // const T = { - minItems: 5 // type: 'array', -}) // minItems: 5, - // items: { - // type: 'integer' - // } - // } - -``` - ### Generic Types -Generic types can be created with generic functions constrained to type `TSchema`. The following creates a generic `Vector` type. - -```typescript -import { Type, Static, TSchema } from '@sinclair/typebox' - -const Vector = (t: T) => Type.Object({ x: t, y: t, z: t }) - -const NumberVector = Vector(Type.Number()) // const NumberVector = { - // type: 'object', - // required: ['x', 'y', 'z'], - // properties: { - // x: { type: 'number' }, - // y: { type: 'number' }, - // z: { type: 'number' } - // } - // } - -type NumberVector = Static // type NumberVector = { - // x: number, - // y: number, - // z: number - // } - -const BooleanVector = Vector(Type.Boolean()) // const BooleanVector = { - // type: 'object', - // required: ['x', 'y', 'z'], - // properties: { - // x: { type: 'boolean' }, - // y: { type: 'boolean' }, - // z: { type: 'boolean' } - // } - // } - -type BooleanVector = Static // type BooleanVector = { - // x: boolean, - // y: boolean, - // z: boolean - // } -``` - -The following creates a generic `Nullable` type. +Generic types can be created with generic functions. ```typescript -const Nullable = (schema: T) => Type.Union([schema, Type.Null()]) - -const T = Nullable(Type.String()) // const T = { - // anyOf: [ - // { type: 'string' }, - // { type: 'null' } - // ] - // } - -type T = Static // type T = string | null -``` - - - -### Reference Types - -Reference types are supported with `Type.Ref`. The target type must specify a valid `$id`. +const Nullable = (T: T) => { // type Nullable = T | null + return Type.Union([T, Type.Null()]) +} -```typescript -const T = Type.String({ $id: 'T' }) // const T = { - // $id: 'T', - // type: 'string' - // } - -const R = Type.Ref(T) // const R = { - // $ref: 'T' - // } +const T = Nullable(Type.String()) // type T = Nullable ``` ### Recursive Types -Recursive types are supported with `Type.Recursive` +Use the Recursive function to create recursive types. ```typescript -const Node = Type.Recursive(Node => Type.Object({ // const Node = { +const Node = Type.Recursive(This => Type.Object({ // const Node = { id: Type.String(), // $id: 'Node', - nodes: Type.Array(Node) // type: 'object', + nodes: Type.Array(This) // type: 'object', }), { $id: 'Node' }) // properties: { // id: { // type: 'string' @@ -752,108 +768,219 @@ function test(node: Node) { } ``` - + -### Conditional Types +### Module Types -Conditional types are supported with `Type.Extends`, `Type.Exclude` and `Type.Extract` +Module types are containers for a set of referential types. Modules act as namespaces, enabling types to reference one another via string identifiers. Modules support both singular and mutually recursive references, as well as deferred dereferencing for computed types such as Partial. Types imported from a module are expressed using the Json Schema `$defs` keyword. ```typescript -// TypeScript +const Module = Type.Module({ + PartialUser: Type.Partial(Type.Ref('User')), // TComputed<'Partial', [TRef<'User'>]> + + User: Type.Object({ // TObject<{ + id: Type.String(), // user: TString, + name: Type.String(), // name: TString, + email: Type.String() // email: TString + }), // }> +}) +const User = Module.Import('User') // const User: TImport<{...}, 'User'> -type T0 = string extends number ? true : false // type T0 = false +type User = Static // type User = { + // id: string, + // name: string, + // email: string + // } -type T1 = Extract // type T1 = number +const PartialUser = Module.Import('PartialUser') // const PartialUser: TImport<{...}, 'PartialUser'> -type T2 = Exclude // type T2 = string +type PartialUser = Static // type PartialUser = { + // id?: string, + // name?: string, + // email?: string + // } +``` -// TypeBox + -const T0 = Type.Extends(Type.String(), Type.Number(), Type.Literal(true), Type.Literal(false)) +### Template Literal Types -const T1 = Type.Extract(Type.Union([Type.String(), Type.Number()]), Type.Number()) +TypeBox supports template literal types with the TemplateLiteral function. This type can be created using a syntax similar to the TypeScript template literal syntax or composed from exterior types. TypeBox encodes template literals as regular expressions which enables the template to be checked by Json Schema validators. This type also supports regular expression parsing that enables template patterns to be used for generative types. The following shows both TypeScript and TypeBox usage. -const T2 = Type.Exclude(Type.Union([Type.String(), Type.Number()]), Type.Number()) +```typescript +// TypeScript +type K = `prop${'A'|'B'|'C'}` // type T = 'propA' | 'propB' | 'propC' -type T0 = Static // type T0 = false +type R = Record // type R = { + // propA: string + // propB: string + // propC: string + // } -type T1 = Static // type T1 = number +// TypeBox -type T2 = Static // type T2 = string +const K = Type.TemplateLiteral('prop${A|B|C}') // const K: TTemplateLiteral<[ + // TLiteral<'prop'>, + // TUnion<[ + // TLiteral<'A'>, + // TLiteral<'B'>, + // TLiteral<'C'>, + // ]> + // ]> + +const R = Type.Record(K, Type.String()) // const R: TObject<{ + // propA: TString, + // propB: TString, + // propC: TString, + // }> ``` - + -### Template Literal Types +### Indexed Access Types -Template Literal types are supported with `Type.TemplateLiteral` +TypeBox supports indexed access types with the Index function. This function enables uniform access to interior property and element types without having to extract them from the underlying schema representation. Index types are supported for Object, Array, Tuple, Union and Intersect types. ```typescript -// TypeScript +const T = Type.Object({ // type T = { + x: Type.Number(), // x: number, + y: Type.String(), // y: string, + z: Type.Boolean() // z: boolean +}) // } + +const A = Type.Index(T, ['x']) // type A = T['x'] + // + // ... evaluated as + // + // const A: TNumber + +const B = Type.Index(T, ['x', 'y']) // type B = T['x' | 'y'] + // + // ... evaluated as + // + // const B: TUnion<[ + // TNumber, + // TString, + // ]> + +const C = Type.Index(T, Type.KeyOf(T)) // type C = T[keyof T] + // + // ... evaluated as + // + // const C: TUnion<[ + // TNumber, + // TString, + // TBoolean + // ]> +``` -type T = `option${'A'|'B'}` // type T = 'optionA' | 'optionB' + -type R = Record // type R = { - // optionA: string - // optionB: string - // } +### Mapped Types -// TypeBox +TypeBox supports mapped types with the Mapped function. This function accepts two arguments, the first is a union type typically derived from KeyOf, the second is a mapping function that receives a mapping key `K` that can be used to index properties of a type. The following implements a mapped type that remaps each property to be `T | null`. -const T = Type.TemplateLiteral([ // const T = { - Type.Literal('option'), // pattern: '^option(A|B)$', - Type.Union([ // type: 'string' - Type.Literal('A'), // } - Type.Literal('B') - ]) -]) +```typescript +const T = Type.Object({ // type T = { + x: Type.Number(), // x: number, + y: Type.String(), // y: string, + z: Type.Boolean() // z: boolean +}) // } + +const M = Type.Mapped(Type.KeyOf(T), K => { // type M = { [K in keyof T]: T[K] | null } + return Type.Union([Type.Index(T, K), Type.Null()]) // +}) // ... evaluated as + // + // const M: TObject<{ + // x: TUnion<[TNumber, TNull]>, + // y: TUnion<[TString, TNull]>, + // z: TUnion<[TBoolean, TNull]> + // }> +``` -const R = Type.Record(T, Type.String()) // const R = { - // type: 'object', - // required: ['optionA', 'optionB'], - // properties: { - // optionA: { - // type: 'string' - // }, - // optionB: { - // type: 'string' - // } - // } - // } + -type T = Static // type T = 'optionA' | 'optionB' +### Conditional Types -type R = Static // type R = { - // optionA: string - // optionB: string - // } +TypeBox supports runtime conditional types with the Extends function. This function performs a structural assignability check against the first (`left`) and second (`right`) arguments and will return either the third (`true`) or fourth (`false`) argument based on the result. The conditional types Exclude and Extract are also supported. The following shows both TypeScript and TypeBox examples of conditional types. + +```typescript +// Extends +const A = Type.Extends( // type A = string extends number ? 1 : 2 + Type.String(), // + Type.Number(), // ... evaluated as + Type.Literal(1), // + Type.Literal(2) // const A: TLiteral<2> +) + +// Extract +const B = Type.Extract( // type B = Extract<1 | 2 | 3, 1> + Type.Union([ // + Type.Literal(1), // ... evaluated as + Type.Literal(2), // + Type.Literal(3) // const B: TLiteral<1> + ]), + Type.Literal(1) +) + +// Exclude +const C = Type.Exclude( // type C = Exclude<1 | 2 | 3, 1> + Type.Union([ // + Type.Literal(1), // ... evaluated as + Type.Literal(2), // + Type.Literal(3) // const C: TUnion<[ + ]), // TLiteral<2>, + Type.Literal(1) // TLiteral<3>, +) // ]> ``` - + -### Unsafe +### Transform Types -Use `Type.Unsafe` to create custom schematics with user defined inference rules. +TypeBox supports value decoding and encoding with Transform types. These types work in tandem with the Encode and Decode functions available on the Value and TypeCompiler submodules. Transform types can be used to convert Json encoded values into constructs more natural to JavaScript. The following creates a Transform type to decode numbers into Dates using the Value submodule. ```typescript -const T = Type.Unsafe({ type: 'number' }) // const T = { - // type: 'number' - // } +import { Value } from '@sinclair/typebox/value' + +const T = Type.Transform(Type.Number()) + .Decode(value => new Date(value)) // decode: number to Date + .Encode(value => value.getTime()) // encode: Date to number -type T = Static // type T = string +const D = Value.Decode(T, 0) // const D = Date(1970-01-01T00:00:00.000Z) +const E = Value.Encode(T, D) // const E = 0 ``` +Use the StaticEncode or StaticDecode types to infer a Transform type. +```typescript +import { Static, StaticDecode, StaticEncode } from '@sinclair/typebox' -The `Type.Unsafe` type can be useful to express specific OpenAPI schema representations. +const T = Type.Transform(Type.Array(Type.Number(), { uniqueItems: true })) + .Decode(value => new Set(value)) + .Encode(value => [...value]) + +type D = StaticDecode // type D = Set +type E = StaticEncode // type E = Array +type T = Static // type T = Array +``` + + + +### Unsafe Types + +TypeBox supports user defined types with Unsafe. This type allows you to specify both schema representation and inference type. The following creates an Unsafe type with a number schema that infers as string. ```typescript -import { Type, Static, TSchema } from '@sinclair/typebox' +const T = Type.Unsafe({ type: 'number' }) // const T = { type: 'number' } -// Nullable +type T = Static // type T = string - ? +``` +The Unsafe type is often used to create schematics for extended specifications like OpenAPI. +```typescript -function Nullable(schema: T) { - return Type.Unsafe | null>({ ...schema, nullable: true }) -} +const Nullable = (schema: T) => Type.Unsafe | null>({ + ...schema, nullable: true +}) const T = Nullable(Type.String()) // const T = { // type: 'string', @@ -862,73 +989,52 @@ const T = Nullable(Type.String()) // const T = { type T = Static // type T = string | null -// StringEnum - -function StringEnum(values: [...T]) { - return Type.Unsafe({ type: 'string', enum: values }) -} - -const T = StringEnum(['A', 'B', 'C']) // const T = { +const StringEnum = (values: [...T]) => Type.Unsafe({ + type: 'string', enum: values +}) +const S = StringEnum(['A', 'B', 'C']) // const S = { // enum: ['A', 'B', 'C'] // } -type T = Static // type T = 'A' | 'B' | 'C' +type S = Static // type S = 'A' | 'B' | 'C' ``` + - +### TypeGuard -### Guards - -TypeBox provides a `TypeGuard` module that can be used for reflection and asserting values as types. +TypeBox can check its own types with the TypeGuard module. This module is written for type introspection and provides structural tests for every built-in TypeBox type. Functions of this module return `is` guards which can be used with control flow assertions to obtain schema inference for unknown values. The following guards that the value `T` is TString. ```typescript -import { Type, TypeGuard } from '@sinclair/typebox' +import { TypeGuard, Kind } from '@sinclair/typebox' + +const T = { [Kind]: 'String', type: 'string' } -const T = Type.String() +if(TypeGuard.IsString(T)) { -if(TypeGuard.TString(T)) { - // T is TString } ``` - + -### Strict +## Values -TypeBox schemas contain the `Kind` and `Modifier` symbol properties. These properties are used for type composition and reflection. These properties are not strictly valid JSON schema; so in some cases it may be desirable to omit them. TypeBox provides a `Type.Strict` function that will omit these properties if necessary. +TypeBox provides an optional Value submodule that can be used to perform structural operations on JavaScript values. This submodule includes functionality to create, check and cast values from types as well as check equality, clone, diff and patch JavaScript values. This submodule is provided via optional import. ```typescript -const T = Type.Object({ // const T = { - name: Type.Optional(Type.String()) // [Kind]: 'Object', -}) // type: 'object', - // properties: { - // name: { - // [Kind]: 'String', - // type: 'string', - // [Modifier]: 'Optional' - // } - // } - // } - -const U = Type.Strict(T) // const U = { - // type: 'object', - // properties: { - // name: { - // type: 'string' - // } - // } - // } +import { Value } from '@sinclair/typebox/value' ``` - + -## Values +### Assert -TypeBox provides an optional utility module that can be used to perform common operations on JavaScript values. This module includes functionality to create, check and cast values from types as well as check equality, clone, diff and patch JavaScript values. This module is provided via optional import. +Use the Assert function to assert a value is valid. ```typescript -import { Value } from '@sinclair/typebox/value' +let value: unknown = 1 + +Value.Assert(Type.Number(), value) // throws AssertError if invalid ``` @@ -947,7 +1053,7 @@ const A = Value.Create(T) // const A = { x: 0, y: 42 ### Clone -Use the Clone function to deeply clone a value +Use the Clone function to deeply clone a value. ```typescript const A = Value.Clone({ x: 1, y: 2, z: 3 }) // const A = { x: 1, y: 2, z: 3 } @@ -957,7 +1063,7 @@ const A = Value.Clone({ x: 1, y: 2, z: 3 }) // const A = { x: 1, y: 2, ### Check -Use the Check function to type check a value +Use the Check function to type check a value. ```typescript const T = Type.Object({ x: Type.Number() }) @@ -969,21 +1075,59 @@ const R = Value.Check(T, { x: 1 }) // const R = true ### Convert -Use the Convert function to convert a value into its target type if a reasonable conversion is possible. +Use the Convert function to convert a value into its target type if a reasonable conversion is possible. This function may return an invalid value and should be checked before use. Its return type is `unknown`. ```typescript const T = Type.Object({ x: Type.Number() }) -const R1 = Value.Convert(T, { x: '3.14' }) // const R1 = { x: 3.14 } +const R1 = Value.Convert(T, { x: '3.14' }) // const R1 = { x: 3.14 } + +const R2 = Value.Convert(T, { x: 'not a number' }) // const R2 = { x: 'not a number' } +``` + + + +### Clean + +Use Clean to remove excess properties from a value. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. + +```typescript +const T = Type.Object({ + x: Type.Number(), + y: Type.Number() +}) + +const X = Value.Clean(T, null) // const 'X = null + +const Y = Value.Clean(T, { x: 1 }) // const 'Y = { x: 1 } -const R2 = Value.Convert(T, { x: 'not a number' }) // const R2 = { x: 'not a number' } +const Z = Value.Clean(T, { x: 1, y: 2, z: 3 }) // const 'Z = { x: 1, y: 2 } +``` + + + +### Default + +Use Default to generate missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. + +```typescript +const T = Type.Object({ + x: Type.Number({ default: 0 }), + y: Type.Number({ default: 0 }) +}) + +const X = Value.Default(T, null) // const 'X = null - non-enumerable + +const Y = Value.Default(T, { }) // const 'Y = { x: 0, y: 0 } + +const Z = Value.Default(T, { x: 1 }) // const 'Z = { x: 1, y: 0 } ``` ### Cast -Use the Cast function to cast a value into a type. The cast function will retain as much information as possible from the original value. +Use the Cast function to upcast a value into a target type. This function will retain as much information as possible from the original value. The Cast function is intended to be used in data migration scenarios where existing values need to be upgraded to match a modified type. ```typescript const T = Type.Object({ x: Type.Number(), y: Type.Number() }, { additionalProperties: false }) @@ -995,6 +1139,57 @@ const Y = Value.Cast(T, { x: 1 }) // const Y = { x: 1, y: 0 } const Z = Value.Cast(T, { x: 1, y: 2, z: 3 }) // const Z = { x: 1, y: 2 } ``` + + +### Decode + +Use the Decode function to decode a value from a type or throw if the value is invalid. The return value will infer as the decoded type. This function will run Transform codecs if available. + +```typescript +const A = Value.Decode(Type.String(), 'hello') // const A = 'hello' + +const B = Value.Decode(Type.String(), 42) // throw +``` + + +### Encode + +Use the Encode function to encode a value to a type or throw if the value is invalid. The return value will infer as the encoded type. This function will run Transform codecs if available. + +```typescript +const A = Value.Encode(Type.String(), 'hello') // const A = 'hello' + +const B = Value.Encode(Type.String(), 42) // throw +``` + + + +### Parse + +Use the Parse function to parse a value. This function calls the `Clone` `Clean`, `Default`, `Convert`, `Assert` and `Decode` Value functions in this exact order to process a value. + +```typescript +const R = Value.Parse(Type.String(), 'hello') // const R: string = "hello" + +const E = Value.Parse(Type.String(), undefined) // throws AssertError +``` + +You can override the order in which functions are run, or omit functions entirely using the following. + +```typescript +// Runs no functions. + +const R = Value.Parse([], Type.String(), 12345) + +// Runs the Assert() function. + +const E = Value.Parse(['Assert'], Type.String(), 12345) + +// Runs the Convert() function followed by the Assert() function. + +const S = Value.Parse(['Convert', 'Assert'], Type.String(), 12345) +``` + ### Equal @@ -1012,34 +1207,34 @@ const R = Value.Equal( // const R = true ### Hash -Use the Hash function to create a [FNV1A-64](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non cryptographic hash of a value. +Use the Hash function to create a [FNV1A-64](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non-cryptographic hash of a value. ```typescript -const A = Value.Hash({ x: 1, y: 2, z: 3 }) // const A = 2910466848807138541n +const A = Value.Hash({ x: 1, y: 2, z: 3 }) // const A = 2910466848807138541n -const B = Value.Hash({ x: 1, y: 4, z: 3 }) // const B = 1418369778807423581n +const B = Value.Hash({ x: 1, y: 4, z: 3 }) // const B = 1418369778807423581n ``` ### Diff -Use the Diff function to produce a sequence of edits to transform one value into another. +Use the Diff function to generate a sequence of edits that will transform one value into another. ```typescript -const E = Value.Diff( // const E = [ - { x: 1, y: 2, z: 3 }, // { type: 'update', path: '/y', value: 4 }, - { y: 4, z: 5, w: 6 } // { type: 'update', path: '/z', value: 5 }, -) // { type: 'insert', path: '/w', value: 6 }, - // { type: 'delete', path: '/x' } - // ] +const E = Value.Diff( // const E = [ + { x: 1, y: 2, z: 3 }, // { type: 'update', path: '/y', value: 4 }, + { y: 4, z: 5, w: 6 } // { type: 'update', path: '/z', value: 5 }, +) // { type: 'insert', path: '/w', value: 6 }, + // { type: 'delete', path: '/x' } + // ] ``` ### Patch -Use the Patch function to apply edits +Use the Patch function to apply a sequence of edits. ```typescript const A = { x: 1, y: 2 } @@ -1058,7 +1253,7 @@ const C = Value.Patch(A, E) // const C = { x: 3 } ### Errors -Use the Errors function enumerate validation errors. +Use the Errors function to enumerate validation errors. ```typescript const T = Type.Object({ x: Type.Number(), y: Type.Number() }) @@ -1083,47 +1278,190 @@ const R = [...Value.Errors(T, { x: '42' })] // const R = [{ Use the Mutate function to perform a deep mutable value assignment while retaining internal references. ```typescript -const Y = { z: 1 } // const Y = { z: 1 } - +const Y = { z: 1 } // const Y = { z: 1 } const X = { y: Y } // const X = { y: { z: 1 } } +const A = { x: X } // const A = { x: { y: { z: 1 } } } -const A = { x: X } // const A = { x: { y: { z: 1 } } } - - -Value.Mutate(A, { x: { y: { z: 2 } } }) // const A' = { x: { y: { z: 2 } } } - -const R0 = A.x.y.z === 2 // const R0 = 2 +Value.Mutate(A, { x: { y: { z: 2 } } }) // A' = { x: { y: { z: 2 } } } +const R0 = A.x.y.z === 2 // const R0 = true const R1 = A.x.y === Y // const R1 = true - const R2 = A.x === X // const R2 = true -``` +``` ### Pointer -Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) JSON Pointers. +Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) Json Pointers. ```typescript import { ValuePointer } from '@sinclair/typebox/value' const A = { x: 0, y: 0, z: 0 } -ValuePointer.Set(A, '/x', 1) // const A' = { x: 1, y: 0, z: 0 } +ValuePointer.Set(A, '/x', 1) // A' = { x: 1, y: 0, z: 0 } +ValuePointer.Set(A, '/y', 1) // A' = { x: 1, y: 1, z: 0 } +ValuePointer.Set(A, '/z', 1) // A' = { x: 1, y: 1, z: 1 } +``` + + + + -ValuePointer.Set(A, '/y', 1) // const A' = { x: 1, y: 1, z: 0 } +## Syntax Types -ValuePointer.Set(A, '/z', 1) // const A' = { x: 1, y: 1, z: 1 } +TypeBox provides experimental support for parsing TypeScript annotation syntax into TypeBox types. + +This feature is provided via optional import. + +```typescript +import { Syntax } from '@sinclair/typebox/syntax' +``` + + + +### Create + +Use the Syntax function to create TypeBox types from TypeScript syntax ([Example](https://www.typescriptlang.org/play/?moduleResolution=99&module=199&ts=5.8.0-beta#code/JYWwDg9gTgLgBAbzgZQJ4DsYEMAecC+cAZlBCHAOQACAzsOgMYA2WwUA9DKmAKYBGEHOxoZsOCgChQkWIhTYYwBgWKly1OoxZtO3foMkSGEdDXgAVOAF4Uo3AAoABkhwAuOOgCuIPjygAaOFR3Lx8-AkcASjgY2Jj2djhjUwt3cwB5PgArHgYYAB4ECTiS0rLyisrYhNi3OHMAOW9fAOKq9o7OuBqY4PqmsKg2rpHR+MT8AD4JCS5eeut5LEUGfLmeCCJ6ybHKmvWFmyLdk86euDrQlv9h07uy876rv1v7t-GCIA)) + +```typescript +const T = Syntax(`{ x: number, y: number }`) // const T: TObject<{ + // x: TNumber, + // y: TNumber + // }> + +type T = Static // type T = { + // x: number, + // y: number + // } +``` + + + +### Parameters + +Syntax types can be parameterized to receive exterior types ([Example](https://www.typescriptlang.org/play/?moduleResolution=99&module=199&ts=5.8.0-beta#code/JYWwDg9gTgLgBAbzgZQJ4DsYEMAecC+cAZlBCHAOQACAzsOgMYA2WwUA9DKmAKYBGEHOxoZsOCgCgJDCOhrwAKnAC8KUbgAUAAyQ4AXHHQBXEHx5QANHFQHjp8wS0BKOK7ev27ODLmKDCgHk+ACseBhgAHgQJd1i4+ITEpLdPN304BQA5EzNLGOSCwqK4VNcbDOz7KHzi2rqPL3wAPikfeRQVNUxNJCV8Ky0ABSxYYCwmCIUm52LUtvhkfyDQ8Kia+o2C0rh0wLAYYFlxycrcpot1zav47fK9g6OJrJzzFuv3m8amoA)) + +```typescript +const T = Syntax(`{ x: number, y: number }`) // const T: TObject<{ + // x: TNumber, + // y: TNumber + // }> + +const S = Syntax({ T }, `Partial`) // const S: TObject<{ + // x: TOptional, + // y: TOptional + // }> +``` + + + + + +### Generics + +Syntax types support generic parameters in the following way ([Example](https://www.typescriptlang.org/play/?moduleResolution=99&module=199&ts=5.8.0-beta#code/JYWwDg9gTgLgBAbzgZQJ4DsYEMAecC+cAZlBCHAOQACAzsOgMYA2WwUA9DKmAKYBGEHOxoZsOCgChQkWIhTYYwBgWKly1OoxZtO3foMkSGEdDXgA1HgxjQ4AXhSjcACgAGAHgAaAGjgBNXwAtAD45CTg4HAAuOB84cLhUGID4iIAvGMD4-FcASgkjEzM4ACEsOhpLa2gae0dMFyQqmygCX1cEBOi4Zuh3AEZfAAZh4O8EpJ6rFvcRuEG4IbGEjKnqqFnh337lnPyJLl5S8uBK6Zq65AUld0OeCCJjit6oGlCIiPZ2ODun05fag5Oh8QaCweCIZCoV8Pt0kN0FpM5qshm0ElCMZisSCYRFJvCYnNJgsUWjseSKeDcXBVgTFr4kb5Vv0COjKezsTD8EA)) + +```typescript +const Vector = Syntax(` { + x: X, + y: Y, + z: Z +}`) + +const BasisVectors = Syntax({ Vector }, `{ + x: Vector<1, 0, 0>, + y: Vector<0, 1, 0>, + z: Vector<0, 0, 1>, +}`) + +type BasisVectors = Static // type BasisVectors = { + // x: { x: 1, y: 0, z: 0 }, + // y: { x: 0, y: 1, z: 0 }, + // z: { x: 0, y: 0, z: 1 } + // } +``` + + + +### Options + +Options can be passed via the last parameter. + +```typescript +const T = Syntax(`number`, { minimum: 42 }) // const T = { + // type: 'number', + // minimum: 42 + // } +``` + + + +### NoInfer + +Syntax parsing is an expensive type level operation and can impact on language service performance. Use the NoInfer function parse syntax at runtime only. + +```typescript +import { NoInfer } from '@sinclair/typebox/syntax' + +const T = NoInfer(`number | string`) // const T: TSchema = { + // anyOf: [ + // { type: 'number' }, + // { type: 'string' } + // ] + // } +``` + + + +## TypeRegistry + +The TypeBox type system can be extended with additional types and formats using the TypeRegistry and FormatRegistry modules. These modules integrate deeply with TypeBox's internal type checking infrastructure and can be used to create application specific types, or register schematics for alternative specifications. + + + +### TypeRegistry + +Use the TypeRegistry to register a type. The Kind must match the registered type name. + +```typescript +import { TSchema, Kind, TypeRegistry } from '@sinclair/typebox' + +TypeRegistry.Set('Foo', (schema, value) => value === 'foo') + +const Foo = { [Kind]: 'Foo' } as TSchema + +const A = Value.Check(Foo, 'foo') // const A = true + +const B = Value.Check(Foo, 'bar') // const B = false +``` + + + +### FormatRegistry + +Use the FormatRegistry to register a string format. + +```typescript +import { FormatRegistry } from '@sinclair/typebox' + +FormatRegistry.Set('foo', (value) => value === 'foo') + +const T = Type.String({ format: 'foo' }) + +const A = Value.Check(T, 'foo') // const A = true + +const B = Value.Check(T, 'bar') // const B = false ``` ## TypeCheck -TypeBox types target JSON Schema draft 6 so are compatible with any validator that supports this specification. TypeBox also provides a built in type checking compiler designed specifically for high performance compilation and value assertion. +TypeBox types target Json Schema Draft 7 and are compatible with any validator that supports this specification. TypeBox also provides a built-in type checking compiler designed specifically for TypeBox types that offers high performance compilation and value checking. -The following sections detail using Ajv and TypeBox's compiler infrastructure. +The following sections detail using Ajv and the TypeBox compiler infrastructure. @@ -1141,36 +1479,36 @@ import addFormats from 'ajv-formats' import Ajv from 'ajv' const ajv = addFormats(new Ajv({}), [ - 'date-time', - 'time', - 'date', - 'email', - 'hostname', - 'ipv4', - 'ipv6', - 'uri', - 'uri-reference', + 'date-time', + 'time', + 'date', + 'email', + 'hostname', + 'ipv4', + 'ipv6', + 'uri', + 'uri-reference', 'uuid', - 'uri-template', - 'json-pointer', - 'relative-json-pointer', + 'uri-template', + 'json-pointer', + 'relative-json-pointer', 'regex' ]) -const C = ajv.compile(Type.Object({ +const validate = ajv.compile(Type.Object({ x: Type.Number(), y: Type.Number(), z: Type.Number() })) -const R = C({ x: 1, y: 2, z: 3 }) // const R = true +const R = validate({ x: 1, y: 2, z: 3 }) // const R = true ``` ### TypeCompiler -The TypeBox TypeCompiler is a high performance JIT compiler that transforms TypeBox types into optimized JavaScript validation routines. The compiler is tuned for fast compilation as well as fast value assertion. It is designed to serve as a validation backend that can be integrated into larger applications; but can also be used as a general purpose validator. +The TypeBox TypeCompiler is a high performance JIT validation compiler that transforms TypeBox types into optimized JavaScript validation routines. The compiler is tuned for fast compilation as well as fast value assertion. It is built to serve as a validation backend that can be integrated into larger applications. It can also be used for code generation. The TypeCompiler is provided as an optional import. @@ -1178,7 +1516,7 @@ The TypeCompiler is provided as an optional import. import { TypeCompiler } from '@sinclair/typebox/compiler' ``` -Use the `Compile(...)` function to compile a type. +Use the Compile function to JIT compile a type. Note that compilation is generally an expensive operation and should only be performed once per type during application start up. TypeBox does not cache previously compiled types, and applications are expected to hold references to each compiled type for the lifetime of the application. ```typescript const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck - -console.log(C.Code()) // return function check(value) { +const C = TypeCompiler.Code(Type.String()) // const C = `return function check(value) { // return ( // (typeof value === 'string') // ) - // } + // }` ``` - + -## TypeSystem - -The TypeBox TypeSystem module provides functionality to define types above and beyond the Standard and Extended type sets as well as control various assertion polices. Configurations made to the TypeSystem module are observed by both `TypeCompiler` and `Value` modules. +## TypeMap -The TypeSystem module is provided as an optional import. +TypeBox offers an external package for bidirectional mapping between TypeBox, Valibot, and Zod type libraries. It also includes syntax parsing support for Valibot and Zod and supports the Standard Schema specification. For more details on TypeMap, refer to the project repository. -```typescript -import { TypeSystem } from '@sinclair/typebox/system' -``` +[TypeMap Repository](https://github.com/sinclairzx81/typemap) - + -### Types +### Usage -Use the `Type(...)` function to create a custom type. This function will return a type factory function that can be used to construct the type. The following creates a Point type. +TypeMap needs to be installed separately -```typescript -type PointOptions = { } // The Type Options +```bash +$ npm install @sinclair/typemap +``` -type PointType = { x: number, y: number } // The Static Type +Once installed it offers advanced structural remapping between various runtime type libraries ([Example](https://www.typescriptlang.org/play/?moduleResolution=99&module=199&ts=5.8.0-beta#code/JYWwDg9gTgLgBAbzgFQJ5gKYCEIA8A0cAyqgHYwCGBcAWhACZwC+cAZlBCHAOQACAzsFIBjADYVgUAPQx0GEBTDcAUMuERS-eMjgBeFHJy4AFAAMkuAFxxSAVxAAjDFEKprdx88IAvd-adQzKYAlHBwUlJw6pra1sgA8g4AVhjCMAA8CMphObl5+QWFRcW5ETlWKABy-s4A3NkljU3NBWVhblU1UPUtvX3FbXC+nZ7dDf0TE2VMAHyq0VrEesRklCbIoS1lC-BE1twWfqOuRwE+p87MKmoaiwBKy3T0xkTBAHRgFFD8GMZ2oqJNnltrd4HdrFlJltImEKh4Aj0oU1Bh14XVxkiBjChhcxpjGtMwkA)) -const Point = TypeSystem.Type('Point', (options, value) => { - return ( - typeof value === 'object' && value !== null && - typeof value.x === 'number' && - typeof value.y === 'number' - ) -}) +```typescript +import { TypeBox, Syntax, Zod } from '@sinclair/typemap' -const T = Point() +const T = TypeBox(`{ x: number, y: number, z: number }`) // const T: TObject<{ + // x: TNumber; + // y: TNumber; + // z: TNumber; + // }> -type T = Static // type T = { x: number, y: number } +const S = Syntax(T) // const S: '{ x: number, y: number, z: number }' -const R = Value.Check(T, { x: 1, y: 2 }) // const R = true +const R = Zod(S).parse(null) // const R: { + // x: number; + // y: number; + // z: number; + // } ``` - + -### Formats +## TypeSystem -Use the `Format(...)` function to create a custom string format. The following creates a format that checks for lowercase strings. +The TypeBox TypeSystem module provides configurations to use either Json Schema or TypeScript type checking semantics. Configurations made to the TypeSystem module are observed by the TypeCompiler, Value and Error modules. -```typescript -TypeSystem.Format('lowercase', value => value === value.toLowerCase()) // format should be lowercase + -const T = Type.String({ format: 'lowercase' }) +### Policies -const A = Value.Check(T, 'Hello') // const A = false +TypeBox validates using standard Json Schema assertion policies by default. The TypeSystemPolicy module can override some of these to have TypeBox assert values inline with TypeScript static checks. It also provides overrides for certain checking rules related to non-serializable values (such as void) which can be helpful in Json based protocols such as Json Rpc 2.0. -const B = Value.Check(T, 'hello') // const B = true -``` +The following overrides are available. - +```typescript +import { TypeSystemPolicy } from '@sinclair/typebox/system' -### Policies +// Disallow undefined values for optional properties (default is false) +// +// const A: { x?: number } = { x: undefined } - disallowed when enabled -TypeBox validates using JSON Schema assertion policies by default. It is possible to override these policies and have TypeBox assert using TypeScript policies. The following overrides are available. +TypeSystemPolicy.ExactOptionalPropertyTypes = true -```typescript // Allow arrays to validate as object types (default is false) // // const A: {} = [] - allowed in TS -TypeSystem.AllowArrayObjects = true +TypeSystemPolicy.AllowArrayObject = true // Allow numeric values to be NaN or + or - Infinity (default is false) // // const A: number = NaN - allowed in TS -TypeSystem.AllowNaN = true +TypeSystemPolicy.AllowNaN = true + +// Allow void types to check with undefined and null (default is false) +// +// Used to signal void return on Json-Rpc 2.0 protocol + +TypeSystemPolicy.AllowNullVoid = true ``` + + +## Error Function + +Error messages in TypeBox can be customized by defining an ErrorFunction. This function allows for the localization of error messages as well as enabling custom error messages for custom types. By default, TypeBox will generate messages using the `en-US` locale. To support additional locales, you can replicate the function found in `src/errors/function.ts` and create a locale specific translation. The function can then be set via SetErrorFunction. + +The following example shows an inline error function that intercepts errors for String, Number and Boolean only. The DefaultErrorFunction is used to return a default error message. + + +```typescript +import { SetErrorFunction, DefaultErrorFunction, ValueErrorType } from '@sinclair/typebox/errors' + +SetErrorFunction((error) => { // i18n override + switch(error.errorType) { + /* en-US */ case ValueErrorType.String: return 'Expected string' + /* fr-FR */ case ValueErrorType.Number: return 'Nombre attendu' + /* ko-KR */ case ValueErrorType.Boolean: return '예상 부울' + /* en-US */ default: return DefaultErrorFunction(error) + } +}) +const T = Type.Object({ // const T: TObject<{ + x: Type.String(), // TString, + y: Type.Number(), // TNumber, + z: Type.Boolean() // TBoolean +}) // }> + +const E = [...Value.Errors(T, { // const E = [{ + x: null, // type: 48, + y: null, // schema: { ... }, + z: null // path: '/x', +})] // value: null, + // message: 'Expected string' + // }, { + // type: 34, + // schema: { ... }, + // path: '/y', + // value: null, + // message: 'Nombre attendu' + // }, { + // type: 14, + // schema: { ... }, + // path: '/z', + // value: null, + // message: '예상 부울' + // }] +``` + + + +## TypeBox Workbench + +TypeBox offers a web based code generation tool that can convert TypeScript types into TypeBox types as well as several other ecosystem libraries. + +[TypeBox Workbench Link Here](https://sinclairzx81.github.io/typebox-workbench/) + + + +## TypeBox Codegen + +TypeBox provides a code generation library that can be integrated into toolchains to automate type translation between TypeScript and TypeBox. This library also includes functionality to transform TypeScript types to other ecosystem libraries. + +[TypeBox Codegen Link Here](https://github.com/sinclairzx81/typebox-codegen) + + + +## Ecosystem + +The following is a list of community packages that offer general tooling, extended functionality and framework integration support for TypeBox. + +| Package | Description | +| ------------- | ------------- | +| [drizzle-typebox](https://www.npmjs.com/package/drizzle-typebox) | Generates TypeBox types from Drizzle ORM schemas | +| [elysia](https://github.com/elysiajs/elysia) | Fast and friendly Bun web framework | +| [fastify-type-provider-typebox](https://github.com/fastify/fastify-type-provider-typebox) | Fastify TypeBox integration with the Fastify Type Provider | +| [feathersjs](https://github.com/feathersjs/feathers) | The API and real-time application framework | +| [fetch-typebox](https://github.com/erfanium/fetch-typebox) | Drop-in replacement for fetch that brings easy integration with TypeBox | +| [@lonli-lokli/fetcher-typebox](https://github.com/Lonli-Lokli/fetcher-ts/tree/master/packages/fetcher-typebox) | A strongly-typed fetch wrapper for TypeScript applications with optional runtime validation using TypeBox | +| [h3-typebox](https://github.com/kevinmarrec/h3-typebox) | Schema validation utilities for h3 using TypeBox & Ajv | +| [http-wizard](https://github.com/flodlc/http-wizard) | Type safe http client library for Fastify | +| [json2typebox](https://github.com/hacxy/json2typebox) | Creating TypeBox code from Json Data | +| [nominal-typebox](https://github.com/Coder-Spirit/nominal/tree/main/%40coderspirit/nominal-typebox) | Allows devs to integrate nominal types into TypeBox schemas | +| [openapi-box](https://github.com/geut/openapi-box) | Generate TypeBox types from OpenApi IDL + Http client library | +| [prismabox](https://github.com/m1212e/prismabox) | Converts a prisma.schema to TypeBox schema matching the database models | +| [schema2typebox](https://github.com/xddq/schema2typebox) | Creating TypeBox code from Json Schemas | +| [sveltekit-superforms](https://github.com/ciscoheat/sveltekit-superforms) | A comprehensive SvelteKit form library for server and client validation | +| [ts2typebox](https://github.com/xddq/ts2typebox) | Creating TypeBox code from Typescript types | +| [typebox-cli](https://github.com/gsuess/typebox-cli) | Generate Schema with TypeBox from the CLI | +| [typebox-form-parser](https://github.com/jtlapp/typebox-form-parser) | Parses form and query data based on TypeBox schemas | +| [typebox-schema-faker](https://github.com/iam-medvedev/typebox-schema-faker) | Generate fake data from TypeBox schemas for testing, prototyping and development | + + ## Benchmark -This project maintains a set of benchmarks that measure Ajv, Value and TypeCompiler compilation and validation performance. These benchmarks can be run locally by cloning this repository and running `npm run benchmark`. The results below show for Ajv version 8.12.0. +This project maintains a set of benchmarks that measure Ajv, Value and TypeCompiler compilation and validation performance. These benchmarks can be run locally by cloning this repository and running `npm run benchmark`. The results below show for Ajv version 8.12.0 running on Node 20.10.0. For additional comparative benchmarks, please refer to [typescript-runtime-type-benchmarks](https://moltar.github.io/typescript-runtime-type-benchmarks/). @@ -1317,41 +1757,41 @@ For additional comparative benchmarks, please refer to [typescript-runtime-type- ### Compile -This benchmark measures compilation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/compile.ts). +This benchmark measures compilation performance for varying types. ```typescript ┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐ -│ (index) │ Iterations │ Ajv │ TypeCompiler │ Performance │ +│ (index) │ Iterations │ Ajv │ TypeCompiler │ Performance │ ├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┤ -│ Literal_String │ 1000 │ ' 257 ms' │ ' 8 ms' │ ' 32.13 x' │ -│ Literal_Number │ 1000 │ ' 203 ms' │ ' 4 ms' │ ' 50.75 x' │ -│ Literal_Boolean │ 1000 │ ' 183 ms' │ ' 4 ms' │ ' 45.75 x' │ -│ Primitive_Number │ 1000 │ ' 174 ms' │ ' 8 ms' │ ' 21.75 x' │ -│ Primitive_String │ 1000 │ ' 158 ms' │ ' 9 ms' │ ' 17.56 x' │ -│ Primitive_String_Pattern │ 1000 │ ' 213 ms' │ ' 13 ms' │ ' 16.38 x' │ -│ Primitive_Boolean │ 1000 │ ' 136 ms' │ ' 6 ms' │ ' 22.67 x' │ -│ Primitive_Null │ 1000 │ ' 144 ms' │ ' 6 ms' │ ' 24.00 x' │ -│ Object_Unconstrained │ 1000 │ ' 1176 ms' │ ' 38 ms' │ ' 30.95 x' │ -│ Object_Constrained │ 1000 │ ' 1181 ms' │ ' 31 ms' │ ' 38.10 x' │ -│ Object_Vector3 │ 1000 │ ' 387 ms' │ ' 8 ms' │ ' 48.38 x' │ -│ Object_Box3D │ 1000 │ ' 1693 ms' │ ' 25 ms' │ ' 67.72 x' │ -│ Tuple_Primitive │ 1000 │ ' 470 ms' │ ' 15 ms' │ ' 31.33 x' │ -│ Tuple_Object │ 1000 │ ' 1206 ms' │ ' 17 ms' │ ' 70.94 x' │ -│ Composite_Intersect │ 1000 │ ' 567 ms' │ ' 20 ms' │ ' 28.35 x' │ -│ Composite_Union │ 1000 │ ' 515 ms' │ ' 21 ms' │ ' 24.52 x' │ -│ Math_Vector4 │ 1000 │ ' 787 ms' │ ' 10 ms' │ ' 78.70 x' │ -│ Math_Matrix4 │ 1000 │ ' 386 ms' │ ' 8 ms' │ ' 48.25 x' │ -│ Array_Primitive_Number │ 1000 │ ' 349 ms' │ ' 7 ms' │ ' 49.86 x' │ -│ Array_Primitive_String │ 1000 │ ' 336 ms' │ ' 4 ms' │ ' 84.00 x' │ -│ Array_Primitive_Boolean │ 1000 │ ' 284 ms' │ ' 3 ms' │ ' 94.67 x' │ -│ Array_Object_Unconstrained │ 1000 │ ' 1704 ms' │ ' 19 ms' │ ' 89.68 x' │ -│ Array_Object_Constrained │ 1000 │ ' 1456 ms' │ ' 18 ms' │ ' 80.89 x' │ -│ Array_Tuple_Primitive │ 1000 │ ' 792 ms' │ ' 15 ms' │ ' 52.80 x' │ -│ Array_Tuple_Object │ 1000 │ ' 1552 ms' │ ' 17 ms' │ ' 91.29 x' │ -│ Array_Composite_Intersect │ 1000 │ ' 744 ms' │ ' 18 ms' │ ' 41.33 x' │ -│ Array_Composite_Union │ 1000 │ ' 783 ms' │ ' 15 ms' │ ' 52.20 x' │ -│ Array_Math_Vector4 │ 1000 │ ' 1093 ms' │ ' 14 ms' │ ' 78.07 x' │ -│ Array_Math_Matrix4 │ 1000 │ ' 684 ms' │ ' 6 ms' │ ' 114.00 x' │ +│ Literal_String │ 1000 │ ' 211 ms' │ ' 8 ms' │ ' 26.38 x' │ +│ Literal_Number │ 1000 │ ' 185 ms' │ ' 5 ms' │ ' 37.00 x' │ +│ Literal_Boolean │ 1000 │ ' 195 ms' │ ' 4 ms' │ ' 48.75 x' │ +│ Primitive_Number │ 1000 │ ' 149 ms' │ ' 7 ms' │ ' 21.29 x' │ +│ Primitive_String │ 1000 │ ' 135 ms' │ ' 5 ms' │ ' 27.00 x' │ +│ Primitive_String_Pattern │ 1000 │ ' 193 ms' │ ' 10 ms' │ ' 19.30 x' │ +│ Primitive_Boolean │ 1000 │ ' 152 ms' │ ' 4 ms' │ ' 38.00 x' │ +│ Primitive_Null │ 1000 │ ' 147 ms' │ ' 4 ms' │ ' 36.75 x' │ +│ Object_Unconstrained │ 1000 │ ' 1065 ms' │ ' 26 ms' │ ' 40.96 x' │ +│ Object_Constrained │ 1000 │ ' 1183 ms' │ ' 26 ms' │ ' 45.50 x' │ +│ Object_Vector3 │ 1000 │ ' 407 ms' │ ' 9 ms' │ ' 45.22 x' │ +│ Object_Box3D │ 1000 │ ' 1777 ms' │ ' 24 ms' │ ' 74.04 x' │ +│ Tuple_Primitive │ 1000 │ ' 485 ms' │ ' 11 ms' │ ' 44.09 x' │ +│ Tuple_Object │ 1000 │ ' 1344 ms' │ ' 17 ms' │ ' 79.06 x' │ +│ Composite_Intersect │ 1000 │ ' 606 ms' │ ' 14 ms' │ ' 43.29 x' │ +│ Composite_Union │ 1000 │ ' 522 ms' │ ' 17 ms' │ ' 30.71 x' │ +│ Math_Vector4 │ 1000 │ ' 851 ms' │ ' 9 ms' │ ' 94.56 x' │ +│ Math_Matrix4 │ 1000 │ ' 406 ms' │ ' 10 ms' │ ' 40.60 x' │ +│ Array_Primitive_Number │ 1000 │ ' 367 ms' │ ' 6 ms' │ ' 61.17 x' │ +│ Array_Primitive_String │ 1000 │ ' 339 ms' │ ' 7 ms' │ ' 48.43 x' │ +│ Array_Primitive_Boolean │ 1000 │ ' 325 ms' │ ' 5 ms' │ ' 65.00 x' │ +│ Array_Object_Unconstrained │ 1000 │ ' 1863 ms' │ ' 21 ms' │ ' 88.71 x' │ +│ Array_Object_Constrained │ 1000 │ ' 1535 ms' │ ' 18 ms' │ ' 85.28 x' │ +│ Array_Tuple_Primitive │ 1000 │ ' 829 ms' │ ' 14 ms' │ ' 59.21 x' │ +│ Array_Tuple_Object │ 1000 │ ' 1674 ms' │ ' 14 ms' │ ' 119.57 x' │ +│ Array_Composite_Intersect │ 1000 │ ' 789 ms' │ ' 13 ms' │ ' 60.69 x' │ +│ Array_Composite_Union │ 1000 │ ' 822 ms' │ ' 15 ms' │ ' 54.80 x' │ +│ Array_Math_Vector4 │ 1000 │ ' 1129 ms' │ ' 14 ms' │ ' 80.64 x' │ +│ Array_Math_Matrix4 │ 1000 │ ' 673 ms' │ ' 9 ms' │ ' 74.78 x' │ └────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┘ ``` @@ -1359,43 +1799,43 @@ This benchmark measures compilation performance for varying types. You can revie ### Validate -This benchmark measures validation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/check.ts). +This benchmark measures validation performance for varying types. ```typescript ┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐ -│ (index) │ Iterations │ ValueCheck │ Ajv │ TypeCompiler │ Performance │ +│ (index) │ Iterations │ ValueCheck │ Ajv │ TypeCompiler │ Performance │ ├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┼──────────────┤ -│ Literal_String │ 1000000 │ ' 27 ms' │ ' 6 ms' │ ' 5 ms' │ ' 1.20 x' │ -│ Literal_Number │ 1000000 │ ' 23 ms' │ ' 21 ms' │ ' 11 ms' │ ' 1.91 x' │ -│ Literal_Boolean │ 1000000 │ ' 21 ms' │ ' 20 ms' │ ' 10 ms' │ ' 2.00 x' │ -│ Primitive_Number │ 1000000 │ ' 26 ms' │ ' 19 ms' │ ' 11 ms' │ ' 1.73 x' │ -│ Primitive_String │ 1000000 │ ' 25 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Primitive_String_Pattern │ 1000000 │ ' 155 ms' │ ' 49 ms' │ ' 43 ms' │ ' 1.14 x' │ -│ Primitive_Boolean │ 1000000 │ ' 23 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Primitive_Null │ 1000000 │ ' 24 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Object_Unconstrained │ 1000000 │ ' 804 ms' │ ' 35 ms' │ ' 28 ms' │ ' 1.25 x' │ -│ Object_Constrained │ 1000000 │ ' 1041 ms' │ ' 55 ms' │ ' 41 ms' │ ' 1.34 x' │ -│ Object_Vector3 │ 1000000 │ ' 380 ms' │ ' 26 ms' │ ' 20 ms' │ ' 1.30 x' │ -│ Object_Box3D │ 1000000 │ ' 1785 ms' │ ' 65 ms' │ ' 52 ms' │ ' 1.25 x' │ -│ Object_Recursive │ 1000000 │ ' 4984 ms' │ ' 396 ms' │ ' 114 ms' │ ' 3.47 x' │ -│ Tuple_Primitive │ 1000000 │ ' 168 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ -│ Tuple_Object │ 1000000 │ ' 673 ms' │ ' 30 ms' │ ' 26 ms' │ ' 1.15 x' │ -│ Composite_Intersect │ 1000000 │ ' 751 ms' │ ' 28 ms' │ ' 20 ms' │ ' 1.40 x' │ -│ Composite_Union │ 1000000 │ ' 489 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ -│ Math_Vector4 │ 1000000 │ ' 259 ms' │ ' 23 ms' │ ' 13 ms' │ ' 1.77 x' │ -│ Math_Matrix4 │ 1000000 │ ' 1002 ms' │ ' 40 ms' │ ' 30 ms' │ ' 1.33 x' │ -│ Array_Primitive_Number │ 1000000 │ ' 252 ms' │ ' 22 ms' │ ' 15 ms' │ ' 1.47 x' │ -│ Array_Primitive_String │ 1000000 │ ' 227 ms' │ ' 22 ms' │ ' 18 ms' │ ' 1.22 x' │ -│ Array_Primitive_Boolean │ 1000000 │ ' 150 ms' │ ' 23 ms' │ ' 22 ms' │ ' 1.05 x' │ -│ Array_Object_Unconstrained │ 1000000 │ ' 4754 ms' │ ' 71 ms' │ ' 64 ms' │ ' 1.11 x' │ -│ Array_Object_Constrained │ 1000000 │ ' 4787 ms' │ ' 142 ms' │ ' 123 ms' │ ' 1.15 x' │ -│ Array_Object_Recursive │ 1000000 │ ' 19088 ms' │ ' 1735 ms' │ ' 314 ms' │ ' 5.53 x' │ -│ Array_Tuple_Primitive │ 1000000 │ ' 650 ms' │ ' 41 ms' │ ' 31 ms' │ ' 1.32 x' │ -│ Array_Tuple_Object │ 1000000 │ ' 2770 ms' │ ' 67 ms' │ ' 55 ms' │ ' 1.22 x' │ -│ Array_Composite_Intersect │ 1000000 │ ' 2693 ms' │ ' 50 ms' │ ' 39 ms' │ ' 1.28 x' │ -│ Array_Composite_Union │ 1000000 │ ' 1982 ms' │ ' 72 ms' │ ' 33 ms' │ ' 2.18 x' │ -│ Array_Math_Vector4 │ 1000000 │ ' 1068 ms' │ ' 40 ms' │ ' 26 ms' │ ' 1.54 x' │ -│ Array_Math_Matrix4 │ 1000000 │ ' 4609 ms' │ ' 115 ms' │ ' 88 ms' │ ' 1.31 x' │ +│ Literal_String │ 1000000 │ ' 17 ms' │ ' 5 ms' │ ' 5 ms' │ ' 1.00 x' │ +│ Literal_Number │ 1000000 │ ' 14 ms' │ ' 18 ms' │ ' 9 ms' │ ' 2.00 x' │ +│ Literal_Boolean │ 1000000 │ ' 14 ms' │ ' 20 ms' │ ' 9 ms' │ ' 2.22 x' │ +│ Primitive_Number │ 1000000 │ ' 17 ms' │ ' 19 ms' │ ' 9 ms' │ ' 2.11 x' │ +│ Primitive_String │ 1000000 │ ' 17 ms' │ ' 18 ms' │ ' 10 ms' │ ' 1.80 x' │ +│ Primitive_String_Pattern │ 1000000 │ ' 172 ms' │ ' 46 ms' │ ' 41 ms' │ ' 1.12 x' │ +│ Primitive_Boolean │ 1000000 │ ' 14 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ +│ Primitive_Null │ 1000000 │ ' 16 ms' │ ' 19 ms' │ ' 9 ms' │ ' 2.11 x' │ +│ Object_Unconstrained │ 1000000 │ ' 437 ms' │ ' 28 ms' │ ' 14 ms' │ ' 2.00 x' │ +│ Object_Constrained │ 1000000 │ ' 653 ms' │ ' 46 ms' │ ' 37 ms' │ ' 1.24 x' │ +│ Object_Vector3 │ 1000000 │ ' 201 ms' │ ' 22 ms' │ ' 12 ms' │ ' 1.83 x' │ +│ Object_Box3D │ 1000000 │ ' 961 ms' │ ' 37 ms' │ ' 19 ms' │ ' 1.95 x' │ +│ Object_Recursive │ 1000000 │ ' 3715 ms' │ ' 363 ms' │ ' 174 ms' │ ' 2.09 x' │ +│ Tuple_Primitive │ 1000000 │ ' 107 ms' │ ' 23 ms' │ ' 11 ms' │ ' 2.09 x' │ +│ Tuple_Object │ 1000000 │ ' 375 ms' │ ' 28 ms' │ ' 15 ms' │ ' 1.87 x' │ +│ Composite_Intersect │ 1000000 │ ' 377 ms' │ ' 22 ms' │ ' 12 ms' │ ' 1.83 x' │ +│ Composite_Union │ 1000000 │ ' 337 ms' │ ' 30 ms' │ ' 17 ms' │ ' 1.76 x' │ +│ Math_Vector4 │ 1000000 │ ' 137 ms' │ ' 23 ms' │ ' 11 ms' │ ' 2.09 x' │ +│ Math_Matrix4 │ 1000000 │ ' 576 ms' │ ' 37 ms' │ ' 28 ms' │ ' 1.32 x' │ +│ Array_Primitive_Number │ 1000000 │ ' 145 ms' │ ' 23 ms' │ ' 12 ms' │ ' 1.92 x' │ +│ Array_Primitive_String │ 1000000 │ ' 152 ms' │ ' 22 ms' │ ' 13 ms' │ ' 1.69 x' │ +│ Array_Primitive_Boolean │ 1000000 │ ' 131 ms' │ ' 20 ms' │ ' 13 ms' │ ' 1.54 x' │ +│ Array_Object_Unconstrained │ 1000000 │ ' 2821 ms' │ ' 62 ms' │ ' 45 ms' │ ' 1.38 x' │ +│ Array_Object_Constrained │ 1000000 │ ' 2958 ms' │ ' 119 ms' │ ' 134 ms' │ ' 0.89 x' │ +│ Array_Object_Recursive │ 1000000 │ ' 14695 ms' │ ' 1621 ms' │ ' 635 ms' │ ' 2.55 x' │ +│ Array_Tuple_Primitive │ 1000000 │ ' 478 ms' │ ' 35 ms' │ ' 28 ms' │ ' 1.25 x' │ +│ Array_Tuple_Object │ 1000000 │ ' 1623 ms' │ ' 63 ms' │ ' 48 ms' │ ' 1.31 x' │ +│ Array_Composite_Intersect │ 1000000 │ ' 1582 ms' │ ' 43 ms' │ ' 30 ms' │ ' 1.43 x' │ +│ Array_Composite_Union │ 1000000 │ ' 1331 ms' │ ' 76 ms' │ ' 40 ms' │ ' 1.90 x' │ +│ Array_Math_Vector4 │ 1000000 │ ' 564 ms' │ ' 38 ms' │ ' 24 ms' │ ' 1.58 x' │ +│ Array_Math_Matrix4 │ 1000000 │ ' 2382 ms' │ ' 111 ms' │ ' 83 ms' │ ' 1.34 x' │ └────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┴──────────────┘ ``` @@ -1407,13 +1847,14 @@ The following table lists esbuild compiled and minified sizes for each TypeBox m ```typescript ┌──────────────────────┬────────────┬────────────┬─────────────┐ -│ (index) │ Compiled │ Minified │ Compression │ +│ (index) │ Compiled │ Minified │ Compression │ ├──────────────────────┼────────────┼────────────┼─────────────┤ -│ typebox/compiler │ '124.3 kb' │ ' 55.7 kb' │ '2.23 x' │ -│ typebox/errors │ '107.8 kb' │ ' 47.9 kb' │ '2.25 x' │ -│ typebox/system │ ' 73.3 kb' │ ' 30.2 kb' │ '2.43 x' │ -│ typebox/value │ '170.7 kb' │ ' 74.2 kb' │ '2.30 x' │ -│ typebox │ ' 72.0 kb' │ ' 29.7 kb' │ '2.43 x' │ +│ typebox/compiler │ '122.4 kb' │ ' 53.4 kb' │ '2.29 x' │ +│ typebox/errors │ ' 67.6 kb' │ ' 29.6 kb' │ '2.28 x' │ +│ typebox/syntax │ '132.9 kb' │ ' 54.2 kb' │ '2.45 x' │ +│ typebox/system │ ' 7.4 kb' │ ' 3.2 kb' │ '2.33 x' │ +│ typebox/value │ '150.1 kb' │ ' 62.2 kb' │ '2.41 x' │ +│ typebox │ '106.8 kb' │ ' 43.2 kb' │ '2.47 x' │ └──────────────────────┴────────────┴────────────┴─────────────┘ ``` @@ -1421,4 +1862,4 @@ The following table lists esbuild compiled and minified sizes for each TypeBox m ## Contribute -TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project preferences open community discussion prior to accepting new features. +TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project prefers open community discussion before accepting new features. diff --git a/node_modules/@sinclair/typebox/syntax/package.json b/node_modules/@sinclair/typebox/syntax/package.json new file mode 100644 index 00000000..f3802316 --- /dev/null +++ b/node_modules/@sinclair/typebox/syntax/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/syntax/index.js", + "types": "../build/cjs/syntax/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/system/index.d.ts b/node_modules/@sinclair/typebox/system/index.d.ts deleted file mode 100644 index 4b58cda6..00000000 --- a/node_modules/@sinclair/typebox/system/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './system'; diff --git a/node_modules/@sinclair/typebox/system/index.js b/node_modules/@sinclair/typebox/system/index.js deleted file mode 100644 index 3c5107f1..00000000 --- a/node_modules/@sinclair/typebox/system/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/system - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./system"), exports); diff --git a/node_modules/@sinclair/typebox/system/package.json b/node_modules/@sinclair/typebox/system/package.json new file mode 100644 index 00000000..93fb9fa8 --- /dev/null +++ b/node_modules/@sinclair/typebox/system/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/system/index.js", + "types": "../build/cjs/system/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/system/system.d.ts b/node_modules/@sinclair/typebox/system/system.d.ts deleted file mode 100644 index 43084544..00000000 --- a/node_modules/@sinclair/typebox/system/system.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as Types from '../typebox'; -export declare class TypeSystemDuplicateTypeKind extends Error { - constructor(kind: string); -} -export declare class TypeSystemDuplicateFormat extends Error { - constructor(kind: string); -} -/** Creates user defined types and formats and provides overrides for value checking behaviours */ -export declare namespace TypeSystem { - /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ - let ExactOptionalPropertyTypes: boolean; - /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ - let AllowArrayObjects: boolean; - /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ - let AllowNaN: boolean; - /** Sets whether `null` should validate for void types. The default is `false` */ - let AllowVoidNull: boolean; - /** Creates a new type */ - function Type(kind: string, check: (options: Options, value: unknown) => boolean): (options?: Partial) => Types.TUnsafe; - /** Creates a new string format */ - function Format(format: F, check: (value: string) => boolean): F; - /** @deprecated Use `TypeSystem.Type()` instead. */ - function CreateType(kind: string, check: (options: Options, value: unknown) => boolean): (options?: Partial) => Types.TUnsafe; - /** @deprecated Use `TypeSystem.Format()` instead. */ - function CreateFormat(format: F, check: (value: string) => boolean): F; -} diff --git a/node_modules/@sinclair/typebox/system/system.js b/node_modules/@sinclair/typebox/system/system.js deleted file mode 100644 index 44911a48..00000000 --- a/node_modules/@sinclair/typebox/system/system.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/system - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypeSystem = exports.TypeSystemDuplicateFormat = exports.TypeSystemDuplicateTypeKind = void 0; -const Types = require("../typebox"); -class TypeSystemDuplicateTypeKind extends Error { - constructor(kind) { - super(`Duplicate type kind '${kind}' detected`); - } -} -exports.TypeSystemDuplicateTypeKind = TypeSystemDuplicateTypeKind; -class TypeSystemDuplicateFormat extends Error { - constructor(kind) { - super(`Duplicate string format '${kind}' detected`); - } -} -exports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat; -/** Creates user defined types and formats and provides overrides for value checking behaviours */ -var TypeSystem; -(function (TypeSystem) { - // ------------------------------------------------------------------------ - // Assertion Policies - // ------------------------------------------------------------------------ - /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ - TypeSystem.ExactOptionalPropertyTypes = false; - /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ - TypeSystem.AllowArrayObjects = false; - /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ - TypeSystem.AllowNaN = false; - /** Sets whether `null` should validate for void types. The default is `false` */ - TypeSystem.AllowVoidNull = false; - // ------------------------------------------------------------------------ - // String Formats and Types - // ------------------------------------------------------------------------ - /** Creates a new type */ - function Type(kind, check) { - if (Types.TypeRegistry.Has(kind)) - throw new TypeSystemDuplicateTypeKind(kind); - Types.TypeRegistry.Set(kind, check); - return (options = {}) => Types.Type.Unsafe({ ...options, [Types.Kind]: kind }); - } - TypeSystem.Type = Type; - /** Creates a new string format */ - function Format(format, check) { - if (Types.FormatRegistry.Has(format)) - throw new TypeSystemDuplicateFormat(format); - Types.FormatRegistry.Set(format, check); - return format; - } - TypeSystem.Format = Format; - // ------------------------------------------------------------------------ - // Deprecated - // ------------------------------------------------------------------------ - /** @deprecated Use `TypeSystem.Type()` instead. */ - function CreateType(kind, check) { - return Type(kind, check); - } - TypeSystem.CreateType = CreateType; - /** @deprecated Use `TypeSystem.Format()` instead. */ - function CreateFormat(format, check) { - return Format(format, check); - } - TypeSystem.CreateFormat = CreateFormat; -})(TypeSystem = exports.TypeSystem || (exports.TypeSystem = {})); diff --git a/node_modules/@sinclair/typebox/type/package.json b/node_modules/@sinclair/typebox/type/package.json new file mode 100644 index 00000000..71b44033 --- /dev/null +++ b/node_modules/@sinclair/typebox/type/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/type/index.js", + "types": "../build/cjs/type/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/typebox.d.ts b/node_modules/@sinclair/typebox/typebox.d.ts deleted file mode 100644 index 1632b965..00000000 --- a/node_modules/@sinclair/typebox/typebox.d.ts +++ /dev/null @@ -1,723 +0,0 @@ -export declare const Modifier: unique symbol; -export declare const Hint: unique symbol; -export declare const Kind: unique symbol; -export declare const PatternBoolean = "(true|false)"; -export declare const PatternNumber = "(0|[1-9][0-9]*)"; -export declare const PatternString = "(.*)"; -export declare const PatternBooleanExact: string; -export declare const PatternNumberExact: string; -export declare const PatternStringExact: string; -export type TupleToIntersect = T extends [infer I] ? I : T extends [infer I, ...infer R] ? I & TupleToIntersect : never; -export type TupleToUnion = { - [K in keyof T]: T[K]; -}[number]; -export type UnionToIntersect = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never; -export type UnionLast = UnionToIntersect 0 : never> extends (x: infer L) => 0 ? L : never; -export type UnionToTuple> = [U] extends [never] ? [] : [...UnionToTuple>, L]; -export type Assert = T extends E ? T : never; -export type Evaluate = T extends infer O ? { - [K in keyof O]: O[K]; -} : never; -export type Ensure = T extends infer U ? U : never; -export type TModifier = TReadonlyOptional | TOptional | TReadonly; -export type TReadonly = T & { - [Modifier]: 'Readonly'; -}; -export type TOptional = T & { - [Modifier]: 'Optional'; -}; -export type TReadonlyOptional = T & { - [Modifier]: 'ReadonlyOptional'; -}; -export interface SchemaOptions { - $schema?: string; - /** Id for this schema */ - $id?: string; - /** Title of this schema */ - title?: string; - /** Description of this schema */ - description?: string; - /** Default value for this schema */ - default?: any; - /** Example values matching this schema */ - examples?: any; - [prop: string]: any; -} -export interface TKind { - [Kind]: string; -} -export interface TSchema extends SchemaOptions, TKind { - [Modifier]?: string; - [Hint]?: string; - params: unknown[]; - static: unknown; -} -export type TAnySchema = TSchema | TAny | TArray | TBigInt | TBoolean | TConstructor | TDate | TEnum | TFunction | TInteger | TIntersect | TLiteral | TNot | TNull | TNumber | TObject | TPromise | TRecord | TRef | TString | TSymbol | TTemplateLiteral | TThis | TTuple | TUndefined | TUnion | TUint8Array | TUnknown | TVoid; -export type TNumeric = TInteger | TNumber; -export interface NumericOptions extends SchemaOptions { - exclusiveMaximum?: N; - exclusiveMinimum?: N; - maximum?: N; - minimum?: N; - multipleOf?: N; -} -export interface TAny extends TSchema { - [Kind]: 'Any'; - static: any; -} -export interface ArrayOptions extends SchemaOptions { - uniqueItems?: boolean; - minItems?: number; - maxItems?: number; -} -export interface TArray extends TSchema, ArrayOptions { - [Kind]: 'Array'; - static: Static[]; - type: 'array'; - items: T; -} -export interface TBigInt extends TSchema, NumericOptions { - [Kind]: 'BigInt'; - static: bigint; - type: 'null'; - typeOf: 'BigInt'; -} -export interface TBoolean extends TSchema { - [Kind]: 'Boolean'; - static: boolean; - type: 'boolean'; -} -export type TConstructorParameters> = TTuple; -export type TInstanceType> = T['returns']; -export type TCompositeEvaluateArray = { - [K in keyof T]: T[K] extends TSchema ? Static : never; -}; -export type TCompositeArray = { - [K in keyof T]: T[K] extends TObject ? P : {}; -}; -export type TCompositeProperties = Evaluate : I extends object ? I : {}>; -export interface TComposite extends TObject { - [Hint]: 'Composite'; - static: Evaluate>>; - properties: TCompositeProperties>; -} -export type TConstructorParameterArray = [...{ - [K in keyof T]: Static, P>; -}]; -export interface TConstructor extends TSchema { - [Kind]: 'Constructor'; - static: new (...param: TConstructorParameterArray) => Static; - type: 'object'; - instanceOf: 'Constructor'; - parameters: T; - returns: U; -} -export interface DateOptions extends SchemaOptions { - exclusiveMaximumTimestamp?: number; - exclusiveMinimumTimestamp?: number; - maximumTimestamp?: number; - minimumTimestamp?: number; -} -export interface TDate extends TSchema, DateOptions { - [Kind]: 'Date'; - static: Date; - type: 'object'; - instanceOf: 'Date'; -} -export interface TEnumOption { - type: 'number' | 'string'; - const: T; -} -export interface TEnum = Record> extends TSchema { - [Kind]: 'Union'; - static: T[keyof T]; - anyOf: TLiteral[]; -} -export type TExtends = (Static extends Static ? T : U) extends infer O ? UnionToTuple extends [infer X, infer Y] ? TUnion<[Assert, Assert]> : Assert : never; -export type TExcludeTemplateLiteralResult = TUnionResult; -}[T]>, TSchema[]>>; -export type TExcludeTemplateLiteral = Exclude, Static> extends infer S ? TExcludeTemplateLiteralResult> : never; -export type TExcludeArray = Assert> extends Static ? never : T[K]; -}[number]>, TSchema[]> extends infer R ? TUnionResult> : never; -export type TExclude = T extends TTemplateLiteral ? TExcludeTemplateLiteral : T extends TUnion ? TExcludeArray : T extends U ? TNever : T; -export type TExtractTemplateLiteralResult = TUnionResult; -}[T]>, TSchema[]>>; -export type TExtractTemplateLiteral = Extract, Static> extends infer S ? TExtractTemplateLiteralResult> : never; -export type TExtractArray = Assert> extends Static ? T[K] : never; -}[number]>, TSchema[]> extends infer R ? TUnionResult> : never; -export type TExtract = T extends TTemplateLiteral ? TExtractTemplateLiteral : T extends TUnion ? TExtractArray : T extends U ? T : T; -export type TFunctionParameters = [...{ - [K in keyof T]: Static, P>; -}]; -export interface TFunction extends TSchema { - [Kind]: 'Function'; - static: (...param: TFunctionParameters) => Static; - type: 'object'; - instanceOf: 'Function'; - parameters: T; - returns: U; -} -export interface TInteger extends TSchema, NumericOptions { - [Kind]: 'Integer'; - static: number; - type: 'integer'; -} -export type TUnevaluatedProperties = undefined | TSchema | boolean; -export interface IntersectOptions extends SchemaOptions { - unevaluatedProperties?: TUnevaluatedProperties; -} -export interface TIntersect extends TSchema, IntersectOptions { - [Kind]: 'Intersect'; - static: TupleToIntersect<{ - [K in keyof T]: Static, this['params']>; - }>; - type?: 'object'; - allOf: [...T]; -} -export type TKeyOfTuple = { - [K in keyof Static]: TLiteral>; -} extends infer U ? UnionToTuple> : never; -export type TKeyOf = (T extends TRecursive ? TKeyOfTuple : T extends TComposite ? TKeyOfTuple : T extends TIntersect ? TKeyOfTuple : T extends TUnion ? TKeyOfTuple : T extends TObject ? TKeyOfTuple : T extends TRecord ? [K] : [ -]) extends infer R ? TUnionResult> : never; -export type TLiteralValue = string | number | boolean; -export interface TLiteral extends TSchema { - [Kind]: 'Literal'; - static: T; - const: T; -} -export interface TNever extends TSchema { - [Kind]: 'Never'; - static: never; - not: {}; -} -export interface TNot extends TSchema { - [Kind]: 'Not'; - static: Static; - allOf: [{ - not: Not; - }, T]; -} -export interface TNull extends TSchema { - [Kind]: 'Null'; - static: null; - type: 'null'; -} -export interface TNumber extends TSchema, NumericOptions { - [Kind]: 'Number'; - static: number; - type: 'number'; -} -export type ReadonlyOptionalPropertyKeys = { - [K in keyof T]: T[K] extends TReadonlyOptional ? K : never; -}[keyof T]; -export type ReadonlyPropertyKeys = { - [K in keyof T]: T[K] extends TReadonly ? K : never; -}[keyof T]; -export type OptionalPropertyKeys = { - [K in keyof T]: T[K] extends TOptional ? K : never; -}[keyof T]; -export type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; -export type PropertiesReducer> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; -export type PropertiesReduce = PropertiesReducer; -}>; -export type TProperties = Record; -export type ObjectProperties = T extends TObject ? U : never; -export type ObjectPropertyKeys = T extends TObject ? keyof U : never; -export type TAdditionalProperties = undefined | TSchema | boolean; -export interface ObjectOptions extends SchemaOptions { - additionalProperties?: TAdditionalProperties; - minProperties?: number; - maxProperties?: number; -} -export interface TObject extends TSchema, ObjectOptions { - [Kind]: 'Object'; - static: PropertiesReduce; - additionalProperties?: TAdditionalProperties; - type: 'object'; - properties: T; - required?: string[]; -} -export type TOmitArray = Assert<{ - [K2 in keyof T]: TOmit, K>; -}, TSchema[]>; -export type TOmitProperties = Evaluate, TProperties>>; -export type TOmit = T extends TRecursive ? TRecursive> : T extends TComposite ? TComposite> : T extends TIntersect ? TIntersect> : T extends TUnion ? TUnion> : T extends TObject ? TObject> : T; -export type TParameters = TTuple; -export type TPartialObjectArray = Assert<{ - [K in keyof T]: TPartial>; -}, TObject[]>; -export type TPartialArray = Assert<{ - [K in keyof T]: TPartial>; -}, TSchema[]>; -export type TPartialProperties = Evaluate ? TReadonlyOptional : T[K] extends TReadonly ? TReadonlyOptional : T[K] extends TOptional ? TOptional : TOptional; -}, TProperties>>; -export type TPartial = T extends TRecursive ? TRecursive> : T extends TComposite ? TComposite> : T extends TIntersect ? TIntersect> : T extends TUnion ? TUnion> : T extends TObject ? TObject> : T; -export type TPickArray = { - [K2 in keyof T]: TPick, K>; -}; -export type TPickProperties = Pick, keyof T>> extends infer R ? ({ - [K in keyof R]: Assert extends TSchema ? R[K] : never; -}) : never; -export type TPick = T extends TRecursive ? TRecursive> : T extends TComposite ? TComposite> : T extends TIntersect ? TIntersect> : T extends TUnion ? TUnion> : T extends TObject ? TObject> : T; -export interface TPromise extends TSchema { - [Kind]: 'Promise'; - static: Promise>; - type: 'object'; - instanceOf: 'Promise'; - item: TSchema; -} -export type RecordTemplateLiteralObjectType = Ensure]: T; -}>>>; -export type RecordTemplateLiteralType = IsTemplateLiteralFinite extends true ? RecordTemplateLiteralObjectType : TRecord; -export type RecordUnionLiteralType[]>, T extends TSchema> = Static extends string ? Ensure]: T; -}>> : never; -export type RecordLiteralType, T extends TSchema> = Ensure>; -export type RecordNumberType = Ensure>; -export type RecordStringType = Ensure>; -export type RecordKey = TUnion[]> | TLiteral | TTemplateLiteral | TInteger | TNumber | TString; -export interface TRecord extends TSchema { - [Kind]: 'Record'; - static: Record, Static>; - type: 'object'; - patternProperties: { - [pattern: string]: T; - }; - additionalProperties: false; -} -export interface TThis extends TSchema { - [Kind]: 'This'; - static: this['params'][0]; - $ref: string; -} -export type TRecursiveReduce = Static]>; -export interface TRecursive extends TSchema { - [Hint]: 'Recursive'; - static: TRecursiveReduce; -} -export interface TRef extends TSchema { - [Kind]: 'Ref'; - static: Static; - $ref: string; -} -export type TReturnType = T['returns']; -export type TRequiredArray = Assert<{ - [K in keyof T]: TRequired>; -}, TSchema[]>; -export type TRequiredProperties = Evaluate ? TReadonly : T[K] extends TReadonly ? TReadonly : T[K] extends TOptional ? U : T[K]; -}, TProperties>>; -export type TRequired = T extends TRecursive ? TRecursive> : T extends TComposite ? TComposite> : T extends TIntersect ? TIntersect> : T extends TUnion ? TUnion> : T extends TObject ? TObject> : T; -export type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex'; -export interface StringOptions extends SchemaOptions { - minLength?: number; - maxLength?: number; - pattern?: string; - format?: Format; - contentEncoding?: '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64'; - contentMediaType?: string; -} -export interface TString extends TSchema, StringOptions { - [Kind]: 'String'; - static: string; - type: 'string'; -} -export type SymbolValue = string | number | undefined; -export interface TSymbol extends TSchema, SchemaOptions { - [Kind]: 'Symbol'; - static: symbol; - type: 'null'; - typeOf: 'Symbol'; -} -export type IsTemplateLiteralFiniteCheck = T extends TTemplateLiteral ? IsTemplateLiteralFiniteArray> : T extends TUnion ? IsTemplateLiteralFiniteArray> : T extends TString ? false : T extends TBoolean ? false : T extends TNumber ? false : T extends TInteger ? false : T extends TBigInt ? false : T extends TLiteral ? true : false; -export type IsTemplateLiteralFiniteArray = T extends [infer L, ...infer R] ? IsTemplateLiteralFiniteCheck extends false ? false : IsTemplateLiteralFiniteArray> : T extends [infer L] ? IsTemplateLiteralFiniteCheck extends false ? false : true : true; -export type IsTemplateLiteralFinite = T extends TTemplateLiteral ? IsTemplateLiteralFiniteArray : false; -export type TTemplateLiteralKind = TUnion | TLiteral | TInteger | TTemplateLiteral | TNumber | TBigInt | TString | TBoolean | TNever; -export type TTemplateLiteralConst = T extends TUnion ? { - [K in keyof U]: TTemplateLiteralUnion, Acc>; -}[number] : T extends TTemplateLiteral ? `${Static}` : T extends TLiteral ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never; -export type TTemplateLiteralUnion = T extends [infer L, ...infer R] ? `${TTemplateLiteralConst}${TTemplateLiteralUnion, Acc>}` : T extends [infer L] ? `${TTemplateLiteralConst}${Acc}` : Acc; -export interface TTemplateLiteral extends TSchema { - [Kind]: 'TemplateLiteral'; - static: TTemplateLiteralUnion; - type: 'string'; - pattern: string; -} -export type TTupleIntoArray> = T extends TTuple ? Assert : never; -export interface TTuple extends TSchema { - [Kind]: 'Tuple'; - static: { - [K in keyof T]: T[K] extends TSchema ? Static : T[K]; - }; - type: 'array'; - items?: T; - additionalItems?: false; - minItems: number; - maxItems: number; -} -export interface TUndefined extends TSchema { - [Kind]: 'Undefined'; - static: undefined; - type: 'null'; - typeOf: 'Undefined'; -} -export type TUnionOfLiteralArray[]> = { - [K in keyof T]: Assert['const']; -}[number]; -export type TUnionOfLiteral[]>> = TUnionOfLiteralArray; -export type TUnionResult = T extends [] ? TNever : T extends [infer S] ? S : TUnion; -export type TUnionTemplateLiteral> = Ensure; -}[S]>, TLiteral[]>>>; -export interface TUnion extends TSchema { - [Kind]: 'Union'; - static: { - [K in keyof T]: T[K] extends TSchema ? Static : never; - }[number]; - anyOf: T; -} -export interface Uint8ArrayOptions extends SchemaOptions { - maxByteLength?: number; - minByteLength?: number; -} -export interface TUint8Array extends TSchema, Uint8ArrayOptions { - [Kind]: 'Uint8Array'; - static: Uint8Array; - instanceOf: 'Uint8Array'; - type: 'object'; -} -export interface TUnknown extends TSchema { - [Kind]: 'Unknown'; - static: unknown; -} -export interface UnsafeOptions extends SchemaOptions { - [Kind]?: string; -} -export interface TUnsafe extends TSchema { - [Kind]: string; - static: T; -} -export interface TVoid extends TSchema { - [Kind]: 'Void'; - static: void; - type: 'null'; - typeOf: 'Void'; -} -/** Creates a TypeScript static type from a TypeBox type */ -export type Static = (T & { - params: P; -})['static']; -export type TypeRegistryValidationFunction = (schema: TSchema, value: unknown) => boolean; -/** A registry for user defined types */ -export declare namespace TypeRegistry { - /** Returns the entries in this registry */ - function Entries(): Map>; - /** Clears all user defined types */ - function Clear(): void; - /** Returns true if this registry contains this kind */ - function Has(kind: string): boolean; - /** Sets a validation function for a user defined type */ - function Set(kind: string, func: TypeRegistryValidationFunction): void; - /** Gets a custom validation function for a user defined type */ - function Get(kind: string): TypeRegistryValidationFunction | undefined; -} -export type FormatRegistryValidationFunction = (value: string) => boolean; -/** A registry for user defined string formats */ -export declare namespace FormatRegistry { - /** Returns the entries in this registry */ - function Entries(): Map; - /** Clears all user defined string formats */ - function Clear(): void; - /** Returns true if the user defined string format exists */ - function Has(format: string): boolean; - /** Sets a validation function for a user defined string format */ - function Set(format: string, func: FormatRegistryValidationFunction): void; - /** Gets a validation function for a user defined string format */ - function Get(format: string): FormatRegistryValidationFunction | undefined; -} -export declare class TypeGuardUnknownTypeError extends Error { - readonly schema: unknown; - constructor(schema: unknown); -} -/** Provides functions to test if JavaScript values are TypeBox types */ -export declare namespace TypeGuard { - /** Returns true if the given schema is TAny */ - function TAny(schema: unknown): schema is TAny; - /** Returns true if the given schema is TArray */ - function TArray(schema: unknown): schema is TArray; - /** Returns true if the given schema is TBigInt */ - function TBigInt(schema: unknown): schema is TBigInt; - /** Returns true if the given schema is TBoolean */ - function TBoolean(schema: unknown): schema is TBoolean; - /** Returns true if the given schema is TConstructor */ - function TConstructor(schema: unknown): schema is TConstructor; - /** Returns true if the given schema is TDate */ - function TDate(schema: unknown): schema is TDate; - /** Returns true if the given schema is TFunction */ - function TFunction(schema: unknown): schema is TFunction; - /** Returns true if the given schema is TInteger */ - function TInteger(schema: unknown): schema is TInteger; - /** Returns true if the given schema is TIntersect */ - function TIntersect(schema: unknown): schema is TIntersect; - /** Returns true if the given schema is TKind */ - function TKind(schema: unknown): schema is Record; - /** Returns true if the given schema is TLiteral */ - function TLiteral(schema: unknown): schema is TLiteral; - /** Returns true if the given schema is TNever */ - function TNever(schema: unknown): schema is TNever; - /** Returns true if the given schema is TNot */ - function TNot(schema: unknown): schema is TNot; - /** Returns true if the given schema is TNull */ - function TNull(schema: unknown): schema is TNull; - /** Returns true if the given schema is TNumber */ - function TNumber(schema: unknown): schema is TNumber; - /** Returns true if the given schema is TObject */ - function TObject(schema: unknown): schema is TObject; - /** Returns true if the given schema is TPromise */ - function TPromise(schema: unknown): schema is TPromise; - /** Returns true if the given schema is TRecord */ - function TRecord(schema: unknown): schema is TRecord; - /** Returns true if the given schema is TRef */ - function TRef(schema: unknown): schema is TRef; - /** Returns true if the given schema is TString */ - function TString(schema: unknown): schema is TString; - /** Returns true if the given schema is TSymbol */ - function TSymbol(schema: unknown): schema is TSymbol; - /** Returns true if the given schema is TTemplateLiteral */ - function TTemplateLiteral(schema: unknown): schema is TTemplateLiteral; - /** Returns true if the given schema is TThis */ - function TThis(schema: unknown): schema is TThis; - /** Returns true if the given schema is TTuple */ - function TTuple(schema: unknown): schema is TTuple; - /** Returns true if the given schema is TUndefined */ - function TUndefined(schema: unknown): schema is TUndefined; - /** Returns true if the given schema is TUnion */ - function TUnion(schema: unknown): schema is TUnion; - /** Returns true if the given schema is TUnion[]> */ - function TUnionLiteral(schema: unknown): schema is TUnion[]>; - /** Returns true if the given schema is TUint8Array */ - function TUint8Array(schema: unknown): schema is TUint8Array; - /** Returns true if the given schema is TUnknown */ - function TUnknown(schema: unknown): schema is TUnknown; - /** Returns true if the given schema is a raw TUnsafe */ - function TUnsafe(schema: unknown): schema is TUnsafe; - /** Returns true if the given schema is TVoid */ - function TVoid(schema: unknown): schema is TVoid; - /** Returns true if this schema has the ReadonlyOptional modifier */ - function TReadonlyOptional(schema: T): schema is TReadonlyOptional; - /** Returns true if this schema has the Readonly modifier */ - function TReadonly(schema: T): schema is TReadonly; - /** Returns true if this schema has the Optional modifier */ - function TOptional(schema: T): schema is TOptional; - /** Returns true if the given schema is TSchema */ - function TSchema(schema: unknown): schema is TSchema; -} -/** Fast undefined check used for properties of type undefined */ -export declare namespace ExtendsUndefined { - function Check(schema: TSchema): boolean; -} -export declare enum TypeExtendsResult { - Union = 0, - True = 1, - False = 2 -} -export declare namespace TypeExtends { - function Extends(left: TSchema, right: TSchema): TypeExtendsResult; -} -/** Specialized Clone for Types */ -export declare namespace TypeClone { - /** Clones a type. */ - function Clone(schema: T, options: SchemaOptions): T; -} -export declare namespace ObjectMap { - function Map(schema: TSchema, callback: (object: TObject) => TObject, options: SchemaOptions): T; -} -export declare namespace KeyResolver { - function Resolve(schema: T): string[]; -} -export declare namespace TemplateLiteralPattern { - function Create(kinds: TTemplateLiteralKind[]): string; -} -export declare namespace TemplateLiteralResolver { - function Resolve(template: TTemplateLiteral): TString | TUnion | TLiteral; -} -export declare class TemplateLiteralParserError extends Error { - constructor(message: string); -} -export declare namespace TemplateLiteralParser { - type Expression = And | Or | Const; - type Const = { - type: 'const'; - const: string; - }; - type And = { - type: 'and'; - expr: Expression[]; - }; - type Or = { - type: 'or'; - expr: Expression[]; - }; - /** Parses a pattern and returns an expression tree */ - function Parse(pattern: string): Expression; - /** Parses a pattern and strips forward and trailing ^ and $ */ - function ParseExact(pattern: string): Expression; -} -export declare namespace TemplateLiteralFinite { - function Check(expression: TemplateLiteralParser.Expression): boolean; -} -export declare namespace TemplateLiteralGenerator { - function Generate(expression: TemplateLiteralParser.Expression): IterableIterator; -} -export declare class TypeBuilder { - /** `[Utility]` Creates a schema without `static` and `params` types */ - protected Create(schema: Omit): T; - /** `[Standard]` Omits compositing symbols from this schema */ - Strict(schema: T): T; -} -export declare class StandardTypeBuilder extends TypeBuilder { - /** `[Modifier]` Creates a Optional property */ - Optional(schema: T): TOptional; - /** `[Modifier]` Creates a ReadonlyOptional property */ - ReadonlyOptional(schema: T): TReadonlyOptional; - /** `[Modifier]` Creates a Readonly object or property */ - Readonly(schema: T): TReadonly; - /** `[Standard]` Creates an Any type */ - Any(options?: SchemaOptions): TAny; - /** `[Standard]` Creates an Array type */ - Array(items: T, options?: ArrayOptions): TArray; - /** `[Standard]` Creates a Boolean type */ - Boolean(options?: SchemaOptions): TBoolean; - /** `[Standard]` Creates a Composite object type. */ - Composite(objects: [...T], options?: ObjectOptions): TComposite; - /** `[Standard]` Creates a Enum type */ - Enum>(item: T, options?: SchemaOptions): TEnum; - /** `[Standard]` A conditional type expression that will return the true type if the left type extends the right */ - Extends(left: L, right: R, trueType: T, falseType: U, options?: SchemaOptions): TExtends; - /** `[Standard]` Excludes from the left type any type that is not assignable to the right */ - Exclude(left: L, right: R, options?: SchemaOptions): TExclude; - /** `[Standard]` Extracts from the left type any type that is assignable to the right */ - Extract(left: L, right: R, options?: SchemaOptions): TExtract; - /** `[Standard]` Creates an Integer type */ - Integer(options?: NumericOptions): TInteger; - /** `[Standard]` Creates a Intersect type */ - Intersect(allOf: [], options?: SchemaOptions): TNever; - /** `[Standard]` Creates a Intersect type */ - Intersect(allOf: [...T], options?: SchemaOptions): T[0]; - Intersect(allOf: [...T], options?: IntersectOptions): TIntersect; - /** `[Standard]` Creates a KeyOf type */ - KeyOf(schema: T, options?: SchemaOptions): TKeyOf; - /** `[Standard]` Creates a Literal type */ - Literal(value: T, options?: SchemaOptions): TLiteral; - /** `[Standard]` Creates a Never type */ - Never(options?: SchemaOptions): TNever; - /** `[Standard]` Creates a Not type. The first argument is the disallowed type, the second is the allowed. */ - Not(not: N, schema: T, options?: SchemaOptions): TNot; - /** `[Standard]` Creates a Null type */ - Null(options?: SchemaOptions): TNull; - /** `[Standard]` Creates a Number type */ - Number(options?: NumericOptions): TNumber; - /** `[Standard]` Creates an Object type */ - Object(properties: T, options?: ObjectOptions): TObject; - /** `[Standard]` Creates a mapped type whose keys are omitted from the given type */ - Omit)[]>(schema: T, keys: readonly [...K], options?: SchemaOptions): TOmit; - /** `[Standard]` Creates a mapped type whose keys are omitted from the given type */ - Omit[]>>(schema: T, keys: K, options?: SchemaOptions): TOmit>; - /** `[Standard]` Creates a mapped type whose keys are omitted from the given type */ - Omit>(schema: T, key: K, options?: SchemaOptions): TOmit; - /** `[Standard]` Creates a mapped type whose keys are omitted from the given type */ - Omit(schema: T, key: K, options?: SchemaOptions): TOmit; - /** `[Standard]` Creates a mapped type where all properties are Optional */ - Partial(schema: T, options?: ObjectOptions): TPartial; - /** `[Standard]` Creates a mapped type whose keys are picked from the given type */ - Pick)[]>(schema: T, keys: readonly [...K], options?: SchemaOptions): TPick; - /** `[Standard]` Creates a mapped type whose keys are picked from the given type */ - Pick[]>>(schema: T, keys: K, options?: SchemaOptions): TPick>; - /** `[Standard]` Creates a mapped type whose keys are picked from the given type */ - Pick>(schema: T, key: K, options?: SchemaOptions): TPick; - /** `[Standard]` Creates a mapped type whose keys are picked from the given type */ - Pick(schema: T, key: K, options?: SchemaOptions): TPick; - /** `[Standard]` Creates a Record type */ - Record[]>, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordUnionLiteralType; - /** `[Standard]` Creates a Record type */ - Record, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordLiteralType; - /** `[Standard]` Creates a Record type */ - Record(key: K, schema: T, options?: ObjectOptions): RecordTemplateLiteralType; - /** `[Standard]` Creates a Record type */ - Record(key: K, schema: T, options?: ObjectOptions): RecordNumberType; - /** `[Standard]` Creates a Record type */ - Record(key: K, schema: T, options?: ObjectOptions): RecordStringType; - /** `[Standard]` Creates a Recursive type */ - Recursive(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive; - /** `[Standard]` Creates a Ref type. The referenced type must contain a $id */ - Ref(schema: T, options?: SchemaOptions): TRef; - /** `[Standard]` Creates a mapped type where all properties are Required */ - Required(schema: T, options?: SchemaOptions): TRequired; - /** `[Standard]` Creates a String type */ - String(options?: StringOptions): TString; - /** `[Standard]` Creates a template literal type */ - TemplateLiteral(kinds: [...T], options?: SchemaOptions): TTemplateLiteral; - /** `[Standard]` Creates a Tuple type */ - Tuple(items: [...T], options?: SchemaOptions): TTuple; - /** `[Standard]` Creates a Union type */ - Union(anyOf: [], options?: SchemaOptions): TNever; - /** `[Standard]` Creates a Union type */ - Union(anyOf: [...T], options?: SchemaOptions): T[0]; - /** `[Standard]` Creates a Union type */ - Union(anyOf: [...T], options?: SchemaOptions): TUnion; - /** `[Experimental]` Remaps a TemplateLiteral into a Union representation. This function is known to cause TS compiler crashes for finite templates with large generation counts. Use with caution. */ - Union(template: T): TUnionTemplateLiteral; - /** `[Standard]` Creates an Unknown type */ - Unknown(options?: SchemaOptions): TUnknown; - /** `[Standard]` Creates a Unsafe type that infers for the generic argument */ - Unsafe(options?: UnsafeOptions): TUnsafe; -} -export declare class ExtendedTypeBuilder extends StandardTypeBuilder { - /** `[Extended]` Creates a BigInt type */ - BigInt(options?: NumericOptions): TBigInt; - /** `[Extended]` Extracts the ConstructorParameters from the given Constructor type */ - ConstructorParameters>(schema: T, options?: SchemaOptions): TConstructorParameters; - /** `[Extended]` Creates a Constructor type */ - Constructor, U extends TSchema>(parameters: T, returns: U, options?: SchemaOptions): TConstructor, U>; - /** `[Extended]` Creates a Constructor type */ - Constructor(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor; - /** `[Extended]` Creates a Date type */ - Date(options?: DateOptions): TDate; - /** `[Extended]` Creates a Function type */ - Function, U extends TSchema>(parameters: T, returns: U, options?: SchemaOptions): TFunction, U>; - /** `[Extended]` Creates a Function type */ - Function(parameters: [...T], returns: U, options?: SchemaOptions): TFunction; - /** `[Extended]` Extracts the InstanceType from the given Constructor */ - InstanceType>(schema: T, options?: SchemaOptions): TInstanceType; - /** `[Extended]` Extracts the Parameters from the given Function type */ - Parameters>(schema: T, options?: SchemaOptions): TParameters; - /** `[Extended]` Creates a Promise type */ - Promise(item: T, options?: SchemaOptions): TPromise; - /** `[Extended]` Creates a regular expression type */ - RegEx(regex: RegExp, options?: SchemaOptions): TString; - /** `[Extended]` Extracts the ReturnType from the given Function */ - ReturnType>(schema: T, options?: SchemaOptions): TReturnType; - /** `[Extended]` Creates a Symbol type */ - Symbol(options?: SchemaOptions): TSymbol; - /** `[Extended]` Creates a Undefined type */ - Undefined(options?: SchemaOptions): TUndefined; - /** `[Extended]` Creates a Uint8Array type */ - Uint8Array(options?: Uint8ArrayOptions): TUint8Array; - /** `[Extended]` Creates a Void type */ - Void(options?: SchemaOptions): TVoid; -} -/** JSON Schema TypeBuilder with Static Resolution for TypeScript */ -export declare const StandardType: StandardTypeBuilder; -/** JSON Schema TypeBuilder with Static Resolution for TypeScript */ -export declare const Type: ExtendedTypeBuilder; diff --git a/node_modules/@sinclair/typebox/typebox.js b/node_modules/@sinclair/typebox/typebox.js deleted file mode 100644 index c8953c35..00000000 --- a/node_modules/@sinclair/typebox/typebox.js +++ /dev/null @@ -1,2220 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Type = exports.StandardType = exports.ExtendedTypeBuilder = exports.StandardTypeBuilder = exports.TypeBuilder = exports.TemplateLiteralGenerator = exports.TemplateLiteralFinite = exports.TemplateLiteralParser = exports.TemplateLiteralParserError = exports.TemplateLiteralResolver = exports.TemplateLiteralPattern = exports.KeyResolver = exports.ObjectMap = exports.TypeClone = exports.TypeExtends = exports.TypeExtendsResult = exports.ExtendsUndefined = exports.TypeGuard = exports.TypeGuardUnknownTypeError = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = exports.Kind = exports.Hint = exports.Modifier = void 0; -// -------------------------------------------------------------------------- -// Symbols -// -------------------------------------------------------------------------- -exports.Modifier = Symbol.for('TypeBox.Modifier'); -exports.Hint = Symbol.for('TypeBox.Hint'); -exports.Kind = Symbol.for('TypeBox.Kind'); -// -------------------------------------------------------------------------- -// Patterns -// -------------------------------------------------------------------------- -exports.PatternBoolean = '(true|false)'; -exports.PatternNumber = '(0|[1-9][0-9]*)'; -exports.PatternString = '(.*)'; -exports.PatternBooleanExact = `^${exports.PatternBoolean}$`; -exports.PatternNumberExact = `^${exports.PatternNumber}$`; -exports.PatternStringExact = `^${exports.PatternString}$`; -/** A registry for user defined types */ -var TypeRegistry; -(function (TypeRegistry) { - const map = new Map(); - /** Returns the entries in this registry */ - function Entries() { - return new Map(map); - } - TypeRegistry.Entries = Entries; - /** Clears all user defined types */ - function Clear() { - return map.clear(); - } - TypeRegistry.Clear = Clear; - /** Returns true if this registry contains this kind */ - function Has(kind) { - return map.has(kind); - } - TypeRegistry.Has = Has; - /** Sets a validation function for a user defined type */ - function Set(kind, func) { - map.set(kind, func); - } - TypeRegistry.Set = Set; - /** Gets a custom validation function for a user defined type */ - function Get(kind) { - return map.get(kind); - } - TypeRegistry.Get = Get; -})(TypeRegistry = exports.TypeRegistry || (exports.TypeRegistry = {})); -/** A registry for user defined string formats */ -var FormatRegistry; -(function (FormatRegistry) { - const map = new Map(); - /** Returns the entries in this registry */ - function Entries() { - return new Map(map); - } - FormatRegistry.Entries = Entries; - /** Clears all user defined string formats */ - function Clear() { - return map.clear(); - } - FormatRegistry.Clear = Clear; - /** Returns true if the user defined string format exists */ - function Has(format) { - return map.has(format); - } - FormatRegistry.Has = Has; - /** Sets a validation function for a user defined string format */ - function Set(format, func) { - map.set(format, func); - } - FormatRegistry.Set = Set; - /** Gets a validation function for a user defined string format */ - function Get(format) { - return map.get(format); - } - FormatRegistry.Get = Get; -})(FormatRegistry = exports.FormatRegistry || (exports.FormatRegistry = {})); -// -------------------------------------------------------------------------- -// TypeGuard -// -------------------------------------------------------------------------- -class TypeGuardUnknownTypeError extends Error { - constructor(schema) { - super('TypeGuard: Unknown type'); - this.schema = schema; - } -} -exports.TypeGuardUnknownTypeError = TypeGuardUnknownTypeError; -/** Provides functions to test if JavaScript values are TypeBox types */ -var TypeGuard; -(function (TypeGuard) { - function IsObject(value) { - return typeof value === 'object' && value !== null && !Array.isArray(value); - } - function IsArray(value) { - return typeof value === 'object' && value !== null && Array.isArray(value); - } - function IsPattern(value) { - try { - new RegExp(value); - return true; - } - catch { - return false; - } - } - function IsControlCharacterFree(value) { - if (typeof value !== 'string') - return false; - for (let i = 0; i < value.length; i++) { - const code = value.charCodeAt(i); - if ((code >= 7 && code <= 13) || code === 27 || code === 127) { - return false; - } - } - return true; - } - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsString(value) { - return typeof value === 'string'; - } - function IsNumber(value) { - return typeof value === 'number' && globalThis.Number.isFinite(value); - } - function IsBoolean(value) { - return typeof value === 'boolean'; - } - function IsOptionalBigInt(value) { - return value === undefined || (value !== undefined && IsBigInt(value)); - } - function IsOptionalNumber(value) { - return value === undefined || (value !== undefined && IsNumber(value)); - } - function IsOptionalBoolean(value) { - return value === undefined || (value !== undefined && IsBoolean(value)); - } - function IsOptionalString(value) { - return value === undefined || (value !== undefined && IsString(value)); - } - function IsOptionalPattern(value) { - return value === undefined || (value !== undefined && IsString(value) && IsControlCharacterFree(value) && IsPattern(value)); - } - function IsOptionalFormat(value) { - return value === undefined || (value !== undefined && IsString(value) && IsControlCharacterFree(value)); - } - function IsOptionalSchema(value) { - return value === undefined || TSchema(value); - } - /** Returns true if the given schema is TAny */ - function TAny(schema) { - return TKind(schema) && schema[exports.Kind] === 'Any' && IsOptionalString(schema.$id); - } - TypeGuard.TAny = TAny; - /** Returns true if the given schema is TArray */ - function TArray(schema) { - return (TKind(schema) && - schema[exports.Kind] === 'Array' && - schema.type === 'array' && - IsOptionalString(schema.$id) && - TSchema(schema.items) && - IsOptionalNumber(schema.minItems) && - IsOptionalNumber(schema.maxItems) && - IsOptionalBoolean(schema.uniqueItems)); - } - TypeGuard.TArray = TArray; - /** Returns true if the given schema is TBigInt */ - function TBigInt(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'BigInt' && - schema.type === 'null' && - schema.typeOf === 'BigInt' && - IsOptionalString(schema.$id) && - IsOptionalBigInt(schema.multipleOf) && - IsOptionalBigInt(schema.minimum) && - IsOptionalBigInt(schema.maximum) && - IsOptionalBigInt(schema.exclusiveMinimum) && - IsOptionalBigInt(schema.exclusiveMaximum)); - } - TypeGuard.TBigInt = TBigInt; - /** Returns true if the given schema is TBoolean */ - function TBoolean(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Boolean' && - schema.type === 'boolean' && - IsOptionalString(schema.$id)); - } - TypeGuard.TBoolean = TBoolean; - /** Returns true if the given schema is TConstructor */ - function TConstructor(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Constructor' && - schema.type === 'object' && - schema.instanceOf === 'Constructor' && - IsOptionalString(schema.$id) && - IsArray(schema.parameters) && - TSchema(schema.returns))) { - return false; - } - for (const parameter of schema.parameters) { - if (!TSchema(parameter)) - return false; - } - return true; - } - TypeGuard.TConstructor = TConstructor; - /** Returns true if the given schema is TDate */ - function TDate(schema) { - return (TKind(schema) && - schema[exports.Kind] === 'Date' && - schema.type === 'object' && - schema.instanceOf === 'Date' && - IsOptionalString(schema.$id) && - IsOptionalNumber(schema.minimumTimestamp) && - IsOptionalNumber(schema.maximumTimestamp) && - IsOptionalNumber(schema.exclusiveMinimumTimestamp) && - IsOptionalNumber(schema.exclusiveMaximumTimestamp)); - } - TypeGuard.TDate = TDate; - /** Returns true if the given schema is TFunction */ - function TFunction(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Function' && - schema.type === 'object' && - schema.instanceOf === 'Function' && - IsOptionalString(schema.$id) && - IsArray(schema.parameters) && - TSchema(schema.returns))) { - return false; - } - for (const parameter of schema.parameters) { - if (!TSchema(parameter)) - return false; - } - return true; - } - TypeGuard.TFunction = TFunction; - /** Returns true if the given schema is TInteger */ - function TInteger(schema) { - return (TKind(schema) && - schema[exports.Kind] === 'Integer' && - schema.type === 'integer' && - IsOptionalString(schema.$id) && - IsOptionalNumber(schema.multipleOf) && - IsOptionalNumber(schema.minimum) && - IsOptionalNumber(schema.maximum) && - IsOptionalNumber(schema.exclusiveMinimum) && - IsOptionalNumber(schema.exclusiveMaximum)); - } - TypeGuard.TInteger = TInteger; - /** Returns true if the given schema is TIntersect */ - function TIntersect(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Intersect' && - IsArray(schema.allOf) && - IsOptionalString(schema.type) && - (IsOptionalBoolean(schema.unevaluatedProperties) || IsOptionalSchema(schema.unevaluatedProperties)) && - IsOptionalString(schema.$id))) { - return false; - } - if ('type' in schema && schema.type !== 'object') { - return false; - } - for (const inner of schema.allOf) { - if (!TSchema(inner)) - return false; - } - return true; - } - TypeGuard.TIntersect = TIntersect; - /** Returns true if the given schema is TKind */ - function TKind(schema) { - return IsObject(schema) && exports.Kind in schema && typeof schema[exports.Kind] === 'string'; // TS 4.1.5: any required for symbol indexer - } - TypeGuard.TKind = TKind; - /** Returns true if the given schema is TLiteral */ - function TLiteral(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Literal' && - IsOptionalString(schema.$id) && - (IsString(schema.const) || - IsNumber(schema.const) || - IsBoolean(schema.const) || - IsBigInt(schema.const))); - } - TypeGuard.TLiteral = TLiteral; - /** Returns true if the given schema is TNever */ - function TNever(schema) { - return TKind(schema) && schema[exports.Kind] === 'Never' && IsObject(schema.not) && globalThis.Object.getOwnPropertyNames(schema.not).length === 0; - } - TypeGuard.TNever = TNever; - /** Returns true if the given schema is TNot */ - function TNot(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Not' && - IsArray(schema.allOf) && - schema.allOf.length === 2 && - IsObject(schema.allOf[0]) && - TSchema(schema.allOf[0].not) && - TSchema(schema.allOf[1])); - } - TypeGuard.TNot = TNot; - /** Returns true if the given schema is TNull */ - function TNull(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Null' && - schema.type === 'null' && - IsOptionalString(schema.$id)); - } - TypeGuard.TNull = TNull; - /** Returns true if the given schema is TNumber */ - function TNumber(schema) { - return (TKind(schema) && - schema[exports.Kind] === 'Number' && - schema.type === 'number' && - IsOptionalString(schema.$id) && - IsOptionalNumber(schema.multipleOf) && - IsOptionalNumber(schema.minimum) && - IsOptionalNumber(schema.maximum) && - IsOptionalNumber(schema.exclusiveMinimum) && - IsOptionalNumber(schema.exclusiveMaximum)); - } - TypeGuard.TNumber = TNumber; - /** Returns true if the given schema is TObject */ - function TObject(schema) { - if (!(TKind(schema) && - schema[exports.Kind] === 'Object' && - schema.type === 'object' && - IsOptionalString(schema.$id) && - IsObject(schema.properties) && - (IsOptionalBoolean(schema.additionalProperties) || IsOptionalSchema(schema.additionalProperties)) && - IsOptionalNumber(schema.minProperties) && - IsOptionalNumber(schema.maxProperties))) { - return false; - } - for (const [key, value] of Object.entries(schema.properties)) { - if (!IsControlCharacterFree(key)) - return false; - if (!TSchema(value)) - return false; - } - return true; - } - TypeGuard.TObject = TObject; - /** Returns true if the given schema is TPromise */ - function TPromise(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Promise' && - schema.type === 'object' && - schema.instanceOf === 'Promise' && - IsOptionalString(schema.$id) && - TSchema(schema.item)); - } - TypeGuard.TPromise = TPromise; - /** Returns true if the given schema is TRecord */ - function TRecord(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Record' && - schema.type === 'object' && - IsOptionalString(schema.$id) && - schema.additionalProperties === false && - IsObject(schema.patternProperties))) { - return false; - } - const keys = Object.keys(schema.patternProperties); - if (keys.length !== 1) { - return false; - } - if (!IsPattern(keys[0])) { - return false; - } - if (!TSchema(schema.patternProperties[keys[0]])) { - return false; - } - return true; - } - TypeGuard.TRecord = TRecord; - /** Returns true if the given schema is TRef */ - function TRef(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Ref' && - IsOptionalString(schema.$id) && - IsString(schema.$ref)); - } - TypeGuard.TRef = TRef; - /** Returns true if the given schema is TString */ - function TString(schema) { - return (TKind(schema) && - schema[exports.Kind] === 'String' && - schema.type === 'string' && - IsOptionalString(schema.$id) && - IsOptionalNumber(schema.minLength) && - IsOptionalNumber(schema.maxLength) && - IsOptionalPattern(schema.pattern) && - IsOptionalFormat(schema.format)); - } - TypeGuard.TString = TString; - /** Returns true if the given schema is TSymbol */ - function TSymbol(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Symbol' && - schema.type === 'null' && - schema.typeOf === 'Symbol' && - IsOptionalString(schema.$id)); - } - TypeGuard.TSymbol = TSymbol; - /** Returns true if the given schema is TTemplateLiteral */ - function TTemplateLiteral(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'TemplateLiteral' && - schema.type === 'string' && - IsString(schema.pattern) && - schema.pattern[0] === '^' && - schema.pattern[schema.pattern.length - 1] === '$'); - } - TypeGuard.TTemplateLiteral = TTemplateLiteral; - /** Returns true if the given schema is TThis */ - function TThis(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'This' && - IsOptionalString(schema.$id) && - IsString(schema.$ref)); - } - TypeGuard.TThis = TThis; - /** Returns true if the given schema is TTuple */ - function TTuple(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Tuple' && - schema.type === 'array' && - IsOptionalString(schema.$id) && - IsNumber(schema.minItems) && - IsNumber(schema.maxItems) && - schema.minItems === schema.maxItems)) { - return false; - } - if (schema.items === undefined && schema.additionalItems === undefined && schema.minItems === 0) { - return true; - } - if (!IsArray(schema.items)) { - return false; - } - for (const inner of schema.items) { - if (!TSchema(inner)) - return false; - } - return true; - } - TypeGuard.TTuple = TTuple; - /** Returns true if the given schema is TUndefined */ - function TUndefined(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Undefined' && - schema.type === 'null' && - schema.typeOf === 'Undefined' && - IsOptionalString(schema.$id)); - } - TypeGuard.TUndefined = TUndefined; - /** Returns true if the given schema is TUnion */ - function TUnion(schema) { - // prettier-ignore - if (!(TKind(schema) && - schema[exports.Kind] === 'Union' && - IsArray(schema.anyOf) && - IsOptionalString(schema.$id))) { - return false; - } - for (const inner of schema.anyOf) { - if (!TSchema(inner)) - return false; - } - return true; - } - TypeGuard.TUnion = TUnion; - /** Returns true if the given schema is TUnion[]> */ - function TUnionLiteral(schema) { - return TUnion(schema) && schema.anyOf.every((schema) => TLiteral(schema) && typeof schema.const === 'string'); - } - TypeGuard.TUnionLiteral = TUnionLiteral; - /** Returns true if the given schema is TUint8Array */ - function TUint8Array(schema) { - return TKind(schema) && schema[exports.Kind] === 'Uint8Array' && schema.type === 'object' && IsOptionalString(schema.$id) && schema.instanceOf === 'Uint8Array' && IsOptionalNumber(schema.minByteLength) && IsOptionalNumber(schema.maxByteLength); - } - TypeGuard.TUint8Array = TUint8Array; - /** Returns true if the given schema is TUnknown */ - function TUnknown(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Unknown' && - IsOptionalString(schema.$id)); - } - TypeGuard.TUnknown = TUnknown; - /** Returns true if the given schema is a raw TUnsafe */ - function TUnsafe(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Unsafe'); - } - TypeGuard.TUnsafe = TUnsafe; - /** Returns true if the given schema is TVoid */ - function TVoid(schema) { - // prettier-ignore - return (TKind(schema) && - schema[exports.Kind] === 'Void' && - schema.type === 'null' && - schema.typeOf === 'Void' && - IsOptionalString(schema.$id)); - } - TypeGuard.TVoid = TVoid; - /** Returns true if this schema has the ReadonlyOptional modifier */ - function TReadonlyOptional(schema) { - return IsObject(schema) && schema[exports.Modifier] === 'ReadonlyOptional'; - } - TypeGuard.TReadonlyOptional = TReadonlyOptional; - /** Returns true if this schema has the Readonly modifier */ - function TReadonly(schema) { - return IsObject(schema) && schema[exports.Modifier] === 'Readonly'; - } - TypeGuard.TReadonly = TReadonly; - /** Returns true if this schema has the Optional modifier */ - function TOptional(schema) { - return IsObject(schema) && schema[exports.Modifier] === 'Optional'; - } - TypeGuard.TOptional = TOptional; - /** Returns true if the given schema is TSchema */ - function TSchema(schema) { - return (typeof schema === 'object' && - (TAny(schema) || - TArray(schema) || - TBoolean(schema) || - TBigInt(schema) || - TConstructor(schema) || - TDate(schema) || - TFunction(schema) || - TInteger(schema) || - TIntersect(schema) || - TLiteral(schema) || - TNever(schema) || - TNot(schema) || - TNull(schema) || - TNumber(schema) || - TObject(schema) || - TPromise(schema) || - TRecord(schema) || - TRef(schema) || - TString(schema) || - TSymbol(schema) || - TTemplateLiteral(schema) || - TThis(schema) || - TTuple(schema) || - TUndefined(schema) || - TUnion(schema) || - TUint8Array(schema) || - TUnknown(schema) || - TUnsafe(schema) || - TVoid(schema) || - (TKind(schema) && TypeRegistry.Has(schema[exports.Kind])))); - } - TypeGuard.TSchema = TSchema; -})(TypeGuard = exports.TypeGuard || (exports.TypeGuard = {})); -// -------------------------------------------------------------------------- -// ExtendsUndefined -// -------------------------------------------------------------------------- -/** Fast undefined check used for properties of type undefined */ -var ExtendsUndefined; -(function (ExtendsUndefined) { - function Check(schema) { - if (schema[exports.Kind] === 'Undefined') - return true; - if (schema[exports.Kind] === 'Union') { - const union = schema; - return union.anyOf.some((schema) => Check(schema)); - } - return false; - } - ExtendsUndefined.Check = Check; -})(ExtendsUndefined = exports.ExtendsUndefined || (exports.ExtendsUndefined = {})); -// -------------------------------------------------------------------------- -// TypeExtends -// -------------------------------------------------------------------------- -var TypeExtendsResult; -(function (TypeExtendsResult) { - TypeExtendsResult[TypeExtendsResult["Union"] = 0] = "Union"; - TypeExtendsResult[TypeExtendsResult["True"] = 1] = "True"; - TypeExtendsResult[TypeExtendsResult["False"] = 2] = "False"; -})(TypeExtendsResult = exports.TypeExtendsResult || (exports.TypeExtendsResult = {})); -var TypeExtends; -(function (TypeExtends) { - // -------------------------------------------------------------------------- - // IntoBooleanResult - // -------------------------------------------------------------------------- - function IntoBooleanResult(result) { - return result === TypeExtendsResult.False ? TypeExtendsResult.False : TypeExtendsResult.True; - } - // -------------------------------------------------------------------------- - // Any - // -------------------------------------------------------------------------- - function AnyRight(left, right) { - return TypeExtendsResult.True; - } - function Any(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right) && right.anyOf.some((schema) => TypeGuard.TAny(schema) || TypeGuard.TUnknown(schema))) - return TypeExtendsResult.True; - if (TypeGuard.TUnion(right)) - return TypeExtendsResult.Union; - if (TypeGuard.TUnknown(right)) - return TypeExtendsResult.True; - if (TypeGuard.TAny(right)) - return TypeExtendsResult.True; - return TypeExtendsResult.Union; - } - // -------------------------------------------------------------------------- - // Array - // -------------------------------------------------------------------------- - function ArrayRight(left, right) { - if (TypeGuard.TUnknown(left)) - return TypeExtendsResult.False; - if (TypeGuard.TAny(left)) - return TypeExtendsResult.Union; - if (TypeGuard.TNever(left)) - return TypeExtendsResult.True; - return TypeExtendsResult.False; - } - function Array(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right) && IsObjectArrayLike(right)) - return TypeExtendsResult.True; - if (!TypeGuard.TArray(right)) - return TypeExtendsResult.False; - return IntoBooleanResult(Visit(left.items, right.items)); - } - // -------------------------------------------------------------------------- - // BigInt - // -------------------------------------------------------------------------- - function BigInt(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TBigInt(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Boolean - // -------------------------------------------------------------------------- - function BooleanRight(left, right) { - if (TypeGuard.TLiteral(left) && typeof left.const === 'boolean') - return TypeExtendsResult.True; - return TypeGuard.TBoolean(left) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Boolean(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TBoolean(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Constructor - // -------------------------------------------------------------------------- - function Constructor(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (!TypeGuard.TConstructor(right)) - return TypeExtendsResult.False; - if (left.parameters.length > right.parameters.length) - return TypeExtendsResult.False; - if (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === TypeExtendsResult.True)) { - return TypeExtendsResult.False; - } - return IntoBooleanResult(Visit(left.returns, right.returns)); - } - // -------------------------------------------------------------------------- - // Date - // -------------------------------------------------------------------------- - function Date(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TDate(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Function - // -------------------------------------------------------------------------- - function Function(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (!TypeGuard.TFunction(right)) - return TypeExtendsResult.False; - if (left.parameters.length > right.parameters.length) - return TypeExtendsResult.False; - if (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === TypeExtendsResult.True)) { - return TypeExtendsResult.False; - } - return IntoBooleanResult(Visit(left.returns, right.returns)); - } - // -------------------------------------------------------------------------- - // Integer - // -------------------------------------------------------------------------- - function IntegerRight(left, right) { - if (TypeGuard.TLiteral(left) && typeof left.const === 'number') - return TypeExtendsResult.True; - return TypeGuard.TNumber(left) || TypeGuard.TInteger(left) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Integer(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TInteger(right) || TypeGuard.TNumber(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Intersect - // -------------------------------------------------------------------------- - function IntersectRight(left, right) { - return right.allOf.every((schema) => Visit(left, schema) === TypeExtendsResult.True) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Intersect(left, right) { - return left.allOf.some((schema) => Visit(schema, right) === TypeExtendsResult.True) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Literal - // -------------------------------------------------------------------------- - function IsLiteralString(schema) { - return typeof schema.const === 'string'; - } - function IsLiteralNumber(schema) { - return typeof schema.const === 'number'; - } - function IsLiteralBoolean(schema) { - return typeof schema.const === 'boolean'; - } - function Literal(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - if (TypeGuard.TString(right)) - return StringRight(left, right); - if (TypeGuard.TNumber(right)) - return NumberRight(left, right); - if (TypeGuard.TInteger(right)) - return IntegerRight(left, right); - if (TypeGuard.TBoolean(right)) - return BooleanRight(left, right); - return TypeGuard.TLiteral(right) && right.const === left.const ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Never - // -------------------------------------------------------------------------- - function NeverRight(left, right) { - return TypeExtendsResult.False; - } - function Never(left, right) { - return TypeExtendsResult.True; - } - // -------------------------------------------------------------------------- - // Null - // -------------------------------------------------------------------------- - function Null(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TNull(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Number - // -------------------------------------------------------------------------- - function NumberRight(left, right) { - if (TypeGuard.TLiteral(left) && IsLiteralNumber(left)) - return TypeExtendsResult.True; - return TypeGuard.TNumber(left) || TypeGuard.TInteger(left) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Number(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TInteger(right) || TypeGuard.TNumber(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Object - // -------------------------------------------------------------------------- - function IsObjectPropertyCount(schema, count) { - return globalThis.Object.keys(schema.properties).length === count; - } - function IsObjectStringLike(schema) { - return IsObjectArrayLike(schema); - } - function IsObjectSymbolLike(schema) { - // prettier-ignore - return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.TUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.TString(schema.properties.description.anyOf[0]) && - TypeGuard.TUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.TString(schema.properties.description.anyOf[1]) && - TypeGuard.TUndefined(schema.properties.description.anyOf[0])))); - } - function IsObjectNumberLike(schema) { - return IsObjectPropertyCount(schema, 0); - } - function IsObjectBooleanLike(schema) { - return IsObjectPropertyCount(schema, 0); - } - function IsObjectBigIntLike(schema) { - return IsObjectPropertyCount(schema, 0); - } - function IsObjectDateLike(schema) { - return IsObjectPropertyCount(schema, 0); - } - function IsObjectUint8ArrayLike(schema) { - return IsObjectArrayLike(schema); - } - function IsObjectFunctionLike(schema) { - const length = exports.Type.Number(); - return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === TypeExtendsResult.True); - } - function IsObjectConstructorLike(schema) { - return IsObjectPropertyCount(schema, 0); - } - function IsObjectArrayLike(schema) { - const length = exports.Type.Number(); - return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === TypeExtendsResult.True); - } - function IsObjectPromiseLike(schema) { - const then = exports.Type.Function([exports.Type.Any()], exports.Type.Any()); - return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === TypeExtendsResult.True); - } - // -------------------------------------------------------------------------- - // Property - // -------------------------------------------------------------------------- - function Property(left, right) { - if (Visit(left, right) === TypeExtendsResult.False) - return TypeExtendsResult.False; - if (TypeGuard.TOptional(left) && !TypeGuard.TOptional(right)) - return TypeExtendsResult.False; - return TypeExtendsResult.True; - } - function ObjectRight(left, right) { - if (TypeGuard.TUnknown(left)) - return TypeExtendsResult.False; - if (TypeGuard.TAny(left)) - return TypeExtendsResult.Union; - if (TypeGuard.TNever(left)) - return TypeExtendsResult.True; - if (TypeGuard.TLiteral(left) && IsLiteralString(left) && IsObjectStringLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TLiteral(left) && IsLiteralNumber(left) && IsObjectNumberLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TLiteral(left) && IsLiteralBoolean(left) && IsObjectBooleanLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TSymbol(left) && IsObjectSymbolLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TBigInt(left) && IsObjectBigIntLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TString(left) && IsObjectStringLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TSymbol(left) && IsObjectSymbolLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TNumber(left) && IsObjectNumberLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TInteger(left) && IsObjectNumberLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TBoolean(left) && IsObjectBooleanLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TUint8Array(left) && IsObjectUint8ArrayLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TDate(left) && IsObjectDateLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TConstructor(left) && IsObjectConstructorLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TFunction(left) && IsObjectFunctionLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TRecord(left) && TypeGuard.TString(RecordKey(left))) { - // When expressing a Record with literal key values, the Record is converted into a Object with - // the Hint assigned as `Record`. This is used to invert the extends logic. - return right[exports.Hint] === 'Record' ? TypeExtendsResult.True : TypeExtendsResult.False; - } - if (TypeGuard.TRecord(left) && TypeGuard.TNumber(RecordKey(left))) { - return IsObjectPropertyCount(right, 0) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - return TypeExtendsResult.False; - } - function Object(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - if (!TypeGuard.TObject(right)) - return TypeExtendsResult.False; - for (const key of globalThis.Object.keys(right.properties)) { - if (!(key in left.properties)) - return TypeExtendsResult.False; - if (Property(left.properties[key], right.properties[key]) === TypeExtendsResult.False) { - return TypeExtendsResult.False; - } - } - return TypeExtendsResult.True; - } - // -------------------------------------------------------------------------- - // Promise - // -------------------------------------------------------------------------- - function Promise(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right) && IsObjectPromiseLike(right)) - return TypeExtendsResult.True; - if (!TypeGuard.TPromise(right)) - return TypeExtendsResult.False; - return IntoBooleanResult(Visit(left.item, right.item)); - } - // -------------------------------------------------------------------------- - // Record - // -------------------------------------------------------------------------- - function RecordKey(schema) { - if (exports.PatternNumberExact in schema.patternProperties) - return exports.Type.Number(); - if (exports.PatternStringExact in schema.patternProperties) - return exports.Type.String(); - throw Error('TypeExtends: Cannot get record key'); - } - function RecordValue(schema) { - if (exports.PatternNumberExact in schema.patternProperties) - return schema.patternProperties[exports.PatternNumberExact]; - if (exports.PatternStringExact in schema.patternProperties) - return schema.patternProperties[exports.PatternStringExact]; - throw Error('TypeExtends: Cannot get record value'); - } - function RecordRight(left, right) { - const Key = RecordKey(right); - const Value = RecordValue(right); - if (TypeGuard.TLiteral(left) && IsLiteralString(left) && TypeGuard.TNumber(Key) && IntoBooleanResult(Visit(left, Value)) === TypeExtendsResult.True) - return TypeExtendsResult.True; - if (TypeGuard.TUint8Array(left) && TypeGuard.TNumber(Key)) - return Visit(left, Value); - if (TypeGuard.TString(left) && TypeGuard.TNumber(Key)) - return Visit(left, Value); - if (TypeGuard.TArray(left) && TypeGuard.TNumber(Key)) - return Visit(left, Value); - if (TypeGuard.TObject(left)) { - for (const key of globalThis.Object.keys(left.properties)) { - if (Property(Value, left.properties[key]) === TypeExtendsResult.False) { - return TypeExtendsResult.False; - } - } - return TypeExtendsResult.True; - } - return TypeExtendsResult.False; - } - function Record(left, right) { - const Value = RecordValue(left); - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (!TypeGuard.TRecord(right)) - return TypeExtendsResult.False; - return Visit(Value, RecordValue(right)); - } - // -------------------------------------------------------------------------- - // String - // -------------------------------------------------------------------------- - function StringRight(left, right) { - if (TypeGuard.TLiteral(left) && typeof left.const === 'string') - return TypeExtendsResult.True; - return TypeGuard.TString(left) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function String(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TString(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Symbol - // -------------------------------------------------------------------------- - function Symbol(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TSymbol(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Tuple - // -------------------------------------------------------------------------- - function TupleRight(left, right) { - if (TypeGuard.TUnknown(left)) - return TypeExtendsResult.False; - if (TypeGuard.TAny(left)) - return TypeExtendsResult.Union; - if (TypeGuard.TNever(left)) - return TypeExtendsResult.True; - return TypeExtendsResult.False; - } - function IsArrayOfTuple(left, right) { - return TypeGuard.TArray(right) && left.items !== undefined && left.items.every((schema) => Visit(schema, right.items) === TypeExtendsResult.True); - } - function Tuple(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right) && IsObjectArrayLike(right)) - return TypeExtendsResult.True; - if (TypeGuard.TArray(right) && IsArrayOfTuple(left, right)) - return TypeExtendsResult.True; - if (!TypeGuard.TTuple(right)) - return TypeExtendsResult.False; - if ((left.items === undefined && right.items !== undefined) || (left.items !== undefined && right.items === undefined)) - return TypeExtendsResult.False; - if (left.items === undefined && right.items === undefined) - return TypeExtendsResult.True; - return left.items.every((schema, index) => Visit(schema, right.items[index]) === TypeExtendsResult.True) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Uint8Array - // -------------------------------------------------------------------------- - function Uint8Array(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - return TypeGuard.TUint8Array(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Undefined - // -------------------------------------------------------------------------- - function Undefined(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TNever(right)) - return NeverRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - if (TypeGuard.TRecord(right)) - return RecordRight(left, right); - if (TypeGuard.TVoid(right)) - return VoidRight(left, right); - return TypeGuard.TUndefined(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Union - // -------------------------------------------------------------------------- - function UnionRight(left, right) { - return right.anyOf.some((schema) => Visit(left, schema) === TypeExtendsResult.True) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Union(left, right) { - return left.anyOf.every((schema) => Visit(schema, right) === TypeExtendsResult.True) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Unknown - // -------------------------------------------------------------------------- - function UnknownRight(left, right) { - return TypeExtendsResult.True; - } - function Unknown(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TString(right)) - return StringRight(left, right); - if (TypeGuard.TNumber(right)) - return NumberRight(left, right); - if (TypeGuard.TInteger(right)) - return IntegerRight(left, right); - if (TypeGuard.TBoolean(right)) - return BooleanRight(left, right); - if (TypeGuard.TArray(right)) - return ArrayRight(left, right); - if (TypeGuard.TTuple(right)) - return TupleRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - return TypeGuard.TUnknown(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - // -------------------------------------------------------------------------- - // Void - // -------------------------------------------------------------------------- - function VoidRight(left, right) { - if (TypeGuard.TUndefined(left)) - return TypeExtendsResult.True; - return TypeGuard.TUndefined(left) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Void(left, right) { - if (TypeGuard.TIntersect(right)) - return IntersectRight(left, right); - if (TypeGuard.TUnion(right)) - return UnionRight(left, right); - if (TypeGuard.TUnknown(right)) - return UnknownRight(left, right); - if (TypeGuard.TAny(right)) - return AnyRight(left, right); - if (TypeGuard.TObject(right)) - return ObjectRight(left, right); - return TypeGuard.TVoid(right) ? TypeExtendsResult.True : TypeExtendsResult.False; - } - function Visit(left, right) { - // template union remap - if (TypeGuard.TTemplateLiteral(left)) - return Visit(TemplateLiteralResolver.Resolve(left), right); - if (TypeGuard.TTemplateLiteral(right)) - return Visit(left, TemplateLiteralResolver.Resolve(right)); - // standard extends - if (TypeGuard.TAny(left)) - return Any(left, right); - if (TypeGuard.TArray(left)) - return Array(left, right); - if (TypeGuard.TBigInt(left)) - return BigInt(left, right); - if (TypeGuard.TBoolean(left)) - return Boolean(left, right); - if (TypeGuard.TConstructor(left)) - return Constructor(left, right); - if (TypeGuard.TDate(left)) - return Date(left, right); - if (TypeGuard.TFunction(left)) - return Function(left, right); - if (TypeGuard.TInteger(left)) - return Integer(left, right); - if (TypeGuard.TIntersect(left)) - return Intersect(left, right); - if (TypeGuard.TLiteral(left)) - return Literal(left, right); - if (TypeGuard.TNever(left)) - return Never(left, right); - if (TypeGuard.TNull(left)) - return Null(left, right); - if (TypeGuard.TNumber(left)) - return Number(left, right); - if (TypeGuard.TObject(left)) - return Object(left, right); - if (TypeGuard.TRecord(left)) - return Record(left, right); - if (TypeGuard.TString(left)) - return String(left, right); - if (TypeGuard.TSymbol(left)) - return Symbol(left, right); - if (TypeGuard.TTuple(left)) - return Tuple(left, right); - if (TypeGuard.TPromise(left)) - return Promise(left, right); - if (TypeGuard.TUint8Array(left)) - return Uint8Array(left, right); - if (TypeGuard.TUndefined(left)) - return Undefined(left, right); - if (TypeGuard.TUnion(left)) - return Union(left, right); - if (TypeGuard.TUnknown(left)) - return Unknown(left, right); - if (TypeGuard.TVoid(left)) - return Void(left, right); - throw Error(`TypeExtends: Unknown left type operand '${left[exports.Kind]}'`); - } - function Extends(left, right) { - return Visit(left, right); - } - TypeExtends.Extends = Extends; -})(TypeExtends = exports.TypeExtends || (exports.TypeExtends = {})); -// -------------------------------------------------------------------------- -// TypeClone -// -------------------------------------------------------------------------- -/** Specialized Clone for Types */ -var TypeClone; -(function (TypeClone) { - function IsObject(value) { - return typeof value === 'object' && value !== null; - } - function IsArray(value) { - return globalThis.Array.isArray(value); - } - function Array(value) { - return value.map((value) => Visit(value)); - } - function Object(value) { - const clonedProperties = globalThis.Object.getOwnPropertyNames(value).reduce((acc, key) => { - return { ...acc, [key]: Visit(value[key]) }; - }, {}); - const clonedSymbols = globalThis.Object.getOwnPropertySymbols(value).reduce((acc, key) => { - return { ...acc, [key]: Visit(value[key]) }; - }, {}); - return { ...clonedProperties, ...clonedSymbols }; - } - function Visit(value) { - if (IsArray(value)) - return Array(value); - if (IsObject(value)) - return Object(value); - return value; - } - /** Clones a type. */ - function Clone(schema, options) { - return { ...Visit(schema), ...options }; - } - TypeClone.Clone = Clone; -})(TypeClone = exports.TypeClone || (exports.TypeClone = {})); -// -------------------------------------------------------------------------- -// ObjectMap -// -------------------------------------------------------------------------- -var ObjectMap; -(function (ObjectMap) { - function Intersect(schema, callback) { - // prettier-ignore - return exports.Type.Intersect(schema.allOf.map((inner) => Visit(inner, callback)), { ...schema }); - } - function Union(schema, callback) { - // prettier-ignore - return exports.Type.Union(schema.anyOf.map((inner) => Visit(inner, callback)), { ...schema }); - } - function Object(schema, callback) { - return callback(schema); - } - function Visit(schema, callback) { - // There are cases where users need to map objects with unregistered kinds. Using a TypeGuard here would - // prevent sub schema mapping as unregistered kinds will not pass TSchema checks. This is notable in the - // case of TObject where unregistered property kinds cause the TObject check to fail. As mapping is only - // used for composition, we use explicit checks instead. - if (schema[exports.Kind] === 'Intersect') - return Intersect(schema, callback); - if (schema[exports.Kind] === 'Union') - return Union(schema, callback); - if (schema[exports.Kind] === 'Object') - return Object(schema, callback); - return schema; - } - function Map(schema, callback, options) { - return { ...Visit(TypeClone.Clone(schema, {}), callback), ...options }; - } - ObjectMap.Map = Map; -})(ObjectMap = exports.ObjectMap || (exports.ObjectMap = {})); -// -------------------------------------------------------------------------- -// KeyResolver -// -------------------------------------------------------------------------- -var KeyResolver; -(function (KeyResolver) { - function IsKeyable(schema) { - return TypeGuard.TIntersect(schema) || TypeGuard.TUnion(schema) || (TypeGuard.TObject(schema) && globalThis.Object.getOwnPropertyNames(schema.properties).length > 0); - } - function Intersect(schema) { - return [...schema.allOf.filter((schema) => IsKeyable(schema)).reduce((set, schema) => Visit(schema).map((key) => set.add(key))[0], new Set())]; - } - function Union(schema) { - const sets = schema.anyOf.filter((schema) => IsKeyable(schema)).map((inner) => Visit(inner)); - return [...sets.reduce((set, outer) => outer.map((key) => (sets.every((inner) => inner.includes(key)) ? set.add(key) : set))[0], new Set())]; - } - function Object(schema) { - return globalThis.Object.keys(schema.properties); - } - function Visit(schema) { - if (TypeGuard.TIntersect(schema)) - return Intersect(schema); - if (TypeGuard.TUnion(schema)) - return Union(schema); - if (TypeGuard.TObject(schema)) - return Object(schema); - return []; - } - function Resolve(schema) { - return Visit(schema); - } - KeyResolver.Resolve = Resolve; -})(KeyResolver = exports.KeyResolver || (exports.KeyResolver = {})); -// -------------------------------------------------------------------------- -// TemplateLiteralPattern -// -------------------------------------------------------------------------- -var TemplateLiteralPattern; -(function (TemplateLiteralPattern) { - function Escape(value) { - return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - } - function Visit(schema, acc) { - if (TypeGuard.TTemplateLiteral(schema)) { - const pattern = schema.pattern.slice(1, schema.pattern.length - 1); - return pattern; - } - else if (TypeGuard.TUnion(schema)) { - const tokens = schema.anyOf.map((schema) => Visit(schema, acc)).join('|'); - return `(${tokens})`; - } - else if (TypeGuard.TNumber(schema)) { - return `${acc}${exports.PatternNumber}`; - } - else if (TypeGuard.TInteger(schema)) { - return `${acc}${exports.PatternNumber}`; - } - else if (TypeGuard.TBigInt(schema)) { - return `${acc}${exports.PatternNumber}`; - } - else if (TypeGuard.TString(schema)) { - return `${acc}${exports.PatternString}`; - } - else if (TypeGuard.TLiteral(schema)) { - return `${acc}${Escape(schema.const.toString())}`; - } - else if (TypeGuard.TBoolean(schema)) { - return `${acc}${exports.PatternBoolean}`; - } - else if (TypeGuard.TNever(schema)) { - throw Error('TemplateLiteralPattern: TemplateLiteral cannot operate on types of TNever'); - } - else { - throw Error(`TemplateLiteralPattern: Unexpected Kind '${schema[exports.Kind]}'`); - } - } - function Create(kinds) { - return `^${kinds.map((schema) => Visit(schema, '')).join('')}\$`; - } - TemplateLiteralPattern.Create = Create; -})(TemplateLiteralPattern = exports.TemplateLiteralPattern || (exports.TemplateLiteralPattern = {})); -// -------------------------------------------------------------------------------------- -// TemplateLiteralResolver -// -------------------------------------------------------------------------------------- -var TemplateLiteralResolver; -(function (TemplateLiteralResolver) { - function Resolve(template) { - const expression = TemplateLiteralParser.ParseExact(template.pattern); - if (!TemplateLiteralFinite.Check(expression)) - return exports.Type.String(); - const literals = [...TemplateLiteralGenerator.Generate(expression)].map((value) => exports.Type.Literal(value)); - return exports.Type.Union(literals); - } - TemplateLiteralResolver.Resolve = Resolve; -})(TemplateLiteralResolver = exports.TemplateLiteralResolver || (exports.TemplateLiteralResolver = {})); -// -------------------------------------------------------------------------------------- -// TemplateLiteralParser -// -------------------------------------------------------------------------------------- -class TemplateLiteralParserError extends Error { - constructor(message) { - super(message); - } -} -exports.TemplateLiteralParserError = TemplateLiteralParserError; -var TemplateLiteralParser; -(function (TemplateLiteralParser) { - function IsNonEscaped(pattern, index, char) { - return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92; - } - function IsOpenParen(pattern, index) { - return IsNonEscaped(pattern, index, '('); - } - function IsCloseParen(pattern, index) { - return IsNonEscaped(pattern, index, ')'); - } - function IsSeparator(pattern, index) { - return IsNonEscaped(pattern, index, '|'); - } - function IsGroup(pattern) { - if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) - return false; - let count = 0; - for (let index = 0; index < pattern.length; index++) { - if (IsOpenParen(pattern, index)) - count += 1; - if (IsCloseParen(pattern, index)) - count -= 1; - if (count === 0 && index !== pattern.length - 1) - return false; - } - return true; - } - function InGroup(pattern) { - return pattern.slice(1, pattern.length - 1); - } - function IsPrecedenceOr(pattern) { - let count = 0; - for (let index = 0; index < pattern.length; index++) { - if (IsOpenParen(pattern, index)) - count += 1; - if (IsCloseParen(pattern, index)) - count -= 1; - if (IsSeparator(pattern, index) && count === 0) - return true; - } - return false; - } - function IsPrecedenceAnd(pattern) { - for (let index = 0; index < pattern.length; index++) { - if (IsOpenParen(pattern, index)) - return true; - } - return false; - } - function Or(pattern) { - let [count, start] = [0, 0]; - const expressions = []; - for (let index = 0; index < pattern.length; index++) { - if (IsOpenParen(pattern, index)) - count += 1; - if (IsCloseParen(pattern, index)) - count -= 1; - if (IsSeparator(pattern, index) && count === 0) { - const range = pattern.slice(start, index); - if (range.length > 0) - expressions.push(Parse(range)); - start = index + 1; - } - } - const range = pattern.slice(start); - if (range.length > 0) - expressions.push(Parse(range)); - if (expressions.length === 0) - return { type: 'const', const: '' }; - if (expressions.length === 1) - return expressions[0]; - return { type: 'or', expr: expressions }; - } - function And(pattern) { - function Group(value, index) { - if (!IsOpenParen(value, index)) - throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`); - let count = 0; - for (let scan = index; scan < value.length; scan++) { - if (IsOpenParen(value, scan)) - count += 1; - if (IsCloseParen(value, scan)) - count -= 1; - if (count === 0) - return [index, scan]; - } - throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`); - } - function Range(pattern, index) { - for (let scan = index; scan < pattern.length; scan++) { - if (IsOpenParen(pattern, scan)) - return [index, scan]; - } - return [index, pattern.length]; - } - const expressions = []; - for (let index = 0; index < pattern.length; index++) { - if (IsOpenParen(pattern, index)) { - const [start, end] = Group(pattern, index); - const range = pattern.slice(start, end + 1); - expressions.push(Parse(range)); - index = end; - } - else { - const [start, end] = Range(pattern, index); - const range = pattern.slice(start, end); - if (range.length > 0) - expressions.push(Parse(range)); - index = end - 1; - } - } - if (expressions.length === 0) - return { type: 'const', const: '' }; - if (expressions.length === 1) - return expressions[0]; - return { type: 'and', expr: expressions }; - } - /** Parses a pattern and returns an expression tree */ - function Parse(pattern) { - if (IsGroup(pattern)) - return Parse(InGroup(pattern)); - if (IsPrecedenceOr(pattern)) - return Or(pattern); - if (IsPrecedenceAnd(pattern)) - return And(pattern); - return { type: 'const', const: pattern }; - } - TemplateLiteralParser.Parse = Parse; - /** Parses a pattern and strips forward and trailing ^ and $ */ - function ParseExact(pattern) { - return Parse(pattern.slice(1, pattern.length - 1)); - } - TemplateLiteralParser.ParseExact = ParseExact; -})(TemplateLiteralParser = exports.TemplateLiteralParser || (exports.TemplateLiteralParser = {})); -// -------------------------------------------------------------------------------------- -// TemplateLiteralFinite -// -------------------------------------------------------------------------------------- -var TemplateLiteralFinite; -(function (TemplateLiteralFinite) { - function IsNumber(expression) { - // prettier-ignore - return (expression.type === 'or' && - expression.expr.length === 2 && - expression.expr[0].type === 'const' && - expression.expr[0].const === '0' && - expression.expr[1].type === 'const' && - expression.expr[1].const === '[1-9][0-9]*'); - } - function IsBoolean(expression) { - // prettier-ignore - return (expression.type === 'or' && - expression.expr.length === 2 && - expression.expr[0].type === 'const' && - expression.expr[0].const === 'true' && - expression.expr[1].type === 'const' && - expression.expr[1].const === 'false'); - } - function IsString(expression) { - return expression.type === 'const' && expression.const === '.*'; - } - function Check(expression) { - if (IsBoolean(expression)) - return true; - if (IsNumber(expression) || IsString(expression)) - return false; - if (expression.type === 'and') - return expression.expr.every((expr) => Check(expr)); - if (expression.type === 'or') - return expression.expr.every((expr) => Check(expr)); - if (expression.type === 'const') - return true; - throw Error(`TemplateLiteralFinite: Unknown expression type`); - } - TemplateLiteralFinite.Check = Check; -})(TemplateLiteralFinite = exports.TemplateLiteralFinite || (exports.TemplateLiteralFinite = {})); -// -------------------------------------------------------------------------------------- -// TemplateLiteralGenerator -// -------------------------------------------------------------------------------------- -var TemplateLiteralGenerator; -(function (TemplateLiteralGenerator) { - function* Reduce(buffer) { - if (buffer.length === 1) - return yield* buffer[0]; - for (const left of buffer[0]) { - for (const right of Reduce(buffer.slice(1))) { - yield `${left}${right}`; - } - } - } - function* And(expression) { - return yield* Reduce(expression.expr.map((expr) => [...Generate(expr)])); - } - function* Or(expression) { - for (const expr of expression.expr) - yield* Generate(expr); - } - function* Const(expression) { - return yield expression.const; - } - function* Generate(expression) { - if (expression.type === 'and') - return yield* And(expression); - if (expression.type === 'or') - return yield* Or(expression); - if (expression.type === 'const') - return yield* Const(expression); - throw Error('TemplateLiteralGenerator: Unknown expression'); - } - TemplateLiteralGenerator.Generate = Generate; -})(TemplateLiteralGenerator = exports.TemplateLiteralGenerator || (exports.TemplateLiteralGenerator = {})); -// -------------------------------------------------------------------------- -// TypeOrdinal: Used for auto $id generation -// -------------------------------------------------------------------------- -let TypeOrdinal = 0; -// -------------------------------------------------------------------------- -// TypeBuilder -// -------------------------------------------------------------------------- -class TypeBuilder { - /** `[Utility]` Creates a schema without `static` and `params` types */ - Create(schema) { - return schema; - } - /** `[Standard]` Omits compositing symbols from this schema */ - Strict(schema) { - return JSON.parse(JSON.stringify(schema)); - } -} -exports.TypeBuilder = TypeBuilder; -// -------------------------------------------------------------------------- -// StandardTypeBuilder -// -------------------------------------------------------------------------- -class StandardTypeBuilder extends TypeBuilder { - // ------------------------------------------------------------------------ - // Modifiers - // ------------------------------------------------------------------------ - /** `[Modifier]` Creates a Optional property */ - Optional(schema) { - return { [exports.Modifier]: 'Optional', ...TypeClone.Clone(schema, {}) }; - } - /** `[Modifier]` Creates a ReadonlyOptional property */ - ReadonlyOptional(schema) { - return { [exports.Modifier]: 'ReadonlyOptional', ...TypeClone.Clone(schema, {}) }; - } - /** `[Modifier]` Creates a Readonly object or property */ - Readonly(schema) { - return { [exports.Modifier]: 'Readonly', ...schema }; - } - // ------------------------------------------------------------------------ - // Types - // ------------------------------------------------------------------------ - /** `[Standard]` Creates an Any type */ - Any(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Any' }); - } - /** `[Standard]` Creates an Array type */ - Array(items, options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Array', type: 'array', items: TypeClone.Clone(items, {}) }); - } - /** `[Standard]` Creates a Boolean type */ - Boolean(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Boolean', type: 'boolean' }); - } - /** `[Standard]` Creates a Composite object type. */ - Composite(objects, options) { - const isOptionalAll = (objects, key) => objects.every((object) => !(key in object.properties) || IsOptional(object.properties[key])); - const IsOptional = (schema) => TypeGuard.TOptional(schema) || TypeGuard.TReadonlyOptional(schema); - const [required, optional] = [new Set(), new Set()]; - for (const object of objects) { - for (const key of globalThis.Object.getOwnPropertyNames(object.properties)) { - if (isOptionalAll(objects, key)) - optional.add(key); - } - } - for (const object of objects) { - for (const key of globalThis.Object.getOwnPropertyNames(object.properties)) { - if (!optional.has(key)) - required.add(key); - } - } - const properties = {}; - for (const object of objects) { - for (const [key, schema] of Object.entries(object.properties)) { - const property = TypeClone.Clone(schema, {}); - if (!optional.has(key)) - delete property[exports.Modifier]; - if (key in properties) { - const left = TypeExtends.Extends(properties[key], property) !== TypeExtendsResult.False; - const right = TypeExtends.Extends(property, properties[key]) !== TypeExtendsResult.False; - if (!left && !right) - properties[key] = exports.Type.Never(); - if (!left && right) - properties[key] = property; - } - else { - properties[key] = property; - } - } - } - if (required.size > 0) { - return this.Create({ ...options, [exports.Kind]: 'Object', [exports.Hint]: 'Composite', type: 'object', properties, required: [...required] }); - } - else { - return this.Create({ ...options, [exports.Kind]: 'Object', [exports.Hint]: 'Composite', type: 'object', properties }); - } - } - /** `[Standard]` Creates a Enum type */ - Enum(item, options = {}) { - // prettier-ignore - const values = globalThis.Object.keys(item).filter((key) => isNaN(key)).map((key) => item[key]); - const anyOf = values.map((value) => (typeof value === 'string' ? { [exports.Kind]: 'Literal', type: 'string', const: value } : { [exports.Kind]: 'Literal', type: 'number', const: value })); - return this.Create({ ...options, [exports.Kind]: 'Union', anyOf }); - } - /** `[Standard]` A conditional type expression that will return the true type if the left type extends the right */ - Extends(left, right, trueType, falseType, options = {}) { - switch (TypeExtends.Extends(left, right)) { - case TypeExtendsResult.Union: - return this.Union([TypeClone.Clone(trueType, options), TypeClone.Clone(falseType, options)]); - case TypeExtendsResult.True: - return TypeClone.Clone(trueType, options); - case TypeExtendsResult.False: - return TypeClone.Clone(falseType, options); - } - } - /** `[Standard]` Excludes from the left type any type that is not assignable to the right */ - Exclude(left, right, options = {}) { - if (TypeGuard.TTemplateLiteral(left)) - return this.Exclude(TemplateLiteralResolver.Resolve(left), right, options); - if (TypeGuard.TTemplateLiteral(right)) - return this.Exclude(left, TemplateLiteralResolver.Resolve(right), options); - if (TypeGuard.TUnion(left)) { - const narrowed = left.anyOf.filter((inner) => TypeExtends.Extends(inner, right) === TypeExtendsResult.False); - return (narrowed.length === 1 ? TypeClone.Clone(narrowed[0], options) : this.Union(narrowed, options)); - } - else { - return (TypeExtends.Extends(left, right) !== TypeExtendsResult.False ? this.Never(options) : TypeClone.Clone(left, options)); - } - } - /** `[Standard]` Extracts from the left type any type that is assignable to the right */ - Extract(left, right, options = {}) { - if (TypeGuard.TTemplateLiteral(left)) - return this.Extract(TemplateLiteralResolver.Resolve(left), right, options); - if (TypeGuard.TTemplateLiteral(right)) - return this.Extract(left, TemplateLiteralResolver.Resolve(right), options); - if (TypeGuard.TUnion(left)) { - const narrowed = left.anyOf.filter((inner) => TypeExtends.Extends(inner, right) !== TypeExtendsResult.False); - return (narrowed.length === 1 ? TypeClone.Clone(narrowed[0], options) : this.Union(narrowed, options)); - } - else { - return (TypeExtends.Extends(left, right) !== TypeExtendsResult.False ? TypeClone.Clone(left, options) : this.Never(options)); - } - } - /** `[Standard]` Creates an Integer type */ - Integer(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Integer', type: 'integer' }); - } - Intersect(allOf, options = {}) { - if (allOf.length === 0) - return exports.Type.Never(); - if (allOf.length === 1) - return TypeClone.Clone(allOf[0], options); - const objects = allOf.every((schema) => TypeGuard.TObject(schema)); - const cloned = allOf.map((schema) => TypeClone.Clone(schema, {})); - const clonedUnevaluatedProperties = TypeGuard.TSchema(options.unevaluatedProperties) ? { unevaluatedProperties: TypeClone.Clone(options.unevaluatedProperties, {}) } : {}; - if (options.unevaluatedProperties === false || TypeGuard.TSchema(options.unevaluatedProperties) || objects) { - return this.Create({ ...options, ...clonedUnevaluatedProperties, [exports.Kind]: 'Intersect', type: 'object', allOf: cloned }); - } - else { - return this.Create({ ...options, ...clonedUnevaluatedProperties, [exports.Kind]: 'Intersect', allOf: cloned }); - } - } - /** `[Standard]` Creates a KeyOf type */ - KeyOf(schema, options = {}) { - if (TypeGuard.TRecord(schema)) { - const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; - if (pattern === exports.PatternNumberExact) - return this.Number(options); - if (pattern === exports.PatternStringExact) - return this.String(options); - throw Error('StandardTypeBuilder: Unable to resolve key type from Record key pattern'); - } - else { - const resolved = KeyResolver.Resolve(schema); - if (resolved.length === 0) - return this.Never(options); - const literals = resolved.map((key) => this.Literal(key)); - return this.Union(literals, options); - } - } - /** `[Standard]` Creates a Literal type */ - Literal(value, options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Literal', const: value, type: typeof value }); - } - /** `[Standard]` Creates a Never type */ - Never(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Never', not: {} }); - } - /** `[Standard]` Creates a Not type. The first argument is the disallowed type, the second is the allowed. */ - Not(not, schema, options) { - return this.Create({ ...options, [exports.Kind]: 'Not', allOf: [{ not: TypeClone.Clone(not, {}) }, TypeClone.Clone(schema, {})] }); - } - /** `[Standard]` Creates a Null type */ - Null(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Null', type: 'null' }); - } - /** `[Standard]` Creates a Number type */ - Number(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Number', type: 'number' }); - } - /** `[Standard]` Creates an Object type */ - Object(properties, options = {}) { - const propertyKeys = globalThis.Object.getOwnPropertyNames(properties); - const optionalKeys = propertyKeys.filter((key) => TypeGuard.TOptional(properties[key]) || TypeGuard.TReadonlyOptional(properties[key])); - const requiredKeys = propertyKeys.filter((name) => !optionalKeys.includes(name)); - const clonedAdditionalProperties = TypeGuard.TSchema(options.additionalProperties) ? { additionalProperties: TypeClone.Clone(options.additionalProperties, {}) } : {}; - const clonedProperties = propertyKeys.reduce((acc, key) => ({ ...acc, [key]: TypeClone.Clone(properties[key], {}) }), {}); - if (requiredKeys.length > 0) { - return this.Create({ ...options, ...clonedAdditionalProperties, [exports.Kind]: 'Object', type: 'object', properties: clonedProperties, required: requiredKeys }); - } - else { - return this.Create({ ...options, ...clonedAdditionalProperties, [exports.Kind]: 'Object', type: 'object', properties: clonedProperties }); - } - } - Omit(schema, unresolved, options = {}) { - // prettier-ignore - const keys = TypeGuard.TUnionLiteral(unresolved) ? unresolved.anyOf.map((schema) => schema.const) : - TypeGuard.TLiteral(unresolved) ? [unresolved.const] : - TypeGuard.TNever(unresolved) ? [] : - unresolved; - // prettier-ignore - return ObjectMap.Map(TypeClone.Clone(schema, {}), (schema) => { - if (schema.required) { - schema.required = schema.required.filter((key) => !keys.includes(key)); - if (schema.required.length === 0) - delete schema.required; - } - for (const key of globalThis.Object.keys(schema.properties)) { - if (keys.includes(key)) - delete schema.properties[key]; - } - return this.Create(schema); - }, options); - } - /** `[Standard]` Creates a mapped type where all properties are Optional */ - Partial(schema, options = {}) { - function Apply(schema) { - // prettier-ignore - switch (schema[exports.Modifier]) { - case 'ReadonlyOptional': - schema[exports.Modifier] = 'ReadonlyOptional'; - break; - case 'Readonly': - schema[exports.Modifier] = 'ReadonlyOptional'; - break; - case 'Optional': - schema[exports.Modifier] = 'Optional'; - break; - default: - schema[exports.Modifier] = 'Optional'; - break; - } - } - // prettier-ignore - return ObjectMap.Map(TypeClone.Clone(schema, {}), (schema) => { - delete schema.required; - globalThis.Object.keys(schema.properties).forEach(key => Apply(schema.properties[key])); - return schema; - }, options); - } - Pick(schema, unresolved, options = {}) { - // prettier-ignore - const keys = TypeGuard.TUnionLiteral(unresolved) ? unresolved.anyOf.map((schema) => schema.const) : - TypeGuard.TLiteral(unresolved) ? [unresolved.const] : - TypeGuard.TNever(unresolved) ? [] : - unresolved; - // prettier-ignore - return ObjectMap.Map(TypeClone.Clone(schema, {}), (schema) => { - if (schema.required) { - schema.required = schema.required.filter((key) => keys.includes(key)); - if (schema.required.length === 0) - delete schema.required; - } - for (const key of globalThis.Object.keys(schema.properties)) { - if (!keys.includes(key)) - delete schema.properties[key]; - } - return this.Create(schema); - }, options); - } - /** `[Standard]` Creates a Record type */ - Record(key, schema, options = {}) { - if (TypeGuard.TTemplateLiteral(key)) { - const expression = TemplateLiteralParser.ParseExact(key.pattern); - // prettier-ignore - return TemplateLiteralFinite.Check(expression) - ? (this.Object([...TemplateLiteralGenerator.Generate(expression)].reduce((acc, key) => ({ ...acc, [key]: TypeClone.Clone(schema, {}) }), {}), options)) - : this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [key.pattern]: TypeClone.Clone(schema, {}) }, additionalProperties: false }); - } - else if (TypeGuard.TUnionLiteral(key)) { - if (key.anyOf.every((schema) => TypeGuard.TLiteral(schema) && (typeof schema.const === 'string' || typeof schema.const === 'number'))) { - const properties = key.anyOf.reduce((acc, literal) => ({ ...acc, [literal.const]: TypeClone.Clone(schema, {}) }), {}); - return this.Object(properties, { ...options, [exports.Hint]: 'Record' }); - } - else - throw Error('TypeBuilder: Record key can only be derived from union literal of number or string'); - } - else if (TypeGuard.TLiteral(key)) { - if (typeof key.const === 'string' || typeof key.const === 'number') { - return this.Object({ [key.const]: TypeClone.Clone(schema, {}) }, options); - } - else - throw Error('TypeBuilder: Record key can only be derived from literals of number or string'); - } - else if (TypeGuard.TInteger(key) || TypeGuard.TNumber(key)) { - const pattern = exports.PatternNumberExact; - return this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [pattern]: TypeClone.Clone(schema, {}) }, additionalProperties: false }); - } - else if (TypeGuard.TString(key)) { - const pattern = key.pattern === undefined ? exports.PatternStringExact : key.pattern; - return this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [pattern]: TypeClone.Clone(schema, {}) }, additionalProperties: false }); - } - else { - throw Error(`StandardTypeBuilder: Invalid Record Key`); - } - } - /** `[Standard]` Creates a Recursive type */ - Recursive(callback, options = {}) { - if (options.$id === undefined) - options.$id = `T${TypeOrdinal++}`; - const thisType = callback({ [exports.Kind]: 'This', $ref: `${options.$id}` }); - thisType.$id = options.$id; - return this.Create({ ...options, [exports.Hint]: 'Recursive', ...thisType }); - } - /** `[Standard]` Creates a Ref type. The referenced type must contain a $id */ - Ref(schema, options = {}) { - if (schema.$id === undefined) - throw Error('StandardTypeBuilder.Ref: Target type must specify an $id'); - return this.Create({ ...options, [exports.Kind]: 'Ref', $ref: schema.$id }); - } - /** `[Standard]` Creates a mapped type where all properties are Required */ - Required(schema, options = {}) { - function Apply(schema) { - // prettier-ignore - switch (schema[exports.Modifier]) { - case 'ReadonlyOptional': - schema[exports.Modifier] = 'Readonly'; - break; - case 'Readonly': - schema[exports.Modifier] = 'Readonly'; - break; - case 'Optional': - delete schema[exports.Modifier]; - break; - default: - delete schema[exports.Modifier]; - break; - } - } - // prettier-ignore - return ObjectMap.Map(TypeClone.Clone(schema, {}), (schema) => { - schema.required = globalThis.Object.keys(schema.properties); - globalThis.Object.keys(schema.properties).forEach(key => Apply(schema.properties[key])); - return schema; - }, options); - } - /** `[Standard]` Creates a String type */ - String(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'String', type: 'string' }); - } - /** `[Standard]` Creates a template literal type */ - TemplateLiteral(kinds, options = {}) { - const pattern = TemplateLiteralPattern.Create(kinds); - return this.Create({ ...options, [exports.Kind]: 'TemplateLiteral', type: 'string', pattern }); - } - /** `[Standard]` Creates a Tuple type */ - Tuple(items, options = {}) { - const [additionalItems, minItems, maxItems] = [false, items.length, items.length]; - const clonedItems = items.map((item) => TypeClone.Clone(item, {})); - // prettier-ignore - const schema = (items.length > 0 ? - { ...options, [exports.Kind]: 'Tuple', type: 'array', items: clonedItems, additionalItems, minItems, maxItems } : - { ...options, [exports.Kind]: 'Tuple', type: 'array', minItems, maxItems }); - return this.Create(schema); - } - Union(union, options = {}) { - if (TypeGuard.TTemplateLiteral(union)) { - return TemplateLiteralResolver.Resolve(union); - } - else { - const anyOf = union; - if (anyOf.length === 0) - return this.Never(options); - if (anyOf.length === 1) - return this.Create(TypeClone.Clone(anyOf[0], options)); - const clonedAnyOf = anyOf.map((schema) => TypeClone.Clone(schema, {})); - return this.Create({ ...options, [exports.Kind]: 'Union', anyOf: clonedAnyOf }); - } - } - /** `[Standard]` Creates an Unknown type */ - Unknown(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Unknown' }); - } - /** `[Standard]` Creates a Unsafe type that infers for the generic argument */ - Unsafe(options = {}) { - return this.Create({ ...options, [exports.Kind]: options[exports.Kind] || 'Unsafe' }); - } -} -exports.StandardTypeBuilder = StandardTypeBuilder; -// -------------------------------------------------------------------------- -// ExtendedTypeBuilder -// -------------------------------------------------------------------------- -class ExtendedTypeBuilder extends StandardTypeBuilder { - /** `[Extended]` Creates a BigInt type */ - BigInt(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'BigInt', type: 'null', typeOf: 'BigInt' }); - } - /** `[Extended]` Extracts the ConstructorParameters from the given Constructor type */ - ConstructorParameters(schema, options = {}) { - return this.Tuple([...schema.parameters], { ...options }); - } - Constructor(parameters, returns, options = {}) { - const clonedReturns = TypeClone.Clone(returns, {}); - if (TypeGuard.TTuple(parameters)) { - const clonedParameters = parameters.items === undefined ? [] : parameters.items.map((parameter) => TypeClone.Clone(parameter, {})); - return this.Create({ ...options, [exports.Kind]: 'Constructor', type: 'object', instanceOf: 'Constructor', parameters: clonedParameters, returns: clonedReturns }); - } - else if (globalThis.Array.isArray(parameters)) { - const clonedParameters = parameters.map((parameter) => TypeClone.Clone(parameter, {})); - return this.Create({ ...options, [exports.Kind]: 'Constructor', type: 'object', instanceOf: 'Constructor', parameters: clonedParameters, returns: clonedReturns }); - } - else { - throw new Error('ExtendedTypeBuilder.Constructor: Invalid parameters'); - } - } - /** `[Extended]` Creates a Date type */ - Date(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Date', type: 'object', instanceOf: 'Date' }); - } - Function(parameters, returns, options = {}) { - const clonedReturns = TypeClone.Clone(returns, {}); - if (TypeGuard.TTuple(parameters)) { - const clonedParameters = parameters.items === undefined ? [] : parameters.items.map((parameter) => TypeClone.Clone(parameter, {})); - return this.Create({ ...options, [exports.Kind]: 'Function', type: 'object', instanceOf: 'Function', parameters: clonedParameters, returns: clonedReturns }); - } - else if (globalThis.Array.isArray(parameters)) { - const clonedParameters = parameters.map((parameter) => TypeClone.Clone(parameter, {})); - return this.Create({ ...options, [exports.Kind]: 'Function', type: 'object', instanceOf: 'Function', parameters: clonedParameters, returns: clonedReturns }); - } - else { - throw new Error('ExtendedTypeBuilder.Function: Invalid parameters'); - } - } - /** `[Extended]` Extracts the InstanceType from the given Constructor */ - InstanceType(schema, options = {}) { - return TypeClone.Clone(schema.returns, options); - } - /** `[Extended]` Extracts the Parameters from the given Function type */ - Parameters(schema, options = {}) { - return this.Tuple(schema.parameters, { ...options }); - } - /** `[Extended]` Creates a Promise type */ - Promise(item, options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Promise', type: 'object', instanceOf: 'Promise', item: TypeClone.Clone(item, {}) }); - } - /** `[Extended]` Creates a regular expression type */ - RegEx(regex, options = {}) { - return this.Create({ ...options, [exports.Kind]: 'String', type: 'string', pattern: regex.source }); - } - /** `[Extended]` Extracts the ReturnType from the given Function */ - ReturnType(schema, options = {}) { - return TypeClone.Clone(schema.returns, options); - } - /** `[Extended]` Creates a Symbol type */ - Symbol(options) { - return this.Create({ ...options, [exports.Kind]: 'Symbol', type: 'null', typeOf: 'Symbol' }); - } - /** `[Extended]` Creates a Undefined type */ - Undefined(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Undefined', type: 'null', typeOf: 'Undefined' }); - } - /** `[Extended]` Creates a Uint8Array type */ - Uint8Array(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Uint8Array', type: 'object', instanceOf: 'Uint8Array' }); - } - /** `[Extended]` Creates a Void type */ - Void(options = {}) { - return this.Create({ ...options, [exports.Kind]: 'Void', type: 'null', typeOf: 'Void' }); - } -} -exports.ExtendedTypeBuilder = ExtendedTypeBuilder; -/** JSON Schema TypeBuilder with Static Resolution for TypeScript */ -exports.StandardType = new StandardTypeBuilder(); -/** JSON Schema TypeBuilder with Static Resolution for TypeScript */ -exports.Type = new ExtendedTypeBuilder(); diff --git a/node_modules/@sinclair/typebox/value/cast.d.ts b/node_modules/@sinclair/typebox/value/cast.d.ts deleted file mode 100644 index 992d9e3f..00000000 --- a/node_modules/@sinclair/typebox/value/cast.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as Types from '../typebox'; -export declare class ValueCastReferenceTypeError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -export declare class ValueCastArrayUniqueItemsTypeError extends Error { - readonly schema: Types.TSchema; - readonly value: unknown; - constructor(schema: Types.TSchema, value: unknown); -} -export declare class ValueCastNeverTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCastRecursiveTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCastUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCastDereferenceError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -export declare namespace ValueCast { - function Visit(schema: Types.TSchema, references: Types.TSchema[], value: any): any; - function Cast(schema: T, references: Types.TSchema[], value: any): Types.Static; -} diff --git a/node_modules/@sinclair/typebox/value/cast.js b/node_modules/@sinclair/typebox/value/cast.js deleted file mode 100644 index 42fe2e14..00000000 --- a/node_modules/@sinclair/typebox/value/cast.js +++ /dev/null @@ -1,372 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueCast = exports.ValueCastDereferenceError = exports.ValueCastUnknownTypeError = exports.ValueCastRecursiveTypeError = exports.ValueCastNeverTypeError = exports.ValueCastArrayUniqueItemsTypeError = exports.ValueCastReferenceTypeError = void 0; -const Types = require("../typebox"); -const create_1 = require("./create"); -const check_1 = require("./check"); -const clone_1 = require("./clone"); -// ---------------------------------------------------------------------------------------------- -// Errors -// ---------------------------------------------------------------------------------------------- -class ValueCastReferenceTypeError extends Error { - constructor(schema) { - super(`ValueCast: Cannot locate referenced schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueCastReferenceTypeError = ValueCastReferenceTypeError; -class ValueCastArrayUniqueItemsTypeError extends Error { - constructor(schema, value) { - super('ValueCast: Array cast produced invalid data due to uniqueItems constraint'); - this.schema = schema; - this.value = value; - } -} -exports.ValueCastArrayUniqueItemsTypeError = ValueCastArrayUniqueItemsTypeError; -class ValueCastNeverTypeError extends Error { - constructor(schema) { - super('ValueCast: Never types cannot be cast'); - this.schema = schema; - } -} -exports.ValueCastNeverTypeError = ValueCastNeverTypeError; -class ValueCastRecursiveTypeError extends Error { - constructor(schema) { - super('ValueCast.Recursive: Cannot cast recursive schemas'); - this.schema = schema; - } -} -exports.ValueCastRecursiveTypeError = ValueCastRecursiveTypeError; -class ValueCastUnknownTypeError extends Error { - constructor(schema) { - super('ValueCast: Unknown type'); - this.schema = schema; - } -} -exports.ValueCastUnknownTypeError = ValueCastUnknownTypeError; -class ValueCastDereferenceError extends Error { - constructor(schema) { - super(`ValueCast: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueCastDereferenceError = ValueCastDereferenceError; -// ---------------------------------------------------------------------------------------------- -// The following will score a schema against a value. For objects, the score is the tally of -// points awarded for each property of the value. Property points are (1.0 / propertyCount) -// to prevent large property counts biasing results. Properties that match literal values are -// maximally awarded as literals are typically used as union discriminator fields. -// ---------------------------------------------------------------------------------------------- -var UnionCastCreate; -(function (UnionCastCreate) { - function Score(schema, references, value) { - if (schema[Types.Kind] === 'Object' && typeof value === 'object' && value !== null) { - const object = schema; - const keys = Object.keys(value); - const entries = globalThis.Object.entries(object.properties); - const [point, max] = [1 / entries.length, entries.length]; - return entries.reduce((acc, [key, schema]) => { - const literal = schema[Types.Kind] === 'Literal' && schema.const === value[key] ? max : 0; - const checks = check_1.ValueCheck.Check(schema, references, value[key]) ? point : 0; - const exists = keys.includes(key) ? point : 0; - return acc + (literal + checks + exists); - }, 0); - } - else { - return check_1.ValueCheck.Check(schema, references, value) ? 1 : 0; - } - } - function Select(union, references, value) { - let [select, best] = [union.anyOf[0], 0]; - for (const schema of union.anyOf) { - const score = Score(schema, references, value); - if (score > best) { - select = schema; - best = score; - } - } - return select; - } - function Create(union, references, value) { - if (union.default !== undefined) { - return union.default; - } - else { - const schema = Select(union, references, value); - return ValueCast.Cast(schema, references, value); - } - } - UnionCastCreate.Create = Create; -})(UnionCastCreate || (UnionCastCreate = {})); -var ValueCast; -(function (ValueCast) { - // ---------------------------------------------------------------------------------------------- - // Guards - // ---------------------------------------------------------------------------------------------- - function IsObject(value) { - return typeof value === 'object' && value !== null && !globalThis.Array.isArray(value); - } - function IsArray(value) { - return typeof value === 'object' && globalThis.Array.isArray(value); - } - function IsNumber(value) { - return typeof value === 'number' && !isNaN(value); - } - function IsString(value) { - return typeof value === 'string'; - } - // ---------------------------------------------------------------------------------------------- - // Cast - // ---------------------------------------------------------------------------------------------- - function Any(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Array(schema, references, value) { - if (check_1.ValueCheck.Check(schema, references, value)) - return clone_1.ValueClone.Clone(value); - const created = IsArray(value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - const minimum = IsNumber(schema.minItems) && created.length < schema.minItems ? [...created, ...globalThis.Array.from({ length: schema.minItems - created.length }, () => null)] : created; - const maximum = IsNumber(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum; - const casted = maximum.map((value) => Visit(schema.items, references, value)); - if (schema.uniqueItems !== true) - return casted; - const unique = [...new Set(casted)]; - if (!check_1.ValueCheck.Check(schema, references, unique)) - throw new ValueCastArrayUniqueItemsTypeError(schema, unique); - return unique; - } - function BigInt(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Boolean(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Constructor(schema, references, value) { - if (check_1.ValueCheck.Check(schema, references, value)) - return create_1.ValueCreate.Create(schema, references); - const required = new Set(schema.returns.required || []); - const result = function () { }; - for (const [key, property] of globalThis.Object.entries(schema.returns.properties)) { - if (!required.has(key) && value.prototype[key] === undefined) - continue; - result.prototype[key] = Visit(property, references, value.prototype[key]); - } - return result; - } - function Date(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Function(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Integer(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Intersect(schema, references, value) { - const created = create_1.ValueCreate.Create(schema, references); - const mapped = IsObject(created) && IsObject(value) ? { ...created, ...value } : value; - return check_1.ValueCheck.Check(schema, references, mapped) ? mapped : create_1.ValueCreate.Create(schema, references); - } - function Literal(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Never(schema, references, value) { - throw new ValueCastNeverTypeError(schema); - } - function Not(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema.allOf[1], references); - } - function Null(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Number(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Object(schema, references, value) { - if (check_1.ValueCheck.Check(schema, references, value)) - return value; - if (value === null || typeof value !== 'object') - return create_1.ValueCreate.Create(schema, references); - const required = new Set(schema.required || []); - const result = {}; - for (const [key, property] of globalThis.Object.entries(schema.properties)) { - if (!required.has(key) && value[key] === undefined) - continue; - result[key] = Visit(property, references, value[key]); - } - // additional schema properties - if (typeof schema.additionalProperties === 'object') { - const propertyNames = globalThis.Object.getOwnPropertyNames(schema.properties); - for (const propertyName of globalThis.Object.getOwnPropertyNames(value)) { - if (propertyNames.includes(propertyName)) - continue; - result[propertyName] = Visit(schema.additionalProperties, references, value[propertyName]); - } - } - return result; - } - function Promise(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Record(schema, references, value) { - if (check_1.ValueCheck.Check(schema, references, value)) - return clone_1.ValueClone.Clone(value); - if (value === null || typeof value !== 'object' || globalThis.Array.isArray(value) || value instanceof globalThis.Date) - return create_1.ValueCreate.Create(schema, references); - const subschemaPropertyName = globalThis.Object.getOwnPropertyNames(schema.patternProperties)[0]; - const subschema = schema.patternProperties[subschemaPropertyName]; - const result = {}; - for (const [propKey, propValue] of globalThis.Object.entries(value)) { - result[propKey] = Visit(subschema, references, propValue); - } - return result; - } - function Ref(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueCastDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function String(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? value : create_1.ValueCreate.Create(schema, references); - } - function Symbol(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function TemplateLiteral(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function This(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueCastDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function Tuple(schema, references, value) { - if (check_1.ValueCheck.Check(schema, references, value)) - return clone_1.ValueClone.Clone(value); - if (!globalThis.Array.isArray(value)) - return create_1.ValueCreate.Create(schema, references); - if (schema.items === undefined) - return []; - return schema.items.map((schema, index) => Visit(schema, references, value[index])); - } - function Undefined(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Union(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : UnionCastCreate.Create(schema, references, value); - } - function Uint8Array(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Unknown(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Void(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function UserDefined(schema, references, value) { - return check_1.ValueCheck.Check(schema, references, value) ? clone_1.ValueClone.Clone(value) : create_1.ValueCreate.Create(schema, references); - } - function Visit(schema, references, value) { - const references_ = IsString(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - switch (schema[Types.Kind]) { - case 'Any': - return Any(schema_, references_, value); - case 'Array': - return Array(schema_, references_, value); - case 'BigInt': - return BigInt(schema_, references_, value); - case 'Boolean': - return Boolean(schema_, references_, value); - case 'Constructor': - return Constructor(schema_, references_, value); - case 'Date': - return Date(schema_, references_, value); - case 'Function': - return Function(schema_, references_, value); - case 'Integer': - return Integer(schema_, references_, value); - case 'Intersect': - return Intersect(schema_, references_, value); - case 'Literal': - return Literal(schema_, references_, value); - case 'Never': - return Never(schema_, references_, value); - case 'Not': - return Not(schema_, references_, value); - case 'Null': - return Null(schema_, references_, value); - case 'Number': - return Number(schema_, references_, value); - case 'Object': - return Object(schema_, references_, value); - case 'Promise': - return Promise(schema_, references_, value); - case 'Record': - return Record(schema_, references_, value); - case 'Ref': - return Ref(schema_, references_, value); - case 'String': - return String(schema_, references_, value); - case 'Symbol': - return Symbol(schema_, references_, value); - case 'TemplateLiteral': - return TemplateLiteral(schema_, references_, value); - case 'This': - return This(schema_, references_, value); - case 'Tuple': - return Tuple(schema_, references_, value); - case 'Undefined': - return Undefined(schema_, references_, value); - case 'Union': - return Union(schema_, references_, value); - case 'Uint8Array': - return Uint8Array(schema_, references_, value); - case 'Unknown': - return Unknown(schema_, references_, value); - case 'Void': - return Void(schema_, references_, value); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new ValueCastUnknownTypeError(schema_); - return UserDefined(schema_, references_, value); - } - } - ValueCast.Visit = Visit; - function Cast(schema, references, value) { - return Visit(schema, references, clone_1.ValueClone.Clone(value)); - } - ValueCast.Cast = Cast; -})(ValueCast = exports.ValueCast || (exports.ValueCast = {})); diff --git a/node_modules/@sinclair/typebox/value/check.d.ts b/node_modules/@sinclair/typebox/value/check.d.ts deleted file mode 100644 index ee18d9b0..00000000 --- a/node_modules/@sinclair/typebox/value/check.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as Types from '../typebox'; -export declare class ValueCheckUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCheckDereferenceError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -export declare namespace ValueCheck { - function Check(schema: T, references: Types.TSchema[], value: any): boolean; -} diff --git a/node_modules/@sinclair/typebox/value/check.js b/node_modules/@sinclair/typebox/value/check.js deleted file mode 100644 index 833aa648..00000000 --- a/node_modules/@sinclair/typebox/value/check.js +++ /dev/null @@ -1,484 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueCheck = exports.ValueCheckDereferenceError = exports.ValueCheckUnknownTypeError = void 0; -const Types = require("../typebox"); -const index_1 = require("../system/index"); -const hash_1 = require("./hash"); -// ------------------------------------------------------------------------- -// Errors -// ------------------------------------------------------------------------- -class ValueCheckUnknownTypeError extends Error { - constructor(schema) { - super(`ValueCheck: ${schema[Types.Kind] ? `Unknown type '${schema[Types.Kind]}'` : 'Unknown type'}`); - this.schema = schema; - } -} -exports.ValueCheckUnknownTypeError = ValueCheckUnknownTypeError; -class ValueCheckDereferenceError extends Error { - constructor(schema) { - super(`ValueCheck: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueCheckDereferenceError = ValueCheckDereferenceError; -var ValueCheck; -(function (ValueCheck) { - // ---------------------------------------------------------------------- - // Guards - // ---------------------------------------------------------------------- - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsInteger(value) { - return globalThis.Number.isInteger(value); - } - function IsString(value) { - return typeof value === 'string'; - } - function IsDefined(value) { - return value !== undefined; - } - // ---------------------------------------------------------------------- - // Policies - // ---------------------------------------------------------------------- - function IsExactOptionalProperty(value, key) { - return index_1.TypeSystem.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined; - } - function IsObject(value) { - const result = typeof value === 'object' && value !== null; - return index_1.TypeSystem.AllowArrayObjects ? result : result && !globalThis.Array.isArray(value); - } - function IsRecordObject(value) { - return IsObject(value) && !(value instanceof globalThis.Date) && !(value instanceof globalThis.Uint8Array); - } - function IsNumber(value) { - const result = typeof value === 'number'; - return index_1.TypeSystem.AllowNaN ? result : result && globalThis.Number.isFinite(value); - } - function IsVoid(value) { - const result = value === undefined; - return index_1.TypeSystem.AllowVoidNull ? result || value === null : result; - } - // ---------------------------------------------------------------------- - // Types - // ---------------------------------------------------------------------- - function Any(schema, references, value) { - return true; - } - function Array(schema, references, value) { - if (!globalThis.Array.isArray(value)) { - return false; - } - if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { - return false; - } - if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { - return false; - } - // prettier-ignore - if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { - const hashed = hash_1.ValueHash.Create(element); - if (set.has(hashed)) { - return false; - } - else { - set.add(hashed); - } - } return true; })())) { - return false; - } - return value.every((value) => Visit(schema.items, references, value)); - } - function BigInt(schema, references, value) { - if (!IsBigInt(value)) { - return false; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === globalThis.BigInt(0))) { - return false; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - return false; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - return false; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - return false; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - return false; - } - return true; - } - function Boolean(schema, references, value) { - return typeof value === 'boolean'; - } - function Constructor(schema, references, value) { - return Visit(schema.returns, references, value.prototype); - } - function Date(schema, references, value) { - if (!(value instanceof globalThis.Date)) { - return false; - } - if (!IsNumber(value.getTime())) { - return false; - } - if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { - return false; - } - if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { - return false; - } - if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { - return false; - } - if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { - return false; - } - return true; - } - function Function(schema, references, value) { - return typeof value === 'function'; - } - function Integer(schema, references, value) { - if (!IsInteger(value)) { - return false; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { - return false; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - return false; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - return false; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - return false; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - return false; - } - return true; - } - function Intersect(schema, references, value) { - if (!schema.allOf.every((schema) => Visit(schema, references, value))) { - return false; - } - else if (schema.unevaluatedProperties === false) { - const schemaKeys = Types.KeyResolver.Resolve(schema); - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - return valueKeys.every((key) => schemaKeys.includes(key)); - } - else if (Types.TypeGuard.TSchema(schema.unevaluatedProperties)) { - const schemaKeys = Types.KeyResolver.Resolve(schema); - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - return valueKeys.every((key) => schemaKeys.includes(key) || Visit(schema.unevaluatedProperties, references, value[key])); - } - else { - return true; - } - } - function Literal(schema, references, value) { - return value === schema.const; - } - function Never(schema, references, value) { - return false; - } - function Not(schema, references, value) { - return !Visit(schema.allOf[0].not, references, value) && Visit(schema.allOf[1], references, value); - } - function Null(schema, references, value) { - return value === null; - } - function Number(schema, references, value) { - if (!IsNumber(value)) { - return false; - } - if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { - return false; - } - if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { - return false; - } - if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { - return false; - } - if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { - return false; - } - if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { - return false; - } - return true; - } - function Object(schema, references, value) { - if (!IsObject(value)) { - return false; - } - if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) { - return false; - } - if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { - return false; - } - const knownKeys = globalThis.Object.getOwnPropertyNames(schema.properties); - for (const knownKey of knownKeys) { - const property = schema.properties[knownKey]; - if (schema.required && schema.required.includes(knownKey)) { - if (!Visit(property, references, value[knownKey])) { - return false; - } - if (Types.ExtendsUndefined.Check(property)) { - return knownKey in value; - } - } - else { - if (IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) { - return false; - } - } - } - if (schema.additionalProperties === false) { - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - // optimization: value is valid if schemaKey length matches the valueKey length - if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) { - return true; - } - else { - return valueKeys.every((valueKey) => knownKeys.includes(valueKey)); - } - } - else if (typeof schema.additionalProperties === 'object') { - const valueKeys = globalThis.Object.getOwnPropertyNames(value); - return valueKeys.every((key) => knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key])); - } - else { - return true; - } - } - function Promise(schema, references, value) { - return typeof value === 'object' && typeof value.then === 'function'; - } - function Record(schema, references, value) { - if (!IsRecordObject(value)) { - return false; - } - if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) { - return false; - } - if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { - return false; - } - const [keyPattern, valueSchema] = globalThis.Object.entries(schema.patternProperties)[0]; - const regex = new RegExp(keyPattern); - if (!globalThis.Object.getOwnPropertyNames(value).every((key) => regex.test(key))) { - return false; - } - for (const propValue of globalThis.Object.values(value)) { - if (!Visit(valueSchema, references, propValue)) - return false; - } - return true; - } - function Ref(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueCheckDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function String(schema, references, value) { - if (!IsString(value)) { - return false; - } - if (IsDefined(schema.minLength)) { - if (!(value.length >= schema.minLength)) - return false; - } - if (IsDefined(schema.maxLength)) { - if (!(value.length <= schema.maxLength)) - return false; - } - if (IsDefined(schema.pattern)) { - const regex = new RegExp(schema.pattern); - if (!regex.test(value)) - return false; - } - if (IsDefined(schema.format)) { - if (!Types.FormatRegistry.Has(schema.format)) - return false; - const func = Types.FormatRegistry.Get(schema.format); - return func(value); - } - return true; - } - function Symbol(schema, references, value) { - if (!(typeof value === 'symbol')) { - return false; - } - return true; - } - function TemplateLiteral(schema, references, value) { - if (!IsString(value)) { - return false; - } - return new RegExp(schema.pattern).test(value); - } - function This(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueCheckDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function Tuple(schema, references, value) { - if (!globalThis.Array.isArray(value)) { - return false; - } - if (schema.items === undefined && !(value.length === 0)) { - return false; - } - if (!(value.length === schema.maxItems)) { - return false; - } - if (!schema.items) { - return true; - } - for (let i = 0; i < schema.items.length; i++) { - if (!Visit(schema.items[i], references, value[i])) - return false; - } - return true; - } - function Undefined(schema, references, value) { - return value === undefined; - } - function Union(schema, references, value) { - return schema.anyOf.some((inner) => Visit(inner, references, value)); - } - function Uint8Array(schema, references, value) { - if (!(value instanceof globalThis.Uint8Array)) { - return false; - } - if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { - return false; - } - if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { - return false; - } - return true; - } - function Unknown(schema, references, value) { - return true; - } - function Void(schema, references, value) { - return IsVoid(value); - } - function UserDefined(schema, references, value) { - if (!Types.TypeRegistry.Has(schema[Types.Kind])) - return false; - const func = Types.TypeRegistry.Get(schema[Types.Kind]); - return func(schema, value); - } - function Visit(schema, references, value) { - const references_ = IsDefined(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - switch (schema_[Types.Kind]) { - case 'Any': - return Any(schema_, references_, value); - case 'Array': - return Array(schema_, references_, value); - case 'BigInt': - return BigInt(schema_, references_, value); - case 'Boolean': - return Boolean(schema_, references_, value); - case 'Constructor': - return Constructor(schema_, references_, value); - case 'Date': - return Date(schema_, references_, value); - case 'Function': - return Function(schema_, references_, value); - case 'Integer': - return Integer(schema_, references_, value); - case 'Intersect': - return Intersect(schema_, references_, value); - case 'Literal': - return Literal(schema_, references_, value); - case 'Never': - return Never(schema_, references_, value); - case 'Not': - return Not(schema_, references_, value); - case 'Null': - return Null(schema_, references_, value); - case 'Number': - return Number(schema_, references_, value); - case 'Object': - return Object(schema_, references_, value); - case 'Promise': - return Promise(schema_, references_, value); - case 'Record': - return Record(schema_, references_, value); - case 'Ref': - return Ref(schema_, references_, value); - case 'String': - return String(schema_, references_, value); - case 'Symbol': - return Symbol(schema_, references_, value); - case 'TemplateLiteral': - return TemplateLiteral(schema_, references_, value); - case 'This': - return This(schema_, references_, value); - case 'Tuple': - return Tuple(schema_, references_, value); - case 'Undefined': - return Undefined(schema_, references_, value); - case 'Union': - return Union(schema_, references_, value); - case 'Uint8Array': - return Uint8Array(schema_, references_, value); - case 'Unknown': - return Unknown(schema_, references_, value); - case 'Void': - return Void(schema_, references_, value); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new ValueCheckUnknownTypeError(schema_); - return UserDefined(schema_, references_, value); - } - } - // ------------------------------------------------------------------------- - // Check - // ------------------------------------------------------------------------- - function Check(schema, references, value) { - return Visit(schema, references, value); - } - ValueCheck.Check = Check; -})(ValueCheck = exports.ValueCheck || (exports.ValueCheck = {})); diff --git a/node_modules/@sinclair/typebox/value/clone.d.ts b/node_modules/@sinclair/typebox/value/clone.d.ts deleted file mode 100644 index 5ca0adf1..00000000 --- a/node_modules/@sinclair/typebox/value/clone.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare namespace ValueClone { - function Clone(value: T): T; -} diff --git a/node_modules/@sinclair/typebox/value/clone.js b/node_modules/@sinclair/typebox/value/clone.js deleted file mode 100644 index 75e2685c..00000000 --- a/node_modules/@sinclair/typebox/value/clone.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueClone = void 0; -const is_1 = require("./is"); -var ValueClone; -(function (ValueClone) { - function Array(value) { - return value.map((element) => Clone(element)); - } - function Date(value) { - return new globalThis.Date(value.toISOString()); - } - function Object(value) { - const keys = [...globalThis.Object.keys(value), ...globalThis.Object.getOwnPropertySymbols(value)]; - return keys.reduce((acc, key) => ({ ...acc, [key]: Clone(value[key]) }), {}); - } - function TypedArray(value) { - return value.slice(); - } - function Value(value) { - return value; - } - function Clone(value) { - if (is_1.Is.Date(value)) { - return Date(value); - } - else if (is_1.Is.Object(value)) { - return Object(value); - } - else if (is_1.Is.Array(value)) { - return Array(value); - } - else if (is_1.Is.TypedArray(value)) { - return TypedArray(value); - } - else if (is_1.Is.Value(value)) { - return Value(value); - } - else { - throw new Error('ValueClone: Unable to clone value'); - } - } - ValueClone.Clone = Clone; -})(ValueClone = exports.ValueClone || (exports.ValueClone = {})); diff --git a/node_modules/@sinclair/typebox/value/convert.d.ts b/node_modules/@sinclair/typebox/value/convert.d.ts deleted file mode 100644 index 99c5d5d3..00000000 --- a/node_modules/@sinclair/typebox/value/convert.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as Types from '../typebox'; -export declare class ValueConvertUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueConvertDereferenceError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -export declare namespace ValueConvert { - function Visit(schema: Types.TSchema, references: Types.TSchema[], value: any): unknown; - function Convert(schema: T, references: Types.TSchema[], value: any): unknown; -} diff --git a/node_modules/@sinclair/typebox/value/convert.js b/node_modules/@sinclair/typebox/value/convert.js deleted file mode 100644 index 70df03bb..00000000 --- a/node_modules/@sinclair/typebox/value/convert.js +++ /dev/null @@ -1,372 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueConvert = exports.ValueConvertDereferenceError = exports.ValueConvertUnknownTypeError = void 0; -const Types = require("../typebox"); -const clone_1 = require("./clone"); -const check_1 = require("./check"); -// ---------------------------------------------------------------------------------------------- -// Errors -// ---------------------------------------------------------------------------------------------- -class ValueConvertUnknownTypeError extends Error { - constructor(schema) { - super('ValueConvert: Unknown type'); - this.schema = schema; - } -} -exports.ValueConvertUnknownTypeError = ValueConvertUnknownTypeError; -class ValueConvertDereferenceError extends Error { - constructor(schema) { - super(`ValueConvert: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueConvertDereferenceError = ValueConvertDereferenceError; -var ValueConvert; -(function (ValueConvert) { - // ---------------------------------------------------------------------------------------------- - // Guards - // ---------------------------------------------------------------------------------------------- - function IsObject(value) { - return typeof value === 'object' && value !== null && !globalThis.Array.isArray(value); - } - function IsArray(value) { - return typeof value === 'object' && globalThis.Array.isArray(value); - } - function IsDate(value) { - return typeof value === 'object' && value instanceof globalThis.Date; - } - function IsSymbol(value) { - return typeof value === 'symbol'; - } - function IsString(value) { - return typeof value === 'string'; - } - function IsBoolean(value) { - return typeof value === 'boolean'; - } - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsNumber(value) { - return typeof value === 'number' && !isNaN(value); - } - function IsStringNumeric(value) { - return IsString(value) && !isNaN(value) && !isNaN(parseFloat(value)); - } - function IsValueToString(value) { - return IsBigInt(value) || IsBoolean(value) || IsNumber(value); - } - function IsValueTrue(value) { - return value === true || (IsNumber(value) && value === 1) || (IsBigInt(value) && value === globalThis.BigInt('1')) || (IsString(value) && (value.toLowerCase() === 'true' || value === '1')); - } - function IsValueFalse(value) { - return value === false || (IsNumber(value) && value === 0) || (IsBigInt(value) && value === globalThis.BigInt('0')) || (IsString(value) && (value.toLowerCase() === 'false' || value === '0')); - } - function IsTimeStringWithTimeZone(value) { - return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); - } - function IsTimeStringWithoutTimeZone(value) { - return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); - } - function IsDateTimeStringWithTimeZone(value) { - return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); - } - function IsDateTimeStringWithoutTimeZone(value) { - return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); - } - function IsDateString(value) { - return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value); - } - // ---------------------------------------------------------------------------------------------- - // Convert - // ---------------------------------------------------------------------------------------------- - function TryConvertLiteralString(value, target) { - const conversion = TryConvertString(value); - return conversion === target ? conversion : value; - } - function TryConvertLiteralNumber(value, target) { - const conversion = TryConvertNumber(value); - return conversion === target ? conversion : value; - } - function TryConvertLiteralBoolean(value, target) { - const conversion = TryConvertBoolean(value); - return conversion === target ? conversion : value; - } - function TryConvertLiteral(schema, value) { - if (typeof schema.const === 'string') { - return TryConvertLiteralString(value, schema.const); - } - else if (typeof schema.const === 'number') { - return TryConvertLiteralNumber(value, schema.const); - } - else if (typeof schema.const === 'boolean') { - return TryConvertLiteralBoolean(value, schema.const); - } - else { - return clone_1.ValueClone.Clone(value); - } - } - function TryConvertBoolean(value) { - return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value; - } - function TryConvertBigInt(value) { - return IsStringNumeric(value) ? globalThis.BigInt(parseInt(value)) : IsNumber(value) ? globalThis.BigInt(value | 0) : IsValueFalse(value) ? 0 : IsValueTrue(value) ? 1 : value; - } - function TryConvertString(value) { - return IsValueToString(value) ? value.toString() : IsSymbol(value) && value.description !== undefined ? value.description.toString() : value; - } - function TryConvertNumber(value) { - return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; - } - function TryConvertInteger(value) { - return IsStringNumeric(value) ? parseInt(value) : IsNumber(value) ? value | 0 : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; - } - function TryConvertNull(value) { - return IsString(value) && value.toLowerCase() === 'null' ? null : value; - } - function TryConvertUndefined(value) { - return IsString(value) && value === 'undefined' ? undefined : value; - } - function TryConvertDate(value) { - // note: this function may return an invalid dates for the regex tests - // above. Invalid dates will however be checked during the casting - // function and will return a epoch date if invalid. Consider better - // string parsing for the iso dates in future revisions. - return IsDate(value) - ? value - : IsNumber(value) - ? new globalThis.Date(value) - : IsValueTrue(value) - ? new globalThis.Date(1) - : IsValueFalse(value) - ? new globalThis.Date(0) - : IsStringNumeric(value) - ? new globalThis.Date(parseInt(value)) - : IsTimeStringWithoutTimeZone(value) - ? new globalThis.Date(`1970-01-01T${value}.000Z`) - : IsTimeStringWithTimeZone(value) - ? new globalThis.Date(`1970-01-01T${value}`) - : IsDateTimeStringWithoutTimeZone(value) - ? new globalThis.Date(`${value}.000Z`) - : IsDateTimeStringWithTimeZone(value) - ? new globalThis.Date(value) - : IsDateString(value) - ? new globalThis.Date(`${value}T00:00:00.000Z`) - : value; - } - // ---------------------------------------------------------------------------------------------- - // Cast - // ---------------------------------------------------------------------------------------------- - function Any(schema, references, value) { - return value; - } - function Array(schema, references, value) { - if (IsArray(value)) { - return value.map((value) => Visit(schema.items, references, value)); - } - return value; - } - function BigInt(schema, references, value) { - return TryConvertBigInt(value); - } - function Boolean(schema, references, value) { - return TryConvertBoolean(value); - } - function Constructor(schema, references, value) { - return clone_1.ValueClone.Clone(value); - } - function Date(schema, references, value) { - return TryConvertDate(value); - } - function Function(schema, references, value) { - return value; - } - function Integer(schema, references, value) { - return TryConvertInteger(value); - } - function Intersect(schema, references, value) { - return value; - } - function Literal(schema, references, value) { - return TryConvertLiteral(schema, value); - } - function Never(schema, references, value) { - return value; - } - function Null(schema, references, value) { - return TryConvertNull(value); - } - function Number(schema, references, value) { - return TryConvertNumber(value); - } - function Object(schema, references, value) { - if (IsObject(value)) - return globalThis.Object.keys(schema.properties).reduce((acc, key) => { - return value[key] !== undefined ? { ...acc, [key]: Visit(schema.properties[key], references, value[key]) } : { ...acc }; - }, value); - return value; - } - function Promise(schema, references, value) { - return value; - } - function Record(schema, references, value) { - const propertyKey = globalThis.Object.getOwnPropertyNames(schema.patternProperties)[0]; - const property = schema.patternProperties[propertyKey]; - const result = {}; - for (const [propKey, propValue] of globalThis.Object.entries(value)) { - result[propKey] = Visit(property, references, propValue); - } - return result; - } - function Ref(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueConvertDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function String(schema, references, value) { - return TryConvertString(value); - } - function Symbol(schema, references, value) { - return value; - } - function TemplateLiteral(schema, references, value) { - return value; - } - function This(schema, references, value) { - const index = references.findIndex((foreign) => foreign.$id === schema.$ref); - if (index === -1) - throw new ValueConvertDereferenceError(schema); - const target = references[index]; - return Visit(target, references, value); - } - function Tuple(schema, references, value) { - if (IsArray(value) && schema.items !== undefined) { - return value.map((value, index) => { - return index < schema.items.length ? Visit(schema.items[index], references, value) : value; - }); - } - return value; - } - function Undefined(schema, references, value) { - return TryConvertUndefined(value); - } - function Union(schema, references, value) { - for (const subschema of schema.anyOf) { - const converted = Visit(subschema, references, value); - if (check_1.ValueCheck.Check(subschema, references, converted)) { - return converted; - } - } - return value; - } - function Uint8Array(schema, references, value) { - return value; - } - function Unknown(schema, references, value) { - return value; - } - function Void(schema, references, value) { - return value; - } - function UserDefined(schema, references, value) { - return value; - } - function Visit(schema, references, value) { - const references_ = IsString(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - switch (schema[Types.Kind]) { - case 'Any': - return Any(schema_, references_, value); - case 'Array': - return Array(schema_, references_, value); - case 'BigInt': - return BigInt(schema_, references_, value); - case 'Boolean': - return Boolean(schema_, references_, value); - case 'Constructor': - return Constructor(schema_, references_, value); - case 'Date': - return Date(schema_, references_, value); - case 'Function': - return Function(schema_, references_, value); - case 'Integer': - return Integer(schema_, references_, value); - case 'Intersect': - return Intersect(schema_, references_, value); - case 'Literal': - return Literal(schema_, references_, value); - case 'Never': - return Never(schema_, references_, value); - case 'Null': - return Null(schema_, references_, value); - case 'Number': - return Number(schema_, references_, value); - case 'Object': - return Object(schema_, references_, value); - case 'Promise': - return Promise(schema_, references_, value); - case 'Record': - return Record(schema_, references_, value); - case 'Ref': - return Ref(schema_, references_, value); - case 'String': - return String(schema_, references_, value); - case 'Symbol': - return Symbol(schema_, references_, value); - case 'TemplateLiteral': - return TemplateLiteral(schema_, references_, value); - case 'This': - return This(schema_, references_, value); - case 'Tuple': - return Tuple(schema_, references_, value); - case 'Undefined': - return Undefined(schema_, references_, value); - case 'Union': - return Union(schema_, references_, value); - case 'Uint8Array': - return Uint8Array(schema_, references_, value); - case 'Unknown': - return Unknown(schema_, references_, value); - case 'Void': - return Void(schema_, references_, value); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new ValueConvertUnknownTypeError(schema_); - return UserDefined(schema_, references_, value); - } - } - ValueConvert.Visit = Visit; - function Convert(schema, references, value) { - return Visit(schema, references, clone_1.ValueClone.Clone(value)); - } - ValueConvert.Convert = Convert; -})(ValueConvert = exports.ValueConvert || (exports.ValueConvert = {})); diff --git a/node_modules/@sinclair/typebox/value/create.d.ts b/node_modules/@sinclair/typebox/value/create.d.ts deleted file mode 100644 index 86e1e5e0..00000000 --- a/node_modules/@sinclair/typebox/value/create.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as Types from '../typebox'; -export declare class ValueCreateUnknownTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCreateNeverTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCreateIntersectTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCreateTempateLiteralTypeError extends Error { - readonly schema: Types.TSchema; - constructor(schema: Types.TSchema); -} -export declare class ValueCreateDereferenceError extends Error { - readonly schema: Types.TRef | Types.TThis; - constructor(schema: Types.TRef | Types.TThis); -} -export declare namespace ValueCreate { - /** Creates a value from the given schema. If the schema specifies a default value, then that value is returned. */ - function Visit(schema: Types.TSchema, references: Types.TSchema[]): unknown; - function Create(schema: T, references: Types.TSchema[]): Types.Static; -} diff --git a/node_modules/@sinclair/typebox/value/create.js b/node_modules/@sinclair/typebox/value/create.js deleted file mode 100644 index 42374a8b..00000000 --- a/node_modules/@sinclair/typebox/value/create.js +++ /dev/null @@ -1,480 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueCreate = exports.ValueCreateDereferenceError = exports.ValueCreateTempateLiteralTypeError = exports.ValueCreateIntersectTypeError = exports.ValueCreateNeverTypeError = exports.ValueCreateUnknownTypeError = void 0; -const Types = require("../typebox"); -const check_1 = require("./check"); -// -------------------------------------------------------------------------- -// Errors -// -------------------------------------------------------------------------- -class ValueCreateUnknownTypeError extends Error { - constructor(schema) { - super('ValueCreate: Unknown type'); - this.schema = schema; - } -} -exports.ValueCreateUnknownTypeError = ValueCreateUnknownTypeError; -class ValueCreateNeverTypeError extends Error { - constructor(schema) { - super('ValueCreate: Never types cannot be created'); - this.schema = schema; - } -} -exports.ValueCreateNeverTypeError = ValueCreateNeverTypeError; -class ValueCreateIntersectTypeError extends Error { - constructor(schema) { - super('ValueCreate: Intersect produced invalid value. Consider using a default value.'); - this.schema = schema; - } -} -exports.ValueCreateIntersectTypeError = ValueCreateIntersectTypeError; -class ValueCreateTempateLiteralTypeError extends Error { - constructor(schema) { - super('ValueCreate: Can only create template literal values from patterns that produce finite sequences. Consider using a default value.'); - this.schema = schema; - } -} -exports.ValueCreateTempateLiteralTypeError = ValueCreateTempateLiteralTypeError; -class ValueCreateDereferenceError extends Error { - constructor(schema) { - super(`ValueCreate: Unable to dereference schema with $id '${schema.$ref}'`); - this.schema = schema; - } -} -exports.ValueCreateDereferenceError = ValueCreateDereferenceError; -// -------------------------------------------------------------------------- -// ValueCreate -// -------------------------------------------------------------------------- -var ValueCreate; -(function (ValueCreate) { - // -------------------------------------------------------- - // Guards - // -------------------------------------------------------- - function IsString(value) { - return typeof value === 'string'; - } - // -------------------------------------------------------- - // Types - // -------------------------------------------------------- - function Any(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return {}; - } - } - function Array(schema, references) { - if (schema.uniqueItems === true && schema.default === undefined) { - throw new Error('ValueCreate.Array: Arrays with uniqueItems require a default value'); - } - else if ('default' in schema) { - return schema.default; - } - else if (schema.minItems !== undefined) { - return globalThis.Array.from({ length: schema.minItems }).map((item) => { - return ValueCreate.Create(schema.items, references); - }); - } - else { - return []; - } - } - function BigInt(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return globalThis.BigInt(0); - } - } - function Boolean(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return false; - } - } - function Constructor(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - const value = ValueCreate.Create(schema.returns, references); - if (typeof value === 'object' && !globalThis.Array.isArray(value)) { - return class { - constructor() { - for (const [key, val] of globalThis.Object.entries(value)) { - const self = this; - self[key] = val; - } - } - }; - } - else { - return class { - }; - } - } - } - function Date(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if (schema.minimumTimestamp !== undefined) { - return new globalThis.Date(schema.minimumTimestamp); - } - else { - return new globalThis.Date(0); - } - } - function Function(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return () => ValueCreate.Create(schema.returns, references); - } - } - function Integer(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if (schema.minimum !== undefined) { - return schema.minimum; - } - else { - return 0; - } - } - function Intersect(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - // Note: The best we can do here is attempt to instance each sub type and apply through object assign. For non-object - // sub types, we just escape the assignment and just return the value. In the latter case, this is typically going to - // be a consequence of an illogical intersection. - const value = schema.allOf.reduce((acc, schema) => { - const next = Visit(schema, references); - return typeof next === 'object' ? { ...acc, ...next } : next; - }, {}); - if (!check_1.ValueCheck.Check(schema, references, value)) - throw new ValueCreateIntersectTypeError(schema); - return value; - } - } - function Literal(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return schema.const; - } - } - function Never(schema, references) { - throw new ValueCreateNeverTypeError(schema); - } - function Not(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return Visit(schema.allOf[1], references); - } - } - function Null(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return null; - } - } - function Number(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if (schema.minimum !== undefined) { - return schema.minimum; - } - else { - return 0; - } - } - function Object(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - const required = new Set(schema.required); - return (schema.default || - globalThis.Object.entries(schema.properties).reduce((acc, [key, schema]) => { - return required.has(key) ? { ...acc, [key]: ValueCreate.Create(schema, references) } : { ...acc }; - }, {})); - } - } - function Promise(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return globalThis.Promise.resolve(ValueCreate.Create(schema.item, references)); - } - } - function Record(schema, references) { - const [keyPattern, valueSchema] = globalThis.Object.entries(schema.patternProperties)[0]; - if ('default' in schema) { - return schema.default; - } - else if (!(keyPattern === Types.PatternStringExact || keyPattern === Types.PatternNumberExact)) { - const propertyKeys = keyPattern.slice(1, keyPattern.length - 1).split('|'); - return propertyKeys.reduce((acc, key) => { - return { ...acc, [key]: Create(valueSchema, references) }; - }, {}); - } - else { - return {}; - } - } - function Ref(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - const index = references.findIndex((foreign) => foreign.$id === schema.$id); - if (index === -1) - throw new ValueCreateDereferenceError(schema); - const target = references[index]; - return Visit(target, references); - } - } - function String(schema, references) { - if (schema.pattern !== undefined) { - if (!('default' in schema)) { - throw new Error('ValueCreate.String: String types with patterns must specify a default value'); - } - else { - return schema.default; - } - } - else if (schema.format !== undefined) { - if (!('default' in schema)) { - throw new Error('ValueCreate.String: String types with formats must specify a default value'); - } - else { - return schema.default; - } - } - else { - if ('default' in schema) { - return schema.default; - } - else if (schema.minLength !== undefined) { - return globalThis.Array.from({ length: schema.minLength }) - .map(() => '.') - .join(''); - } - else { - return ''; - } - } - } - function Symbol(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if ('value' in schema) { - return globalThis.Symbol.for(schema.value); - } - else { - return globalThis.Symbol(); - } - } - function TemplateLiteral(schema, references) { - if ('default' in schema) { - return schema.default; - } - const expression = Types.TemplateLiteralParser.ParseExact(schema.pattern); - if (!Types.TemplateLiteralFinite.Check(expression)) - throw new ValueCreateTempateLiteralTypeError(schema); - const sequence = Types.TemplateLiteralGenerator.Generate(expression); - return sequence.next().value; - } - function This(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - const index = references.findIndex((foreign) => foreign.$id === schema.$id); - if (index === -1) - throw new ValueCreateDereferenceError(schema); - const target = references[index]; - return Visit(target, references); - } - } - function Tuple(schema, references) { - if ('default' in schema) { - return schema.default; - } - if (schema.items === undefined) { - return []; - } - else { - return globalThis.Array.from({ length: schema.minItems }).map((_, index) => ValueCreate.Create(schema.items[index], references)); - } - } - function Undefined(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return undefined; - } - } - function Union(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if (schema.anyOf.length === 0) { - throw new Error('ValueCreate.Union: Cannot create Union with zero variants'); - } - else { - return ValueCreate.Create(schema.anyOf[0], references); - } - } - function Uint8Array(schema, references) { - if ('default' in schema) { - return schema.default; - } - else if (schema.minByteLength !== undefined) { - return new globalThis.Uint8Array(schema.minByteLength); - } - else { - return new globalThis.Uint8Array(0); - } - } - function Unknown(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return {}; - } - } - function Void(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - return void 0; - } - } - function UserDefined(schema, references) { - if ('default' in schema) { - return schema.default; - } - else { - throw new Error('ValueCreate.UserDefined: User defined types must specify a default value'); - } - } - /** Creates a value from the given schema. If the schema specifies a default value, then that value is returned. */ - function Visit(schema, references) { - const references_ = IsString(schema.$id) ? [...references, schema] : references; - const schema_ = schema; - switch (schema_[Types.Kind]) { - case 'Any': - return Any(schema_, references_); - case 'Array': - return Array(schema_, references_); - case 'BigInt': - return BigInt(schema_, references_); - case 'Boolean': - return Boolean(schema_, references_); - case 'Constructor': - return Constructor(schema_, references_); - case 'Date': - return Date(schema_, references_); - case 'Function': - return Function(schema_, references_); - case 'Integer': - return Integer(schema_, references_); - case 'Intersect': - return Intersect(schema_, references_); - case 'Literal': - return Literal(schema_, references_); - case 'Never': - return Never(schema_, references_); - case 'Not': - return Not(schema_, references_); - case 'Null': - return Null(schema_, references_); - case 'Number': - return Number(schema_, references_); - case 'Object': - return Object(schema_, references_); - case 'Promise': - return Promise(schema_, references_); - case 'Record': - return Record(schema_, references_); - case 'Ref': - return Ref(schema_, references_); - case 'String': - return String(schema_, references_); - case 'Symbol': - return Symbol(schema_, references_); - case 'TemplateLiteral': - return TemplateLiteral(schema_, references_); - case 'This': - return This(schema_, references_); - case 'Tuple': - return Tuple(schema_, references_); - case 'Undefined': - return Undefined(schema_, references_); - case 'Union': - return Union(schema_, references_); - case 'Uint8Array': - return Uint8Array(schema_, references_); - case 'Unknown': - return Unknown(schema_, references_); - case 'Void': - return Void(schema_, references_); - default: - if (!Types.TypeRegistry.Has(schema_[Types.Kind])) - throw new ValueCreateUnknownTypeError(schema_); - return UserDefined(schema_, references_); - } - } - ValueCreate.Visit = Visit; - function Create(schema, references) { - return Visit(schema, references); - } - ValueCreate.Create = Create; -})(ValueCreate = exports.ValueCreate || (exports.ValueCreate = {})); diff --git a/node_modules/@sinclair/typebox/value/delta.d.ts b/node_modules/@sinclair/typebox/value/delta.d.ts deleted file mode 100644 index 3320fac7..00000000 --- a/node_modules/@sinclair/typebox/value/delta.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Static } from '../typebox'; -export type Insert = Static; -export declare const Insert: import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"insert">; - path: import("../typebox").TString; - value: import("../typebox").TUnknown; -}>; -export type Update = Static; -export declare const Update: import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"update">; - path: import("../typebox").TString; - value: import("../typebox").TUnknown; -}>; -export type Delete = Static; -export declare const Delete: import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"delete">; - path: import("../typebox").TString; -}>; -export type Edit = Static; -export declare const Edit: import("../typebox").TUnion<[import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"insert">; - path: import("../typebox").TString; - value: import("../typebox").TUnknown; -}>, import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"update">; - path: import("../typebox").TString; - value: import("../typebox").TUnknown; -}>, import("../typebox").TObject<{ - type: import("../typebox").TLiteral<"delete">; - path: import("../typebox").TString; -}>]>; -export declare class ValueDeltaObjectWithSymbolKeyError extends Error { - readonly key: unknown; - constructor(key: unknown); -} -export declare class ValueDeltaUnableToDiffUnknownValue extends Error { - readonly value: unknown; - constructor(value: unknown); -} -export declare namespace ValueDelta { - function Diff(current: unknown, next: unknown): Edit[]; - function Patch(current: unknown, edits: Edit[]): T; -} diff --git a/node_modules/@sinclair/typebox/value/delta.js b/node_modules/@sinclair/typebox/value/delta.js deleted file mode 100644 index 89c06a0d..00000000 --- a/node_modules/@sinclair/typebox/value/delta.js +++ /dev/null @@ -1,204 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueDelta = exports.ValueDeltaUnableToDiffUnknownValue = exports.ValueDeltaObjectWithSymbolKeyError = exports.Edit = exports.Delete = exports.Update = exports.Insert = void 0; -const typebox_1 = require("../typebox"); -const is_1 = require("./is"); -const clone_1 = require("./clone"); -const pointer_1 = require("./pointer"); -exports.Insert = typebox_1.Type.Object({ - type: typebox_1.Type.Literal('insert'), - path: typebox_1.Type.String(), - value: typebox_1.Type.Unknown(), -}); -exports.Update = typebox_1.Type.Object({ - type: typebox_1.Type.Literal('update'), - path: typebox_1.Type.String(), - value: typebox_1.Type.Unknown(), -}); -exports.Delete = typebox_1.Type.Object({ - type: typebox_1.Type.Literal('delete'), - path: typebox_1.Type.String(), -}); -exports.Edit = typebox_1.Type.Union([exports.Insert, exports.Update, exports.Delete]); -// --------------------------------------------------------------------- -// Errors -// --------------------------------------------------------------------- -class ValueDeltaObjectWithSymbolKeyError extends Error { - constructor(key) { - super('ValueDelta: Cannot diff objects with symbol keys'); - this.key = key; - } -} -exports.ValueDeltaObjectWithSymbolKeyError = ValueDeltaObjectWithSymbolKeyError; -class ValueDeltaUnableToDiffUnknownValue extends Error { - constructor(value) { - super('ValueDelta: Unable to create diff edits for unknown value'); - this.value = value; - } -} -exports.ValueDeltaUnableToDiffUnknownValue = ValueDeltaUnableToDiffUnknownValue; -// --------------------------------------------------------------------- -// ValueDelta -// --------------------------------------------------------------------- -var ValueDelta; -(function (ValueDelta) { - // --------------------------------------------------------------------- - // Edits - // --------------------------------------------------------------------- - function Update(path, value) { - return { type: 'update', path, value }; - } - function Insert(path, value) { - return { type: 'insert', path, value }; - } - function Delete(path) { - return { type: 'delete', path }; - } - // --------------------------------------------------------------------- - // Diff - // --------------------------------------------------------------------- - function* Object(path, current, next) { - if (!is_1.Is.Object(next)) - return yield Update(path, next); - const currentKeys = [...globalThis.Object.keys(current), ...globalThis.Object.getOwnPropertySymbols(current)]; - const nextKeys = [...globalThis.Object.keys(next), ...globalThis.Object.getOwnPropertySymbols(next)]; - for (const key of currentKeys) { - if (typeof key === 'symbol') - throw new ValueDeltaObjectWithSymbolKeyError(key); - if (next[key] === undefined && nextKeys.includes(key)) - yield Update(`${path}/${String(key)}`, undefined); - } - for (const key of nextKeys) { - if (current[key] === undefined || next[key] === undefined) - continue; - if (typeof key === 'symbol') - throw new ValueDeltaObjectWithSymbolKeyError(key); - yield* Visit(`${path}/${String(key)}`, current[key], next[key]); - } - for (const key of nextKeys) { - if (typeof key === 'symbol') - throw new ValueDeltaObjectWithSymbolKeyError(key); - if (current[key] === undefined) - yield Insert(`${path}/${String(key)}`, next[key]); - } - for (const key of currentKeys.reverse()) { - if (typeof key === 'symbol') - throw new ValueDeltaObjectWithSymbolKeyError(key); - if (next[key] === undefined && !nextKeys.includes(key)) - yield Delete(`${path}/${String(key)}`); - } - } - function* Array(path, current, next) { - if (!is_1.Is.Array(next)) - return yield Update(path, next); - for (let i = 0; i < Math.min(current.length, next.length); i++) { - yield* Visit(`${path}/${i}`, current[i], next[i]); - } - for (let i = 0; i < next.length; i++) { - if (i < current.length) - continue; - yield Insert(`${path}/${i}`, next[i]); - } - for (let i = current.length - 1; i >= 0; i--) { - if (i < next.length) - continue; - yield Delete(`${path}/${i}`); - } - } - function* TypedArray(path, current, next) { - if (!is_1.Is.TypedArray(next) || current.length !== next.length || globalThis.Object.getPrototypeOf(current).constructor.name !== globalThis.Object.getPrototypeOf(next).constructor.name) - return yield Update(path, next); - for (let i = 0; i < Math.min(current.length, next.length); i++) { - yield* Visit(`${path}/${i}`, current[i], next[i]); - } - } - function* Value(path, current, next) { - if (current === next) - return; - yield Update(path, next); - } - function* Visit(path, current, next) { - if (is_1.Is.Object(current)) { - return yield* Object(path, current, next); - } - else if (is_1.Is.Array(current)) { - return yield* Array(path, current, next); - } - else if (is_1.Is.TypedArray(current)) { - return yield* TypedArray(path, current, next); - } - else if (is_1.Is.Value(current)) { - return yield* Value(path, current, next); - } - else { - throw new ValueDeltaUnableToDiffUnknownValue(current); - } - } - function Diff(current, next) { - return [...Visit('', current, next)]; - } - ValueDelta.Diff = Diff; - // --------------------------------------------------------------------- - // Patch - // --------------------------------------------------------------------- - function IsRootUpdate(edits) { - return edits.length > 0 && edits[0].path === '' && edits[0].type === 'update'; - } - function IsIdentity(edits) { - return edits.length === 0; - } - function Patch(current, edits) { - if (IsRootUpdate(edits)) { - return clone_1.ValueClone.Clone(edits[0].value); - } - if (IsIdentity(edits)) { - return clone_1.ValueClone.Clone(current); - } - const clone = clone_1.ValueClone.Clone(current); - for (const edit of edits) { - switch (edit.type) { - case 'insert': { - pointer_1.ValuePointer.Set(clone, edit.path, edit.value); - break; - } - case 'update': { - pointer_1.ValuePointer.Set(clone, edit.path, edit.value); - break; - } - case 'delete': { - pointer_1.ValuePointer.Delete(clone, edit.path); - break; - } - } - } - return clone; - } - ValueDelta.Patch = Patch; -})(ValueDelta = exports.ValueDelta || (exports.ValueDelta = {})); diff --git a/node_modules/@sinclair/typebox/value/equal.d.ts b/node_modules/@sinclair/typebox/value/equal.d.ts deleted file mode 100644 index 785c2b8d..00000000 --- a/node_modules/@sinclair/typebox/value/equal.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare namespace ValueEqual { - function Equal(left: T, right: unknown): right is T; -} diff --git a/node_modules/@sinclair/typebox/value/equal.js b/node_modules/@sinclair/typebox/value/equal.js deleted file mode 100644 index ed9773b5..00000000 --- a/node_modules/@sinclair/typebox/value/equal.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueEqual = void 0; -const is_1 = require("./is"); -var ValueEqual; -(function (ValueEqual) { - function Object(left, right) { - if (!is_1.Is.Object(right)) - return false; - const leftKeys = [...globalThis.Object.keys(left), ...globalThis.Object.getOwnPropertySymbols(left)]; - const rightKeys = [...globalThis.Object.keys(right), ...globalThis.Object.getOwnPropertySymbols(right)]; - if (leftKeys.length !== rightKeys.length) - return false; - return leftKeys.every((key) => Equal(left[key], right[key])); - } - function Date(left, right) { - return is_1.Is.Date(right) && left.getTime() === right.getTime(); - } - function Array(left, right) { - if (!is_1.Is.Array(right) || left.length !== right.length) - return false; - return left.every((value, index) => Equal(value, right[index])); - } - function TypedArray(left, right) { - if (!is_1.Is.TypedArray(right) || left.length !== right.length || globalThis.Object.getPrototypeOf(left).constructor.name !== globalThis.Object.getPrototypeOf(right).constructor.name) - return false; - return left.every((value, index) => Equal(value, right[index])); - } - function Value(left, right) { - return left === right; - } - function Equal(left, right) { - if (is_1.Is.Object(left)) { - return Object(left, right); - } - else if (is_1.Is.Date(left)) { - return Date(left, right); - } - else if (is_1.Is.TypedArray(left)) { - return TypedArray(left, right); - } - else if (is_1.Is.Array(left)) { - return Array(left, right); - } - else if (is_1.Is.Value(left)) { - return Value(left, right); - } - else { - throw new Error('ValueEquals: Unable to compare value'); - } - } - ValueEqual.Equal = Equal; -})(ValueEqual = exports.ValueEqual || (exports.ValueEqual = {})); diff --git a/node_modules/@sinclair/typebox/value/hash.d.ts b/node_modules/@sinclair/typebox/value/hash.d.ts deleted file mode 100644 index 4c9116b5..00000000 --- a/node_modules/@sinclair/typebox/value/hash.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare class ValueHashError extends Error { - readonly value: unknown; - constructor(value: unknown); -} -export declare namespace ValueHash { - /** Creates a FNV1A-64 non cryptographic hash of the given value */ - function Create(value: unknown): bigint; -} diff --git a/node_modules/@sinclair/typebox/value/hash.js b/node_modules/@sinclair/typebox/value/hash.js deleted file mode 100644 index 95944208..00000000 --- a/node_modules/@sinclair/typebox/value/hash.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/hash - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueHash = exports.ValueHashError = void 0; -class ValueHashError extends Error { - constructor(value) { - super(`Hash: Unable to hash value`); - this.value = value; - } -} -exports.ValueHashError = ValueHashError; -var ValueHash; -(function (ValueHash) { - let ByteMarker; - (function (ByteMarker) { - ByteMarker[ByteMarker["Undefined"] = 0] = "Undefined"; - ByteMarker[ByteMarker["Null"] = 1] = "Null"; - ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean"; - ByteMarker[ByteMarker["Number"] = 3] = "Number"; - ByteMarker[ByteMarker["String"] = 4] = "String"; - ByteMarker[ByteMarker["Object"] = 5] = "Object"; - ByteMarker[ByteMarker["Array"] = 6] = "Array"; - ByteMarker[ByteMarker["Date"] = 7] = "Date"; - ByteMarker[ByteMarker["Uint8Array"] = 8] = "Uint8Array"; - ByteMarker[ByteMarker["Symbol"] = 9] = "Symbol"; - ByteMarker[ByteMarker["BigInt"] = 10] = "BigInt"; - })(ByteMarker || (ByteMarker = {})); - // ---------------------------------------------------- - // State - // ---------------------------------------------------- - let Hash = globalThis.BigInt('14695981039346656037'); - const [Prime, Size] = [globalThis.BigInt('1099511628211'), globalThis.BigInt('2') ** globalThis.BigInt('64')]; - const Bytes = globalThis.Array.from({ length: 256 }).map((_, i) => globalThis.BigInt(i)); - const F64 = new globalThis.Float64Array(1); - const F64In = new globalThis.DataView(F64.buffer); - const F64Out = new globalThis.Uint8Array(F64.buffer); - // ---------------------------------------------------- - // Guards - // ---------------------------------------------------- - function IsDate(value) { - return value instanceof globalThis.Date; - } - function IsUint8Array(value) { - return value instanceof globalThis.Uint8Array; - } - function IsArray(value) { - return globalThis.Array.isArray(value); - } - function IsBoolean(value) { - return typeof value === 'boolean'; - } - function IsNull(value) { - return value === null; - } - function IsNumber(value) { - return typeof value === 'number'; - } - function IsSymbol(value) { - return typeof value === 'symbol'; - } - function IsBigInt(value) { - return typeof value === 'bigint'; - } - function IsObject(value) { - return typeof value === 'object' && value !== null && !IsArray(value) && !IsDate(value) && !IsUint8Array(value); - } - function IsString(value) { - return typeof value === 'string'; - } - function IsUndefined(value) { - return value === undefined; - } - // ---------------------------------------------------- - // Encoding - // ---------------------------------------------------- - function Array(value) { - FNV1A64(ByteMarker.Array); - for (const item of value) { - Visit(item); - } - } - function Boolean(value) { - FNV1A64(ByteMarker.Boolean); - FNV1A64(value ? 1 : 0); - } - function BigInt(value) { - FNV1A64(ByteMarker.BigInt); - F64In.setBigInt64(0, value); - for (const byte of F64Out) { - FNV1A64(byte); - } - } - function Date(value) { - FNV1A64(ByteMarker.Date); - Visit(value.getTime()); - } - function Null(value) { - FNV1A64(ByteMarker.Null); - } - function Number(value) { - FNV1A64(ByteMarker.Number); - F64In.setFloat64(0, value); - for (const byte of F64Out) { - FNV1A64(byte); - } - } - function Object(value) { - FNV1A64(ByteMarker.Object); - for (const key of globalThis.Object.keys(value).sort()) { - Visit(key); - Visit(value[key]); - } - } - function String(value) { - FNV1A64(ByteMarker.String); - for (let i = 0; i < value.length; i++) { - FNV1A64(value.charCodeAt(i)); - } - } - function Symbol(value) { - FNV1A64(ByteMarker.Symbol); - Visit(value.description); - } - function Uint8Array(value) { - FNV1A64(ByteMarker.Uint8Array); - for (let i = 0; i < value.length; i++) { - FNV1A64(value[i]); - } - } - function Undefined(value) { - return FNV1A64(ByteMarker.Undefined); - } - function Visit(value) { - if (IsArray(value)) { - Array(value); - } - else if (IsBoolean(value)) { - Boolean(value); - } - else if (IsBigInt(value)) { - BigInt(value); - } - else if (IsDate(value)) { - Date(value); - } - else if (IsNull(value)) { - Null(value); - } - else if (IsNumber(value)) { - Number(value); - } - else if (IsObject(value)) { - Object(value); - } - else if (IsString(value)) { - String(value); - } - else if (IsSymbol(value)) { - Symbol(value); - } - else if (IsUint8Array(value)) { - Uint8Array(value); - } - else if (IsUndefined(value)) { - Undefined(value); - } - else { - throw new ValueHashError(value); - } - } - function FNV1A64(byte) { - Hash = Hash ^ Bytes[byte]; - Hash = (Hash * Prime) % Size; - } - /** Creates a FNV1A-64 non cryptographic hash of the given value */ - function Create(value) { - Hash = globalThis.BigInt('14695981039346656037'); - Visit(value); - return Hash; - } - ValueHash.Create = Create; -})(ValueHash = exports.ValueHash || (exports.ValueHash = {})); diff --git a/node_modules/@sinclair/typebox/value/index.d.ts b/node_modules/@sinclair/typebox/value/index.d.ts deleted file mode 100644 index 4ad0b778..00000000 --- a/node_modules/@sinclair/typebox/value/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { ValueError, ValueErrorIterator, ValueErrorType } from '../errors/index'; -export { ValueHash } from './hash'; -export { Edit, Insert, Update, Delete } from './delta'; -export { Mutable } from './mutate'; -export * from './pointer'; -export * from './value'; diff --git a/node_modules/@sinclair/typebox/value/index.js b/node_modules/@sinclair/typebox/value/index.js deleted file mode 100644 index 1f21de4d..00000000 --- a/node_modules/@sinclair/typebox/value/index.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Delete = exports.Update = exports.Insert = exports.Edit = exports.ValueHash = exports.ValueErrorType = exports.ValueErrorIterator = void 0; -var index_1 = require("../errors/index"); -Object.defineProperty(exports, "ValueErrorIterator", { enumerable: true, get: function () { return index_1.ValueErrorIterator; } }); -Object.defineProperty(exports, "ValueErrorType", { enumerable: true, get: function () { return index_1.ValueErrorType; } }); -var hash_1 = require("./hash"); -Object.defineProperty(exports, "ValueHash", { enumerable: true, get: function () { return hash_1.ValueHash; } }); -var delta_1 = require("./delta"); -Object.defineProperty(exports, "Edit", { enumerable: true, get: function () { return delta_1.Edit; } }); -Object.defineProperty(exports, "Insert", { enumerable: true, get: function () { return delta_1.Insert; } }); -Object.defineProperty(exports, "Update", { enumerable: true, get: function () { return delta_1.Update; } }); -Object.defineProperty(exports, "Delete", { enumerable: true, get: function () { return delta_1.Delete; } }); -__exportStar(require("./pointer"), exports); -__exportStar(require("./value"), exports); diff --git a/node_modules/@sinclair/typebox/value/is.d.ts b/node_modules/@sinclair/typebox/value/is.d.ts deleted file mode 100644 index b78ba9c2..00000000 --- a/node_modules/@sinclair/typebox/value/is.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type ValueType = null | undefined | Function | symbol | bigint | number | boolean | string; -export type ObjectType = Record; -export type TypedArrayType = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; -export type ArrayType = unknown[]; -export declare namespace Is { - function Object(value: unknown): value is ObjectType; - function Date(value: unknown): value is Date; - function Array(value: unknown): value is ArrayType; - function Value(value: unknown): value is ValueType; - function TypedArray(value: unknown): value is TypedArrayType; -} diff --git a/node_modules/@sinclair/typebox/value/is.js b/node_modules/@sinclair/typebox/value/is.js deleted file mode 100644 index fbe1ed43..00000000 --- a/node_modules/@sinclair/typebox/value/is.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Is = void 0; -var Is; -(function (Is) { - function Object(value) { - return value !== null && typeof value === 'object' && !globalThis.Array.isArray(value) && !ArrayBuffer.isView(value) && !(value instanceof globalThis.Date); - } - Is.Object = Object; - function Date(value) { - return value instanceof globalThis.Date; - } - Is.Date = Date; - function Array(value) { - return globalThis.Array.isArray(value) && !ArrayBuffer.isView(value); - } - Is.Array = Array; - function Value(value) { - return value === null || value === undefined || typeof value === 'function' || typeof value === 'symbol' || typeof value === 'bigint' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'string'; - } - Is.Value = Value; - function TypedArray(value) { - return ArrayBuffer.isView(value); - } - Is.TypedArray = TypedArray; -})(Is = exports.Is || (exports.Is = {})); diff --git a/node_modules/@sinclair/typebox/value/mutate.d.ts b/node_modules/@sinclair/typebox/value/mutate.d.ts deleted file mode 100644 index e45c07e2..00000000 --- a/node_modules/@sinclair/typebox/value/mutate.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare class ValueMutateTypeMismatchError extends Error { - constructor(); -} -export declare class ValueMutateInvalidRootMutationError extends Error { - constructor(); -} -export type Mutable = { - [key: string]: unknown; -} | unknown[]; -export declare namespace ValueMutate { - /** Performs a deep mutable value assignment while retaining internal references. */ - function Mutate(current: Mutable, next: Mutable): void; -} diff --git a/node_modules/@sinclair/typebox/value/mutate.js b/node_modules/@sinclair/typebox/value/mutate.js deleted file mode 100644 index 4151596b..00000000 --- a/node_modules/@sinclair/typebox/value/mutate.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueMutate = exports.ValueMutateInvalidRootMutationError = exports.ValueMutateTypeMismatchError = void 0; -const is_1 = require("./is"); -const pointer_1 = require("./pointer"); -const clone_1 = require("./clone"); -class ValueMutateTypeMismatchError extends Error { - constructor() { - super('ValueMutate: Cannot assign due type mismatch of assignable values'); - } -} -exports.ValueMutateTypeMismatchError = ValueMutateTypeMismatchError; -class ValueMutateInvalidRootMutationError extends Error { - constructor() { - super('ValueMutate: Only object and array types can be mutated at the root level'); - } -} -exports.ValueMutateInvalidRootMutationError = ValueMutateInvalidRootMutationError; -var ValueMutate; -(function (ValueMutate) { - function Object(root, path, current, next) { - if (!is_1.Is.Object(current)) { - pointer_1.ValuePointer.Set(root, path, clone_1.ValueClone.Clone(next)); - } - else { - const currentKeys = globalThis.Object.keys(current); - const nextKeys = globalThis.Object.keys(next); - for (const currentKey of currentKeys) { - if (!nextKeys.includes(currentKey)) { - delete current[currentKey]; - } - } - for (const nextKey of nextKeys) { - if (!currentKeys.includes(nextKey)) { - current[nextKey] = null; - } - } - for (const nextKey of nextKeys) { - Visit(root, `${path}/${nextKey}`, current[nextKey], next[nextKey]); - } - } - } - function Array(root, path, current, next) { - if (!is_1.Is.Array(current)) { - pointer_1.ValuePointer.Set(root, path, clone_1.ValueClone.Clone(next)); - } - else { - for (let index = 0; index < next.length; index++) { - Visit(root, `${path}/${index}`, current[index], next[index]); - } - current.splice(next.length); - } - } - function TypedArray(root, path, current, next) { - if (is_1.Is.TypedArray(current) && current.length === next.length) { - for (let i = 0; i < current.length; i++) { - current[i] = next[i]; - } - } - else { - pointer_1.ValuePointer.Set(root, path, clone_1.ValueClone.Clone(next)); - } - } - function Value(root, path, current, next) { - if (current === next) - return; - pointer_1.ValuePointer.Set(root, path, next); - } - function Visit(root, path, current, next) { - if (is_1.Is.Array(next)) { - return Array(root, path, current, next); - } - else if (is_1.Is.TypedArray(next)) { - return TypedArray(root, path, current, next); - } - else if (is_1.Is.Object(next)) { - return Object(root, path, current, next); - } - else if (is_1.Is.Value(next)) { - return Value(root, path, current, next); - } - } - /** Performs a deep mutable value assignment while retaining internal references. */ - function Mutate(current, next) { - if (is_1.Is.TypedArray(current) || is_1.Is.Value(current) || is_1.Is.TypedArray(next) || is_1.Is.Value(next)) { - throw new ValueMutateInvalidRootMutationError(); - } - if ((is_1.Is.Object(current) && is_1.Is.Array(next)) || (is_1.Is.Array(current) && is_1.Is.Object(next))) { - throw new ValueMutateTypeMismatchError(); - } - Visit(current, '', current, next); - } - ValueMutate.Mutate = Mutate; -})(ValueMutate = exports.ValueMutate || (exports.ValueMutate = {})); diff --git a/node_modules/@sinclair/typebox/value/package.json b/node_modules/@sinclair/typebox/value/package.json new file mode 100644 index 00000000..7a7aef6e --- /dev/null +++ b/node_modules/@sinclair/typebox/value/package.json @@ -0,0 +1,4 @@ +{ + "main": "../build/cjs/value/index.js", + "types": "../build/cjs/value/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/@sinclair/typebox/value/pointer.d.ts b/node_modules/@sinclair/typebox/value/pointer.d.ts deleted file mode 100644 index abae1e1c..00000000 --- a/node_modules/@sinclair/typebox/value/pointer.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export declare class ValuePointerRootSetError extends Error { - readonly value: unknown; - readonly path: string; - readonly update: unknown; - constructor(value: unknown, path: string, update: unknown); -} -export declare class ValuePointerRootDeleteError extends Error { - readonly value: unknown; - readonly path: string; - constructor(value: unknown, path: string); -} -/** Provides functionality to update values through RFC6901 string pointers */ -export declare namespace ValuePointer { - /** Formats the given pointer into navigable key components */ - function Format(pointer: string): IterableIterator; - /** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ - function Set(value: any, pointer: string, update: unknown): void; - /** Deletes a value at the given pointer */ - function Delete(value: any, pointer: string): void; - /** Returns true if a value exists at the given pointer */ - function Has(value: any, pointer: string): boolean; - /** Gets the value at the given pointer */ - function Get(value: any, pointer: string): any; -} diff --git a/node_modules/@sinclair/typebox/value/pointer.js b/node_modules/@sinclair/typebox/value/pointer.js deleted file mode 100644 index 981be635..00000000 --- a/node_modules/@sinclair/typebox/value/pointer.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValuePointer = exports.ValuePointerRootDeleteError = exports.ValuePointerRootSetError = void 0; -class ValuePointerRootSetError extends Error { - constructor(value, path, update) { - super('ValuePointer: Cannot set root value'); - this.value = value; - this.path = path; - this.update = update; - } -} -exports.ValuePointerRootSetError = ValuePointerRootSetError; -class ValuePointerRootDeleteError extends Error { - constructor(value, path) { - super('ValuePointer: Cannot delete root value'); - this.value = value; - this.path = path; - } -} -exports.ValuePointerRootDeleteError = ValuePointerRootDeleteError; -/** Provides functionality to update values through RFC6901 string pointers */ -var ValuePointer; -(function (ValuePointer) { - function Escape(component) { - return component.indexOf('~') === -1 ? component : component.replace(/~1/g, '/').replace(/~0/g, '~'); - } - /** Formats the given pointer into navigable key components */ - function* Format(pointer) { - if (pointer === '') - return; - let [start, end] = [0, 0]; - for (let i = 0; i < pointer.length; i++) { - const char = pointer.charAt(i); - if (char === '/') { - if (i === 0) { - start = i + 1; - } - else { - end = i; - yield Escape(pointer.slice(start, end)); - start = i + 1; - } - } - else { - end = i; - } - } - yield Escape(pointer.slice(start)); - } - ValuePointer.Format = Format; - /** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ - function Set(value, pointer, update) { - if (pointer === '') - throw new ValuePointerRootSetError(value, pointer, update); - let [owner, next, key] = [null, value, '']; - for (const component of Format(pointer)) { - if (next[component] === undefined) - next[component] = {}; - owner = next; - next = next[component]; - key = component; - } - owner[key] = update; - } - ValuePointer.Set = Set; - /** Deletes a value at the given pointer */ - function Delete(value, pointer) { - if (pointer === '') - throw new ValuePointerRootDeleteError(value, pointer); - let [owner, next, key] = [null, value, '']; - for (const component of Format(pointer)) { - if (next[component] === undefined || next[component] === null) - return; - owner = next; - next = next[component]; - key = component; - } - if (globalThis.Array.isArray(owner)) { - const index = parseInt(key); - owner.splice(index, 1); - } - else { - delete owner[key]; - } - } - ValuePointer.Delete = Delete; - /** Returns true if a value exists at the given pointer */ - function Has(value, pointer) { - if (pointer === '') - return true; - let [owner, next, key] = [null, value, '']; - for (const component of Format(pointer)) { - if (next[component] === undefined) - return false; - owner = next; - next = next[component]; - key = component; - } - return globalThis.Object.getOwnPropertyNames(owner).includes(key); - } - ValuePointer.Has = Has; - /** Gets the value at the given pointer */ - function Get(value, pointer) { - if (pointer === '') - return value; - let current = value; - for (const component of Format(pointer)) { - if (current[component] === undefined) - return undefined; - current = current[component]; - } - return current; - } - ValuePointer.Get = Get; -})(ValuePointer = exports.ValuePointer || (exports.ValuePointer = {})); diff --git a/node_modules/@sinclair/typebox/value/value.d.ts b/node_modules/@sinclair/typebox/value/value.d.ts deleted file mode 100644 index bf8d32f5..00000000 --- a/node_modules/@sinclair/typebox/value/value.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import * as Types from '../typebox'; -import { ValueErrorIterator } from '../errors/index'; -import { Mutable } from './mutate'; -import { Edit } from './delta'; -/** Provides functions to perform structural updates to JavaScript values */ -export declare namespace Value { - /** Casts a value into a given type. The return value will retain as much information of the original value as possible. Cast will convert string, number, boolean and date values if a reasonable conversion is possible. */ - function Cast(schema: T, references: [...R], value: unknown): Types.Static; - /** Casts a value into a given type. The return value will retain as much information of the original value as possible. Cast will convert string, number, boolean and date values if a reasonable conversion is possible. */ - function Cast(schema: T, value: unknown): Types.Static; - /** Creates a value from the given type */ - function Create(schema: T, references: [...R]): Types.Static; - /** Creates a value from the given type */ - function Create(schema: T): Types.Static; - /** Returns true if the value matches the given type. */ - function Check(schema: T, references: [...R], value: unknown): value is Types.Static; - /** Returns true if the value matches the given type. */ - function Check(schema: T, value: unknown): value is Types.Static; - /** Converts any type mismatched values to their target type if a conversion is possible. */ - function Convert(schema: T, references: [...R], value: unknown): unknown; - /** Converts any type mismatched values to their target type if a conversion is possible. */ - function Convert(schema: T, value: unknown): unknown; - /** Returns a structural clone of the given value */ - function Clone(value: T): T; - /** Returns an iterator for each error in this value. */ - function Errors(schema: T, references: [...R], value: unknown): ValueErrorIterator; - /** Returns an iterator for each error in this value. */ - function Errors(schema: T, value: unknown): ValueErrorIterator; - /** Returns true if left and right values are structurally equal */ - function Equal(left: T, right: unknown): right is T; - /** Returns edits to transform the current value into the next value */ - function Diff(current: unknown, next: unknown): Edit[]; - /** Returns a FNV1A-64 non cryptographic hash of the given value */ - function Hash(value: unknown): bigint; - /** Returns a new value with edits applied to the given value */ - function Patch(current: unknown, edits: Edit[]): T; - /** Performs a deep mutable value assignment while retaining internal references. */ - function Mutate(current: Mutable, next: Mutable): void; -} diff --git a/node_modules/@sinclair/typebox/value/value.js b/node_modules/@sinclair/typebox/value/value.js deleted file mode 100644 index e1ab919f..00000000 --- a/node_modules/@sinclair/typebox/value/value.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Value = void 0; -const index_1 = require("../errors/index"); -const mutate_1 = require("./mutate"); -const hash_1 = require("./hash"); -const equal_1 = require("./equal"); -const cast_1 = require("./cast"); -const clone_1 = require("./clone"); -const convert_1 = require("./convert"); -const create_1 = require("./create"); -const check_1 = require("./check"); -const delta_1 = require("./delta"); -/** Provides functions to perform structural updates to JavaScript values */ -var Value; -(function (Value) { - function Cast(...args) { - const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; - return cast_1.ValueCast.Cast(schema, references, value); - } - Value.Cast = Cast; - function Create(...args) { - const [schema, references] = args.length === 2 ? [args[0], args[1]] : [args[0], []]; - return create_1.ValueCreate.Create(schema, references); - } - Value.Create = Create; - function Check(...args) { - const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; - return check_1.ValueCheck.Check(schema, references, value); - } - Value.Check = Check; - function Convert(...args) { - const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; - return convert_1.ValueConvert.Convert(schema, references, value); - } - Value.Convert = Convert; - /** Returns a structural clone of the given value */ - function Clone(value) { - return clone_1.ValueClone.Clone(value); - } - Value.Clone = Clone; - function Errors(...args) { - const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; - return index_1.ValueErrors.Errors(schema, references, value); - } - Value.Errors = Errors; - /** Returns true if left and right values are structurally equal */ - function Equal(left, right) { - return equal_1.ValueEqual.Equal(left, right); - } - Value.Equal = Equal; - /** Returns edits to transform the current value into the next value */ - function Diff(current, next) { - return delta_1.ValueDelta.Diff(current, next); - } - Value.Diff = Diff; - /** Returns a FNV1A-64 non cryptographic hash of the given value */ - function Hash(value) { - return hash_1.ValueHash.Create(value); - } - Value.Hash = Hash; - /** Returns a new value with edits applied to the given value */ - function Patch(current, edits) { - return delta_1.ValueDelta.Patch(current, edits); - } - Value.Patch = Patch; - /** Performs a deep mutable value assignment while retaining internal references. */ - function Mutate(current, next) { - mutate_1.ValueMutate.Mutate(current, next); - } - Value.Mutate = Mutate; -})(Value = exports.Value || (exports.Value = {})); diff --git a/node_modules/@sinonjs/fake-timers/README.md b/node_modules/@sinonjs/fake-timers/README.md index 049f0672..a7f5ab63 100644 --- a/node_modules/@sinonjs/fake-timers/README.md +++ b/node_modules/@sinonjs/fake-timers/README.md @@ -3,19 +3,27 @@ [![codecov](https://codecov.io/gh/sinonjs/fake-timers/branch/main/graph/badge.svg)](https://codecov.io/gh/sinonjs/fake-timers) Contributor Covenant -JavaScript implementation of the timer APIs; `setTimeout`, `clearTimeout`, `setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, `requestAnimationFrame`, `cancelAnimationFrame`, `requestIdleCallback`, and `cancelIdleCallback`, along with a clock instance that controls the flow of time. FakeTimers also provides a `Date` implementation that gets its time from the clock. +JavaScript implementation of the timer +APIs; `setTimeout`, `clearTimeout`, `setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, `requestAnimationFrame`, `cancelAnimationFrame`, `requestIdleCallback`, +and `cancelIdleCallback`, along with a clock instance that controls the flow of time. FakeTimers also provides a `Date` +implementation that gets its time from the clock. -In addition in browser environment `@sinonjs/fake-timers` provides a `performance` implementation that gets its time from the clock. In Node environments FakeTimers provides a `nextTick` implementation that is synchronized with the clock - and a `process.hrtime` shim that works with the clock. +In addition in browser environment `@sinonjs/fake-timers` provides a `performance` implementation that gets its time +from the clock. In Node environments FakeTimers provides a `nextTick` implementation that is synchronized with the +clock - and a `process.hrtime` shim that works with the clock. `@sinonjs/fake-timers` can be used to simulate passing time in automated tests and other situations where you want the scheduling semantics, but don't want to actually wait. -`@sinonjs/fake-timers` is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js) and targets the [same runtimes](https://sinonjs.org/releases/latest/#supported-runtimes). +`@sinonjs/fake-timers` is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js) and targets +the [same runtimes](https://sinonjs.org/releases/latest/#supported-runtimes). ## Autocomplete, IntelliSense and TypeScript definitions -Version 7 introduced JSDoc to the codebase. This should provide autocomplete and type suggestions in supporting IDEs. If you need more elaborate type support, TypeScript definitions for the Sinon projects are independently maintained by the Definitely Types community: +Version 7 introduced JSDoc to the codebase. This should provide autocomplete and type suggestions in supporting IDEs. If +you need more elaborate type support, TypeScript definitions for the Sinon projects are independently maintained by the +Definitely Types community: ``` npm install -D @types/sinonjs__fake-timers @@ -29,7 +37,8 @@ npm install -D @types/sinonjs__fake-timers npm install @sinonjs/fake-timers ``` -If you want to use `@sinonjs/fake-timers` in a browser you can either build your own bundle or use [Skypack](https://www.skypack.dev). +If you want to use `@sinonjs/fake-timers` in a browser you can either build your own bundle or +use [Skypack](https://www.skypack.dev). ## Usage @@ -43,7 +52,7 @@ var clock = FakeTimers.createClock(); clock.setTimeout(function () { console.log( - "The poblano is a mild chili pepper originating in the state of Puebla, Mexico." + "The poblano is a mild chili pepper originating in the state of Puebla, Mexico.", ); }, 15); @@ -54,7 +63,8 @@ clock.tick(15); Upon executing the last line, an interesting fact about the [Poblano](https://en.wikipedia.org/wiki/Poblano) will be printed synchronously to -the screen. If you want to simulate asynchronous behavior, please see the `async` function variants (eg `clock.tick(time)` vs `await clock.tickAsync(time)`). +the screen. If you want to simulate asynchronous behavior, please see the `async` function variants ( +eg `clock.tick(time)` vs `await clock.tickAsync(time)`). The `next`, `runAll`, `runToFrame`, and `runToLast` methods are available to advance the clock. See the API Reference for more details. @@ -67,6 +77,9 @@ clock instance, not the browser's internals. Calling `install` with no arguments achieves this. You can call `uninstall` later to restore things as they were again. +Note that in NodeJS the [timers](https://nodejs.org/api/timers.html) +and [timers/promises](https://nodejs.org/api/timers.html#timers-promises-api) modules will also receive fake timers when +using global scope. ```js // In the browser distribution, a global `FakeTimers` is already available @@ -142,20 +155,26 @@ Creates a clock. The default The `now` argument may be a number (in milliseconds) or a Date object. -The `loopLimit` argument sets the maximum number of timers that will be run when calling `runAll()` before assuming that we have an infinite loop and throwing an error. The default is `1000`. +The `loopLimit` argument sets the maximum number of timers that will be run when calling `runAll()` before assuming that +we have an infinite loop and throwing an error. The default is `1000`. ### `var clock = FakeTimers.install([config])` -Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). The following configuration options are available - -| Parameter | Type | Default | Description | -| -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `config.now` | Number/Date | 0 | installs FakeTimers with the specified unix epoch | -| `config.toFake` | String[] | ["setTimeout", "clearTimeout", "setImmediate", "clearImmediate","setInterval", "clearInterval", "Date", "requestAnimationFrame", "cancelAnimationFrame", "requestIdleCallback", "cancelIdleCallback", "hrtime", "performance"] | an array with explicit function names (or objects, in the case of "performance") to hijack. _When not set, FakeTimers will automatically fake all methods **except** `nextTick`_ e.g., `FakeTimers.install({ toFake: ["setTimeout","nextTick"]})` will fake only `setTimeout` and `nextTick` | -| `config.loopLimit` | Number | 1000 | the maximum number of timers that will be run when calling runAll() | -| `config.shouldAdvanceTime` | Boolean | false | tells FakeTimers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) | -| `config.advanceTimeDelta` | Number | 20 | relevant only when using with `shouldAdvanceTime: true`. increment mocked time by `advanceTimeDelta` ms every `advanceTimeDelta` ms change in the real system time. | -| `config.shouldClearNativeTimers` | Boolean | false | tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. | +Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). +Note that in NodeJS the [timers](https://nodejs.org/api/timers.html) +and [timers/promises](https://nodejs.org/api/timers.html#timers-promises-api) modules will also receive fake timers when +using global scope. +The following configuration options are available + +| Parameter | Type | Default | Description | +| -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `config.now` | Number/Date | 0 | installs FakeTimers with the specified unix epoch | +| `config.toFake` | String[] | ["setTimeout", "clearTimeout", "setImmediate", "clearImmediate","setInterval", "clearInterval", "Date", "requestAnimationFrame", "cancelAnimationFrame", "requestIdleCallback", "cancelIdleCallback", "hrtime", "performance"] | an array with explicit function names (or objects, in the case of "performance") to hijack. \_When not set, FakeTimers will automatically fake all methods e.g., `FakeTimers.install({ toFake: ["setTimeout","nextTick"]})` will fake only `setTimeout` and `nextTick` | +| `config.loopLimit` | Number | 1000 | the maximum number of timers that will be run when calling runAll() | +| `config.shouldAdvanceTime` | Boolean | false | tells FakeTimers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) | +| `config.advanceTimeDelta` | Number | 20 | relevant only when using with `shouldAdvanceTime: true`. increment mocked time by `advanceTimeDelta` ms every `advanceTimeDelta` ms change in the real system time. | +| `config.shouldClearNativeTimers` | Boolean | false | tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. | +| `config.ignoreMissingTimers` | Boolean | false | tells FakeTimers to ignore missing timers that might not exist in the given environment | ### `var id = clock.setTimeout(callback, timeout)` @@ -215,7 +234,9 @@ Cancels the callback scheduled by the provided id. ### `clock.requestIdleCallback(callback[, timeout])` -Queued the callback to be fired during idle periods to perform background and low priority work on the main event loop. Callbacks which have a timeout option will be fired no later than time in milliseconds. Returns an `id` which can be used to cancel the callback. +Queued the callback to be fired during idle periods to perform background and low priority work on the main event loop. +Callbacks which have a timeout option will be fired no later than time in milliseconds. Returns an `id` which can be +used to cancel the callback. ### `clock.cancelIdleCallback(id)` @@ -260,7 +281,8 @@ callbacks to execute _before_ running the timers. Advance the clock by jumping forward in time, firing callbacks at most once. `time` takes the same formats as [`clock.tick`](#clockticktime--await-clocktickasynctime). -This can be used to simulate the JS engine (such as a browser) being put to sleep and resumed later, skipping intermediary timers. +This can be used to simulate the JS engine (such as a browser) being put to sleep and resumed later, skipping +intermediary timers. ### `clock.reset()` @@ -270,9 +292,11 @@ Useful to reset the state of the clock without having to `uninstall` and `instal ### `clock.runAll()` / `await clock.runAllAsync()` -This runs all pending timers until there are none remaining. If new timers are added while it is executing they will be run as well. +This runs all pending timers until there are none remaining. If new timers are added while it is executing they will be +run as well. -This makes it easier to run asynchronous tests to completion without worrying about the number of timers they use, or the delays in those timers. +This makes it easier to run asynchronous tests to completion without worrying about the number of timers they use, or +the delays in those timers. It runs a maximum of `loopLimit` times after which it assumes there is an infinite loop of timers and throws an error. @@ -281,7 +305,8 @@ callbacks to execute _before_ running the timers. ### `clock.runMicrotasks()` -This runs all pending microtasks scheduled with `nextTick` but none of the timers and is mostly useful for libraries using FakeTimers underneath and for running `nextTick` items without any timers. +This runs all pending microtasks scheduled with `nextTick` but none of the timers and is mostly useful for libraries +using FakeTimers underneath and for running `nextTick` items without any timers. ### `clock.runToFrame()` @@ -320,11 +345,22 @@ Implements the `Date` object but using the clock to provide the correct time. ### `Performance` -Implements the `now` method of the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) object but using the clock to provide the correct time. Only available in environments that support the Performance object (browsers mostly). +Implements the `now` method of the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) +object but using the clock to provide the correct time. Only available in environments that support the Performance +object (browsers mostly). ### `FakeTimers.withGlobal` -In order to support creating clocks based on separate or sandboxed environments (such as JSDOM), FakeTimers exports a factory method which takes single argument `global`, which it inspects to figure out what to mock and what features to support. When invoking this function with a global, you will get back an object with `timers`, `createClock` and `install` - same as the regular FakeTimers exports only based on the passed in global instead of the global environment. +In order to support creating clocks based on separate or sandboxed environments (such as JSDOM), FakeTimers exports a +factory method which takes single argument `global`, which it inspects to figure out what to mock and what features to +support. When invoking this function with a global, you will get back an object with `timers`, `createClock` +and `install` - same as the regular FakeTimers exports only based on the passed in global instead of the global +environment. + +## Promises and fake time + +If you use a Promise library like Bluebird, note that you should either call `clock.runMicrotasks()` or make sure to +_not_ mock `nextTick`. ## Running tests @@ -346,8 +382,8 @@ $(npm bin)/mocha ./test/fake-timers-test.js ### In the browser -[Mochify](https://github.com/mantoni/mochify.js) is used to run the tests in -PhantomJS. Make sure you have `phantomjs` installed. Then: +[Mochify](https://github.com/mochify-js) is used to run the tests in headless +Chrome. ```sh npm test-headless diff --git a/node_modules/@sinonjs/fake-timers/package.json b/node_modules/@sinonjs/fake-timers/package.json index fdb18926..e59405eb 100644 --- a/node_modules/@sinonjs/fake-timers/package.json +++ b/node_modules/@sinonjs/fake-timers/package.json @@ -1,12 +1,12 @@ { "name": "@sinonjs/fake-timers", "description": "Fake JavaScript timers", - "version": "10.3.0", + "version": "13.0.5", "homepage": "https://github.com/sinonjs/fake-timers", "author": "Christian Johansen", "repository": { "type": "git", - "url": "https://github.com/sinonjs/fake-timers.git" + "url": "git+https://github.com/sinonjs/fake-timers.git" }, "bugs": { "mail": "christian@cjohansen.no", @@ -16,39 +16,52 @@ "scripts": { "lint": "eslint .", "test-node": "mocha --timeout 200 test/ integration-test/ -R dot --check-leaks", - "test-headless": "mochify --no-detect-globals --timeout=10000", + "test-headless": "mochify --driver puppeteer", "test-check-coverage": "npm run test-coverage && nyc check-coverage", - "test-cloud": "mochify --wd --no-detect-globals --timeout=10000", - "test-coverage": "nyc --all --reporter text --reporter html --reporter lcovonly npm run test-node", + "test-cloud": "npm run test-edge && npm run test-firefox && npm run test-safari", + "test-edge": "BROWSER_NAME=MicrosoftEdge mochify --config mochify.webdriver.js", + "test-firefox": "BROWSER_NAME=firefox mochify --config mochify.webdriver.js", + "test-safari": "BROWSER_NAME=safari mochify --config mochify.webdriver.js", + "test-coverage": "nyc -x mochify.webdriver.js -x coverage --all --reporter text --reporter html --reporter lcovonly npm run test-node", "test": "npm run test-node && npm run test-headless", "prettier:check": "prettier --check '**/*.{js,css,md}'", "prettier:write": "prettier --write '**/*.{js,css,md}'", "preversion": "./scripts/preversion.sh", "version": "./scripts/version.sh", "postversion": "./scripts/postversion.sh", - "prepare": "husky install" + "prepare": "husky" }, "lint-staged": { "*.{js,css,md}": "prettier --check", "*.js": "eslint" }, + "mochify": { + "reporter": "dot", + "timeout": 10000, + "bundle": "esbuild --bundle --sourcemap=inline --define:process.env.NODE_DEBUG=\"\"", + "bundle_stdin": "require", + "spec": "test/**/*-test.js" + }, "files": [ "src/" ], "devDependencies": { - "@sinonjs/eslint-config": "^4.1.0", - "@sinonjs/referee-sinon": "11.0.0", - "husky": "^8.0.3", - "jsdom": "22.0.0", - "lint-staged": "13.2.2", - "mocha": "10.2.0", - "mochify": "9.2.0", - "nyc": "15.1.0", - "prettier": "2.8.8" + "@mochify/cli": "^0.4.1", + "@mochify/driver-puppeteer": "^0.4.0", + "@mochify/driver-webdriver": "^0.2.1", + "@sinonjs/eslint-config": "^5.0.3", + "@sinonjs/referee-sinon": "12.0.0", + "esbuild": "^0.23.1", + "husky": "^9.1.5", + "jsdom": "24.1.1", + "lint-staged": "15.2.9", + "mocha": "10.7.3", + "nyc": "17.0.0", + "prettier": "3.3.3" }, "main": "./src/fake-timers-src.js", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@sinonjs/commons": "^3.0.1" }, "nyc": { "branches": 85, diff --git a/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js b/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js index 607d91fb..b9a8a8d0 100644 --- a/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js +++ b/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js @@ -1,6 +1,19 @@ "use strict"; const globalObject = require("@sinonjs/commons").global; +let timersModule, timersPromisesModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } + try { + timersPromisesModule = require("timers/promises"); + } catch (e) { + // ignored + } +} /** * @typedef {object} IdleDeadline @@ -20,14 +33,14 @@ const globalObject = require("@sinonjs/commons").global; /** * @callback NextTick * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {void} */ /** * @callback SetImmediate * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {NodeImmediate} */ @@ -85,6 +98,9 @@ const globalObject = require("@sinonjs/commons").global; * @property {function(): void} uninstall Uninstall the clock. * @property {Function[]} methods - the methods that are faked * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + * @property {{methodName:string, original:any}[] | undefined} timersPromisesModuleMethods + * @property {Map} abortListenerMap */ /* eslint-enable jsdoc/require-property-description */ @@ -98,6 +114,7 @@ const globalObject = require("@sinonjs/commons").global; * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + * @property {boolean} [ignoreMissingTimers] default is false, meaning asking to fake timers that are not present will throw an error */ /* eslint-disable jsdoc/require-property-description */ @@ -134,8 +151,6 @@ const globalObject = require("@sinonjs/commons").global; * @returns {FakeTimers} */ function withGlobal(_global) { - const userAgent = _global.navigator && _global.navigator.userAgent; - const isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1; const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs const NOOP = function () { @@ -144,16 +159,26 @@ function withGlobal(_global) { const NOOP_ARRAY = function () { return []; }; - const timeoutResult = _global.setTimeout(NOOP, 0); - const addTimerReturnsObject = typeof timeoutResult === "object"; - const hrtimePresent = + const isPresent = {}; + let timeoutResult, + addTimerReturnsObject = false; + + if (_global.setTimeout) { + isPresent.setTimeout = true; + timeoutResult = _global.setTimeout(NOOP, 0); + addTimerReturnsObject = typeof timeoutResult === "object"; + } + isPresent.clearTimeout = Boolean(_global.clearTimeout); + isPresent.setInterval = Boolean(_global.setInterval); + isPresent.clearInterval = Boolean(_global.clearInterval); + isPresent.hrtime = _global.process && typeof _global.process.hrtime === "function"; - const hrtimeBigintPresent = - hrtimePresent && typeof _global.process.hrtime.bigint === "function"; - const nextTickPresent = + isPresent.hrtimeBigint = + isPresent.hrtime && typeof _global.process.hrtime.bigint === "function"; + isPresent.nextTick = _global.process && typeof _global.process.nextTick === "function"; const utilPromisify = _global.process && require("util").promisify; - const performancePresent = + isPresent.performance = _global.performance && typeof _global.performance.now === "function"; const hasPerformancePrototype = _global.Performance && @@ -162,45 +187,59 @@ function withGlobal(_global) { _global.performance && _global.performance.constructor && _global.performance.constructor.prototype; - const queueMicrotaskPresent = _global.hasOwnProperty("queueMicrotask"); - const requestAnimationFramePresent = + isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask"); + isPresent.requestAnimationFrame = _global.requestAnimationFrame && typeof _global.requestAnimationFrame === "function"; - const cancelAnimationFramePresent = + isPresent.cancelAnimationFrame = _global.cancelAnimationFrame && typeof _global.cancelAnimationFrame === "function"; - const requestIdleCallbackPresent = + isPresent.requestIdleCallback = _global.requestIdleCallback && typeof _global.requestIdleCallback === "function"; - const cancelIdleCallbackPresent = + isPresent.cancelIdleCallbackPresent = _global.cancelIdleCallback && typeof _global.cancelIdleCallback === "function"; - const setImmediatePresent = + isPresent.setImmediate = _global.setImmediate && typeof _global.setImmediate === "function"; + isPresent.clearImmediate = + _global.clearImmediate && typeof _global.clearImmediate === "function"; + isPresent.Intl = _global.Intl && typeof _global.Intl === "object"; - // Make properties writable in IE, as per - // https://www.adequatelygood.com/Replacing-setTimeout-Globally.html - /* eslint-disable no-self-assign */ - if (isRunningInIE) { - _global.setTimeout = _global.setTimeout; - _global.clearTimeout = _global.clearTimeout; - _global.setInterval = _global.setInterval; - _global.clearInterval = _global.clearInterval; - _global.Date = _global.Date; + if (_global.clearTimeout) { + _global.clearTimeout(timeoutResult); } - // setImmediate is not a standard function - // avoid adding the prop to the window object if not present - if (setImmediatePresent) { - _global.setImmediate = _global.setImmediate; - _global.clearImmediate = _global.clearImmediate; + const NativeDate = _global.Date; + const NativeIntl = _global.Intl; + let uniqueTimerId = idCounterStart; + + if (NativeDate === undefined) { + throw new Error( + "The global scope doesn't have a `Date` object" + + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", + ); } - /* eslint-enable no-self-assign */ + isPresent.Date = true; - _global.clearTimeout(timeoutResult); + /** + * The PerformanceEntry object encapsulates a single performance metric + * that is part of the browser's performance timeline. + * + * This is an object returned by the `mark` and `measure` methods on the Performance prototype + */ + class FakePerformanceEntry { + constructor(name, entryType, startTime, duration) { + this.name = name; + this.entryType = entryType; + this.startTime = startTime; + this.duration = duration; + } - const NativeDate = _global.Date; - let uniqueTimerId = idCounterStart; + toJSON() { + return JSON.stringify({ ...this }); + } + } /** * @param {number} num @@ -254,7 +293,7 @@ function withGlobal(_global) { if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error( - "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits" + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", ); } @@ -323,7 +362,7 @@ function withGlobal(_global) { */ function getInfiniteLoopError(clock, job) { const infiniteLoopError = new Error( - `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!` + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, ); if (!job.error) { @@ -333,13 +372,13 @@ function withGlobal(_global) { // pattern never matched in Node const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; let clockMethodPattern = new RegExp( - String(Object.keys(clock).join("|")) + String(Object.keys(clock).join("|")), ); if (addTimerReturnsObject) { // node.js environment clockMethodPattern = new RegExp( - `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+` + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, ); } @@ -386,109 +425,132 @@ function withGlobal(_global) { return infiniteLoopError; } - /** - * @param {Date} target - * @param {Date} source - * @returns {Date} the target after modifications - */ - function mirrorDateProperties(target, source) { - let prop; - for (prop in source) { - if (source.hasOwnProperty(prop)) { - target[prop] = source[prop]; + //eslint-disable-next-line jsdoc/require-jsdoc + function createDate() { + class ClockDate extends NativeDate { + /** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns void + */ + // eslint-disable-next-line no-unused-vars + constructor(year, month, date, hour, minute, second, ms) { + // Defensive and verbose to avoid potential harm in passing + // explicit undefined when user does not pass argument + if (arguments.length === 0) { + super(ClockDate.clock.now); + } else { + super(...arguments); + } + + // ensures identity checks using the constructor prop still works + // this should have no other functional effect + Object.defineProperty(this, "constructor", { + value: NativeDate, + enumerable: false, + }); + } + + static [Symbol.hasInstance](instance) { + return instance instanceof NativeDate; } } - // set special now implementation - if (source.now) { - target.now = function now() { - return target.clock.now; + ClockDate.isFake = true; + + if (NativeDate.now) { + ClockDate.now = function now() { + return ClockDate.clock.now; }; - } else { - delete target.now; } - // set special toSource implementation - if (source.toSource) { - target.toSource = function toSource() { - return source.toSource(); + if (NativeDate.toSource) { + ClockDate.toSource = function toSource() { + return NativeDate.toSource(); }; - } else { - delete target.toSource; } - // set special toString implementation - target.toString = function toString() { - return source.toString(); + ClockDate.toString = function toString() { + return NativeDate.toString(); }; - target.prototype = source.prototype; - target.parse = source.parse; - target.UTC = source.UTC; - target.prototype.toUTCString = source.prototype.toUTCString; - target.isFake = true; + // noinspection UnnecessaryLocalVariableJS + /** + * A normal Class constructor cannot be called without `new`, but Date can, so we need + * to wrap it in a Proxy in order to ensure this functionality of Date is kept intact + * + * @type {ClockDate} + */ + const ClockDateProxy = new Proxy(ClockDate, { + // handler for [[Call]] invocations (i.e. not using `new`) + apply() { + // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. + // This remains so in the 10th edition of 2019 as well. + if (this instanceof ClockDate) { + throw new TypeError( + "A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.", + ); + } + + return new NativeDate(ClockDate.clock.now).toString(); + }, + }); - return target; + return ClockDateProxy; } - //eslint-disable-next-line jsdoc/require-jsdoc - function createDate() { - /** - * @param {number} year - * @param {number} month - * @param {number} date - * @param {number} hour - * @param {number} minute - * @param {number} second - * @param {number} ms - * @returns {Date} + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. */ - function ClockDate(year, month, date, hour, minute, second, ms) { - // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. - // This remains so in the 10th edition of 2019 as well. - if (!(this instanceof ClockDate)) { - return new NativeDate(ClockDate.clock.now).toString(); - } + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); - // if Date is called as a constructor with 'new' keyword - // Defensive and verbose to avoid potential harm in passing - // explicit undefined when user does not pass argument - switch (arguments.length) { - case 0: - return new NativeDate(ClockDate.clock.now); - case 1: - return new NativeDate(year); - case 2: - return new NativeDate(year, month); - case 3: - return new NativeDate(year, month, date); - case 4: - return new NativeDate(year, month, date, hour); - case 5: - return new NativeDate(year, month, date, hour, minute); - case 6: - return new NativeDate( - year, - month, - date, - hour, - minute, - second - ); - default: - return new NativeDate( - year, - month, - date, - hour, - minute, - second, - ms - ); - } - } + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; - return mirrorDateProperties(ClockDate, NativeDate); + return ClockIntl; } //eslint-disable-next-line jsdoc/require-jsdoc @@ -535,7 +597,7 @@ function withGlobal(_global) { throw new TypeError( `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ timer.func - } of type ${typeof timer.func}` + } of type ${typeof timer.func}`, ); } } @@ -818,7 +880,7 @@ function withGlobal(_global) { } warnOnce( `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + - "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`." + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", ); } @@ -835,7 +897,7 @@ function withGlobal(_global) { const clear = getClearHandler(ttype); const schedule = getScheduleHandler(timer.type); throw new Error( - `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()` + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, ); } } @@ -860,7 +922,7 @@ function withGlobal(_global) { } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( clock, - `_${method}` + `_${method}`, ); if ( originalPerfDescriptor && @@ -870,7 +932,7 @@ function withGlobal(_global) { Object.defineProperty( _global, method, - originalPerfDescriptor + originalPerfDescriptor, ); } else if (originalPerfDescriptor.configurable) { _global[method] = clock[`_${method}`]; @@ -886,6 +948,22 @@ function withGlobal(_global) { } } } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } + if (clock.timersPromisesModuleMethods !== undefined) { + for ( + let j = 0; + j < clock.timersPromisesModuleMethods.length; + j++ + ) { + const entry = clock.timersPromisesModuleMethods[j]; + timersPromisesModule[entry.methodName] = entry.original; + } + } } if (config.shouldAdvanceTime === true) { @@ -895,6 +973,11 @@ function withGlobal(_global) { // Prevent multiple executions which will completely remove these props clock.methods = []; + for (const [listener, signal] of clock.abortListenerMap.entries()) { + signal.removeEventListener("abort", listener); + clock.abortListenerMap.delete(listener); + } + // return pending timers, to enable checking what timers remained on uninstall if (!clock.timers) { return []; @@ -912,17 +995,18 @@ function withGlobal(_global) { function hijackMethod(target, method, clock) { clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( target, - method + method, ); clock[`_${method}`] = target[method]; if (method === "Date") { - const date = mirrorDateProperties(clock[method], target[method]); - target[method] = date; + target[method] = clock[method]; + } else if (method === "Intl") { + target[method] = clock[method]; } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( target, - method + method, ); // JSDOM has a read only performance field so we have to save/copy it differently if ( @@ -933,12 +1017,12 @@ function withGlobal(_global) { Object.defineProperty( clock, `_${method}`, - originalPerfDescriptor + originalPerfDescriptor, ); const perfDescriptor = Object.getOwnPropertyDescriptor( clock, - method + method, ); Object.defineProperty(target, method, perfDescriptor); } else { @@ -951,7 +1035,7 @@ function withGlobal(_global) { Object.defineProperties( target[method], - Object.getOwnPropertyDescriptors(clock[method]) + Object.getOwnPropertyDescriptors(clock[method]), ); } @@ -973,6 +1057,7 @@ function withGlobal(_global) { * @property {setInterval} setInterval * @property {clearInterval} clearInterval * @property {Date} Date + * @property {Intl} Intl * @property {SetImmediate=} setImmediate * @property {function(NodeImmediate): void=} clearImmediate * @property {function(number[]):number[]=} hrtime @@ -994,43 +1079,50 @@ function withGlobal(_global) { Date: _global.Date, }; - if (setImmediatePresent) { + if (isPresent.setImmediate) { timers.setImmediate = _global.setImmediate; + } + + if (isPresent.clearImmediate) { timers.clearImmediate = _global.clearImmediate; } - if (hrtimePresent) { + if (isPresent.hrtime) { timers.hrtime = _global.process.hrtime; } - if (nextTickPresent) { + if (isPresent.nextTick) { timers.nextTick = _global.process.nextTick; } - if (performancePresent) { + if (isPresent.performance) { timers.performance = _global.performance; } - if (requestAnimationFramePresent) { + if (isPresent.requestAnimationFrame) { timers.requestAnimationFrame = _global.requestAnimationFrame; } - if (queueMicrotaskPresent) { - timers.queueMicrotask = true; + if (isPresent.queueMicrotask) { + timers.queueMicrotask = _global.queueMicrotask; } - if (cancelAnimationFramePresent) { + if (isPresent.cancelAnimationFrame) { timers.cancelAnimationFrame = _global.cancelAnimationFrame; } - if (requestIdleCallbackPresent) { + if (isPresent.requestIdleCallback) { timers.requestIdleCallback = _global.requestIdleCallback; } - if (cancelIdleCallbackPresent) { + if (isPresent.cancelIdleCallback) { timers.cancelIdleCallback = _global.cancelIdleCallback; } + if (isPresent.Intl) { + timers.Intl = _global.Intl; + } + const originalSetTimeout = _global.setImmediate || _global.setTimeout; /** @@ -1046,13 +1138,6 @@ function withGlobal(_global) { let nanos = 0; const adjustedSystemTime = [0, 0]; // [millis, nanoremainder] - if (NativeDate === undefined) { - throw new Error( - "The global scope doesn't have a `Date` object" + - " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)" - ); - } - const clock = { now: start, Date: createDate(), @@ -1078,7 +1163,7 @@ function withGlobal(_global) { if (Array.isArray(prev)) { if (prev[1] > 1e9) { throw new TypeError( - "Number of nanoseconds can't exceed a billion" + "Number of nanoseconds can't exceed a billion", ); } @@ -1096,22 +1181,38 @@ function withGlobal(_global) { return [secsSinceStart, remainderInNanos]; } + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ function fakePerformanceNow() { const hrt = hrtime(); const millis = hrt[0] * 1000 + hrt[1] / 1e6; return millis; } - if (hrtimeBigintPresent) { + if (isPresent.hrtimeBigint) { hrtime.bigint = function () { const parts = hrtime(); return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]); // eslint-disable-line }; } + if (isPresent.Intl) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + clock.requestIdleCallback = function requestIdleCallback( func, - timeout + timeout, ) { let timeToNextIdlePeriod = 0; @@ -1147,7 +1248,7 @@ function withGlobal(_global) { clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) { return new _global.Promise(function setTimeoutExecutor( - resolve + resolve, ) { addTimer(clock, { func: resolve, @@ -1189,7 +1290,7 @@ function withGlobal(_global) { return clearTimer(clock, timerId, "Interval"); }; - if (setImmediatePresent) { + if (isPresent.setImmediate) { clock.setImmediate = function setImmediate(func) { return addTimer(clock, { func: func, @@ -1208,7 +1309,7 @@ function withGlobal(_global) { args: [arg], immediate: true, }); - } + }, ); }; } @@ -1510,6 +1611,8 @@ function withGlobal(_global) { function doRun() { originalSetTimeout(function () { try { + runJobs(clock); + let numTimers; if (i < clock.loopLimit) { if (!clock.timers) { @@ -1519,7 +1622,7 @@ function withGlobal(_global) { } numTimers = Object.keys( - clock.timers + clock.timers, ).length; if (numTimers === 0) { resetIsNearInfiniteLimit(); @@ -1565,6 +1668,7 @@ function withGlobal(_global) { try { const timer = lastTimer(clock); if (!timer) { + runJobs(clock); resolve(clock.now); } @@ -1625,12 +1729,12 @@ function withGlobal(_global) { clock.tick(ms); }; - if (performancePresent) { + if (isPresent.performance) { clock.performance = Object.create(null); clock.performance.now = fakePerformanceNow; } - if (hrtimePresent) { + if (isPresent.hrtime) { clock.hrtime = hrtime; } @@ -1652,8 +1756,8 @@ function withGlobal(_global) { ) { throw new TypeError( `FakeTimers.install called with ${String( - config - )} install requires an object parameter` + config, + )} install requires an object parameter`, ); } @@ -1661,7 +1765,7 @@ function withGlobal(_global) { // Timers are already faked; this is a problem. // Make the user reset timers before continuing. throw new TypeError( - "Can't install fake timers twice on the same global object." + "Can't install fake timers twice on the same global object.", ); } @@ -1674,7 +1778,21 @@ function withGlobal(_global) { if (config.target) { throw new TypeError( - "config.target is no longer supported. Use `withGlobal(target)` instead." + "config.target is no longer supported. Use `withGlobal(target)` instead.", + ); + } + + /** + * @param {string} timer/object the name of the thing that is not present + * @param timer + */ + function handleMissingTimer(timer) { + if (config.ignoreMissingTimers) { + return; + } + + throw new ReferenceError( + `non-existent timers and/or objects cannot be faked: '${timer}'`, ); } @@ -1686,36 +1804,35 @@ function withGlobal(_global) { return uninstall(clock, config); }; + clock.abortListenerMap = new Map(); + clock.methods = config.toFake || []; if (clock.methods.length === 0) { - // do not fake nextTick by default - GitHub#126 - clock.methods = Object.keys(timers).filter(function (key) { - return key !== "nextTick" && key !== "queueMicrotask"; - }); + clock.methods = Object.keys(timers); } if (config.shouldAdvanceTime === true) { const intervalTick = doIntervalTick.bind( null, clock, - config.advanceTimeDelta + config.advanceTimeDelta, ); const intervalId = _global.setInterval( intervalTick, - config.advanceTimeDelta + config.advanceTimeDelta, ); clock.attachedInterval = intervalId; } if (clock.methods.includes("performance")) { const proto = (() => { - if (hasPerformancePrototype) { - return _global.Performance.prototype; - } if (hasPerformanceConstructorPrototype) { return _global.performance.constructor.prototype; } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } })(); if (proto) { Object.getOwnPropertyNames(proto).forEach(function (name) { @@ -1726,16 +1843,30 @@ function withGlobal(_global) { : NOOP; } }); + // ensure `mark` returns a value that is valid + clock.performance.mark = (name) => + new FakePerformanceEntry(name, "mark", 0, 0); + clock.performance.measure = (name) => + new FakePerformanceEntry(name, "measure", 0, 100); } else if ((config.toFake || []).includes("performance")) { - // user explicitly tried to fake performance when not present - throw new ReferenceError( - "non-existent performance object cannot be faked" - ); + return handleMissingTimer("performance"); } } - + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } + if (_global === globalObject && timersPromisesModule) { + clock.timersPromisesModuleMethods = []; + } for (i = 0, l = clock.methods.length; i < l; i++) { const nameOfMethodToReplace = clock.methods[i]; + + if (!isPresent[nameOfMethodToReplace]) { + handleMissingTimer(nameOfMethodToReplace); + // eslint-disable-next-line + continue; + } + if (nameOfMethodToReplace === "hrtime") { if ( _global.process && @@ -1753,6 +1884,251 @@ function withGlobal(_global) { } else { hijackMethod(_global, nameOfMethodToReplace, clock); } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } + if (clock.timersPromisesModuleMethods !== undefined) { + if (nameOfMethodToReplace === "setTimeout") { + clock.timersPromisesModuleMethods.push({ + methodName: "setTimeout", + original: timersPromisesModule.setTimeout, + }); + + timersPromisesModule.setTimeout = ( + delay, + value, + options = {}, + ) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearTimeout(handle); + reject(options.signal.reason); + }; + + const handle = clock.setTimeout(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }, delay); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setImmediate") { + clock.timersPromisesModuleMethods.push({ + methodName: "setImmediate", + original: timersPromisesModule.setImmediate, + }); + + timersPromisesModule.setImmediate = (value, options = {}) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearImmediate(handle); + reject(options.signal.reason); + }; + + const handle = clock.setImmediate(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setInterval") { + clock.timersPromisesModuleMethods.push({ + methodName: "setInterval", + original: timersPromisesModule.setInterval, + }); + + timersPromisesModule.setInterval = ( + delay, + value, + options = {}, + ) => ({ + [Symbol.asyncIterator]: () => { + const createResolvable = () => { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; + }; + + let done = false; + let hasThrown = false; + let returnCall; + let nextAvailable = 0; + const nextQueue = []; + + const handle = clock.setInterval(() => { + if (nextQueue.length > 0) { + nextQueue.shift().resolve(); + } else { + nextAvailable++; + } + }, delay); + + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + clock.clearInterval(handle); + done = true; + for (const resolvable of nextQueue) { + resolvable.resolve(); + } + }; + + if (options.signal) { + if (options.signal.aborted) { + done = true; + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + + return { + next: async () => { + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + if (nextAvailable > 0) { + nextAvailable--; + return { done: false, value: value }; + } + + const resolvable = createResolvable(); + nextQueue.push(resolvable); + + await resolvable; + + if (returnCall && nextQueue.length === 0) { + returnCall.resolve(); + } + + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + return { done: false, value: value }; + }, + return: async () => { + if (done) { + return { done: true, value: undefined }; + } + + if (nextQueue.length > 0) { + returnCall = createResolvable(); + await returnCall; + } + + clock.clearInterval(handle); + done = true; + + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + return { done: true, value: undefined }; + }, + }; + }, + }); + } + } } return clock; diff --git a/node_modules/@tootallnate/once/LICENSE b/node_modules/@tootallnate/once/LICENSE deleted file mode 100644 index c4c56a2a..00000000 --- a/node_modules/@tootallnate/once/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tootallnate/once/README.md b/node_modules/@tootallnate/once/README.md deleted file mode 100644 index bc980fd4..00000000 --- a/node_modules/@tootallnate/once/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# @tootallnate/once - -### Creates a Promise that waits for a single event - -## Installation - -Install with `npm`: - -```bash -$ npm install @tootallnate/once -``` - -## API - -### once(emitter: EventEmitter, name: string, opts?: OnceOptions): Promise<[...Args]> - -Creates a Promise that waits for event `name` to occur on `emitter`, and resolves -the promise with an array of the values provided to the event handler. If an -`error` event occurs before the event specified by `name`, then the Promise is -rejected with the error argument. - -```typescript -import once from '@tootallnate/once'; -import { EventEmitter } from 'events'; - -const emitter = new EventEmitter(); - -setTimeout(() => { - emitter.emit('foo', 'bar'); -}, 100); - -const [result] = await once(emitter, 'foo'); -console.log({ result }); -// { result: 'bar' } -``` - -#### Promise Strong Typing - -The main feature that this module provides over other "once" implementations is that -the Promise that is returned is _**strongly typed**_ based on the type of `emitter` -and the `name` of the event. Some examples are shown below. - -_The process "exit" event contains a single number for exit code:_ - -```typescript -const [code] = await once(process, 'exit'); -// ^ number -``` -_A child process "exit" event contains either an exit code or a signal:_ - -```typescript -const child = spawn('echo', []); -const [code, signal] = await once(child, 'exit'); -// ^ number | null -// ^ string | null -``` - -_A forked child process "message" event is type `any`, so you can cast the Promise directly:_ - -```typescript -const child = fork('file.js'); - -// With `await` -const [message, _]: [WorkerPayload, unknown] = await once(child, 'message'); - -// With Promise -const messagePromise: Promise<[WorkerPayload, unknown]> = once(child, 'message'); - -// Better yet would be to leave it as `any`, and validate the payload -// at runtime with i.e. `ajv` + `json-schema-to-typescript` -``` - -_If the TypeScript definition does not contain an overload for the specified event name, then the Promise will have type `unknown[]` and your code will need to narrow the result manually:_ - -```typescript -interface CustomEmitter extends EventEmitter { - on(name: 'foo', listener: (a: string, b: number) => void): this; -} - -const emitter: CustomEmitter = new EventEmitter(); - -// "foo" event is a defined overload, so it's properly typed -const fooPromise = once(emitter, 'foo'); -// ^ Promise<[a: string, b: number]> - -// "bar" event in not a defined overload, so it gets `unknown[]` -const barPromise = once(emitter, 'bar'); -// ^ Promise -``` - -### OnceOptions - -- `signal` - `AbortSignal` instance to unbind event handlers before the Promise has been fulfilled. diff --git a/node_modules/@tootallnate/once/dist/index.d.ts b/node_modules/@tootallnate/once/dist/index.d.ts deleted file mode 100644 index 93d02a9a..00000000 --- a/node_modules/@tootallnate/once/dist/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { EventNames, EventListenerParameters, AbortSignal } from './types'; -export interface OnceOptions { - signal?: AbortSignal; -} -export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>; diff --git a/node_modules/@tootallnate/once/dist/index.js b/node_modules/@tootallnate/once/dist/index.js deleted file mode 100644 index ca6385b1..00000000 --- a/node_modules/@tootallnate/once/dist/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function once(emitter, name, { signal } = {}) { - return new Promise((resolve, reject) => { - function cleanup() { - signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); - emitter.removeListener(name, onEvent); - emitter.removeListener('error', onError); - } - function onEvent(...args) { - cleanup(); - resolve(args); - } - function onError(err) { - cleanup(); - reject(err); - } - signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); - emitter.on(name, onEvent); - emitter.on('error', onError); - }); -} -exports.default = once; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tootallnate/once/dist/index.js.map b/node_modules/@tootallnate/once/dist/index.js.map deleted file mode 100644 index 61708ca0..00000000 --- a/node_modules/@tootallnate/once/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAOA,SAAwB,IAAI,CAI3B,OAAgB,EAChB,IAAW,EACX,EAAE,MAAM,KAAkB,EAAE;IAE5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,SAAS,OAAO;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,SAAS,OAAO,CAAC,GAAG,IAAW;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAA+C,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"} \ No newline at end of file diff --git a/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts b/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts deleted file mode 100644 index eb2bbc6c..00000000 --- a/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -export declare type OverloadedParameters = T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; - (...args: infer A20): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 | A20 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; -} ? A1 | A2 | A3 | A4 | A5 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; -} ? A1 | A2 | A3 | A4 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; -} ? A1 | A2 | A3 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; -} ? A1 | A2 : T extends { - (...args: infer A1): any; -} ? A1 : any; diff --git a/node_modules/@tootallnate/once/dist/overloaded-parameters.js b/node_modules/@tootallnate/once/dist/overloaded-parameters.js deleted file mode 100644 index 207186d9..00000000 --- a/node_modules/@tootallnate/once/dist/overloaded-parameters.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=overloaded-parameters.js.map \ No newline at end of file diff --git a/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map b/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map deleted file mode 100644 index 863f146d..00000000 --- a/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overloaded-parameters.js","sourceRoot":"","sources":["../src/overloaded-parameters.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tootallnate/once/dist/types.d.ts b/node_modules/@tootallnate/once/dist/types.d.ts deleted file mode 100644 index 58be8284..00000000 --- a/node_modules/@tootallnate/once/dist/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { OverloadedParameters } from './overloaded-parameters'; -export declare type FirstParameter = T extends [infer R, ...any[]] ? R : never; -export declare type EventListener = F extends [ - T, - infer R, - ...any[] -] ? R : never; -export declare type EventParameters = OverloadedParameters; -export declare type EventNames = FirstParameter>; -export declare type EventListenerParameters> = WithDefault, Event>>, unknown[]>; -export declare type WithDefault = [T] extends [never] ? D : T; -export interface AbortSignal { - addEventListener: (name: string, listener: (...args: any[]) => any) => void; - removeEventListener: (name: string, listener: (...args: any[]) => any) => void; -} diff --git a/node_modules/@tootallnate/once/package.json b/node_modules/@tootallnate/once/package.json deleted file mode 100644 index 69ce947d..00000000 --- a/node_modules/@tootallnate/once/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@tootallnate/once", - "version": "2.0.0", - "description": "Creates a Promise that waits for a single event", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "dist" - ], - "scripts": { - "prebuild": "rimraf dist", - "build": "tsc", - "test": "jest", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/once.git" - }, - "keywords": [], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/once/issues" - }, - "devDependencies": { - "@types/jest": "^27.0.2", - "@types/node": "^12.12.11", - "abort-controller": "^3.0.0", - "jest": "^27.2.1", - "rimraf": "^3.0.0", - "ts-jest": "^27.0.5", - "typescript": "^4.4.3" - }, - "engines": { - "node": ">= 10" - }, - "jest": { - "preset": "ts-jest", - "globals": { - "ts-jest": { - "diagnostics": false, - "isolatedModules": true - } - }, - "verbose": false, - "testEnvironment": "node", - "testMatch": [ - "/test/**/*.test.ts" - ] - } -} diff --git a/node_modules/@types/graceful-fs/LICENSE b/node_modules/@types/graceful-fs/LICENSE deleted file mode 100644 index 9e841e7a..00000000 --- a/node_modules/@types/graceful-fs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/graceful-fs/README.md b/node_modules/@types/graceful-fs/README.md deleted file mode 100644 index b43f9715..00000000 --- a/node_modules/@types/graceful-fs/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Installation -> `npm install --save @types/graceful-fs` - -# Summary -This package contains type definitions for graceful-fs (https://github.com/isaacs/node-graceful-fs). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs/index.d.ts) -````ts -/// - -export * from "fs"; - -/** - * Use this method to patch the global fs module (or any other fs-like module). - * NOTE: This should only ever be done at the top-level application layer, in order to delay on - * EMFILE errors from any fs-using dependencies. You should **not** do this in a library, because - * it can cause unexpected delays in other parts of the program. - * @param fsModule The reference to the fs module or an fs-like module. - */ -export function gracefulify(fsModule: T): T; - -```` - -### Additional Details - * Last updated: Tue, 07 Nov 2023 03:09:37 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node) - -# Credits -These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), and [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/graceful-fs/index.d.ts b/node_modules/@types/graceful-fs/index.d.ts deleted file mode 100644 index 93094f2e..00000000 --- a/node_modules/@types/graceful-fs/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -export * from "fs"; - -/** - * Use this method to patch the global fs module (or any other fs-like module). - * NOTE: This should only ever be done at the top-level application layer, in order to delay on - * EMFILE errors from any fs-using dependencies. You should **not** do this in a library, because - * it can cause unexpected delays in other parts of the program. - * @param fsModule The reference to the fs module or an fs-like module. - */ -export function gracefulify(fsModule: T): T; diff --git a/node_modules/@types/graceful-fs/package.json b/node_modules/@types/graceful-fs/package.json deleted file mode 100644 index b7ab0d08..00000000 --- a/node_modules/@types/graceful-fs/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@types/graceful-fs", - "version": "4.1.9", - "description": "TypeScript definitions for graceful-fs", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs", - "license": "MIT", - "contributors": [ - { - "name": "Bart van der Schoor", - "githubUsername": "Bartvds", - "url": "https://github.com/Bartvds" - }, - { - "name": "BendingBender", - "githubUsername": "BendingBender", - "url": "https://github.com/BendingBender" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/graceful-fs" - }, - "scripts": {}, - "dependencies": { - "@types/node": "*" - }, - "typesPublisherContentHash": "4e85fab24364f5c04bc484efb612d1c679702932e21e6f4f30c297aa14e21b36", - "typeScriptVersion": "4.5" -} \ No newline at end of file diff --git a/node_modules/@types/jsdom/README.md b/node_modules/@types/jsdom/README.md index 707026ec..4e77a980 100644 --- a/node_modules/@types/jsdom/README.md +++ b/node_modules/@types/jsdom/README.md @@ -1,16 +1,15 @@ -# Installation -> `npm install --save @types/jsdom` - -# Summary -This package contains type definitions for jsdom (https://github.com/jsdom/jsdom). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsdom. - -### Additional Details - * Last updated: Mon, 07 Nov 2022 20:33:46 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/parse5](https://npmjs.com/package/@types/parse5), [@types/tough-cookie](https://npmjs.com/package/@types/tough-cookie) - * Global values: none - -# Credits -These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [Johan Palmfjord](https://github.com/palmfjord), and [ExE Boss](https://github.com/ExE-Boss). +# Installation +> `npm install --save @types/jsdom` + +# Summary +This package contains type definitions for jsdom (https://github.com/jsdom/jsdom). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsdom. + +### Additional Details + * Last updated: Thu, 30 May 2024 17:06:56 GMT + * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/tough-cookie](https://npmjs.com/package/@types/tough-cookie), [parse5](https://npmjs.com/package/parse5) + +# Credits +These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [Johan Palmfjord](https://github.com/palmfjord), and [ExE Boss](https://github.com/ExE-Boss). diff --git a/node_modules/@types/jsdom/base.d.ts b/node_modules/@types/jsdom/base.d.ts index 67d7514c..420870f8 100644 --- a/node_modules/@types/jsdom/base.d.ts +++ b/node_modules/@types/jsdom/base.d.ts @@ -4,12 +4,12 @@ import { EventEmitter } from "events"; import { Token } from "parse5"; -import { Context } from "vm"; import * as tough from "tough-cookie"; +import { Context } from "vm"; // Needed to allow adding properties to `DOMWindow` that are only supported // in newer TypeScript versions: -// tslint:disable-next-line: no-declare-current-package no-single-declare-module +// eslint-disable-next-line @definitelytyped/no-declare-current-package declare module "jsdom" { const toughCookie: typeof tough; class CookieJar extends tough.CookieJar {} @@ -144,7 +144,7 @@ declare module "jsdom" { * contentType affects the value read from document.contentType, and how the document is parsed: as HTML or as XML. * Values that are not "text/html" or an XML mime type will throw. It defaults to "text/html". */ - contentType?: SupportedContentTypes | undefined; + contentType?: string | undefined; /** * The maximum size in code units for the separate storage areas used by localStorage and sessionStorage. @@ -156,7 +156,12 @@ declare module "jsdom" { storageQuota?: number | undefined; } - type SupportedContentTypes = 'text/html' | 'application/xhtml+xml' | 'application/xml' | 'text/xml' | 'image/svg+xml'; + type SupportedContentTypes = + | "text/html" + | "application/xhtml+xml" + | "application/xml" + | "text/xml" + | "image/svg+xml"; interface VirtualConsoleSendToOptions { omitJSDOMErrors: boolean; diff --git a/node_modules/@types/jsdom/index.d.ts b/node_modules/@types/jsdom/index.d.ts index 99bf6d4f..9c93042d 100644 --- a/node_modules/@types/jsdom/index.d.ts +++ b/node_modules/@types/jsdom/index.d.ts @@ -1,14 +1,6 @@ -// Type definitions for jsdom 20.0 -// Project: https://github.com/jsdom/jsdom -// Definitions by: Leonard Thieu -// Johan Palmfjord -// ExE Boss -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Minimum TypeScript Version: 4.5 - /// -// tslint:disable-next-line: no-declare-current-package no-single-declare-module +// eslint-disable-next-line @definitelytyped/no-declare-current-package declare module "jsdom" { interface DOMWindow { FinalizationRegistry: FinalizationRegistryConstructor; @@ -20,7 +12,7 @@ declare module "jsdom" { // Necessary to avoid breaking dependents because of the dependency // on the `ESNext.WeakRef` lib: -// tslint:disable-next-line: no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface FinalizationRegistryConstructor {} -// tslint:disable-next-line: no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface WeakRefConstructor {} diff --git a/node_modules/@types/jsdom/package.json b/node_modules/@types/jsdom/package.json index e1f9aa38..9d16f61b 100644 --- a/node_modules/@types/jsdom/package.json +++ b/node_modules/@types/jsdom/package.json @@ -1,28 +1,34 @@ { "name": "@types/jsdom", - "version": "20.0.1", + "version": "21.1.7", "description": "TypeScript definitions for jsdom", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsdom", "license": "MIT", "contributors": [ { "name": "Leonard Thieu", - "url": "https://github.com/leonard-thieu", - "githubUsername": "leonard-thieu" + "githubUsername": "leonard-thieu", + "url": "https://github.com/leonard-thieu" }, { "name": "Johan Palmfjord", - "url": "https://github.com/palmfjord", - "githubUsername": "palmfjord" + "githubUsername": "palmfjord", + "url": "https://github.com/palmfjord" }, { "name": "ExE Boss", - "url": "https://github.com/ExE-Boss", - "githubUsername": "ExE-Boss" + "githubUsername": "ExE-Boss", + "url": "https://github.com/ExE-Boss" } ], "main": "", "types": "index.d.ts", + "exports": { + ".": { + "types": "./index.d.ts" + }, + "./package.json": "./package.json" + }, "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", @@ -34,12 +40,6 @@ "@types/tough-cookie": "*", "parse5": "^7.0.0" }, - "typesPublisherContentHash": "91b555382b6af4d833822849e1e5a6aa4ffd52a22666c65e2917bf76520f1326", - "typeScriptVersion": "4.5", - "exports": { - ".": { - "types": "./index.d.ts" - }, - "./package.json": "./package.json" - } + "typesPublisherContentHash": "ff2b3302adf7f1ae40db6101f0c6d5f7ba972ee3864ae371e975f9545d93d8bb", + "typeScriptVersion": "4.7" } \ No newline at end of file diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index b424c40a..3ecaaae6 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Tue, 11 Nov 2025 23:33:13 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig). +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for node (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Tue, 16 Dec 2025 21:35:18 GMT + * Dependencies: [undici-types](https://npmjs.com/package/undici-types) + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts index cd6d6df9..ef4d852d 100644 --- a/node_modules/@types/node/assert.d.ts +++ b/node_modules/@types/node/assert.d.ts @@ -1,10 +1,10 @@ /** * The `node:assert` module provides a set of assertion functions for verifying * invariants. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/assert.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js) */ -declare module "assert" { - import strict = require("assert/strict"); +declare module "node:assert" { + import strict = require("node:assert/strict"); /** * An alias of {@link assert.ok}. * @since v0.5.9 @@ -182,154 +182,6 @@ declare module "assert" { */ operator: string; } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return A function that wraps `fn`. - */ - calls(exact?: number): () => void; - calls(fn: undefined, exact?: number): () => void; - calls any>(fn: Func, exact?: number): Func; - calls any>(fn?: Func, exact?: number): Func | (() => void); - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @return An array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; /** * Throws an `AssertionError` with the provided error message or a default @@ -348,22 +200,10 @@ declare module "assert" { * assert.fail(new TypeError('need array')); * // TypeError: need array * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. * @since v0.1.21 * @param [message='Failed'] */ function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - stackStartFn?: Function, - ): never; /** * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. * @@ -931,7 +771,7 @@ declare module "assert" { * check that the promise is rejected. * * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v24.x/api/errors.html#err_invalid_return_value) + * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) * error. In both cases the error handler is skipped. * * Besides the async nature to await the completion behaves identically to {@link throws}. @@ -1001,7 +841,7 @@ declare module "assert" { * * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v24.x/api/errors.html#err_invalid_return_value) error. In both cases + * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) error. In both cases * the error handler is skipped. * * Using `assert.doesNotReject()` is actually not useful because there is little @@ -1064,7 +904,7 @@ declare module "assert" { * If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal * to the value of the `message` parameter. If the `message` parameter is * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. + * instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. * @since v13.6.0, v12.16.0 */ function match(value: string, regExp: RegExp, message?: string | Error): void; @@ -1087,7 +927,7 @@ declare module "assert" { * If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal * to the value of the `message` parameter. If the `message` parameter is * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. + * instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. * @since v13.6.0, v12.16.0 */ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; @@ -1109,7 +949,7 @@ declare module "assert" { } export = assert; } -declare module "node:assert" { - import assert = require("assert"); +declare module "assert" { + import assert = require("node:assert"); export = assert; } diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts index 4ed7395a..51bb3520 100644 --- a/node_modules/@types/node/assert/strict.d.ts +++ b/node_modules/@types/node/assert/strict.d.ts @@ -40,11 +40,11 @@ * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` * environment variables. This will also deactivate the colors in the REPL. For * more on color support in terminal environments, read the tty - * [`getColorDepth()`](https://nodejs.org/docs/latest-v24.x/api/tty.html#writestreamgetcolordepthenv) documentation. + * [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation. * @since v15.0.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/assert/strict.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js) */ -declare module "assert/strict" { +declare module "node:assert/strict" { import { Assert, AssertionError, @@ -52,9 +52,6 @@ declare module "assert/strict" { AssertOptions, AssertPredicate, AssertStrict, - CallTracker, - CallTrackerCall, - CallTrackerReportInformation, deepStrictEqual, doesNotMatch, doesNotReject, @@ -79,9 +76,6 @@ declare module "assert/strict" { AssertOptions, AssertPredicate, AssertStrict, - CallTracker, - CallTrackerCall, - CallTrackerReportInformation, deepStrictEqual, deepStrictEqual as deepEqual, doesNotMatch, @@ -105,7 +99,7 @@ declare module "assert/strict" { } export = strict; } -declare module "node:assert/strict" { - import strict = require("assert/strict"); +declare module "assert/strict" { + import strict = require("node:assert/strict"); export = strict; } diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts index 2377689f..aa692c10 100644 --- a/node_modules/@types/node/async_hooks.d.ts +++ b/node_modules/@types/node/async_hooks.d.ts @@ -2,8 +2,8 @@ * We strongly discourage the use of the `async_hooks` API. * Other APIs that can cover most of its use cases include: * - * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v24.x/api/async_context.html#class-asynclocalstorage) tracks async context - * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processgetactiveresourcesinfo) tracks active resources + * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context + * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources * * The `node:async_hooks` module provides an API to track asynchronous resources. * It can be accessed using: @@ -12,9 +12,9 @@ * import async_hooks from 'node:async_hooks'; * ``` * @experimental - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/async_hooks.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js) */ -declare module "async_hooks" { +declare module "node:async_hooks" { /** * ```js * import { executionAsyncId } from 'node:async_hooks'; @@ -44,7 +44,7 @@ declare module "async_hooks" { * ``` * * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking). + * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking). * @since v8.1.0 * @return The `asyncId` of the current execution context. Useful to track when something calls. */ @@ -117,7 +117,7 @@ declare module "async_hooks" { * ``` * * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking). + * the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking). * @return The ID of the resource responsible for calling the callback that is currently being executed. */ function triggerAsyncId(): number; @@ -618,6 +618,6 @@ declare module "async_hooks" { const VERIFYREQUEST: number; } } -declare module "node:async_hooks" { - export * from "async_hooks"; +declare module "async_hooks" { + export * from "node:async_hooks"; } diff --git a/node_modules/@types/node/buffer.buffer.d.ts b/node_modules/@types/node/buffer.buffer.d.ts index 8823deeb..a3c23046 100644 --- a/node_modules/@types/node/buffer.buffer.d.ts +++ b/node_modules/@types/node/buffer.buffer.d.ts @@ -1,4 +1,4 @@ -declare module "buffer" { +declare module "node:buffer" { type ImplicitArrayBuffer> = T extends { valueOf(): infer V extends ArrayBufferLike } ? V : T; global { @@ -463,10 +463,4 @@ declare module "buffer" { */ type AllowSharedBuffer = Buffer; } - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - var SlowBuffer: { - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - new(size: number): Buffer; - prototype: Buffer; - }; } diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts index 9a62ccf9..bb0f0044 100644 --- a/node_modules/@types/node/buffer.d.ts +++ b/node_modules/@types/node/buffer.d.ts @@ -1,8 +1,3 @@ -// If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types. -// Otherwise, use the types from node. -type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob; -type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File; - /** * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many * Node.js APIs support `Buffer`s. @@ -46,11 +41,10 @@ type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : impo * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. * const buf7 = Buffer.from('tést', 'latin1'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/buffer.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js) */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; +declare module "node:buffer" { + import { ReadableStream } from "node:stream/web"; /** * This function returns `true` if `input` contains only valid UTF-8-encoded data, * including the case in which `input` is empty. @@ -126,115 +120,11 @@ declare module "buffer" { */ export function resolveObjectURL(id: string): Blob | undefined; export { type AllowSharedBuffer, Buffer, type NonSharedBuffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts - * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`. - */ - endings?: "transparent" | "native"; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A `Blob` encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. - * - * ```js - * const blob = new Blob(['hello']); - * blob.bytes().then((bytes) => { - * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] - * }); - * ``` - */ - bytes(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; + /** @deprecated This alias will be removed in a future version. Use the canonical `BlobPropertyBag` instead. */ + // TODO: remove in future major + export interface BlobOptions extends BlobPropertyBag {} + /** @deprecated This alias will be removed in a future version. Use the canonical `FilePropertyBag` instead. */ + export interface FileOptions extends FilePropertyBag {} export type WithImplicitCoercion = | T | { valueOf(): T } @@ -1879,56 +1769,42 @@ declare module "buffer" { includes(value: string | number | Buffer, encoding: BufferEncoding): boolean; } var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends _Blob {} - /** - * `Blob` class is a global reference for `import { Blob } from 'node:buffer'` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T - : typeof import("buffer").Blob; - interface File extends _File {} - /** - * `File` class is a global reference for `import { File } from 'node:buffer'` - * https://nodejs.org/api/buffer.html#class-file - * @since v20.0.0 - */ - var File: typeof globalThis extends { onmessage: any; File: infer T } ? T - : typeof import("buffer").File; } + // #region web types + export type BlobPart = NodeJS.BufferSource | Blob | string; + export interface BlobPropertyBag { + endings?: "native" | "transparent"; + type?: string; + } + export interface FilePropertyBag extends BlobPropertyBag { + lastModified?: number; + } + export interface Blob { + readonly size: number; + readonly type: string; + arrayBuffer(): Promise; + bytes(): Promise; + slice(start?: number, end?: number, contentType?: string): Blob; + stream(): ReadableStream; + text(): Promise; + } + export var Blob: { + prototype: Blob; + new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; + }; + export interface File extends Blob { + readonly lastModified: number; + readonly name: string; + readonly webkitRelativePath: string; + } + export var File: { + prototype: File; + new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; + }; + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + // #endregion } -declare module "node:buffer" { - export * from "buffer"; +declare module "buffer" { + export * from "node:buffer"; } diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts index ecad7d8e..e546fe6e 100644 --- a/node_modules/@types/node/child_process.d.ts +++ b/node_modules/@types/node/child_process.d.ts @@ -63,17 +63,25 @@ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, * the synchronous methods can have significant impact on performance due to * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/child_process.js) */ -declare module "child_process" { +declare module "node:child_process" { import { NonSharedBuffer } from "node:buffer"; - import { Abortable, EventEmitter } from "node:events"; import * as dgram from "node:dgram"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; import * as net from "node:net"; import { Readable, Stream, Writable } from "node:stream"; import { URL } from "node:url"; type Serializable = string | object | number | boolean | bigint; type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; + interface ChildProcessEventMap { + "close": [code: number | null, signal: NodeJS.Signals | null]; + "disconnect": []; + "error": [err: Error]; + "exit": [code: number | null, signal: NodeJS.Signals | null]; + "message": [message: Serializable, sendHandle: SendHandle]; + "spawn": []; + } /** * Instances of the `ChildProcess` represent spawned child processes. * @@ -82,7 +90,7 @@ declare module "child_process" { * instances of `ChildProcess`. * @since v2.2.0 */ - class ChildProcess extends EventEmitter { + class ChildProcess implements EventEmitter { /** * A `Writable Stream` that represents the child process's `stdin`. * @@ -458,7 +466,7 @@ declare module "child_process" { * as the connection may have been closed during the time it takes to send the * connection to the child. * @since v0.5.9 - * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v24.x/api/dgram.html#class-dgramsocket) object. + * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v25.x/api/dgram.html#class-dgramsocket) object. * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: */ send(message: Serializable, callback?: (error: Error | null) => void): boolean; @@ -524,64 +532,8 @@ declare module "child_process" { * @since v0.7.10 */ ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; } + interface ChildProcess extends InternalEventEmitter {} // return this object when stdio option is undefined or not specified interface ChildProcessWithoutNullStreams extends ChildProcess { stdin: Writable; @@ -1471,6 +1423,6 @@ declare module "child_process" { options?: ExecFileSyncOptions, ): string | NonSharedBuffer; } -declare module "node:child_process" { - export * from "child_process"; +declare module "child_process" { + export * from "node:child_process"; } diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts index cdbc2190..4e5efbfb 100644 --- a/node_modules/@types/node/cluster.d.ts +++ b/node_modules/@types/node/cluster.d.ts @@ -1,7 +1,7 @@ /** * Clusters of Node.js processes can be used to run multiple instances of Node.js * that can distribute workloads among their application threads. When process isolation - * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html) + * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html) * module instead, which allows running multiple application threads within a single Node.js instance. * * The cluster module allows easy creation of child processes that all share @@ -50,90 +50,13 @@ * ``` * * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/cluster.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/cluster.js) */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - /** - * List of string arguments passed to the Node.js executable. - * @default process.execArgv - */ - execArgv?: string[] | undefined; - /** - * File path to worker file. - * @default process.argv[1] - */ - exec?: string | undefined; - /** - * String arguments passed to worker. - * @default process.argv.slice(2) - */ - args?: readonly string[] | undefined; - /** - * Whether or not to send output to parent's stdio. - * @default false - */ - silent?: boolean | undefined; - /** - * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must - * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processspawncommand-args-options)'s - * [`stdio`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#optionsstdio). - */ - stdio?: any[] | undefined; - /** - * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) - */ - uid?: number | undefined; - /** - * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) - */ - gid?: number | undefined; - /** - * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. - * By default each worker gets its own port, incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. - * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#advanced-serialization) for more details. - * @default false - */ - serialization?: SerializationType | undefined; - /** - * Current working directory of the worker process. - * @default undefined (inherits from parent process) - */ - cwd?: string | undefined; - /** - * Hide the forked processes console window that would normally be created on Windows systems. - * @default false - */ - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - /** - * The `addressType` is one of: - * - * * `4` (TCPv4) - * * `6` (TCPv6) - * * `-1` (Unix domain socket) - * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) - */ - addressType: 4 | 6 | -1 | "udp4" | "udp6"; - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { +declare module "node:cluster" { + import * as child_process from "node:child_process"; + import { EventEmitter, InternalEventEmitter } from "node:events"; + class Worker implements EventEmitter { + constructor(options?: cluster.WorkerOptions); /** * Each new worker is given its own unique id, this id is stored in the `id`. * @@ -142,21 +65,21 @@ declare module "cluster" { */ id: number; /** - * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object + * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object * from this function is stored as `.process`. In a worker, the global `process` is stored. * - * See: [Child Process module](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options). + * See: [Child Process module](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processforkmodulepath-args-options). * * Workers will call `process.exit(0)` if the `'disconnect'` event occurs * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against * accidental disconnection. * @since v0.7.0 */ - process: child.ChildProcess; + process: child_process.ChildProcess; /** * Send a message to a worker or primary, optionally with a handle. * - * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). + * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). * * In a worker, this sends a message to the primary. It is identical to `process.send()`. * @@ -176,16 +99,16 @@ declare module "cluster" { * @since v0.7.0 * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; + send(message: child_process.Serializable, callback?: (error: Error | null) => void): boolean; send( - message: child.Serializable, - sendHandle: child.SendHandle, + message: child_process.Serializable, + sendHandle: child_process.SendHandle, callback?: (error: Error | null) => void, ): boolean; send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, + message: child_process.Serializable, + sendHandle: child_process.SendHandle, + options?: child_process.MessageOptions, callback?: (error: Error | null) => void, ): boolean; /** @@ -198,7 +121,7 @@ declare module "cluster" { * This method is aliased as `worker.destroy()` for backwards compatibility. * * In a worker, `process.kill()` exists, but it is not this function; - * it is [`kill()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processkillpid-signal). + * it is [`kill()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processkillpid-signal). * @since v0.9.12 * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. */ @@ -335,244 +258,229 @@ declare module "cluster" { * @since v6.0.0 */ exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - /** - * Spawn a new worker process. - * - * This can only be called from the primary process. - * @param env Key/value pairs to add to worker process environment. - * @since v0.6.0 - */ - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - /** - * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` - * is undefined, then `isPrimary` is `true`. - * @since v16.0.0 - */ - readonly isPrimary: boolean; - /** - * True if the process is not a primary (it is the negation of `cluster.isPrimary`). - * @since v0.6.0 - */ - readonly isWorker: boolean; - /** - * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a - * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings) - * is called, whichever comes first. - * - * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute - * IOCP handles without incurring a large performance hit. - * - * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. - * @since v0.11.2 - */ - schedulingPolicy: number; - /** - * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings) - * (or [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv)) this settings object will contain - * the settings, including the default values. - * - * This object is not intended to be changed or set manually. - * @since v0.7.1 - */ - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings) instead. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. - * - * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv) - * and have no effect on workers that are already running. - * - * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to - * [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv). - * - * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of - * `cluster.setupPrimary()` is called. - * - * ```js - * import cluster from 'node:cluster'; - * - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'https'], - * silent: true, - * }); - * cluster.fork(); // https worker - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'http'], - * }); - * cluster.fork(); // http worker - * ``` - * - * This can only be called from the primary process. - * @since v16.0.0 - */ - setupPrimary(settings?: ClusterSettings): void; - /** - * A reference to the current worker object. Not available in the primary process. - * - * ```js - * import cluster from 'node:cluster'; - * - * if (cluster.isPrimary) { - * console.log('I am primary'); - * cluster.fork(); - * cluster.fork(); - * } else if (cluster.isWorker) { - * console.log(`I am worker #${cluster.worker.id}`); - * } - * ``` - * @since v0.7.0 - */ - readonly worker?: Worker; - /** - * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. - * - * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it - * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. - * - * ```js - * import cluster from 'node:cluster'; - * - * for (const worker of Object.values(cluster.workers)) { - * worker.send('big announcement to all workers'); - * } - * ``` - * @since v0.7.0 - */ - readonly workers?: NodeJS.Dict; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + interface Worker extends InternalEventEmitter {} + type _Worker = Worker; + namespace cluster { + interface Worker extends _Worker {} + interface WorkerOptions { + id?: number | undefined; + process?: child_process.ChildProcess | undefined; + state?: string | undefined; + } + interface WorkerEventMap { + "disconnect": []; + "error": [error: Error]; + "exit": [code: number, signal: string]; + "listening": [address: Address]; + "message": [message: any, handle: child_process.SendHandle]; + "online": []; + } + interface ClusterSettings { + /** + * List of string arguments passed to the Node.js executable. + * @default process.execArgv + */ + execArgv?: string[] | undefined; + /** + * File path to worker file. + * @default process.argv[1] + */ + exec?: string | undefined; + /** + * String arguments passed to worker. + * @default process.argv.slice(2) + */ + args?: readonly string[] | undefined; + /** + * Whether or not to send output to parent's stdio. + * @default false + */ + silent?: boolean | undefined; + /** + * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must + * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#child_processspawncommand-args-options)'s + * [`stdio`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#optionsstdio). + */ + stdio?: any[] | undefined; + /** + * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) + */ + uid?: number | undefined; + /** + * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) + */ + gid?: number | undefined; + /** + * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. + * By default each worker gets its own port, incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + /** + * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. + * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v25.x/api/child_process.html#advanced-serialization) for more details. + * @default false + */ + serialization?: "json" | "advanced" | undefined; + /** + * Current working directory of the worker process. + * @default undefined (inherits from parent process) + */ + cwd?: string | undefined; + /** + * Hide the forked processes console window that would normally be created on Windows systems. + * @default false + */ + windowsHide?: boolean | undefined; + } + interface Address { + address: string; + port: number; + /** + * The `addressType` is one of: + * + * * `4` (TCPv4) + * * `6` (TCPv6) + * * `-1` (Unix domain socket) + * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) + */ + addressType: 4 | 6 | -1 | "udp4" | "udp6"; + } + interface ClusterEventMap { + "disconnect": [worker: Worker]; + "exit": [worker: Worker, code: number, signal: string]; + "fork": [worker: Worker]; + "listening": [worker: Worker, address: Address]; + "message": [worker: Worker, message: any, handle: child_process.SendHandle]; + "online": [worker: Worker]; + "setup": [settings: ClusterSettings]; + } + interface Cluster extends InternalEventEmitter { + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + Worker: typeof Worker; + disconnect(callback?: () => void): void; + /** + * Spawn a new worker process. + * + * This can only be called from the primary process. + * @param env Key/value pairs to add to worker process environment. + * @since v0.6.0 + */ + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + /** + * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` + * is undefined, then `isPrimary` is `true`. + * @since v16.0.0 + */ + readonly isPrimary: boolean; + /** + * True if the process is not a primary (it is the negation of `cluster.isPrimary`). + * @since v0.6.0 + */ + readonly isWorker: boolean; + /** + * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a + * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) + * is called, whichever comes first. + * + * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute + * IOCP handles without incurring a large performance hit. + * + * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. + * @since v0.11.2 + */ + schedulingPolicy: number; + /** + * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) + * (or [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv)) this settings object will contain + * the settings, including the default values. + * + * This object is not intended to be changed or set manually. + * @since v0.7.1 + */ + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clustersetupprimarysettings) instead. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. + * + * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv) + * and have no effect on workers that are already running. + * + * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to + * [`.fork()`](https://nodejs.org/docs/latest-v25.x/api/cluster.html#clusterforkenv). + * + * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of + * `cluster.setupPrimary()` is called. + * + * ```js + * import cluster from 'node:cluster'; + * + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'https'], + * silent: true, + * }); + * cluster.fork(); // https worker + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'http'], + * }); + * cluster.fork(); // http worker + * ``` + * + * This can only be called from the primary process. + * @since v16.0.0 + */ + setupPrimary(settings?: ClusterSettings): void; + /** + * A reference to the current worker object. Not available in the primary process. + * + * ```js + * import cluster from 'node:cluster'; + * + * if (cluster.isPrimary) { + * console.log('I am primary'); + * cluster.fork(); + * cluster.fork(); + * } else if (cluster.isWorker) { + * console.log(`I am worker #${cluster.worker.id}`); + * } + * ``` + * @since v0.7.0 + */ + readonly worker?: Worker; + /** + * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. + * + * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it + * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. + * + * ```js + * import cluster from 'node:cluster'; + * + * for (const worker of Object.values(cluster.workers)) { + * worker.send('big announcement to all workers'); + * } + * ``` + * @since v0.7.0 + */ + readonly workers?: NodeJS.Dict; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + } } - const cluster: Cluster; - export default cluster; + var cluster: cluster.Cluster; + export = cluster; } -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; +declare module "cluster" { + import cluster = require("node:cluster"); + export = cluster; } diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts index 3c8a6825..39434421 100644 --- a/node_modules/@types/node/console.d.ts +++ b/node_modules/@types/node/console.d.ts @@ -5,12 +5,12 @@ * The module exports two specific components: * * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. + * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) and + * [`process.stderr`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. * * _**Warning**_: The global console object's methods are neither consistently * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for + * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v25.x/api/process.html#a-note-on-process-io) for * more information. * * Example using the global `console`: @@ -54,276 +54,63 @@ * myConsole.warn(`Danger ${name}! Danger!`); * // Prints: Danger Will Robinson! Danger!, to err * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/console.js) */ -declare module "console" { - import console = require("node:console"); - export = console; -} declare module "node:console" { import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; + namespace console { + interface ConsoleOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using - * [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args). - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. + * Ignore errors when writing to the underlying streams. + * @default true */ - assert(value: any, message?: string, ...optionalParams: any[]): void; + ignoreErrors?: boolean | undefined; /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 + * Set color support for this `Console` instance. Setting to true enables coloring while inspecting + * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color + * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the + * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. + * @default 'auto' */ - clear(): void; + colorMode?: boolean | "auto" | undefined; /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. + * Specifies options that are passed along to + * [`util.inspect()`](https://nodejs.org/docs/latest-v25.x/api/util.html#utilinspectobject-options). */ - count(label?: string): void; + inspectOptions?: InspectOptions | ReadonlyMap | undefined; /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. + * Set group indentation. + * @default 2 */ + groupIndentation?: number | undefined; + } + interface Console { + readonly Console: { + prototype: Console; + new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new(options: ConsoleOptions): Console; + }; + assert(condition?: unknown, ...data: any[]): void; + clear(): void; + count(label?: string): void; countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ + debug(...data: any[]): void; + dir(item?: any, options?: InspectOptions): void; dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then - * [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the - * resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) - * for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation` length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation` length. - * @since v8.5.0 - */ + error(...data: any[]): void; + group(...data: any[]): void; + groupCollapsed(...data: any[]): void; groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ + info(...data: any[]): void; + log(...data: any[]): void; + table(tabularData?: any, properties?: string[]): void; time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) - * formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- + trace(...data: any[]): void; + warn(...data: any[]): void; /** * This method does not display anything unless used in the inspector. The `console.profile()` * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} @@ -354,100 +141,11 @@ declare module "node:console" { */ timeStamp(label?: string): void; } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - /** - * Ignore errors when writing to the underlying streams. - * @default true - */ - ignoreErrors?: boolean | undefined; - /** - * Set color support for this `Console` instance. Setting to true enables coloring while inspecting - * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color - * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the - * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. - * @default auto - */ - colorMode?: boolean | "auto" | undefined; - /** - * Specifies options that are passed along to - * `util.inspect()`. Can be an options object or, if different options - * for stdout and stderr are desired, a `Map` from stream objects to options. - */ - inspectOptions?: InspectOptions | ReadonlyMap | undefined; - /** - * Set group indentation. - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; } - export = globalThis.console; + var console: console.Console; + export = console; +} +declare module "console" { + import console = require("node:console"); + export = console; } diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts index 5685a9df..c24ad989 100644 --- a/node_modules/@types/node/constants.d.ts +++ b/node_modules/@types/node/constants.d.ts @@ -4,7 +4,7 @@ * to the `constants` property exposed by the relevant module. For instance, * `require('node:fs').constants` and `require('node:os').constants`. */ -declare module "constants" { +declare module "node:constants" { const constants: & typeof import("node:os").constants.dlopen & typeof import("node:os").constants.errno @@ -14,8 +14,7 @@ declare module "constants" { & typeof import("node:crypto").constants; export = constants; } - -declare module "node:constants" { - import constants = require("constants"); +declare module "constants" { + import constants = require("node:constants"); export = constants; } diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts index d975cafc..0ae42e45 100644 --- a/node_modules/@types/node/crypto.d.ts +++ b/node_modules/@types/node/crypto.d.ts @@ -14,9 +14,9 @@ * // Prints: * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/crypto.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/crypto.js) */ -declare module "crypto" { +declare module "node:crypto" { import { NonSharedBuffer } from "node:buffer"; import * as stream from "node:stream"; import { PeerCertificate } from "node:tls"; @@ -97,7 +97,7 @@ declare module "crypto" { verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; } namespace constants { - // https://nodejs.org/dist/latest-v24.x/docs/api/crypto.html#crypto-constants + // https://nodejs.org/dist/latest-v25.x/docs/api/crypto.html#crypto-constants const OPENSSL_VERSION_NUMBER: number; /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ const SSL_OP_ALL: number; @@ -471,7 +471,6 @@ declare module "crypto" { * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e * ``` * @since v0.1.94 - * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances. */ class Hmac extends stream.Transform { private constructor(); @@ -500,32 +499,66 @@ declare module "crypto" { digest(): NonSharedBuffer; digest(encoding: BinaryToTextEncoding): string; } + type KeyFormat = "pem" | "der" | "jwk"; type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; + type PublicKeyExportType = "pkcs1" | "spki"; + type PrivateKeyExportType = "pkcs1" | "pkcs8" | "sec1"; + type KeyExportOptions = + | SymmetricKeyExportOptions + | PublicKeyExportOptions + | PrivateKeyExportOptions + | JwkKeyExportOptions; + interface SymmetricKeyExportOptions { + format?: "buffer" | undefined; + } + interface PublicKeyExportOptions { + type: T; + format: Exclude; + } + interface PrivateKeyExportOptions { + type: T; + format: Exclude; cipher?: string | undefined; passphrase?: string | Buffer | undefined; } interface JwkKeyExportOptions { format: "jwk"; } - interface JsonWebKey { - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - k?: string; - kty?: string; - n?: string; - p?: string; - q?: string; - qi?: string; - x?: string; - y?: string; - [key: string]: unknown; - } + interface KeyPairExportOptions< + TPublic extends PublicKeyExportType = PublicKeyExportType, + TPrivate extends PrivateKeyExportType = PrivateKeyExportType, + > { + publicKeyEncoding?: PublicKeyExportOptions | JwkKeyExportOptions | undefined; + privateKeyEncoding?: PrivateKeyExportOptions | JwkKeyExportOptions | undefined; + } + type KeyExportResult = T extends { format: infer F extends KeyFormat } + ? { der: NonSharedBuffer; jwk: webcrypto.JsonWebKey; pem: string }[F] + : Default; + interface KeyPairExportResult { + publicKey: KeyExportResult; + privateKey: KeyExportResult; + } + type KeyPairExportCallback = ( + err: Error | null, + publicKey: KeyExportResult, + privateKey: KeyExportResult, + ) => void; + type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`; + type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`; + type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`; + type AsymmetricKeyType = + | "dh" + | "dsa" + | "ec" + | "ed25519" + | "ed448" + | MLDSAKeyType + | MLKEMKeyType + | "rsa-pss" + | "rsa" + | SLHDSAKeyType + | "x25519" + | "x448"; interface AsymmetricKeyDetails { /** * Key size in bits (RSA, DSA). @@ -593,13 +626,13 @@ declare module "crypto" { static from(key: webcrypto.CryptoKey): KeyObject; /** * For asymmetric keys, this property represents the type of the key. See the - * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types). + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). * * This property is `undefined` for unrecognized `KeyObject` types and symmetric * keys. * @since v11.6.0 */ - asymmetricKeyType?: KeyType; + asymmetricKeyType?: AsymmetricKeyType; /** * This property exists only on asymmetric keys. Depending on the type of the key, * this object contains information about the key. None of the information obtained @@ -637,9 +670,7 @@ declare module "crypto" { * PKCS#1 and SEC1 encryption. * @since v11.6.0 */ - export(options: KeyExportOptions<"pem">): string | NonSharedBuffer; - export(options?: KeyExportOptions<"der">): NonSharedBuffer; - export(options?: JwkKeyExportOptions): JsonWebKey; + export(options?: T): KeyExportResult; /** * Returns `true` or `false` depending on whether the keys have exactly the same * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). @@ -1204,14 +1235,14 @@ declare module "crypto" { interface PrivateKeyInput { key: string | Buffer; format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; + type?: PrivateKeyExportType | undefined; passphrase?: string | Buffer | undefined; encoding?: string | undefined; } interface PublicKeyInput { key: string | Buffer; format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; + type?: PublicKeyExportType | undefined; encoding?: string | undefined; } /** @@ -1264,7 +1295,7 @@ declare module "crypto" { }, ): KeyObject; interface JsonWebKeyInput { - key: JsonWebKey; + key: webcrypto.JsonWebKey; format: "jwk"; } /** @@ -2468,96 +2499,27 @@ declare module "crypto" { * @since v6.6.0 */ function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = - | "dh" - | "dsa" - | "ec" - | "ed25519" - | "ed448" - | "ml-dsa-44" - | "ml-dsa-65" - | "ml-dsa-87" - | "ml-kem-1024" - | "ml-kem-512" - | "ml-kem-768" - | "rsa-pss" - | "rsa" - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s" - | "x25519" - | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface MLDSAKeyPairKeyObjectOptions {} - interface MLKEMKeyPairKeyObjectOptions {} - interface SLHDSAKeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { + interface DHKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { /** - * Name of the curve to use + * The prime parameter */ - namedCurve: string; + prime?: Buffer | undefined; /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. + * Prime length in bits */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { + primeLength?: number | undefined; /** - * Key size in bits + * Custom generator + * @default 2 */ - modulusLength: number; + generator?: number | undefined; /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest + * Diffie-Hellman group name + * @see {@link getDiffieHellman} */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes - */ - saltLength?: string | undefined; + groupName?: string | undefined; } - interface DSAKeyPairKeyObjectOptions { + interface DSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { /** * Key size in bits */ @@ -2567,25 +2529,22 @@ declare module "crypto" { */ divisorLength: number; } - interface RSAKeyPairOptions { + interface ECKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8" | "sec1"> { /** - * Key size in bits + * Name of the curve to use */ - modulusLength: number; + namedCurve: string; /** - * Public exponent - * @default 0x10001 + * Must be `'named'` or `'explicit'` + * @default 'named' */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; + paramEncoding?: "explicit" | "named" | undefined; } - interface RSAPSSKeyPairOptions { + interface ED25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface ED448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface MLDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface MLKEMKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface RSAPSSKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> { /** * Key size in bits */ @@ -2607,107 +2566,21 @@ declare module "crypto" { * Minimal salt length in bytes */ saltLength?: string | undefined; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; } - interface DSAKeyPairOptions { + interface RSAKeyPairOptions extends KeyPairExportOptions<"pkcs1" | "spki", "pkcs1" | "pkcs8"> { /** * Key size in bits */ modulusLength: number; /** - * Size of q in bits + * Public exponent + * @default 0x10001 */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface MLDSAKeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface MLKEMKeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface SLHDSAKeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; + publicExponent?: number | undefined; } + interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} + interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} /** * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, * Ed25519, Ed448, X25519, X448, DH, and ML-DSA are currently supported. @@ -2748,264 +2621,56 @@ declare module "crypto" { * it will be a buffer containing the data encoded as DER. * @since v10.12.0 * @param type The asymmetric key type to generate. See the - * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types). + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( + function generateKeyPairSync( + type: "dh", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: MLDSAKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: MLKEMKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "rsa-pss", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: "rsa", + options: T, + ): KeyPairExportResult; + function generateKeyPairSync( + type: SLHDSAKeyType, + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( + options?: T, + ): KeyPairExportResult; + function generateKeyPairSync( type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options?: MLDSAKeyPairKeyObjectOptions, - ): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options?: MLKEMKeyPairKeyObjectOptions, - ): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options?: SLHDSAKeyPairKeyObjectOptions, - ): KeyPairKeyObjectResult; + options?: T, + ): KeyPairExportResult; /** * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, * Ed25519, Ed448, X25519, X448, and DH are currently supported. @@ -3044,741 +2709,117 @@ declare module "crypto" { * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. * @since v10.12.0 * @param type The asymmetric key type to generate. See the - * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types). + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, + function generateKeyPair( + type: "dh", + options: T, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( + function generateKeyPair( type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, + options: T, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( + function generateKeyPair( type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, + options: T, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( + function generateKeyPair( type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( + function generateKeyPair( type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + function generateKeyPair( + type: MLDSAKeyType, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, + function generateKeyPair( + type: MLKEMKeyType, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, + function generateKeyPair( + type: "rsa-pss", + options: T, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, + function generateKeyPair( + type: "rsa", + options: T, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, + function generateKeyPair( + type: SLHDSAKeyType, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( + function generateKeyPair( type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, + options: T | undefined, + callback: KeyPairExportCallback, ): void; - function generateKeyPair( + function generateKeyPair( type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + options: T | undefined, + callback: KeyPairExportCallback, ): void; namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( + function __promisify__( + type: "dh", + options: T, + ): Promise>; + function __promisify__( type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( + options: T, + ): Promise>; + function __promisify__( type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( + options: T, + ): Promise>; + function __promisify__( type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( + options?: T, + ): Promise>; + function __promisify__( type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( + options?: T, + ): Promise>; + function __promisify__( + type: MLDSAKeyType, + options?: T, + ): Promise>; + function __promisify__( + type: MLKEMKeyType, + options?: T, + ): Promise>; + function __promisify__( + type: "rsa-pss", + options: T, + ): Promise>; + function __promisify__( + type: "rsa", + options: T, + ): Promise>; + function __promisify__( + type: SLHDSAKeyType, + options?: T, + ): Promise>; + function __promisify__( type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( + options?: T, + ): Promise>; + function __promisify__( type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options: MLDSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87", - options?: MLDSAKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options: MLKEMKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768", - options?: MLKEMKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options: SLHDSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: - | "slh-dsa-sha2-128f" - | "slh-dsa-sha2-128s" - | "slh-dsa-sha2-192f" - | "slh-dsa-sha2-192s" - | "slh-dsa-sha2-256f" - | "slh-dsa-sha2-256s" - | "slh-dsa-shake-128f" - | "slh-dsa-shake-128s" - | "slh-dsa-shake-192f" - | "slh-dsa-shake-192s" - | "slh-dsa-shake-256f" - | "slh-dsa-shake-256s", - options?: SLHDSAKeyPairKeyObjectOptions, - ): Promise; + options?: T, + ): Promise>; } /** * Calculates and returns the signature for `data` using the given private key and @@ -4557,7 +3598,12 @@ declare module "crypto" { * @since v17.4.0 * @return Returns `typedArray`. */ - function getRandomValues(typedArray: T): T; + function getRandomValues< + T extends Exclude< + NodeJS.NonSharedTypedArray, + NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array + >, + >(typedArray: T): T; type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id"; interface Argon2Parameters { /** @@ -4611,7 +3657,7 @@ declare module "crypto" { * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. * * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please - * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). + * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). * * The `callback` function is called with two arguments: `err` and `derivedKey`. * `err` is an exception object when key derivation fails, otherwise `err` is @@ -4655,7 +3701,7 @@ declare module "crypto" { * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. * * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please - * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). + * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis). * * An exception is thrown when key derivation fails, otherwise the derived key is * returned as a `Buffer`. @@ -4695,48 +3741,40 @@ declare module "crypto" { */ const webcrypto: webcrypto.Crypto; namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; + type AlgorithmIdentifier = Algorithm | string; + type BigInteger = NodeJS.NonSharedUint8Array; type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki"; type KeyType = "private" | "public" | "secret"; type KeyUsage = - | "encrypt" + | "decapsulateBits" + | "decapsulateKey" | "decrypt" - | "sign" - | "verify" - | "deriveKey" | "deriveBits" + | "deriveKey" | "encapsulateBits" - | "decapsulateBits" | "encapsulateKey" - | "decapsulateKey" - | "wrapKey" - | "unwrapKey"; - type AlgorithmIdentifier = Algorithm | string; + | "encrypt" + | "sign" + | "unwrapKey" + | "verify" + | "wrapKey"; type HashAlgorithmIdentifier = AlgorithmIdentifier; type NamedCurve = string; - type BigInteger = Uint8Array; interface AeadParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; + additionalData?: NodeJS.BufferSource; + iv: NodeJS.BufferSource; tagLength: number; } interface AesCbcParams extends Algorithm { - iv: BufferSource; + iv: NodeJS.BufferSource; } interface AesCtrParams extends Algorithm { - counter: BufferSource; + counter: NodeJS.BufferSource; length: number; } interface AesDerivedKeyParams extends Algorithm { length: number; } - // TODO: remove in next major - /** @deprecated Replaced by `AeadParams`. */ - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } interface AesKeyAlgorithm extends KeyAlgorithm { length: number; } @@ -4747,21 +3785,21 @@ declare module "crypto" { name: string; } interface Argon2Params extends Algorithm { - associatedData?: BufferSource; + associatedData?: NodeJS.BufferSource; memory: number; - nonce: BufferSource; + nonce: NodeJS.BufferSource; parallelism: number; passes: number; - secretValue?: BufferSource; + secretValue?: NodeJS.BufferSource; version?: number; } interface CShakeParams extends Algorithm { - customization?: BufferSource; - functionName?: BufferSource; + customization?: NodeJS.BufferSource; + functionName?: NodeJS.BufferSource; length: number; } interface ContextParams extends Algorithm { - context?: BufferSource; + context?: NodeJS.BufferSource; } interface EcKeyAlgorithm extends KeyAlgorithm { namedCurve: NamedCurve; @@ -4780,8 +3818,8 @@ declare module "crypto" { } interface HkdfParams extends Algorithm { hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; + info: NodeJS.BufferSource; + salt: NodeJS.BufferSource; } interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; @@ -4828,13 +3866,13 @@ declare module "crypto" { length?: number; } interface KmacParams extends Algorithm { - customization?: BufferSource; + customization?: NodeJS.BufferSource; length: number; } interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; - salt: BufferSource; + salt: NodeJS.BufferSource; } interface RsaHashedImportParams extends Algorithm { hash: HashAlgorithmIdentifier; @@ -4854,7 +3892,7 @@ declare module "crypto" { publicExponent: BigInteger; } interface RsaOaepParams extends Algorithm { - label?: BufferSource; + label?: NodeJS.BufferSource; } interface RsaOtherPrimesInfo { d?: string; @@ -4864,87 +3902,26 @@ declare module "crypto" { interface RsaPssParams extends Algorithm { saltLength: number; } - /** - * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>( + getRandomValues< + T extends Exclude< + NodeJS.NonSharedTypedArray, + NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array + >, + >( typedArray: T, ): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ randomUUID(): UUID; } - /** - * @since v15.0.0 - */ interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ readonly usages: KeyUsage[]; } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ publicKey: CryptoKey; } interface EncapsulatedBits { @@ -4955,293 +3932,73 @@ declare module "crypto" { sharedKey: CryptoKey; ciphertext: ArrayBuffer; } - /** - * @since v15.0.0 - */ interface SubtleCrypto { - /** - * A message recipient uses their asymmetric private key to decrypt an - * "encapsulated key" (ciphertext), thereby recovering a temporary symmetric - * key (represented as `ArrayBuffer`) which is then used to decrypt a message. - * - * The algorithms currently supported include: - * - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * @since v24.7.0 - * @returns Fulfills with `ArrayBuffer` upon success. - */ decapsulateBits( decapsulationAlgorithm: AlgorithmIdentifier, decapsulationKey: CryptoKey, - ciphertext: BufferSource, + ciphertext: NodeJS.BufferSource, ): Promise; - /** - * A message recipient uses their asymmetric private key to decrypt an - * "encapsulated key" (ciphertext), thereby recovering a temporary symmetric - * key (represented as `CryptoKey`) which is then used to decrypt a message. - * - * The algorithms currently supported include: - * - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * @since v24.7.0 - * @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages). - * @returns Fulfills with `CryptoKey` upon success. - */ decapsulateKey( decapsulationAlgorithm: AlgorithmIdentifier, decapsulationKey: CryptoKey, - ciphertext: BufferSource, + ciphertext: NodeJS.BufferSource, sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams, extractable: boolean, usages: KeyUsage[], ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * this method attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'RSA-OAEP'` - * @since v15.0.0 - */ decrypt( algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, key: CryptoKey, - data: BufferSource, + data: NodeJS.BufferSource, ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * this method attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * * `'Argon2d'` - * * `'Argon2i'` - * * `'Argon2id'` - * * `'ECDH'` - * * `'HKDF'` - * * `'PBKDF2'` - * * `'X25519'` - * * `'X448'` - * @since v15.0.0 - */ deriveBits( - algorithm: EcdhKeyDeriveParams, + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, baseKey: CryptoKey, length?: number | null, ): Promise; - deriveBits( - algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * this method attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * * `'Argon2d'` - * * `'Argon2i'` - * * `'Argon2id'` - * * `'ECDH'` - * * `'HKDF'` - * * `'PBKDF2'` - * * `'X25519'` - * * `'X448'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ deriveKey( - algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, baseKey: CryptoKey, - derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams, + derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, extractable: boolean, keyUsages: readonly KeyUsage[], ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * * `'cSHAKE128'` - * * `'cSHAKE256'` - * * `'SHA-1'` - * * `'SHA-256'` - * * `'SHA-384'` - * * `'SHA-512'` - * * `'SHA3-256'` - * * `'SHA3-384'` - * * `'SHA3-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier | CShakeParams, data: BufferSource): Promise; - /** - * Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. - * This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`. - * - * The algorithms currently supported include: - * - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * @since v24.7.0 - * @returns Fulfills with `EncapsulatedBits` upon success. - */ + digest(algorithm: AlgorithmIdentifier | CShakeParams, data: NodeJS.BufferSource): Promise; encapsulateBits( encapsulationAlgorithm: AlgorithmIdentifier, encapsulationKey: CryptoKey, ): Promise; - /** - * Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. - * This encrypted key is the "encapsulated key" represented as `EncapsulatedKey`. - * - * The algorithms currently supported include: - * - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * @since v24.7.0 - * @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages). - * @returns Fulfills with `EncapsulatedKey` upon success. - */ encapsulateKey( encapsulationAlgorithm: AlgorithmIdentifier, encapsulationKey: CryptoKey, - sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams, + sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, extractable: boolean, usages: KeyUsage[], ): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * this method attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'RSA-OAEP'` - * @since v15.0.0 - */ encrypt( algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, key: CryptoKey, - data: BufferSource, + data: NodeJS.BufferSource, ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, - * `'raw-public'`, or `'raw-seed'`. - * @returns `` containing ``. - * @since v15.0.0 - */ exportKey(format: "jwk", key: CryptoKey): Promise; exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the parameters provided in `algorithm`, this method - * attempts to generate new keying material. Depending on the algorithm used - * either a single `CryptoKey` or a `CryptoKeyPair` is generated. - * - * The `CryptoKeyPair` (public and private key) generating algorithms supported - * include: - * - * * `'ECDH'` - * * `'ECDSA'` - * * `'Ed25519'` - * * `'Ed448'` - * * `'ML-DSA-44'` - * * `'ML-DSA-65'` - * * `'ML-DSA-87'` - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * * `'RSA-OAEP'` - * * `'RSA-PSS'` - * * `'RSASSA-PKCS1-v1_5'` - * * `'X25519'` - * * `'X448'` - * - * The `CryptoKey` (secret key) generating algorithms supported include: - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-KW'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'HMAC'` - * * `'KMAC128'` - * * `'KMAC256'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ + exportKey(format: KeyFormat, key: CryptoKey): Promise; generateKey( algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, - keyUsages: readonly KeyUsage[], + keyUsages: KeyUsage[], ): Promise; generateKey( algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams, extractable: boolean, - keyUsages: readonly KeyUsage[], + keyUsages: KeyUsage[], ): Promise; generateKey( algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[], ): Promise; - /** - * Derives the public key from a given private key. - * @since v24.7.0 - * @param key A private key from which to derive the corresponding public key. - * @param keyUsages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages). - * @returns Fulfills with a `CryptoKey` upon success. - */ getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise; - /** - * This method attempts to interpret the provided `keyData` - * as the given `format` to create a `CryptoKey` instance using the provided - * `algorithm`, `extractable`, and `keyUsages` arguments. If the import is - * successful, the returned promise will be resolved with a {CryptoKey} - * representation of the key material. - * - * If importing KDF algorithm keys, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, - * `'raw-public'`, or `'raw-seed'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ importKey( format: "jwk", keyData: JsonWebKey, @@ -5253,11 +4010,11 @@ declare module "crypto" { | AesKeyAlgorithm | KmacImportParams, extractable: boolean, - keyUsages: readonly KeyUsage[], + keyUsages: KeyUsage[], ): Promise; importKey( format: Exclude, - keyData: BufferSource, + keyData: NodeJS.BufferSource, algorithm: | AlgorithmIdentifier | RsaHashedImportParams @@ -5268,82 +4025,14 @@ declare module "crypto" { extractable: boolean, keyUsages: KeyUsage[], ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * this method attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * * `'ECDSA'` - * * `'Ed25519'` - * * `'Ed448'` - * * `'HMAC'` - * * `'KMAC128'` - * * `'KMAC256'` - * * `'ML-DSA-44'` - * * `'ML-DSA-65'` - * * `'ML-DSA-87'` - * * `'RSA-PSS'` - * * `'RSASSA-PKCS1-v1_5'` - * @since v15.0.0 - */ sign( algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, key: CryptoKey, - data: BufferSource, + data: NodeJS.BufferSource, ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * This method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-KW'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'RSA-OAEP'` - * - * The unwrapped key algorithms supported include: - * - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-KW'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'ECDH'` - * * `'ECDSA'` - * * `'Ed25519'` - * * `'Ed448'` - * * `'HMAC'` - * * `'KMAC128'` - * * `'KMAC256'` - * * `'ML-DSA-44'` - * * `'ML-DSA-65'` - * * `'ML-DSA-87'` - * * `'ML-KEM-512'` - * * `'ML-KEM-768'` - * * `'ML-KEM-1024'` - * * `'RSA-OAEP'` - * * `'RSA-PSS'` - * * `'RSASSA-PKCS1-v1_5'` - * * `'X25519'` - * * `'X448'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, - * `'raw-public'`, or `'raw-seed'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ unwrapKey( format: KeyFormat, - wrappedKey: BufferSource, + wrappedKey: NodeJS.BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, unwrappedKeyAlgorithm: @@ -5356,53 +4045,12 @@ declare module "crypto" { extractable: boolean, keyUsages: KeyUsage[], ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * This method attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * * `'ECDSA'` - * * `'Ed25519'` - * * `'Ed448'` - * * `'HMAC'` - * * `'KMAC128'` - * * `'KMAC256'` - * * `'ML-DSA-44'` - * * `'ML-DSA-65'` - * * `'ML-DSA-87'` - * * `'RSA-PSS'` - * * `'RSASSA-PKCS1-v1_5'` - * @since v15.0.0 - */ verify( algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, key: CryptoKey, - signature: BufferSource, - data: BufferSource, + signature: NodeJS.BufferSource, + data: NodeJS.BufferSource, ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * This method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * * `'AES-CBC'` - * * `'AES-CTR'` - * * `'AES-GCM'` - * * `'AES-KW'` - * * `'AES-OCB'` - * * `'ChaCha20-Poly1305'` - * * `'RSA-OAEP'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, - * `'raw-public'`, or `'raw-seed'`. - * @since v15.0.0 - */ wrapKey( format: KeyFormat, key: CryptoKey, @@ -5412,6 +4060,6 @@ declare module "crypto" { } } } -declare module "node:crypto" { - export * from "crypto"; +declare module "crypto" { + export * from "node:crypto"; } diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts index bc69f0b4..3672e08b 100644 --- a/node_modules/@types/node/dgram.d.ts +++ b/node_modules/@types/node/dgram.d.ts @@ -23,13 +23,13 @@ * server.bind(41234); * // Prints: server listening 0.0.0.0:41234 * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dgram.js) */ -declare module "dgram" { +declare module "node:dgram" { import { NonSharedBuffer } from "node:buffer"; - import { AddressInfo, BlockList } from "node:net"; import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import { AddressInfo, BlockList } from "node:net"; interface RemoteInfo { address: string; family: "IPv4" | "IPv6"; @@ -88,6 +88,13 @@ declare module "dgram" { */ function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; + interface SocketEventMap { + "close": []; + "connect": []; + "error": [err: Error]; + "listening": []; + "message": [msg: NonSharedBuffer, rinfo: RemoteInfo]; + } /** * Encapsulates the datagram functionality. * @@ -95,7 +102,7 @@ declare module "dgram" { * The `new` keyword is not to be used to create `dgram.Socket` instances. * @since v0.1.99 */ - class Socket extends EventEmitter { + class Socket implements EventEmitter { /** * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not * specified, the operating system will choose @@ -544,57 +551,14 @@ declare module "dgram" { * @since v13.1.0, v12.16.0 */ dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; /** * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. * @since v20.5.0 */ [Symbol.asyncDispose](): Promise; } + interface Socket extends InternalEventEmitter {} } -declare module "node:dgram" { - export * from "dgram"; +declare module "dgram" { + export * from "node:dgram"; } diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts index 025847de..206592bd 100644 --- a/node_modules/@types/node/diagnostics_channel.d.ts +++ b/node_modules/@types/node/diagnostics_channel.d.ts @@ -20,9 +20,9 @@ * should generally include the module name to avoid collisions with data from * other modules. * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/diagnostics_channel.js) */ -declare module "diagnostics_channel" { +declare module "node:diagnostics_channel" { import { AsyncLocalStorage } from "node:async_hooks"; /** * Check if there are active subscribers to the named channel. This is helpful if @@ -571,6 +571,6 @@ declare module "diagnostics_channel" { readonly hasSubscribers: boolean; } } -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; +declare module "diagnostics_channel" { + export * from "node:diagnostics_channel"; } diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts index ba0d1221..80a2272c 100644 --- a/node_modules/@types/node/dns.d.ts +++ b/node_modules/@types/node/dns.d.ts @@ -41,28 +41,27 @@ * }); * ``` * - * See the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) for more information. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dns.js) + * See the [Implementation considerations section](https://nodejs.org/docs/latest-v25.x/api/dns.html#implementation-considerations) for more information. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dns.js) */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; +declare module "node:dns" { // Supported getaddrinfo flags. /** * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are * only returned if the current system has at least one IPv4 address configured. */ - export const ADDRCONFIG: number; + const ADDRCONFIG: number; /** * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported * on some operating systems (e.g. FreeBSD 10.1). */ - export const V4MAPPED: number; + const V4MAPPED: number; /** * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as * well as IPv4 mapped IPv6 addresses. */ - export const ALL: number; - export interface LookupOptions { + const ALL: number; + interface LookupOptions { /** * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used @@ -71,7 +70,7 @@ declare module "dns" { */ family?: number | "IPv4" | "IPv6" | undefined; /** - * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v24.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be + * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v25.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be * passed by bitwise `OR`ing their values. */ hints?: number | undefined; @@ -84,7 +83,7 @@ declare module "dns" { * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 * addresses before IPv4 addresses. Default value is configurable using - * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). + * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--dns-result-orderorder). * @default `verbatim` (addresses are not reordered) * @since v22.1.0 */ @@ -98,13 +97,13 @@ declare module "dns" { */ verbatim?: boolean | undefined; } - export interface LookupOneOptions extends LookupOptions { + interface LookupOneOptions extends LookupOptions { all?: false | undefined; } - export interface LookupAllOptions extends LookupOptions { + interface LookupAllOptions extends LookupOptions { all: true; } - export interface LookupAddress { + interface LookupAddress { /** * A string representation of an IPv4 or IPv6 address. */ @@ -133,7 +132,7 @@ declare module "dns" { * The implementation uses an operating system facility that can associate names * with addresses and vice versa. This implementation can have subtle but * important consequences on the behavior of any Node.js program. Please take some - * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) + * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v25.x/api/dns.html#implementation-considerations) * before using `dns.lookup()`. * * Example usage: @@ -155,35 +154,35 @@ declare module "dns" { * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] * ``` * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v25.x/api/util.html#utilpromisifyoriginal) ed * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. * @since v0.1.90 */ - export function lookup( + function lookup( hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, ): void; - export function lookup( + function lookup( hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, ): void; - export function lookup( + function lookup( hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, ): void; - export function lookup( + function lookup( hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, ): void; - export function lookup( + function lookup( hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, ): void; - export namespace lookup { + namespace lookup { function __promisify__(hostname: string, options: LookupAllOptions): Promise; function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; function __promisify__(hostname: string, options: LookupOptions): Promise; @@ -195,7 +194,7 @@ declare module "dns" { * If `address` is not a valid IP address, a `TypeError` will be thrown. * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. * - * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, + * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, * where `err.code` is the error code. * * ```js @@ -206,16 +205,16 @@ declare module "dns" { * }); * ``` * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v25.x/api/util.html#utilpromisifyoriginal) ed * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. * @since v0.11.14 */ - export function lookupService( + function lookupService( address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, ): void; - export namespace lookupService { + namespace lookupService { function __promisify__( address: string, port: number, @@ -224,25 +223,23 @@ declare module "dns" { service: string; }>; } - export interface ResolveOptions { + interface ResolveOptions { ttl: boolean; } - export interface ResolveWithTtlOptions extends ResolveOptions { + interface ResolveWithTtlOptions extends ResolveOptions { ttl: true; } - export interface RecordWithTtl { + interface RecordWithTtl { address: string; ttl: number; } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { + interface AnyARecord extends RecordWithTtl { type: "A"; } - export interface AnyAaaaRecord extends RecordWithTtl { + interface AnyAaaaRecord extends RecordWithTtl { type: "AAAA"; } - export interface CaaRecord { + interface CaaRecord { critical: number; issue?: string | undefined; issuewild?: string | undefined; @@ -250,17 +247,17 @@ declare module "dns" { contactemail?: string | undefined; contactphone?: string | undefined; } - export interface AnyCaaRecord extends CaaRecord { + interface AnyCaaRecord extends CaaRecord { type: "CAA"; } - export interface MxRecord { + interface MxRecord { priority: number; exchange: string; } - export interface AnyMxRecord extends MxRecord { + interface AnyMxRecord extends MxRecord { type: "MX"; } - export interface NaptrRecord { + interface NaptrRecord { flags: string; service: string; regexp: string; @@ -268,10 +265,10 @@ declare module "dns" { order: number; preference: number; } - export interface AnyNaptrRecord extends NaptrRecord { + interface AnyNaptrRecord extends NaptrRecord { type: "NAPTR"; } - export interface SoaRecord { + interface SoaRecord { nsname: string; hostmaster: string; serial: number; @@ -280,44 +277,44 @@ declare module "dns" { expire: number; minttl: number; } - export interface AnySoaRecord extends SoaRecord { + interface AnySoaRecord extends SoaRecord { type: "SOA"; } - export interface SrvRecord { + interface SrvRecord { priority: number; weight: number; port: number; name: string; } - export interface AnySrvRecord extends SrvRecord { + interface AnySrvRecord extends SrvRecord { type: "SRV"; } - export interface TlsaRecord { + interface TlsaRecord { certUsage: number; selector: number; match: number; data: ArrayBuffer; } - export interface AnyTlsaRecord extends TlsaRecord { + interface AnyTlsaRecord extends TlsaRecord { type: "TLSA"; } - export interface AnyTxtRecord { + interface AnyTxtRecord { type: "TXT"; entries: string[]; } - export interface AnyNsRecord { + interface AnyNsRecord { type: "NS"; value: string; } - export interface AnyPtrRecord { + interface AnyPtrRecord { type: "PTR"; value: string; } - export interface AnyCnameRecord { + interface AnyCnameRecord { type: "CNAME"; value: string; } - export type AnyRecord = + type AnyRecord = | AnyARecord | AnyAaaaRecord | AnyCaaRecord @@ -337,62 +334,62 @@ declare module "dns" { * * * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, * where `err.code` is one of the `DNS error codes`. * @since v0.1.27 * @param hostname Host name to resolve. * @param [rrtype='A'] Resource record type. */ - export function resolve( + function resolve( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "CAA", callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "TLSA", callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, ): void; - export function resolve( + function resolve( hostname: string, rrtype: string, callback: ( @@ -409,7 +406,7 @@ declare module "dns" { | AnyRecord[], ) => void, ): void; - export namespace resolve { + namespace resolve { function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; function __promisify__(hostname: string, rrtype: "ANY"): Promise; function __promisify__(hostname: string, rrtype: "CAA"): Promise; @@ -440,21 +437,21 @@ declare module "dns" { * @since v0.1.16 * @param hostname Host name to resolve. */ - export function resolve4( + function resolve4( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export function resolve4( + function resolve4( hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, ): void; - export function resolve4( + function resolve4( hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, ): void; - export namespace resolve4 { + namespace resolve4 { function __promisify__(hostname: string): Promise; function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; function __promisify__(hostname: string, options?: ResolveOptions): Promise; @@ -465,21 +462,21 @@ declare module "dns" { * @since v0.1.16 * @param hostname Host name to resolve. */ - export function resolve6( + function resolve6( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export function resolve6( + function resolve6( hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, ): void; - export function resolve6( + function resolve6( hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, ): void; - export namespace resolve6 { + namespace resolve6 { function __promisify__(hostname: string): Promise; function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; function __promisify__(hostname: string, options?: ResolveOptions): Promise; @@ -489,11 +486,11 @@ declare module "dns" { * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). * @since v0.3.2 */ - export function resolveCname( + function resolveCname( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export namespace resolveCname { + namespace resolveCname { function __promisify__(hostname: string): Promise; } /** @@ -502,11 +499,11 @@ declare module "dns" { * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). * @since v15.0.0, v14.17.0 */ - export function resolveCaa( + function resolveCaa( hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, ): void; - export namespace resolveCaa { + namespace resolveCaa { function __promisify__(hostname: string): Promise; } /** @@ -514,11 +511,11 @@ declare module "dns" { * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). * @since v0.1.27 */ - export function resolveMx( + function resolveMx( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, ): void; - export namespace resolveMx { + namespace resolveMx { function __promisify__(hostname: string): Promise; } /** @@ -544,11 +541,11 @@ declare module "dns" { * ``` * @since v0.9.12 */ - export function resolveNaptr( + function resolveNaptr( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, ): void; - export namespace resolveNaptr { + namespace resolveNaptr { function __promisify__(hostname: string): Promise; } /** @@ -556,11 +553,11 @@ declare module "dns" { * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). * @since v0.1.90 */ - export function resolveNs( + function resolveNs( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export namespace resolveNs { + namespace resolveNs { function __promisify__(hostname: string): Promise; } /** @@ -568,11 +565,11 @@ declare module "dns" { * be an array of strings containing the reply records. * @since v6.0.0 */ - export function resolvePtr( + function resolvePtr( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, ): void; - export namespace resolvePtr { + namespace resolvePtr { function __promisify__(hostname: string): Promise; } /** @@ -601,11 +598,11 @@ declare module "dns" { * ``` * @since v0.11.10 */ - export function resolveSoa( + function resolveSoa( hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, ): void; - export namespace resolveSoa { + namespace resolveSoa { function __promisify__(hostname: string): Promise; } /** @@ -627,11 +624,11 @@ declare module "dns" { * ``` * @since v0.1.27 */ - export function resolveSrv( + function resolveSrv( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, ): void; - export namespace resolveSrv { + namespace resolveSrv { function __promisify__(hostname: string): Promise; } /** @@ -654,11 +651,11 @@ declare module "dns" { * ``` * @since v23.9.0, v22.15.0 */ - export function resolveTlsa( + function resolveTlsa( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void, ): void; - export namespace resolveTlsa { + namespace resolveTlsa { function __promisify__(hostname: string): Promise; } /** @@ -668,11 +665,11 @@ declare module "dns" { * treated separately. * @since v0.1.27 */ - export function resolveTxt( + function resolveTxt( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, ): void; - export namespace resolveTxt { + namespace resolveTxt { function __promisify__(hostname: string): Promise; } /** @@ -705,27 +702,27 @@ declare module "dns" { * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see * [RFC 8482](https://tools.ietf.org/html/rfc8482). */ - export function resolveAny( + function resolveAny( hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, ): void; - export namespace resolveAny { + namespace resolveAny { function __promisify__(hostname: string): Promise; } /** * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an * array of host names. * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is - * one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes). + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) object, where `err.code` is + * one of the [DNS error codes](https://nodejs.org/docs/latest-v25.x/api/dns.html#error-codes). * @since v0.1.16 */ - export function reverse( + function reverse( ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, ): void; /** - * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options). + * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnspromiseslookuphostname-options). * The value could be: * * * `ipv4first`: for `order` defaulting to `ipv4first`. @@ -733,7 +730,7 @@ declare module "dns" { * * `verbatim`: for `order` defaulting to `verbatim`. * @since v18.17.0 */ - export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; + function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; /** * Sets the IP address and port of servers to be used when performing DNS * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted @@ -762,7 +759,7 @@ declare module "dns" { * @since v0.11.3 * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses */ - export function setServers(servers: readonly string[]): void; + function setServers(servers: readonly string[]): void; /** * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), * that are currently configured for DNS resolution. A string will include a port @@ -778,9 +775,9 @@ declare module "dns" { * ``` * @since v0.11.3 */ - export function getServers(): string[]; + function getServers(): string[]; /** - * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options). + * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnspromiseslookuphostname-options). * The value could be: * * * `ipv4first`: sets default `order` to `ipv4first`. @@ -788,39 +785,39 @@ declare module "dns" { * * `verbatim`: sets default `order` to `verbatim`. * * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using - * [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main + * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--dns-result-orderorder). When using + * [worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main * thread won't affect the default dns orders in workers. * @since v16.4.0, v14.18.0 * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. */ - export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; + function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; // Error codes - export const NODATA: "ENODATA"; - export const FORMERR: "EFORMERR"; - export const SERVFAIL: "ESERVFAIL"; - export const NOTFOUND: "ENOTFOUND"; - export const NOTIMP: "ENOTIMP"; - export const REFUSED: "EREFUSED"; - export const BADQUERY: "EBADQUERY"; - export const BADNAME: "EBADNAME"; - export const BADFAMILY: "EBADFAMILY"; - export const BADRESP: "EBADRESP"; - export const CONNREFUSED: "ECONNREFUSED"; - export const TIMEOUT: "ETIMEOUT"; - export const EOF: "EOF"; - export const FILE: "EFILE"; - export const NOMEM: "ENOMEM"; - export const DESTRUCTION: "EDESTRUCTION"; - export const BADSTR: "EBADSTR"; - export const BADFLAGS: "EBADFLAGS"; - export const NONAME: "ENONAME"; - export const BADHINTS: "EBADHINTS"; - export const NOTINITIALIZED: "ENOTINITIALIZED"; - export const LOADIPHLPAPI: "ELOADIPHLPAPI"; - export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - export const CANCELLED: "ECANCELLED"; - export interface ResolverOptions { + const NODATA: "ENODATA"; + const FORMERR: "EFORMERR"; + const SERVFAIL: "ESERVFAIL"; + const NOTFOUND: "ENOTFOUND"; + const NOTIMP: "ENOTIMP"; + const REFUSED: "EREFUSED"; + const BADQUERY: "EBADQUERY"; + const BADNAME: "EBADNAME"; + const BADFAMILY: "EBADFAMILY"; + const BADRESP: "EBADRESP"; + const CONNREFUSED: "ECONNREFUSED"; + const TIMEOUT: "ETIMEOUT"; + const EOF: "EOF"; + const FILE: "EFILE"; + const NOMEM: "ENOMEM"; + const DESTRUCTION: "EDESTRUCTION"; + const BADSTR: "EBADSTR"; + const BADFLAGS: "EBADFLAGS"; + const NONAME: "ENONAME"; + const BADHINTS: "EBADHINTS"; + const NOTINITIALIZED: "ENOTINITIALIZED"; + const LOADIPHLPAPI: "ELOADIPHLPAPI"; + const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; + const CANCELLED: "ECANCELLED"; + interface ResolverOptions { /** * Query timeout in milliseconds, or `-1` to use the default timeout. */ @@ -840,7 +837,7 @@ declare module "dns" { * An independent resolver for DNS requests. * * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect + * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v25.x/api/dns.html#dnssetserversservers) does not affect * other resolvers: * * ```js @@ -874,7 +871,7 @@ declare module "dns" { * * `resolver.setServers()` * @since v8.3.0 */ - export class Resolver { + class Resolver { constructor(options?: ResolverOptions); /** * Cancel all outstanding DNS queries made by this resolver. The corresponding @@ -916,8 +913,10 @@ declare module "dns" { setLocalAddress(ipv4?: string, ipv6?: string): void; setServers: typeof setServers; } - export { dnsPromises as promises }; } declare module "node:dns" { - export * from "dns"; + export * as promises from "node:dns/promises"; +} +declare module "dns" { + export * from "node:dns"; } diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts index efb9fbfd..8d5f9898 100644 --- a/node_modules/@types/node/dns/promises.d.ts +++ b/node_modules/@types/node/dns/promises.d.ts @@ -4,7 +4,7 @@ * via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`. * @since v10.6.0 */ -declare module "dns/promises" { +declare module "node:dns/promises" { import { AnyRecord, CaaRecord, @@ -498,6 +498,6 @@ declare module "dns/promises" { setServers: typeof setServers; } } -declare module "node:dns/promises" { - export * from "dns/promises"; +declare module "dns/promises" { + export * from "node:dns/promises"; } diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts index 4c641153..24a09814 100644 --- a/node_modules/@types/node/domain.d.ts +++ b/node_modules/@types/node/domain.d.ts @@ -12,10 +12,10 @@ * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to * exit immediately with an error code. * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/domain.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/domain.js) */ -declare module "domain" { - import EventEmitter = require("node:events"); +declare module "node:domain" { + import { EventEmitter } from "node:events"; /** * The `Domain` class encapsulates the functionality of routing errors and * uncaught exceptions to the active `Domain` object. @@ -24,10 +24,9 @@ declare module "domain" { */ class Domain extends EventEmitter { /** - * An array of timers and event emitters that have been explicitly added - * to the domain. + * An array of event emitters that have been explicitly added to the domain. */ - members: Array; + members: EventEmitter[]; /** * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly * pushes the domain onto the domain @@ -91,20 +90,17 @@ declare module "domain" { * will be routed to the domain's `'error'` event, just like with implicit * binding. * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain + * If the `EventEmitter` was already bound to a domain, it is removed from that + * one, and bound to this one instead. + * @param emitter emitter to be added to the domain */ - add(emitter: EventEmitter | NodeJS.Timer): void; + add(emitter: EventEmitter): void; /** * The opposite of {@link add}. Removes domain handling from the * specified emitter. - * @param emitter emitter or timer to be removed from the domain + * @param emitter emitter to be removed from the domain */ - remove(emitter: EventEmitter | NodeJS.Timer): void; + remove(emitter: EventEmitter): void; /** * The returned function will be a wrapper around the supplied callback * function. When the returned function is called, any errors that are @@ -165,6 +161,6 @@ declare module "domain" { } function create(): Domain; } -declare module "node:domain" { - export * from "domain"; +declare module "domain" { + export * from "node:domain"; } diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts index 023348e0..4ed0f651 100644 --- a/node_modules/@types/node/events.d.ts +++ b/node_modules/@types/node/events.d.ts @@ -32,58 +32,47 @@ * }); * myEmitter.emit('event'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/events.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/events.js) */ -declare module "events" { +declare module "node:events" { import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; + // #region Event map helpers + type EventMap = Record; + type IfEventMap, True, False> = {} extends Events ? False : True; + type Args, EventName extends string | symbol> = IfEventMap< + Events, + EventName extends keyof Events ? Events[EventName] + : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName] + : any[], + any[] + >; + type EventNames, EventName extends string | symbol> = IfEventMap< + Events, + EventName | (keyof Events & (string | symbol)) | keyof EventEmitterEventMap, + string | symbol + >; + type Listener, EventName extends string | symbol> = IfEventMap< + Events, + ( + ...args: EventName extends keyof Events ? Events[EventName] + : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName] + : any[] + ) => void, + (...args: any[]) => void + >; + interface EventEmitterEventMap { + newListener: [eventName: string | symbol, listener: (...args: any[]) => void]; + removeListener: [eventName: string | symbol, listener: (...args: any[]) => void]; + } + // #endregion interface EventEmitterOptions { /** - * Enables automatic capturing of promise rejection. + * It enables + * [automatic capturing of promise rejection](https://nodejs.org/docs/latest-v25.x/api/events.html#capture-rejections-of-promises). + * @default false */ captureRejections?: boolean | undefined; } - interface StaticEventEmitterOptions { - /** - * Can be used to cancel awaiting events. - */ - signal?: AbortSignal | undefined; - } - interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions { - /** - * Names of events that will end the iteration. - */ - close?: string[] | undefined; - /** - * The high watermark. The emitter is paused every time the size of events being buffered is higher than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default Number.MAX_SAFE_INTEGER - */ - highWaterMark?: number | undefined; - /** - * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default 1 - */ - lowWaterMark?: number | undefined; - } - interface EventEmitter = DefaultEventMap> extends NodeJS.EventEmitter {} - type EventMap = Record | DefaultEventMap; - type DefaultEventMap = [never]; - type AnyRest = [...args: any[]]; - type Args = T extends DefaultEventMap ? AnyRest : ( - K extends keyof T ? T[K] : never - ); - type Key = T extends DefaultEventMap ? string | symbol : K | keyof T; - type Key2 = T extends DefaultEventMap ? string | symbol : K & keyof T; - type Listener = T extends DefaultEventMap ? F : ( - K extends keyof T ? ( - T[K] extends unknown[] ? (...args: T[K]) => void : never - ) - : never - ); - type Listener1 = Listener void>; - type Listener2 = Listener; - /** * The `EventEmitter` class is defined and exposed by the `node:events` module: * @@ -97,584 +86,182 @@ declare module "events" { * It supports the following option: * @since v0.1.26 */ - class EventEmitter = DefaultEventMap> { + class EventEmitter = any> { constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * - * Use the `close` option to specify an array of event names that will end the iteration: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * ee.emit('close'); - * }); - * - * for await (const event of on(ee, 'foo', { close: ['close'] })) { - * console.log(event); // prints ['bar'] [42] - * } - * // the loop will exit after 'close' is emitted - * console.log('done'); // prints 'done' - * ``` - * @since v13.6.0, v12.16.0 - * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - static on( - emitter: EventTarget, - eventName: string, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - /** - * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property - * can be used. If this value is not a positive number, a `RangeError` is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_ `EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single - * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string | undefined; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - /** - * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget` - * that emulates a subset of the `EventEmitter` API. - * @since v14.5.0 - */ - export interface NodeEventTarget extends EventTarget { - /** - * Node.js-specific extension to the `EventTarget` class that emulates the - * equivalent `EventEmitter` API. The only difference between `addListener()` and - * `addEventListener()` is that `addListener()` will return a reference to the - * `EventTarget`. - * @since v14.5.0 - */ - addListener(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class that dispatches the - * `arg` to the list of handlers for `type`. - * @since v15.2.0 - * @returns `true` if event listeners registered for the `type` exist, - * otherwise `false`. - */ - emit(type: string, arg: any): boolean; - /** - * Node.js-specific extension to the `EventTarget` class that returns an array - * of event `type` names for which event listeners are registered. - * @since 14.5.0 - */ - eventNames(): string[]; - /** - * Node.js-specific extension to the `EventTarget` class that returns the number - * of event listeners registered for the `type`. - * @since v14.5.0 - */ - listenerCount(type: string): number; - /** - * Node.js-specific extension to the `EventTarget` class that sets the number - * of max event listeners as `n`. - * @since v14.5.0 - */ - setMaxListeners(n: number): void; - /** - * Node.js-specific extension to the `EventTarget` class that returns the number - * of max event listeners. - * @since v14.5.0 - */ - getMaxListeners(): number; - /** - * Node.js-specific alias for `eventTarget.removeEventListener()`. - * @since v14.5.0 - */ - off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - /** - * Node.js-specific alias for `eventTarget.addEventListener()`. - * @since v14.5.0 - */ - on(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class that adds a `once` - * listener for the given event `type`. This is equivalent to calling `on` - * with the `once` option set to `true`. - * @since v14.5.0 - */ - once(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class. If `type` is specified, - * removes all registered listeners for `type`, otherwise removes all registered - * listeners. - * @since v14.5.0 - */ - removeAllListeners(type?: string): this; - /** - * Node.js-specific extension to the `EventTarget` class that removes the - * `listener` for the given `type`. The only difference between `removeListener()` - * and `removeEventListener()` is that `removeListener()` will return a reference - * to the `EventTarget`. - * @since v14.5.0 - */ - removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - } } + interface EventEmitter = any> extends NodeJS.EventEmitter {} global { namespace NodeJS { - interface EventEmitter = DefaultEventMap> { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: Key, listener: Listener1): this; + interface EventEmitter = any> { /** - * Adds the `listener` function to the end of the listeners array for the event - * named `eventName`. No checks are made to see if the `listener` has already - * been added. Multiple calls passing the same combination of `eventName` and - * `listener` will result in the `listener` being added, and called, multiple times. + * The `Symbol.for('nodejs.rejection')` method is called in case a + * promise rejection happens when emitting an event and + * `captureRejections` is enabled on the emitter. + * It is possible to use `events.captureRejectionSymbol` in + * place of `Symbol.for('nodejs.rejection')`. * * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` + * import { EventEmitter, captureRejectionSymbol } from 'node:events'; * - * Returns a reference to the `EventEmitter`, so that calls can be chained. + * class MyClass extends EventEmitter { + * constructor() { + * super({ captureRejections: true }); + * } * - * By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. + * [captureRejectionSymbol](err, event, ...args) { + * console.log('rejection happened for', event, 'with', err, ...args); + * this.destroy(err); + * } * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a + * destroy(err) { + * // Tear the resource down here. + * } + * } * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function + * @since v13.4.0, v12.16.0 */ - on(eventName: Key, listener: Listener1): this; + [EventEmitter.captureRejectionSymbol]?(error: Error, event: string | symbol, ...args: any[]): void; /** - * Adds a **one-time** `listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: EventNames, listener: Listener): this; + /** + * Synchronously calls each of the listeners registered for the event named + * `eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: EventNames, ...args: Args): boolean; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): (string | symbol)[]; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to + * `events.defaultMaxListeners`. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns the number of listeners listening for the event named `eventName`. + * If `listener` is provided, it will return how many times the listener is found + * in the list of the listeners of the event. + * @since v3.2.0 + * @param eventName The name of the event being listened for + * @param listener The event handler function + */ + listenerCount( + eventName: EventNames, + listener?: Listener, + ): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: EventNames): Listener[]; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: EventNames, listener: Listener): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName` + * and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The + * `emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: EventNames, listener: Listener): this; + /** + * Adds a **one-time** `listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. * * ```js * server.once('connection', (stream) => { @@ -684,7 +271,8 @@ declare module "events" { * * Returns a reference to the `EventEmitter`, so that calls can be chained. * - * By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the + * By default, event listeners are invoked in the order they are added. The + * `emitter.prependOnceListener()` method can be used as an alternative to add the * event listener to the beginning of the listeners array. * * ```js @@ -701,9 +289,92 @@ declare module "events" { * @param eventName The name of the event. * @param listener The callback function */ - once(eventName: Key, listener: Listener1): this; + once(eventName: EventNames, listener: Listener): this; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName` + * and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: EventNames, listener: Listener): this; + /** + * Adds a **one-time** `listener` function for the event named `eventName` to the + * _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener( + eventName: EventNames, + listener: Listener, + ): this; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: EventNames): Listener[]; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: EventNames): this; /** - * Removes the specified `listener` from the listener array for the event named `eventName`. + * Removes the specified `listener` from the listener array for the event named + * `eventName`. * * ```js * const callback = (stream) => { @@ -720,8 +391,10 @@ declare module "events" { * called multiple times to remove each instance. * * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. + * time of emitting are called in order. This implies that any + * `removeListener()` or `removeAllListeners()` calls _after_ emitting and + * _before_ the last listener finishes execution will not remove them from + * `emit()` in progress. Subsequent events behave as expected. * * ```js * import { EventEmitter } from 'node:events'; @@ -756,14 +429,15 @@ declare module "events" { * ``` * * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener + * change the position indexes of any listener registered _after_ the listener * being removed. This will not impact the order in which listeners are called, * but it means that any copies of the listener array as returned by * the `emitter.listeners()` method will need to be recreated. * * When a single function has been added as a handler multiple times for a single * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')` listener is removed: + * recently added instance. In the example the `once('ping')` + * listener is removed: * * ```js * import { EventEmitter } from 'node:events'; @@ -784,193 +458,597 @@ declare module "events" { * Returns a reference to the `EventEmitter`, so that calls can be chained. * @since v0.1.26 */ - removeListener(eventName: Key, listener: Listener1): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: Key, listener: Listener1): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(eventName?: Key): this; + removeListener(eventName: EventNames, listener: Listener): this; /** * By default `EventEmitter`s will print a warning if more than `10` listeners are * added for a particular event. This is a useful default that helps finding * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. + * modified for this specific `EventEmitter` instance. The value can be set to + * `Infinity` (or `0`) to indicate an unlimited number of listeners. * * Returns a reference to the `EventEmitter`, so that calls can be chained. * @since v0.3.5 */ setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link EventEmitter.defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: Key): Array>; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: Key): Array>; - /** - * Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: Key, ...args: Args): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: Key, listener?: Listener2): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName` - * and `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: Key, listener: Listener1): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array<(string | symbol) & Key2>; } } } + namespace EventEmitter { + export { EventEmitter, EventEmitterEventMap, EventEmitterOptions }; + } + namespace EventEmitter { + interface Abortable { + signal?: AbortSignal | undefined; + } + /** + * See how to write a custom [rejection handler](https://nodejs.org/docs/latest-v25.x/api/events.html#emittersymbolfornodejsrejectionerr-eventname-args). + * @since v13.4.0, v12.16.0 + */ + const captureRejectionSymbol: unique symbol; + /** + * Change the default `captureRejections` option on all new `EventEmitter` objects. + * @since v13.4.0, v12.16.0 + */ + let captureRejections: boolean; + /** + * By default, a maximum of `10` listeners can be registered for any single + * event. This limit can be changed for individual `EventEmitter` instances + * using the `emitter.setMaxListeners(n)` method. To change the default + * for _all_ `EventEmitter` instances, the `events.defaultMaxListeners` + * property can be used. If this value is not a positive number, a `RangeError` + * is thrown. + * + * Take caution when setting the `events.defaultMaxListeners` because the + * change affects _all_ `EventEmitter` instances, including those created before + * the change is made. However, calling `emitter.setMaxListeners(n)` still has + * precedence over `events.defaultMaxListeners`. + * + * This is not a hard limit. The `EventEmitter` instance will allow + * more listeners to be added but will output a trace warning to stderr indicating + * that a "possible EventEmitter memory leak" has been detected. For any single + * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` + * methods can be used to temporarily avoid this warning: + * + * `defaultMaxListeners` has no effect on `AbortSignal` instances. While it is + * still possible to use `emitter.setMaxListeners(n)` to set a warning limit + * for individual `AbortSignal` instances, per default `AbortSignal` instances will not warn. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.setMaxListeners(emitter.getMaxListeners() + 1); + * emitter.once('event', () => { + * // do stuff + * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); + * }); + * ``` + * + * The `--trace-warnings` command-line flag can be used to display the + * stack trace for such warnings. + * + * The emitted warning can be inspected with `process.on('warning')` and will + * have the additional `emitter`, `type`, and `count` properties, referring to + * the event emitter instance, the event's name and the number of attached + * listeners, respectively. + * Its `name` property is set to `'MaxListenersExceededWarning'`. + * @since v0.11.2 + */ + let defaultMaxListeners: number; + /** + * This symbol shall be used to install a listener for only monitoring `'error'` + * events. Listeners installed using this symbol are called before the regular + * `'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an + * `'error'` event is emitted. Therefore, the process will still crash if no + * regular `'error'` listener is installed. + * @since v13.6.0, v12.17.0 + */ + const errorMonitor: unique symbol; + /** + * Listens once to the `abort` event on the provided `signal`. + * + * Listening to the `abort` event on abort signals is unsafe and may + * lead to resource leaks since another third party with the signal can + * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change + * this since it would violate the web standard. Additionally, the original + * API makes it easy to forget to remove listeners. + * + * This API allows safely using `AbortSignal`s in Node.js APIs by solving these + * two issues by listening to the event such that `stopImmediatePropagation` does + * not prevent the listener from running. + * + * Returns a disposable so that it may be unsubscribed from more easily. + * + * ```js + * import { addAbortListener } from 'node:events'; + * + * function example(signal) { + * let disposable; + * try { + * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); + * disposable = addAbortListener(signal, (e) => { + * // Do something when signal is aborted. + * }); + * } finally { + * disposable?.[Symbol.dispose](); + * } + * } + * ``` + * @since v20.5.0 + * @return Disposable that removes the `abort` listener. + */ + function addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * import { getEventListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + function getEventListeners(emitter: EventEmitter, name: string | symbol): ((...args: any[]) => void)[]; + function getEventListeners(emitter: EventTarget, name: string): ((...args: any[]) => void)[]; + /** + * Returns the currently set max amount of listeners. + * + * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the max event listeners for the + * event target. If the number of event handlers on a single EventTarget exceeds + * the max set, the EventTarget will print a warning. + * + * ```js + * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * console.log(getMaxListeners(ee)); // 10 + * setMaxListeners(11, ee); + * console.log(getMaxListeners(ee)); // 11 + * } + * { + * const et = new EventTarget(); + * console.log(getMaxListeners(et)); // 10 + * setMaxListeners(11, et); + * console.log(getMaxListeners(et)); // 11 + * } + * ``` + * @since v19.9.0 + */ + function getMaxListeners(emitter: EventEmitter | EventTarget): number; + /** + * A class method that returns the number of listeners for the given `eventName` + * registered on the given `emitter`. + * + * ```js + * import { EventEmitter, listenerCount } from 'node:events'; + * + * const myEmitter = new EventEmitter(); + * myEmitter.on('event', () => {}); + * myEmitter.on('event', () => {}); + * console.log(listenerCount(myEmitter, 'event')); + * // Prints: 2 + * ``` + * @since v0.9.12 + * @deprecated Use `emitter.listenerCount()` instead. + * @param emitter The emitter to query + * @param eventName The event name + */ + function listenerCount(emitter: EventEmitter, eventName: string | symbol): number; + interface OnOptions extends Abortable { + /** + * Names of events that will end the iteration. + */ + close?: readonly string[] | undefined; + /** + * The high watermark. The emitter is paused every time the size of events + * being buffered is higher than it. Supported only on emitters implementing + * `pause()` and `resume()` methods. + * @default Number.MAX_SAFE_INTEGER + */ + highWaterMark?: number | undefined; + /** + * The low watermark. The emitter is resumed every time the size of events + * being buffered is lower than it. Supported only on emitters implementing + * `pause()` and `resume()` methods. + * @default 1 + */ + lowWaterMark?: number | undefined; + } + /** + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @returns `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + */ + function on( + emitter: EventEmitter, + eventName: string | symbol, + options?: OnOptions, + ): NodeJS.AsyncIterator; + function on( + emitter: EventTarget, + eventName: string, + options?: OnOptions, + ): NodeJS.AsyncIterator; + interface OnceOptions extends Abortable {} + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform + * [EventTarget][WHATWG-EventTarget] interface, which has no special + * `'error'` event semantics and does not listen to the `'error'` event. + * + * ```js + * import { once, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.error('error happened', err); + * } + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()` + * is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.error('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + function once( + emitter: EventEmitter, + eventName: string | symbol, + options?: OnceOptions, + ): Promise; + function once(emitter: EventTarget, eventName: string, options?: OnceOptions): Promise; + /** + * ```js + * import { setMaxListeners, EventEmitter } from 'node:events'; + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventTargets Zero or more `EventTarget` + * or `EventEmitter` instances. If none are specified, `n` is set as the default + * max for all newly created `EventTarget` and `EventEmitter` objects. + * objects. + */ + function setMaxListeners(n: number, ...eventTargets: ReadonlyArray): void; + /** + * This is the interface from which event-emitting Node.js APIs inherit in the types package. + * **It is not intended for consumer use.** + * + * It provides event-mapped definitions similar to EventEmitter, except that its signatures + * are deliberately permissive: they provide type _hinting_, but not rigid type-checking, + * for compatibility reasons. + * + * Classes that inherit directly from EventEmitter in JavaScript can inherit directly from + * this interface in the type definitions. Classes that are more than one inheritance level + * away from EventEmitter (eg. `net.Socket` > `stream.Duplex` > `EventEmitter`) must instead + * copy these method definitions into the derived class. Search "#region InternalEventEmitter" + * for examples. + * @internal + */ + interface InternalEventEmitter> extends EventEmitter { + addListener(eventName: E, listener: (...args: T[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: T[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount(eventName: E, listener?: (...args: T[E]) => void): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: T[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: T[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: T[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: T[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener(eventName: E, listener: (...args: T[E]) => void): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(eventName: E, listener: (...args: T[E]) => void): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: T[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener(eventName: E, listener: (...args: T[E]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + interface EventEmitterReferencingAsyncResource extends AsyncResource { + readonly eventEmitter: EventEmitterAsyncResource; + } + interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { + /** + * The type of async event. + * @default new.target.name + */ + name?: string | undefined; + } + /** + * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that + * require manual async tracking. Specifically, all events emitted by instances + * of `events.EventEmitterAsyncResource` will run within its [async context](https://nodejs.org/docs/latest-v25.x/api/async_context.html). + * + * ```js + * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; + * import { notStrictEqual, strictEqual } from 'node:assert'; + * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; + * + * // Async tracking tooling will identify this as 'Q'. + * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); + * + * // 'foo' listeners will run in the EventEmitters async context. + * ee1.on('foo', () => { + * strictEqual(executionAsyncId(), ee1.asyncId); + * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); + * }); + * + * const ee2 = new EventEmitter(); + * + * // 'foo' listeners on ordinary EventEmitters that do not track async + * // context, however, run in the same async context as the emit(). + * ee2.on('foo', () => { + * notStrictEqual(executionAsyncId(), ee2.asyncId); + * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); + * }); + * + * Promise.resolve().then(() => { + * ee1.emit('foo'); + * ee2.emit('foo'); + * }); + * ``` + * + * The `EventEmitterAsyncResource` class has the same methods and takes the + * same options as `EventEmitter` and `AsyncResource` themselves. + * @since v17.4.0, v16.14.0 + */ + class EventEmitterAsyncResource extends EventEmitter { + constructor(options?: EventEmitterAsyncResourceOptions); + /** + * The unique `asyncId` assigned to the resource. + */ + readonly asyncId: number; + /** + * The returned `AsyncResource` object has an additional `eventEmitter` property + * that provides a reference to this `EventEmitterAsyncResource`. + */ + readonly asyncResource: EventEmitterReferencingAsyncResource; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + */ + emitDestroy(): void; + /** + * The same `triggerAsyncId` that is passed to the + * `AsyncResource` constructor. + */ + readonly triggerAsyncId: number; + } + /** + * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget` + * that emulates a subset of the `EventEmitter` API. + * @since v14.5.0 + */ + interface NodeEventTarget extends EventTarget { + /** + * Node.js-specific extension to the `EventTarget` class that emulates the + * equivalent `EventEmitter` API. The only difference between `addListener()` and + * `addEventListener()` is that `addListener()` will return a reference to the + * `EventTarget`. + * @since v14.5.0 + */ + addListener(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class that dispatches the + * `arg` to the list of handlers for `type`. + * @since v15.2.0 + * @returns `true` if event listeners registered for the `type` exist, + * otherwise `false`. + */ + emit(type: string, arg: any): boolean; + /** + * Node.js-specific extension to the `EventTarget` class that returns an array + * of event `type` names for which event listeners are registered. + * @since 14.5.0 + */ + eventNames(): string[]; + /** + * Node.js-specific extension to the `EventTarget` class that returns the number + * of event listeners registered for the `type`. + * @since v14.5.0 + */ + listenerCount(type: string): number; + /** + * Node.js-specific extension to the `EventTarget` class that sets the number + * of max event listeners as `n`. + * @since v14.5.0 + */ + setMaxListeners(n: number): void; + /** + * Node.js-specific extension to the `EventTarget` class that returns the number + * of max event listeners. + * @since v14.5.0 + */ + getMaxListeners(): number; + /** + * Node.js-specific alias for `eventTarget.removeEventListener()`. + * @since v14.5.0 + */ + off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + /** + * Node.js-specific alias for `eventTarget.addEventListener()`. + * @since v14.5.0 + */ + on(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class that adds a `once` + * listener for the given event `type`. This is equivalent to calling `on` + * with the `once` option set to `true`. + * @since v14.5.0 + */ + once(type: string, listener: (arg: any) => void): this; + /** + * Node.js-specific extension to the `EventTarget` class. If `type` is specified, + * removes all registered listeners for `type`, otherwise removes all registered + * listeners. + * @since v14.5.0 + */ + removeAllListeners(type?: string): this; + /** + * Node.js-specific extension to the `EventTarget` class that removes the + * `listener` for the given `type`. The only difference between `removeListener()` + * and `removeEventListener()` is that `removeListener()` will return a reference + * to the `EventTarget`. + * @since v14.5.0 + */ + removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + } + /** @internal */ + type InternalEventTargetEventProperties = { + [K in keyof T & string as `on${K}`]: ((ev: T[K]) => void) | null; + }; + } export = EventEmitter; } -declare module "node:events" { - import events = require("events"); +declare module "events" { + import events = require("node:events"); export = events; } diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts index b300ca45..6eb69846 100644 --- a/node_modules/@types/node/fs.d.ts +++ b/node_modules/@types/node/fs.d.ts @@ -16,34 +16,33 @@ * * All file system operations have synchronous, callback, and promise-based * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/fs.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/fs.js) */ -declare module "fs" { +declare module "node:fs" { import { NonSharedBuffer } from "node:buffer"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import { FileHandle } from "node:fs/promises"; import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; /** * Valid types for path values in "fs". */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = + type PathLike = string | Buffer | URL; + type PathOrFileDescriptor = PathLike | number; + type TimeLike = string | number | Date; + type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + type BufferEncodingOption = | "buffer" | { encoding: "buffer"; }; - export interface ObjectEncodingOptions { + interface ObjectEncodingOptions { encoding?: BufferEncoding | null | undefined; } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { + type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + type OpenMode = number | string; + type Mode = number | string; + interface StatsBase { isFile(): boolean; isDirectory(): boolean; isBlockDevice(): boolean; @@ -70,7 +69,7 @@ declare module "fs" { ctime: Date; birthtime: Date; } - export interface Stats extends StatsBase {} + interface Stats extends StatsBase {} /** * A `fs.Stats` object provides information about a file. * @@ -131,10 +130,10 @@ declare module "fs" { * ``` * @since v0.1.21 */ - export class Stats { + class Stats { private constructor(); } - export interface StatsFsBase { + interface StatsFsBase { /** Type of file system. */ type: T; /** Optimal transfer block size. */ @@ -150,7 +149,7 @@ declare module "fs" { /** Free file nodes in file system. */ ffree: T; } - export interface StatsFs extends StatsFsBase {} + interface StatsFs extends StatsFsBase {} /** * Provides information about a mounted file system. * @@ -185,9 +184,9 @@ declare module "fs" { * ``` * @since v19.6.0, v18.15.0 */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { + class StatsFs {} + interface BigIntStatsFs extends StatsFsBase {} + interface StatFsOptions { bigint?: boolean | undefined; } /** @@ -199,7 +198,7 @@ declare module "fs" { * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. * @since v10.10.0 */ - export class Dirent { + class Dirent { /** * Returns `true` if the `fs.Dirent` object describes a regular file. * @since v10.10.0 @@ -270,7 +269,7 @@ declare module "fs" { * closed after the iterator exits. * @since v12.12.0 */ - export class Dir implements AsyncIterable { + class Dir implements AsyncIterable { /** * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. * @since v12.12.0 @@ -342,7 +341,7 @@ declare module "fs" { * Extends `EventEmitter` * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. */ - export interface StatWatcher extends EventEmitter { + interface StatWatcher extends EventEmitter { /** * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have * no effect. @@ -363,7 +362,12 @@ declare module "fs" { */ unref(): this; } - export interface FSWatcher extends EventEmitter { + interface FSWatcherEventMap { + "change": [eventType: string, filename: string | NonSharedBuffer]; + "close": []; + "error": [error: Error]; + } + interface FSWatcher extends InternalEventEmitter { /** * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. * @since v0.5.8 @@ -388,44 +392,18 @@ declare module "fs" { * @since v14.3.0, v12.20.0 */ unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener( - event: "change", - listener: (eventType: string, filename: string | NonSharedBuffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "change", - listener: (eventType: string, filename: string | NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; + } + interface ReadStreamEventMap extends stream.ReadableEventMap { + "close": []; + "data": [chunk: string | NonSharedBuffer]; + "open": [fd: number]; + "ready": []; } /** * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. * @since v0.1.93 */ - export class ReadStream extends stream.Readable { + class ReadStream extends stream.Readable { close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; /** * The number of bytes that have been read so far. @@ -445,19 +423,53 @@ declare module "fs" { * @since v11.2.0, v10.16.0 */ pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: K, listener: ReadStreamEvents[K]): this; - on(event: K, listener: ReadStreamEvents[K]): this; - once(event: K, listener: ReadStreamEvents[K]): this; - prependListener(event: K, listener: ReadStreamEvents[K]): this; - prependOnceListener(event: K, listener: ReadStreamEvents[K]): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ReadStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ReadStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ReadStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } - export interface Utf8StreamOptions { + interface Utf8StreamOptions { /** * Appends writes to dest file instead of truncating it. * @default true @@ -533,6 +545,15 @@ declare module "fs" { */ sync?: boolean | undefined; } + interface Utf8StreamEventMap { + "close": []; + "drain": []; + "drop": [data: string | Buffer]; + "error": [error: Error]; + "finish": []; + "ready": []; + "write": [n: number]; + } /** * An optimized UTF-8 stream writer that allows for flushing all the internal * buffering on demand. It handles `EAGAIN` errors correctly, allowing for @@ -540,7 +561,7 @@ declare module "fs" { * @since v24.6.0 * @experimental */ - export class Utf8Stream extends EventEmitter { + class Utf8Stream implements EventEmitter { constructor(options: Utf8StreamOptions); /** * Whether the stream is appending to the file or truncating it. @@ -634,95 +655,18 @@ declare module "fs" { * Calls `utf8Stream.destroy()`. */ [Symbol.dispose](): void; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "drop", listener: (data: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "write", listener: (n: number) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "drop", listener: (data: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "write", listener: (n: number) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "drop", listener: (data: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "write", listener: (n: number) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "drop", listener: (data: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "write", listener: (n: number) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "write", listener: (n: number) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; } - - /** - * The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted. - */ - type ReadStreamEvents = { - close: () => void; - data: (chunk: Buffer | string) => void; - end: () => void; - error: (err: Error) => void; - open: (fd: number) => void; - pause: () => void; - readable: () => void; - ready: () => void; - resume: () => void; - } & CustomEvents; - - /** - * string & {} allows to allow any kind of strings for the event - * but still allows to have auto completion for the normal events. - */ - type CustomEvents = { [Key in string & {} | symbol]: (...args: any[]) => void }; - - /** - * The Keys are events of the WriteStream and the values are the functions that are called when the event is emitted. - */ - type WriteStreamEvents = { - close: () => void; - drain: () => void; - error: (err: Error) => void; - finish: () => void; - open: (fd: number) => void; - pipe: (src: stream.Readable) => void; - ready: () => void; - unpipe: (src: stream.Readable) => void; - } & CustomEvents; + interface Utf8Stream extends InternalEventEmitter {} + interface WriteStreamEventMap extends stream.WritableEventMap { + "close": []; + "open": [fd: number]; + "ready": []; + } /** - * * Extends `stream.Writable` - * * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. * @since v0.1.93 */ - export class WriteStream extends stream.Writable { + class WriteStream extends stream.Writable { /** * Closes `writeStream`. Optionally accepts a * callback that will be executed once the `writeStream`is closed. @@ -748,17 +692,57 @@ declare module "fs" { * @since v11.2.0 */ pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: K, listener: WriteStreamEvents[K]): this; - on(event: K, listener: WriteStreamEvents[K]): this; - once(event: K, listener: WriteStreamEvents[K]): this; - prependListener(event: K, listener: WriteStreamEvents[K]): this; - prependOnceListener(event: K, listener: WriteStreamEvents[K]): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WriteStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WriteStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } /** * Asynchronously rename file at `oldPath` to the pathname provided @@ -779,8 +763,8 @@ declare module "fs" { * ``` * @since v0.0.2 */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { + function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + namespace rename { /** * Asynchronous rename(2) - Change the name or location of a file or directory. * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -796,7 +780,7 @@ declare module "fs" { * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. * @since v0.1.21 */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; + function renameSync(oldPath: PathLike, newPath: PathLike): void; /** * Truncates the file. No arguments other than a possible exception are * given to the completion callback. A file descriptor can also be passed as the @@ -818,13 +802,13 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; + function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous truncate(2) - Truncate a file to a specified length. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { + function truncate(path: PathLike, callback: NoParamCallback): void; + namespace truncate { /** * Asynchronous truncate(2) - Truncate a file to a specified length. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -841,7 +825,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncateSync(path: PathLike, len?: number): void; + function truncateSync(path: PathLike, len?: number): void; /** * Truncates the file descriptor. No arguments other than a possible exception are * given to the completion callback. @@ -885,13 +869,13 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; + function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous ftruncate(2) - Truncate a file to a specified length. * @param fd A file descriptor. */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { + function ftruncate(fd: number, callback: NoParamCallback): void; + namespace ftruncate { /** * Asynchronous ftruncate(2) - Truncate a file to a specified length. * @param fd A file descriptor. @@ -907,7 +891,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncateSync(fd: number, len?: number): void; + function ftruncateSync(fd: number, len?: number): void; /** * Asynchronously changes owner and group of a file. No arguments other than a * possible exception are given to the completion callback. @@ -915,8 +899,8 @@ declare module "fs" { * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. * @since v0.1.97 */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { + function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + namespace chown { /** * Asynchronous chown(2) - Change ownership of a file. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -930,7 +914,7 @@ declare module "fs" { * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. * @since v0.1.97 */ - export function chownSync(path: PathLike, uid: number, gid: number): void; + function chownSync(path: PathLike, uid: number, gid: number): void; /** * Sets the owner of the file. No arguments other than a possible exception are * given to the completion callback. @@ -938,8 +922,8 @@ declare module "fs" { * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. * @since v0.4.7 */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { + function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + namespace fchown { /** * Asynchronous fchown(2) - Change ownership of a file. * @param fd A file descriptor. @@ -954,15 +938,15 @@ declare module "fs" { * @param uid The file's new owner's user id. * @param gid The file's new group's group id. */ - export function fchownSync(fd: number, uid: number, gid: number): void; + function fchownSync(fd: number, uid: number, gid: number): void; /** * Set the owner of the symbolic link. No arguments other than a possible * exception are given to the completion callback. * * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { + function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + namespace lchown { /** * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -976,7 +960,7 @@ declare module "fs" { * @param uid The file's new owner's user id. * @param gid The file's new group's group id. */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; + function lchownSync(path: PathLike, uid: number, gid: number): void; /** * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic * link, then the link is not dereferenced: instead, the timestamps of the @@ -986,8 +970,8 @@ declare module "fs" { * callback. * @since v14.5.0, v12.19.0 */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace lutimes { /** * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, * with the difference that if the path refers to a symbolic link, then the link is not @@ -1004,7 +988,7 @@ declare module "fs" { * the operation fails. This is the synchronous version of {@link lutimes}. * @since v14.5.0, v12.19.0 */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; /** * Asynchronously changes the permissions of a file. No arguments other than a * possible exception are given to the completion callback. @@ -1021,8 +1005,8 @@ declare module "fs" { * ``` * @since v0.1.30 */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { + function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + namespace chmod { /** * Asynchronous chmod(2) - Change permissions of a file. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1037,7 +1021,7 @@ declare module "fs" { * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. * @since v0.6.7 */ - export function chmodSync(path: PathLike, mode: Mode): void; + function chmodSync(path: PathLike, mode: Mode): void; /** * Sets the permissions on the file. No arguments other than a possible exception * are given to the completion callback. @@ -1045,8 +1029,8 @@ declare module "fs" { * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. * @since v0.4.7 */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { + function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + namespace fchmod { /** * Asynchronous fchmod(2) - Change permissions of a file. * @param fd A file descriptor. @@ -1060,7 +1044,7 @@ declare module "fs" { * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. * @since v0.4.7 */ - export function fchmodSync(fd: number, mode: Mode): void; + function fchmodSync(fd: number, mode: Mode): void; /** * Changes the permissions on a symbolic link. No arguments other than a possible * exception are given to the completion callback. @@ -1070,9 +1054,9 @@ declare module "fs" { * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. * @deprecated Since v0.4.7 */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; /** @deprecated */ - export namespace lchmod { + namespace lchmod { /** * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1088,7 +1072,7 @@ declare module "fs" { * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. * @deprecated Since v0.4.7 */ - export function lchmodSync(path: PathLike, mode: Mode): void; + function lchmodSync(path: PathLike, mode: Mode): void; /** * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. * @@ -1174,8 +1158,8 @@ declare module "fs" { * ``` * @since v0.0.2 */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( + function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function stat( path: PathLike, options: | (StatOptions & { @@ -1184,19 +1168,19 @@ declare module "fs" { | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, ): void; - export function stat( + function stat( path: PathLike, options: StatOptions & { bigint: true; }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, ): void; - export function stat( + function stat( path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, ): void; - export namespace stat { + namespace stat { /** * Asynchronous stat(2) - Get file status. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1215,7 +1199,7 @@ declare module "fs" { ): Promise; function __promisify__(path: PathLike, options?: StatOptions): Promise; } - export interface StatSyncFn extends Function { + interface StatSyncFn extends Function { (path: PathLike, options?: undefined): Stats; ( path: PathLike, @@ -1256,15 +1240,15 @@ declare module "fs" { * Synchronous stat(2) - Get file status. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export const statSync: StatSyncFn; + const statSync: StatSyncFn; /** * Invokes the callback with the `fs.Stats` for the file descriptor. * * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. * @since v0.1.95 */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( + function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function fstat( fd: number, options: | (StatOptions & { @@ -1273,19 +1257,19 @@ declare module "fs" { | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, ): void; - export function fstat( + function fstat( fd: number, options: StatOptions & { bigint: true; }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, ): void; - export function fstat( + function fstat( fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, ): void; - export namespace fstat { + namespace fstat { /** * Asynchronous fstat(2) - Get file status. * @param fd A file descriptor. @@ -1310,19 +1294,19 @@ declare module "fs" { * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. * @since v0.1.95 */ - export function fstatSync( + function fstatSync( fd: number, options?: StatOptions & { bigint?: false | undefined; }, ): Stats; - export function fstatSync( + function fstatSync( fd: number, options: StatOptions & { bigint: true; }, ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; /** * Retrieves the `fs.Stats` for the symbolic link referred to by the path. * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic @@ -1331,8 +1315,8 @@ declare module "fs" { * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. * @since v0.1.30 */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( + function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + function lstat( path: PathLike, options: | (StatOptions & { @@ -1341,19 +1325,19 @@ declare module "fs" { | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, ): void; - export function lstat( + function lstat( path: PathLike, options: StatOptions & { bigint: true; }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, ): void; - export function lstat( + function lstat( path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, ): void; - export namespace lstat { + namespace lstat { /** * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1380,8 +1364,8 @@ declare module "fs" { * @since v19.6.0, v18.15.0 * @param path A path to an existing file or directory on the file system to be queried. */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( + function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; + function statfs( path: PathLike, options: | (StatFsOptions & { @@ -1390,19 +1374,19 @@ declare module "fs" { | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, ): void; - export function statfs( + function statfs( path: PathLike, options: StatFsOptions & { bigint: true; }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, ): void; - export function statfs( + function statfs( path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, ): void; - export namespace statfs { + namespace statfs { /** * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. * @param path A path to an existing file or directory on the file system to be queried. @@ -1429,32 +1413,32 @@ declare module "fs" { * @since v19.6.0, v18.15.0 * @param path A path to an existing file or directory on the file system to be queried. */ - export function statfsSync( + function statfsSync( path: PathLike, options?: StatFsOptions & { bigint?: false | undefined; }, ): StatsFs; - export function statfsSync( + function statfsSync( path: PathLike, options: StatFsOptions & { bigint: true; }, ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; + function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; /** * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export const lstatSync: StatSyncFn; + const lstatSync: StatSyncFn; /** * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than * a possible * exception are given to the completion callback. * @since v0.1.31 */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { + function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + namespace link { /** * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1466,7 +1450,7 @@ declare module "fs" { * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. * @since v0.1.31 */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; + function linkSync(existingPath: PathLike, newPath: PathLike): void; /** * Creates the link called `path` pointing to `target`. No arguments other than a * possible exception are given to the completion callback. @@ -1500,7 +1484,7 @@ declare module "fs" { * @since v0.1.31 * @param [type='null'] */ - export function symlink( + function symlink( target: PathLike, path: PathLike, type: symlink.Type | undefined | null, @@ -1511,8 +1495,8 @@ declare module "fs" { * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { + function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + namespace symlink { /** * Asynchronous symlink(2) - Create a new symbolic link to an existing file. * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. @@ -1531,7 +1515,7 @@ declare module "fs" { * @since v0.1.31 * @param [type='null'] */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; /** * Reads the contents of the symbolic link referred to by `path`. The callback gets * two arguments `(err, linkString)`. @@ -1544,7 +1528,7 @@ declare module "fs" { * the link path returned will be passed as a `Buffer` object. * @since v0.1.31 */ - export function readlink( + function readlink( path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, @@ -1554,7 +1538,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readlink( + function readlink( path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: NonSharedBuffer) => void, @@ -1564,7 +1548,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readlink( + function readlink( path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | NonSharedBuffer) => void, @@ -1573,11 +1557,11 @@ declare module "fs" { * Asynchronous readlink(2) - read value of a symbolic link. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function readlink( + function readlink( path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, ): void; - export namespace readlink { + namespace readlink { /** * Asynchronous readlink(2) - read value of a symbolic link. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1608,19 +1592,19 @@ declare module "fs" { * the link path returned will be passed as a `Buffer` object. * @since v0.1.31 */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; + function readlinkSync(path: PathLike, options?: EncodingOption): string; /** * Synchronous readlink(2) - read value of a symbolic link. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; + function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; /** * Synchronous readlink(2) - read value of a symbolic link. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; + function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; /** * Asynchronously computes the canonical pathname by resolving `.`, `..`, and * symbolic links. @@ -1647,7 +1631,7 @@ declare module "fs" { * dependent name for that object. * @since v0.1.31 */ - export function realpath( + function realpath( path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, @@ -1657,7 +1641,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function realpath( + function realpath( path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void, @@ -1667,7 +1651,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function realpath( + function realpath( path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void, @@ -1676,11 +1660,11 @@ declare module "fs" { * Asynchronous realpath(3) - return the canonicalized absolute pathname. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function realpath( + function realpath( path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, ): void; - export namespace realpath { + namespace realpath { /** * Asynchronous realpath(3) - return the canonicalized absolute pathname. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1743,20 +1727,20 @@ declare module "fs" { * this API: {@link realpath}. * @since v0.1.31 */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; + function realpathSync(path: PathLike, options?: EncodingOption): string; /** * Synchronous realpath(3) - return the canonicalized absolute pathname. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; + function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; /** * Synchronous realpath(3) - return the canonicalized absolute pathname. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; - export namespace realpathSync { + function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; + namespace realpathSync { function native(path: PathLike, options?: EncodingOption): string; function native(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; function native(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; @@ -1780,8 +1764,8 @@ declare module "fs" { * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. * @since v0.0.2 */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { + function unlink(path: PathLike, callback: NoParamCallback): void; + namespace unlink { /** * Asynchronous unlink(2) - delete a name and possibly the file it refers to. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -1792,34 +1776,10 @@ declare module "fs" { * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. * @since v0.1.21 */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } + function unlinkSync(path: PathLike): void; + /** @deprecated `rmdir()` no longer provides any options. This interface will be removed in a future version. */ + // TODO: remove in future major + interface RmDirOptions {} /** * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given * to the completion callback. @@ -1830,14 +1790,13 @@ declare module "fs" { * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. * @since v0.0.2 */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { + function rmdir(path: PathLike, callback: NoParamCallback): void; + namespace rmdir { /** * Asynchronous rmdir(2) - delete a directory. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + function __promisify__(path: PathLike): Promise; } /** * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. @@ -1848,8 +1807,8 @@ declare module "fs" { * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. * @since v0.1.21 */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { + function rmdirSync(path: PathLike): void; + interface RmOptions { /** * When `true`, exceptions will be ignored if `path` does not exist. * @default false @@ -1882,9 +1841,9 @@ declare module "fs" { * completion callback. * @since v14.14.0 */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { + function rm(path: PathLike, callback: NoParamCallback): void; + function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + namespace rm { /** * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). */ @@ -1894,8 +1853,8 @@ declare module "fs" { * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. * @since v14.14.0 */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { + function rmSync(path: PathLike, options?: RmOptions): void; + interface MakeDirectoryOptions { /** * Indicates whether parent folders should be created. * If a folder was created, the path to the first created folder will be returned. @@ -1944,7 +1903,7 @@ declare module "fs" { * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. * @since v0.1.8 */ - export function mkdir( + function mkdir( path: PathLike, options: MakeDirectoryOptions & { recursive: true; @@ -1957,7 +1916,7 @@ declare module "fs" { * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. */ - export function mkdir( + function mkdir( path: PathLike, options: | Mode @@ -1974,7 +1933,7 @@ declare module "fs" { * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. */ - export function mkdir( + function mkdir( path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void, @@ -1983,8 +1942,8 @@ declare module "fs" { * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { + function mkdir(path: PathLike, callback: NoParamCallback): void; + namespace mkdir { /** * Asynchronous mkdir(2) - create a directory. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -2030,7 +1989,7 @@ declare module "fs" { * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. * @since v0.1.21 */ - export function mkdirSync( + function mkdirSync( path: PathLike, options: MakeDirectoryOptions & { recursive: true; @@ -2042,7 +2001,7 @@ declare module "fs" { * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. */ - export function mkdirSync( + function mkdirSync( path: PathLike, options?: | Mode @@ -2057,7 +2016,7 @@ declare module "fs" { * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; /** * Creates a unique temporary directory. * @@ -2117,7 +2076,7 @@ declare module "fs" { * ``` * @since v5.10.0 */ - export function mkdtemp( + function mkdtemp( prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void, @@ -2127,7 +2086,7 @@ declare module "fs" { * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function mkdtemp( + function mkdtemp( prefix: string, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: NonSharedBuffer) => void, @@ -2137,7 +2096,7 @@ declare module "fs" { * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function mkdtemp( + function mkdtemp( prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | NonSharedBuffer) => void, @@ -2146,11 +2105,11 @@ declare module "fs" { * Asynchronously creates a unique temporary directory. * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. */ - export function mkdtemp( + function mkdtemp( prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void, ): void; - export namespace mkdtemp { + namespace mkdtemp { /** * Asynchronously creates a unique temporary directory. * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. @@ -2180,20 +2139,20 @@ declare module "fs" { * object with an `encoding` property specifying the character encoding to use. * @since v5.10.0 */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; + function mkdtempSync(prefix: string, options?: EncodingOption): string; /** * Synchronously creates a unique temporary directory. * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer; + function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer; /** * Synchronously creates a unique temporary directory. * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer; - export interface DisposableTempDir extends AsyncDisposable { + function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer; + interface DisposableTempDir extends AsyncDisposable { /** * The path of the created directory. */ @@ -2225,7 +2184,7 @@ declare module "fs" { * object with an `encoding` property specifying the character encoding to use. * @since v24.4.0 */ - export function mkdtempDisposableSync(prefix: string, options?: EncodingOption): DisposableTempDir; + function mkdtempDisposableSync(prefix: string, options?: EncodingOption): DisposableTempDir; /** * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. * @@ -2239,7 +2198,7 @@ declare module "fs" { * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. * @since v0.1.8 */ - export function readdir( + function readdir( path: PathLike, options: | { @@ -2257,7 +2216,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdir( + function readdir( path: PathLike, options: | { @@ -2273,7 +2232,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdir( + function readdir( path: PathLike, options: | (ObjectEncodingOptions & { @@ -2289,7 +2248,7 @@ declare module "fs" { * Asynchronous readdir(3) - read a directory. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function readdir( + function readdir( path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, ): void; @@ -2298,7 +2257,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. */ - export function readdir( + function readdir( path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true; @@ -2311,7 +2270,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. */ - export function readdir( + function readdir( path: PathLike, options: { encoding: "buffer"; @@ -2320,7 +2279,7 @@ declare module "fs" { }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, ): void; - export namespace readdir { + namespace readdir { /** * Asynchronous readdir(3) - read a directory. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -2406,7 +2365,7 @@ declare module "fs" { * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. * @since v0.1.21 */ - export function readdirSync( + function readdirSync( path: PathLike, options?: | { @@ -2422,7 +2381,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdirSync( + function readdirSync( path: PathLike, options: | { @@ -2437,7 +2396,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdirSync( + function readdirSync( path: PathLike, options?: | (ObjectEncodingOptions & { @@ -2452,7 +2411,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. */ - export function readdirSync( + function readdirSync( path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true; @@ -2464,7 +2423,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. */ - export function readdirSync( + function readdirSync( path: PathLike, options: { encoding: "buffer"; @@ -2482,8 +2441,8 @@ declare module "fs" { * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. * @since v0.0.2 */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { + function close(fd: number, callback?: NoParamCallback): void; + namespace close { /** * Asynchronous close(2) - close a file descriptor. * @param fd A file descriptor. @@ -2499,7 +2458,7 @@ declare module "fs" { * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. * @since v0.1.21 */ - export function closeSync(fd: number): void; + function closeSync(fd: number): void; /** * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. * @@ -2517,7 +2476,7 @@ declare module "fs" { * @param [flags='r'] See `support of file system `flags``. * @param [mode=0o666] */ - export function open( + function open( path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, @@ -2528,7 +2487,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param [flags='r'] See `support of file system `flags``. */ - export function open( + function open( path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void, @@ -2537,8 +2496,8 @@ declare module "fs" { * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { + function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + namespace open { /** * Asynchronous open(2) - open and possibly create a file. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -2555,7 +2514,7 @@ declare module "fs" { * @param [flags='r'] * @param [mode=0o666] */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; /** * Change the file system timestamps of the object referenced by `path`. * @@ -2565,8 +2524,8 @@ declare module "fs" { * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. * @since v0.4.2 */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace utimes { /** * Asynchronously change file timestamps of the file referenced by the supplied path. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -2582,14 +2541,14 @@ declare module "fs" { * this API: {@link utimes}. * @since v0.4.2 */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; /** * Change the file system timestamps of the object referenced by the supplied file * descriptor. See {@link utimes}. * @since v0.4.2 */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { + function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + namespace futimes { /** * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. * @param fd A file descriptor. @@ -2602,7 +2561,7 @@ declare module "fs" { * Synchronous version of {@link futimes}. Returns `undefined`. * @since v0.4.2 */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; /** * Request that all data for the open file descriptor is flushed to the storage * device. The specific implementation is operating system and device specific. @@ -2610,8 +2569,8 @@ declare module "fs" { * than a possible exception are given to the completion callback. * @since v0.1.96 */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { + function fsync(fd: number, callback: NoParamCallback): void; + namespace fsync { /** * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. * @param fd A file descriptor. @@ -2624,8 +2583,8 @@ declare module "fs" { * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. * @since v0.1.96 */ - export function fsyncSync(fd: number): void; - export interface WriteOptions { + function fsyncSync(fd: number): void; + interface WriteOptions { /** * @default 0 */ @@ -2666,7 +2625,7 @@ declare module "fs" { * @param [length=buffer.byteLength - offset] * @param [position='null'] */ - export function write( + function write( fd: number, buffer: TBuffer, offset: number | undefined | null, @@ -2680,7 +2639,7 @@ declare module "fs" { * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. */ - export function write( + function write( fd: number, buffer: TBuffer, offset: number | undefined | null, @@ -2692,7 +2651,7 @@ declare module "fs" { * @param fd A file descriptor. * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. */ - export function write( + function write( fd: number, buffer: TBuffer, offset: number | undefined | null, @@ -2702,7 +2661,7 @@ declare module "fs" { * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. * @param fd A file descriptor. */ - export function write( + function write( fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, @@ -2715,7 +2674,7 @@ declare module "fs" { * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. */ - export function write( + function write( fd: number, buffer: TBuffer, options: WriteOptions, @@ -2728,7 +2687,7 @@ declare module "fs" { * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. * @param encoding The expected string encoding. */ - export function write( + function write( fd: number, string: string, position: number | undefined | null, @@ -2741,7 +2700,7 @@ declare module "fs" { * @param string A string to write. * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. */ - export function write( + function write( fd: number, string: string, position: number | undefined | null, @@ -2752,12 +2711,12 @@ declare module "fs" { * @param fd A file descriptor. * @param string A string to write. */ - export function write( + function write( fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, ): void; - export namespace write { + namespace write { /** * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. * @param fd A file descriptor. @@ -2817,7 +2776,7 @@ declare module "fs" { * @param [position='null'] * @return The number of bytes written. */ - export function writeSync( + function writeSync( fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, @@ -2831,14 +2790,14 @@ declare module "fs" { * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. * @param encoding The expected string encoding. */ - export function writeSync( + function writeSync( fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null, ): number; - export type ReadPosition = number | bigint; - export interface ReadOptions { + type ReadPosition = number | bigint; + interface ReadOptions { /** * @default 0 */ @@ -2852,15 +2811,15 @@ declare module "fs" { */ position?: ReadPosition | null | undefined; } - export interface ReadOptionsWithBuffer extends ReadOptions { + interface ReadOptionsWithBuffer extends ReadOptions { buffer?: T | undefined; } /** @deprecated Use `ReadOptions` instead. */ // TODO: remove in future major - export interface ReadSyncOptions extends ReadOptions {} + interface ReadSyncOptions extends ReadOptions {} /** @deprecated Use `ReadOptionsWithBuffer` instead. */ // TODO: remove in future major - export interface ReadAsyncOptions extends ReadOptionsWithBuffer {} + interface ReadAsyncOptions extends ReadOptionsWithBuffer {} /** * Read data from the file specified by `fd`. * @@ -2878,7 +2837,7 @@ declare module "fs" { * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If * `position` is an integer, the file position will be unchanged. */ - export function read( + function read( fd: number, buffer: TBuffer, offset: number, @@ -2895,27 +2854,27 @@ declare module "fs" { * `position` defaults to `null` * @since v12.17.0, 13.11.0 */ - export function read( + function read( fd: number, options: ReadOptionsWithBuffer, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, ): void; - export function read( + function read( fd: number, buffer: TBuffer, options: ReadOptions, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, ): void; - export function read( + function read( fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, ): void; - export function read( + function read( fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NonSharedBuffer) => void, ): void; - export namespace read { + namespace read { /** * @param fd A file descriptor. * @param buffer The buffer that the data will be written to. @@ -2953,7 +2912,7 @@ declare module "fs" { * @since v0.1.21 * @param [position='null'] */ - export function readSync( + function readSync( fd: number, buffer: NodeJS.ArrayBufferView, offset: number, @@ -2964,7 +2923,7 @@ declare module "fs" { * Similar to the above `fs.readSync` function, this version takes an optional `options` object. * If no `options` object is specified, it will default with the above values. */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number; + function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number; /** * Asynchronously reads the entire contents of a file. * @@ -3031,7 +2990,7 @@ declare module "fs" { * @since v0.1.29 * @param path filename or file descriptor */ - export function readFile( + function readFile( path: PathOrFileDescriptor, options: | ({ @@ -3049,7 +3008,7 @@ declare module "fs" { * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. * If a flag is not provided, it defaults to `'r'`. */ - export function readFile( + function readFile( path: PathOrFileDescriptor, options: | ({ @@ -3066,7 +3025,7 @@ declare module "fs" { * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. * If a flag is not provided, it defaults to `'r'`. */ - export function readFile( + function readFile( path: PathOrFileDescriptor, options: | (ObjectEncodingOptions & { @@ -3082,11 +3041,11 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * If a file descriptor is provided, the underlying file will _not_ be closed automatically. */ - export function readFile( + function readFile( path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void, ): void; - export namespace readFile { + namespace readFile { /** * Asynchronously reads the entire contents of a file. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -3160,7 +3119,7 @@ declare module "fs" { * @since v0.1.8 * @param path filename or file descriptor */ - export function readFileSync( + function readFileSync( path: PathOrFileDescriptor, options?: { encoding?: null | undefined; @@ -3174,7 +3133,7 @@ declare module "fs" { * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. * If a flag is not provided, it defaults to `'r'`. */ - export function readFileSync( + function readFileSync( path: PathOrFileDescriptor, options: | { @@ -3190,7 +3149,7 @@ declare module "fs" { * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. * If a flag is not provided, it defaults to `'r'`. */ - export function readFileSync( + function readFileSync( path: PathOrFileDescriptor, options?: | (ObjectEncodingOptions & { @@ -3199,7 +3158,7 @@ declare module "fs" { | BufferEncoding | null, ): string | NonSharedBuffer; - export type WriteFileOptions = + type WriteFileOptions = | ( & ObjectEncodingOptions & Abortable @@ -3272,7 +3231,7 @@ declare module "fs" { * @since v0.1.29 * @param file filename or file descriptor */ - export function writeFile( + function writeFile( file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, @@ -3284,12 +3243,12 @@ declare module "fs" { * If a file descriptor is provided, the underlying file will _not_ be closed automatically. * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. */ - export function writeFile( + function writeFile( path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback, ): void; - export namespace writeFile { + namespace writeFile { /** * Asynchronously writes data to a file, replacing the file if it already exists. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -3318,7 +3277,7 @@ declare module "fs" { * @since v0.1.29 * @param file filename or file descriptor */ - export function writeFileSync( + function writeFileSync( file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions, @@ -3376,7 +3335,7 @@ declare module "fs" { * @since v0.6.7 * @param path filename or file descriptor */ - export function appendFile( + function appendFile( path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, @@ -3388,8 +3347,8 @@ declare module "fs" { * If a file descriptor is provided, the underlying file will _not_ be closed automatically. * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { + function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + namespace appendFile { /** * Asynchronously append data to a file, creating the file if it does not exist. * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -3455,7 +3414,7 @@ declare module "fs" { * @since v0.6.7 * @param path filename or file descriptor */ - export function appendFileSync( + function appendFileSync( path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions, @@ -3506,7 +3465,7 @@ declare module "fs" { * * the file is renamed and then renamed a second time back to its original name * @since v0.1.31 */ - export interface WatchFileOptions { + interface WatchFileOptions { bigint?: boolean | undefined; persistent?: boolean | undefined; interval?: number | undefined; @@ -3557,7 +3516,7 @@ declare module "fs" { * * the file is renamed and then renamed a second time back to its original name * @since v0.1.31 */ - export function watchFile( + function watchFile( filename: PathLike, options: | (WatchFileOptions & { @@ -3566,7 +3525,7 @@ declare module "fs" { | undefined, listener: StatsListener, ): StatWatcher; - export function watchFile( + function watchFile( filename: PathLike, options: | (WatchFileOptions & { @@ -3579,7 +3538,7 @@ declare module "fs" { * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; + function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; /** * Stop watching for changes on `filename`. If `listener` is specified, only that * particular listener is removed. Otherwise, _all_ listeners are removed, @@ -3592,23 +3551,23 @@ declare module "fs" { * @since v0.1.31 * @param listener Optional, a listener previously attached using `fs.watchFile()` */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { + function unwatchFile(filename: PathLike, listener?: StatsListener): void; + function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; + interface WatchOptions extends Abortable { encoding?: BufferEncoding | "buffer" | undefined; persistent?: boolean | undefined; recursive?: boolean | undefined; } - export interface WatchOptionsWithBufferEncoding extends WatchOptions { + interface WatchOptionsWithBufferEncoding extends WatchOptions { encoding: "buffer"; } - export interface WatchOptionsWithStringEncoding extends WatchOptions { + interface WatchOptionsWithStringEncoding extends WatchOptions { encoding?: BufferEncoding | undefined; } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; + type WatchEventType = "rename" | "change"; + type WatchListener = (event: WatchEventType, filename: T | null) => void; + type StatsListener = (curr: Stats, prev: Stats) => void; + type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; /** * Watch for changes on `filename`, where `filename` is either a file or a * directory. @@ -3629,22 +3588,22 @@ declare module "fs" { * @since v0.5.10 * @param listener */ - export function watch( + function watch( filename: PathLike, options?: WatchOptionsWithStringEncoding | BufferEncoding | null, listener?: WatchListener, ): FSWatcher; - export function watch( + function watch( filename: PathLike, options: WatchOptionsWithBufferEncoding | "buffer", listener: WatchListener, ): FSWatcher; - export function watch( + function watch( filename: PathLike, options: WatchOptions | BufferEncoding | "buffer" | null, listener: WatchListener, ): FSWatcher; - export function watch(filename: PathLike, listener: WatchListener): FSWatcher; + function watch(filename: PathLike, listener: WatchListener): FSWatcher; /** * Test whether or not the given path exists by checking with the file system. * Then call the `callback` argument with either true or false: @@ -3774,9 +3733,9 @@ declare module "fs" { * @since v0.0.2 * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; + function exists(path: PathLike, callback: (exists: boolean) => void): void; /** @deprecated */ - export namespace exists { + namespace exists { /** * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. * URL support is _experimental_. @@ -3800,8 +3759,8 @@ declare module "fs" { * ``` * @since v0.1.21 */ - export function existsSync(path: PathLike): boolean; - export namespace constants { + function existsSync(path: PathLike): boolean; + namespace constants { // File Access Constants /** Constant for fs.access(). File is visible to the calling process. */ const F_OK: number; @@ -4075,13 +4034,13 @@ declare module "fs" { * @since v0.11.15 * @param [mode=fs.constants.F_OK] */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; /** * Asynchronously tests a user's permissions for the file specified by path. * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { + function access(path: PathLike, callback: NoParamCallback): void; + namespace access { /** * Asynchronously tests a user's permissions for the file specified by path. * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. @@ -4112,11 +4071,11 @@ declare module "fs" { * @since v0.11.15 * @param [mode=fs.constants.F_OK] */ - export function accessSync(path: PathLike, mode?: number): void; + function accessSync(path: PathLike, mode?: number): void; interface StreamOptions { flags?: string | undefined; encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; + fd?: number | FileHandle | undefined; mode?: number | undefined; autoClose?: boolean | undefined; emitClose?: boolean | undefined; @@ -4204,7 +4163,7 @@ declare module "fs" { * If `options` is a string, then it specifies the encoding. * @since v0.1.31 */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; /** * `options` may also include a `start` option to allow writing data at some * position past the beginning of the file, allowed values are in the @@ -4232,7 +4191,7 @@ declare module "fs" { * If `options` is a string, then it specifies the encoding. * @since v0.1.31 */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; + function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; /** * Forces all currently queued I/O operations associated with the file to the * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other @@ -4240,8 +4199,8 @@ declare module "fs" { * exception are given to the completion callback. * @since v0.1.96 */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { + function fdatasync(fd: number, callback: NoParamCallback): void; + namespace fdatasync { /** * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. * @param fd A file descriptor. @@ -4253,7 +4212,7 @@ declare module "fs" { * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. * @since v0.1.96 */ - export function fdatasyncSync(fd: number): void; + function fdatasyncSync(fd: number): void; /** * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it * already exists. No arguments other than a possible exception are given to the @@ -4293,9 +4252,9 @@ declare module "fs" { * @param dest destination filename of the copy operation * @param [mode=0] modifiers for copy operation. */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { + function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + namespace copyFile { function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; } /** @@ -4332,7 +4291,7 @@ declare module "fs" { * @param dest destination filename of the copy operation * @param [mode=0] modifiers for copy operation. */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; /** * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. * @@ -4353,12 +4312,12 @@ declare module "fs" { * @since v12.9.0 * @param [position='null'] */ - export function writev( + function writev( fd: number, buffers: TBuffers, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void, ): void; - export function writev( + function writev( fd: number, buffers: TBuffers, position: number | null, @@ -4366,11 +4325,11 @@ declare module "fs" { ): void; // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 // TODO: remove default in future major version - export interface WriteVResult { + interface WriteVResult { bytesWritten: number; buffers: T; } - export namespace writev { + namespace writev { function __promisify__( fd: number, buffers: TBuffers, @@ -4384,7 +4343,7 @@ declare module "fs" { * @param [position='null'] * @return The number of bytes written. */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; + function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; /** * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s * using `readv()`. @@ -4400,12 +4359,12 @@ declare module "fs" { * @since v13.13.0, v12.17.0 * @param [position='null'] */ - export function readv( + function readv( fd: number, buffers: TBuffers, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void, ): void; - export function readv( + function readv( fd: number, buffers: TBuffers, position: number | null, @@ -4413,11 +4372,11 @@ declare module "fs" { ): void; // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 // TODO: remove default in future major version - export interface ReadVResult { + interface ReadVResult { bytesRead: number; buffers: T; } - export namespace readv { + namespace readv { function __promisify__( fd: number, buffers: TBuffers, @@ -4431,9 +4390,9 @@ declare module "fs" { * @param [position='null'] * @return The number of bytes read. */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; + function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - export interface OpenAsBlobOptions { + interface OpenAsBlobOptions { /** * An optional mime type for the blob. * @@ -4459,9 +4418,9 @@ declare module "fs" { * ``` * @since v19.8.0 */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; + function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - export interface OpenDirOptions { + interface OpenDirOptions { /** * @default 'utf8' */ @@ -4488,7 +4447,7 @@ declare module "fs" { * directory and subsequent read operations. * @since v12.12.0 */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; /** * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for * more details. @@ -4500,28 +4459,28 @@ declare module "fs" { * directory and subsequent read operations. * @since v12.12.0 */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( + function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + function opendir( path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, ): void; - export namespace opendir { + namespace opendir { function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; } - export interface BigIntStats extends StatsBase { + interface BigIntStats extends StatsBase { atimeNs: bigint; mtimeNs: bigint; ctimeNs: bigint; birthtimeNs: bigint; } - export interface BigIntOptions { + interface BigIntOptions { bigint: true; } - export interface StatOptions { + interface StatOptions { bigint?: boolean | undefined; } - export interface StatSyncOptions extends StatOptions { + interface StatSyncOptions extends StatOptions { throwIfNoEntry?: boolean | undefined; } interface CopyOptionsBase { @@ -4564,14 +4523,14 @@ declare module "fs" { */ verbatimSymlinks?: boolean | undefined; } - export interface CopyOptions extends CopyOptionsBase { + interface CopyOptions extends CopyOptionsBase { /** * Function to filter copied files/directories. Return * `true` to copy the item, `false` to ignore it. */ filter?: ((source: string, destination: string) => boolean | Promise) | undefined; } - export interface CopySyncOptions extends CopyOptionsBase { + interface CopySyncOptions extends CopyOptionsBase { /** * Function to filter copied files/directories. Return * `true` to copy the item, `false` to ignore it. @@ -4589,12 +4548,12 @@ declare module "fs" { * @param src source path to copy. * @param dest destination path to copy to. */ - export function cp( + function cp( source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void, ): void; - export function cp( + function cp( source: string | URL, destination: string | URL, opts: CopyOptions, @@ -4611,7 +4570,7 @@ declare module "fs" { * @param src source path to copy. * @param dest destination path to copy to. */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; + function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; // TODO: collapse interface _GlobOptions { @@ -4637,11 +4596,11 @@ declare module "fs" { */ exclude?: ((fileName: T) => boolean) | readonly string[] | undefined; } - export interface GlobOptions extends _GlobOptions {} - export interface GlobOptionsWithFileTypes extends _GlobOptions { + interface GlobOptions extends _GlobOptions {} + interface GlobOptionsWithFileTypes extends _GlobOptions { withFileTypes: true; } - export interface GlobOptionsWithoutFileTypes extends _GlobOptions { + interface GlobOptionsWithoutFileTypes extends _GlobOptions { withFileTypes?: false | undefined; } @@ -4658,11 +4617,11 @@ declare module "fs" { * ``` * @since v22.0.0 */ - export function glob( + function glob( pattern: string | readonly string[], callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void, ): void; - export function glob( + function glob( pattern: string | readonly string[], options: GlobOptionsWithFileTypes, callback: ( @@ -4670,7 +4629,7 @@ declare module "fs" { matches: Dirent[], ) => void, ): void; - export function glob( + function glob( pattern: string | readonly string[], options: GlobOptionsWithoutFileTypes, callback: ( @@ -4678,7 +4637,7 @@ declare module "fs" { matches: string[], ) => void, ): void; - export function glob( + function glob( pattern: string | readonly string[], options: GlobOptions, callback: ( @@ -4695,20 +4654,23 @@ declare module "fs" { * @since v22.0.0 * @returns paths of files that match the pattern. */ - export function globSync(pattern: string | readonly string[]): string[]; - export function globSync( + function globSync(pattern: string | readonly string[]): string[]; + function globSync( pattern: string | readonly string[], options: GlobOptionsWithFileTypes, ): Dirent[]; - export function globSync( + function globSync( pattern: string | readonly string[], options: GlobOptionsWithoutFileTypes, ): string[]; - export function globSync( + function globSync( pattern: string | readonly string[], options: GlobOptions, ): Dirent[] | string[]; } declare module "node:fs" { - export * from "fs"; + export * as promises from "node:fs/promises"; +} +declare module "fs" { + export * from "node:fs"; } diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts index 986b6da5..ded1b243 100644 --- a/node_modules/@types/node/fs/promises.d.ts +++ b/node_modules/@types/node/fs/promises.d.ts @@ -8,11 +8,10 @@ * concurrent modifications on the same file or data corruption may occur. * @since v10.0.0 */ -declare module "fs/promises" { +declare module "node:fs/promises" { import { NonSharedBuffer } from "node:buffer"; import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; + import { Interface as ReadlineInterface } from "node:readline"; import { BigIntStats, BigIntStatsFs, @@ -37,7 +36,6 @@ declare module "fs/promises" { ReadPosition, ReadStream, ReadVResult, - RmDirOptions, RmOptions, StatFsOptions, StatOptions, @@ -49,7 +47,8 @@ declare module "fs/promises" { WriteStream, WriteVResult, } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; + import { Stream } from "node:stream"; + import { ReadableStream } from "node:stream/web"; interface FileChangeInfo { eventType: WatchEventType; filename: T | null; @@ -602,7 +601,7 @@ declare module "fs/promises" { * @since v10.0.0 * @return Fulfills with `undefined` upon success. */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; + function rmdir(path: PathLike): Promise; /** * Removes files and directories (modeled on the standard POSIX `rm` utility). * @since v14.14.0 @@ -1312,6 +1311,6 @@ declare module "fs/promises" { options: GlobOptions, ): NodeJS.AsyncIterator; } -declare module "node:fs/promises" { - export * from "fs/promises"; +declare module "fs/promises" { + export * from "node:fs/promises"; } diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts index 9c6837d3..36e7f90c 100644 --- a/node_modules/@types/node/globals.d.ts +++ b/node_modules/@types/node/globals.d.ts @@ -1,7 +1,6 @@ declare var global: typeof globalThis; declare var process: NodeJS.Process; -declare var console: Console; interface ErrorConstructor { /** @@ -105,31 +104,6 @@ declare namespace NodeJS { syscall?: string | undefined; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - interface RefCounted { ref(): this; unref(): this; @@ -167,4 +141,10 @@ declare namespace NodeJS { interface AsyncIterator extends AsyncIteratorObject { [Symbol.asyncIterator](): NodeJS.AsyncIterator; } + + /** The [`BufferSource`](https://webidl.spec.whatwg.org/#BufferSource) type from the Web IDL specification. */ + type BufferSource = NonSharedArrayBufferView | ArrayBuffer; + + /** The [`AllowSharedBufferSource`](https://webidl.spec.whatwg.org/#AllowSharedBufferSource) type from the Web IDL specification. */ + type AllowSharedBufferSource = ArrayBufferView | ArrayBufferLike; } diff --git a/node_modules/@types/node/globals.typedarray.d.ts b/node_modules/@types/node/globals.typedarray.d.ts index cae4c0b1..e69dd0cd 100644 --- a/node_modules/@types/node/globals.typedarray.d.ts +++ b/node_modules/@types/node/globals.typedarray.d.ts @@ -22,20 +22,80 @@ declare global { // The following aliases are required to allow use of non-shared ArrayBufferViews in @types/node // while maintaining compatibility with TS <=5.6. // TODO: remove once @types/node no longer supports TS 5.6, and replace with native types. + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedUint8Array = Uint8Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedUint8ClampedArray = Uint8ClampedArray; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedUint16Array = Uint16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedUint32Array = Uint32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedInt8Array = Int8Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedInt16Array = Int16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedInt32Array = Int32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedBigUint64Array = BigUint64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedBigInt64Array = BigInt64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedFloat16Array = Float16Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedFloat32Array = Float32Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedFloat64Array = Float64Array; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedDataView = DataView; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedTypedArray = TypedArray; + /** + * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports + * TypeScript versions earlier than 5.7. + */ type NonSharedArrayBufferView = ArrayBufferView; } } diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts index 771b8b2f..44444d3d 100644 --- a/node_modules/@types/node/http.d.ts +++ b/node_modules/@types/node/http.d.ts @@ -37,15 +37,15 @@ * 'Host', 'example.com', * 'accepT', '*' ] * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/http.js) */ -declare module "http" { +declare module "node:http" { import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { URL } from "node:url"; import { LookupOptions } from "node:dns"; import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; + import * as net from "node:net"; + import * as stream from "node:stream"; + import { URL } from "node:url"; // incoming headers will never contain number interface IncomingHttpHeaders extends NodeJS.Dict { accept?: string | undefined; @@ -219,7 +219,7 @@ declare module "http" { insecureHTTPParser?: boolean | undefined; localAddress?: string | undefined; localPort?: number | undefined; - lookup?: LookupFunction | undefined; + lookup?: net.LookupFunction | undefined; /** * @default 16384 */ @@ -361,14 +361,27 @@ declare module "http" { type RequestListener< Request extends typeof IncomingMessage = typeof IncomingMessage, Response extends typeof ServerResponse> = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; + > = (request: InstanceType, response: InstanceType & { req: InstanceType }) => void; + interface ServerEventMap< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse> = typeof ServerResponse, + > extends net.ServerEventMap { + "checkContinue": Parameters>; + "checkExpectation": Parameters>; + "clientError": [exception: Error, socket: stream.Duplex]; + "connect": [request: InstanceType, socket: stream.Duplex, head: NonSharedBuffer]; + "connection": [socket: net.Socket]; + "dropRequest": [request: InstanceType, socket: stream.Duplex]; + "request": Parameters>; + "upgrade": [req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer]; + } /** * @since v0.1.17 */ class Server< Request extends typeof IncomingMessage = typeof IncomingMessage, Response extends typeof ServerResponse> = typeof ServerResponse, - > extends NetServer { + > extends net.Server { constructor(requestListener?: RequestListener); constructor(options: ServerOptions, requestListener?: RequestListener); /** @@ -385,8 +398,8 @@ declare module "http" { * @since v0.9.12 * @param [msecs=0 (no timeout)] */ - setTimeout(msecs?: number, callback?: (socket: Socket) => void): this; - setTimeout(callback: (socket: Socket) => void): this; + setTimeout(msecs?: number, callback?: (socket: net.Socket) => void): this; + setTimeout(callback: (socket: net.Socket) => void): this; /** * Limits maximum incoming headers count. If set to 0, no limit will be applied. * @since v0.7.0 @@ -486,126 +499,64 @@ declare module "http" { * @since v18.2.0 */ closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface OutgoingMessageEventMap extends stream.WritableEventMap { + "prefinish": []; } /** * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from @@ -613,6 +564,7 @@ declare module "http" { * @since v0.1.17 */ class OutgoingMessage extends stream.Writable { + constructor(); readonly req: Request; chunkedEncoding: boolean; shouldKeepAlive: boolean; @@ -632,7 +584,7 @@ declare module "http" { * @since v0.3.0 * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. */ - readonly connection: Socket | null; + readonly connection: net.Socket | null; /** * Reference to the underlying socket. Usually, users will not want to access * this property. @@ -640,8 +592,7 @@ declare module "http" { * After calling `outgoingMessage.end()`, this property will be nulled. * @since v0.3.0 */ - readonly socket: Socket | null; - constructor(); + readonly socket: net.Socket | null; /** * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. * @since v0.9.12 @@ -799,6 +750,61 @@ declare module "http" { * @since v1.6.0 */ flushHeaders(): void; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: OutgoingMessageEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: OutgoingMessageEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: OutgoingMessageEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: OutgoingMessageEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: OutgoingMessageEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } /** * This object is created internally by an HTTP server, not by the user. It is @@ -843,8 +849,8 @@ declare module "http" { */ strictContentLength: boolean; constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; + assignSocket(socket: net.Socket): void; + detachSocket(socket: net.Socket): void; /** * Sends an HTTP/1.1 100 Continue message to the client, indicating that * the request body should be sent. See the `'checkContinue'` event on `Server`. @@ -956,14 +962,25 @@ declare module "http" { writeProcessing(callback?: () => void): void; } interface InformationEvent { - statusCode: number; - statusMessage: string; httpVersion: string; httpVersionMajor: number; httpVersionMinor: number; + statusCode: number; + statusMessage: string; headers: IncomingHttpHeaders; rawHeaders: string[]; } + interface ClientRequestEventMap extends stream.WritableEventMap { + /** @deprecated Listen for the `'close'` event instead. */ + "abort": []; + "connect": [response: IncomingMessage, socket: net.Socket, head: NonSharedBuffer]; + "continue": []; + "information": [info: InformationEvent]; + "response": [response: IncomingMessage]; + "socket": [socket: net.Socket]; + "timeout": []; + "upgrade": [response: IncomingMessage, socket: net.Socket, head: NonSharedBuffer]; + } /** * This object is created internally and returned from {@link request}. It * represents an _in-progress_ request whose header has already been queued. The @@ -1086,7 +1103,7 @@ declare module "http" { * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. */ abort(): void; - onSocket(socket: Socket): void; + onSocket(socket: net.Socket): void; /** * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. * @since v0.5.9 @@ -1118,126 +1135,63 @@ declare module "http" { * @since v15.13.0, v14.17.0 */ getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientRequestEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientRequestEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ClientRequestEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientRequestEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientRequestEventMap[E]) => void, ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface IncomingMessageEventMap extends stream.ReadableEventMap { + /** @deprecated Listen for `'close'` event instead. */ + "aborted": []; } /** * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to @@ -1250,7 +1204,7 @@ declare module "http" { * @since v0.1.17 */ class IncomingMessage extends stream.Readable { - constructor(socket: Socket); + constructor(socket: net.Socket); /** * The `message.aborted` property will be `true` if the request has * been aborted. @@ -1298,7 +1252,7 @@ declare module "http" { * @since v0.1.90 * @deprecated Since v16.0.0 - Use `socket`. */ - connection: Socket; + connection: net.Socket; /** * The `net.Socket` object associated with the connection. * @@ -1310,7 +1264,7 @@ declare module "http" { * type other than `net.Socket` or internally nulled. * @since v0.3.0 */ - socket: Socket; + socket: net.Socket; /** * The request/response headers object. * @@ -1472,6 +1426,61 @@ declare module "http" { * @since v0.3.0 */ destroy(error?: Error): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: IncomingMessageEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: IncomingMessageEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: IncomingMessageEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: IncomingMessageEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: IncomingMessageEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface ProxyEnv extends NodeJS.ProcessEnv { HTTP_PROXY?: string | undefined; @@ -1481,7 +1490,7 @@ declare module "http" { https_proxy?: string | undefined; no_proxy?: string | undefined; } - interface AgentOptions extends NodeJS.PartialOptions { + interface AgentOptions extends NodeJS.PartialOptions { /** * Keep sockets around in a pool to be used by other requests in the future. Default = false */ @@ -1524,7 +1533,7 @@ declare module "http" { scheduling?: "fifo" | "lifo" | undefined; /** * Environment variables for proxy configuration. See - * [Built-in Proxy Support](https://nodejs.org/docs/latest-v24.x/api/http.html#built-in-proxy-support) for details. + * [Built-in Proxy Support](https://nodejs.org/docs/latest-v25.x/api/http.html#built-in-proxy-support) for details. * @since v24.5.0 */ proxyEnv?: ProxyEnv | undefined; @@ -1593,7 +1602,7 @@ declare module "http" { * }); * ``` * - * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v24.x/api/net.html#socketconnectoptions-connectlistener) are also supported. + * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v25.x/api/net.html#socketconnectoptions-connectlistener) are also supported. * * To configure any of them, a custom {@link Agent} instance must be created. * @@ -1633,13 +1642,13 @@ declare module "http" { * removed from the array on `'timeout'`. * @since v0.11.4 */ - readonly freeSockets: NodeJS.ReadOnlyDict; + readonly freeSockets: NodeJS.ReadOnlyDict; /** * An object which contains arrays of sockets currently in use by the * agent. Do not modify. * @since v0.3.6 */ - readonly sockets: NodeJS.ReadOnlyDict; + readonly sockets: NodeJS.ReadOnlyDict; /** * An object which contains queues of requests that have not yet been assigned to * sockets. Do not modify. @@ -2129,6 +2138,6 @@ declare module "http" { */ const MessageEvent: typeof import("undici-types").MessageEvent; } -declare module "node:http" { - export * from "http"; +declare module "http" { + export * from "node:http"; } diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts index c90af905..4130bfe2 100644 --- a/node_modules/@types/node/http2.d.ts +++ b/node_modules/@types/node/http2.d.ts @@ -6,11 +6,11 @@ * import http2 from 'node:http2'; * ``` * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http2.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/http2.js) */ -declare module "http2" { +declare module "node:http2" { import { NonSharedBuffer } from "node:buffer"; - import EventEmitter = require("node:events"); + import { InternalEventEmitter } from "node:events"; import * as fs from "node:fs"; import * as net from "node:net"; import * as stream from "node:stream"; @@ -22,18 +22,17 @@ declare module "http2" { OutgoingHttpHeaders, ServerResponse, } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { + interface IncomingHttpStatusHeader { ":status"?: number | undefined; } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { ":path"?: string | undefined; ":method"?: string | undefined; ":authority"?: string | undefined; ":scheme"?: string | undefined; } // Http2Stream - export interface StreamState { + interface StreamState { localWindowSize?: number | undefined; state?: number | undefined; localClose?: number | undefined; @@ -43,15 +42,15 @@ declare module "http2" { /** @deprecated */ weight?: number | undefined; } - export interface ServerStreamResponseOptions { + interface ServerStreamResponseOptions { endStream?: boolean | undefined; waitForTrailers?: boolean | undefined; } - export interface StatOptions { + interface StatOptions { offset: number; length: number; } - export interface ServerStreamFileResponseOptions { + interface ServerStreamFileResponseOptions { statCheck?: | ((stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void) | undefined; @@ -59,10 +58,20 @@ declare module "http2" { offset?: number | undefined; length?: number | undefined; } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { onError?: ((err: NodeJS.ErrnoException) => void) | undefined; } - export interface Http2Stream extends stream.Duplex { + interface Http2StreamEventMap extends stream.DuplexEventMap { + "aborted": []; + "data": [chunk: string | NonSharedBuffer]; + "frameError": [type: number, code: number, id: number]; + "ready": []; + "streamClosed": [code: number]; + "timeout": []; + "trailers": [trailers: IncomingHttpHeaders, flags: number]; + "wantTrailers": []; + } + interface Http2Stream extends stream.Duplex { /** * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, * the `'aborted'` event will have been emitted. @@ -190,210 +199,122 @@ declare module "http2" { * @since v10.0.0 */ sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: NonSharedBuffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: Http2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: Http2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: Http2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: Http2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: Http2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit( - event: "headers", - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit( - event: "response", - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: ( - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + interface ClientHttp2StreamEventMap extends Http2StreamEventMap { + "continue": []; + "headers": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]]; + "push": [headers: IncomingHttpHeaders, flags: number]; + "response": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]]; } - export interface ServerHttp2Stream extends Http2Stream { + interface ClientHttp2Stream extends Http2Stream { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientHttp2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientHttp2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface ServerHttp2Stream extends Http2Stream { /** * True if headers were sent, false otherwise (read-only). * @since v8.4.0 @@ -663,7 +584,7 @@ declare module "http2" { ): void; } // Http2Session - export interface Settings { + interface Settings { headerTableSize?: number | undefined; enablePush?: boolean | undefined; initialWindowSize?: number | undefined; @@ -672,14 +593,14 @@ declare module "http2" { maxHeaderListSize?: number | undefined; enableConnectProtocol?: boolean | undefined; } - export interface ClientSessionRequestOptions { + interface ClientSessionRequestOptions { endStream?: boolean | undefined; exclusive?: boolean | undefined; parent?: number | undefined; waitForTrailers?: boolean | undefined; signal?: AbortSignal | undefined; } - export interface SessionState { + interface SessionState { effectiveLocalWindowSize?: number | undefined; effectiveRecvDataLength?: number | undefined; nextStreamID?: number | undefined; @@ -690,7 +611,24 @@ declare module "http2" { deflateDynamicTableSize?: number | undefined; inflateDynamicTableSize?: number | undefined; } - export interface Http2Session extends EventEmitter { + interface Http2SessionEventMap { + "close": []; + "connect": [session: Http2Session, socket: net.Socket | tls.TLSSocket]; + "error": [err: Error]; + "frameError": [type: number, code: number, id: number]; + "goaway": [errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer]; + "localSettings": [settings: Settings]; + "ping": [payload: Buffer]; + "remoteSettings": [settings: Settings]; + "stream": [ + stream: Http2Stream, + headers: IncomingHttpHeaders & IncomingHttpStatusHeader, + flags: number, + rawHeaders: string[], + ]; + "timeout": []; + } + interface Http2Session extends InternalEventEmitter { /** * Value will be `undefined` if the `Http2Session` is not yet connected to a * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or @@ -892,86 +830,19 @@ declare module "http2" { * @since v9.4.0 */ unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; } - export interface ClientHttp2Session extends Http2Session { + interface ClientHttp2SessionEventMap extends Http2SessionEventMap { + "altsvc": [alt: string, origin: string, streamId: number]; + "connect": [session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket]; + "origin": [origins: string[]]; + "stream": [ + stream: ClientHttp2Stream, + headers: IncomingHttpHeaders & IncomingHttpStatusHeader, + flags: number, + rawHeaders: string[], + ]; + } + interface ClientHttp2Session extends Http2Session { /** * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an * HTTP/2 request to the connected server. @@ -1021,99 +892,78 @@ declare module "http2" { headers?: OutgoingHttpHeaders | readonly string[], options?: ClientSessionRequestOptions, ): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ClientHttp2StreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ClientHttp2StreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ClientHttp2StreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ClientHttp2StreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } - export interface AlternativeServiceOptions { + interface AlternativeServiceOptions { origin: number | string | url.URL; } - export interface ServerHttp2Session< + interface ServerHttp2SessionEventMap< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends Http2SessionEventMap { + "connect": [ + session: ServerHttp2Session, + socket: net.Socket | tls.TLSSocket, + ]; + "stream": [stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]]; + } + interface ServerHttp2Session< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -1214,107 +1064,87 @@ declare module "http2" { } > ): void; - addListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - addListener( - event: "stream", + // #region InternalEventEmitter + addListener( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "connect", - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ): boolean; - emit( - event: "stream", - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: ServerHttp2SessionEventMap[E] ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: ServerHttp2SessionEventMap[E] ) => void, - ): this; - on( - event: "stream", + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): (( + ...args: ServerHttp2SessionEventMap[E] + ) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - once( - event: "stream", + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - prependListener( - event: "stream", + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): (( + ...args: ServerHttp2SessionEventMap[E] + ) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, + ...args: ServerHttp2SessionEventMap[E] ) => void, ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } // Http2Server - export interface SessionOptions { + interface SessionOptions { /** * Sets the maximum dynamic table size for deflating header fields. * @default 4Kib @@ -1392,7 +1222,7 @@ declare module "http2" { */ strictFieldWhitespaceValidation?: boolean | undefined; } - export interface ClientSessionOptions extends SessionOptions { + interface ClientSessionOptions extends SessionOptions { /** * Sets the maximum number of reserved push streams the client will accept at any given time. * Once the current number of currently reserved push streams exceeds reaches this limit, @@ -1414,7 +1244,7 @@ declare module "http2" { */ protocol?: "http:" | "https:" | undefined; } - export interface ServerSessionOptions< + interface ServerSessionOptions< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -1427,20 +1257,20 @@ declare module "http2" { Http2ServerRequest?: Http2Request | undefined; Http2ServerResponse?: Http2Response | undefined; } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions< + interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + interface SecureServerSessionOptions< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, > extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions< + interface ServerOptions< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, > extends ServerSessionOptions {} - export interface SecureServerOptions< + interface SecureServerOptions< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -1449,7 +1279,7 @@ declare module "http2" { allowHTTP1?: boolean | undefined; origins?: string[] | undefined; } - interface HTTP2ServerCommon { + interface Http2ServerCommon { setTimeout(msec?: number, callback?: () => void): this; /** * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. @@ -1457,274 +1287,194 @@ declare module "http2" { */ updateSettings(settings: Settings): void; } - export interface Http2Server< + interface Http2ServerEventMap< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", + > extends net.ServerEventMap, Pick { + "checkContinue": [request: InstanceType, response: InstanceType]; + "request": [request: InstanceType, response: InstanceType]; + "session": [session: ServerHttp2Session]; + "sessionError": [err: Error]; + } + interface Http2Server< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends net.Server, Http2ServerCommon { + // #region InternalEventEmitter + addListener( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: Http2ServerEventMap[E] ) => void, ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit( - event: "stream", - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: Http2ServerEventMap[E] ): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: Http2ServerEventMap[E] + ) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: Http2ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: Http2ServerEventMap[E] ) => void, ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: Http2ServerEventMap[E] ) => void, ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: Http2ServerEventMap[E] ) => void, ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: ( + ...args: Http2ServerEventMap[E] + ) => void, ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: Http2ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, listener: ( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - flags: number, - rawHeaders: string[], + ...args: Http2ServerEventMap[E] ) => void, ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } - export interface Http2SecureServer< + interface Http2SecureServerEventMap< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, + > extends tls.ServerEventMap, Http2ServerEventMap { + "unknownProtocol": [socket: tls.TLSSocket]; + } + interface Http2SecureServer< + Http1Request extends typeof IncomingMessage = typeof IncomingMessage, + Http1Response extends typeof ServerResponse> = typeof ServerResponse, + Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, + Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, + > extends tls.Server, Http2ServerCommon { + // #region InternalEventEmitter + addListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit( + eventName: E, + ...args: Http2SecureServerEventMap[E] ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: ( + ...args: Http2SecureServerEventMap[E] + ) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): (( + ...args: Http2SecureServerEventMap[E] + ) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): (( + ...args: Http2SecureServerEventMap[E] + ) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: ( + ...args: Http2SecureServerEventMap[E] + ) => void, ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion + } + interface Http2ServerRequestEventMap extends stream.ReadableEventMap { + "aborted": [hadError: boolean, code: number]; + "data": [chunk: string | NonSharedBuffer]; } /** * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, @@ -1732,7 +1482,7 @@ declare module "http2" { * data. * @since v8.4.0 */ - export class Http2ServerRequest extends stream.Readable { + class Http2ServerRequest extends stream.Readable { constructor( stream: ServerHttp2Stream, headers: IncomingHttpHeaders, @@ -1923,56 +1673,69 @@ declare module "http2" { * @since v8.4.0 */ setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): NonSharedBuffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: NonSharedBuffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + read(size?: number): Buffer | string | null; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: Http2ServerRequestEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: Http2ServerRequestEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: Http2ServerRequestEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: Http2ServerRequestEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: Http2ServerRequestEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } /** * This object is created internally by an HTTP server, not by the user. It is * passed as the second parameter to the `'request'` event. * @since v8.4.0 */ - export class Http2ServerResponse extends stream.Writable { + class Http2ServerResponse extends stream.Writable { constructor(stream: ServerHttp2Stream); /** * See `response.socket`. @@ -1988,7 +1751,7 @@ declare module "http2" { * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. * * Attempting to set a header field name or value that contains invalid characters will result in a - * [TypeError](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-typeerror) being thrown. + * [TypeError](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-typeerror) being thrown. * * ```js * // Returns headers including "set-cookie: a" and "set-cookie: b" @@ -2336,50 +2099,8 @@ declare module "http2" { headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void, ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; } - export namespace constants { + namespace constants { const NGHTTP2_SESSION_SERVER: number; const NGHTTP2_SESSION_CLIENT: number; const NGHTTP2_STREAM_STATE_IDLE: number; @@ -2599,13 +2320,13 @@ declare module "http2" { * This symbol can be set as a property on the HTTP/2 headers object with * an array value in order to provide a list of headers considered sensitive. */ - export const sensitiveHeaders: symbol; + const sensitiveHeaders: symbol; /** * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called * so instances returned may be safely modified for use. * @since v8.4.0 */ - export function getDefaultSettings(): Settings; + function getDefaultSettings(): Settings; /** * Returns a `Buffer` instance containing serialized representation of the given * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended @@ -2621,14 +2342,14 @@ declare module "http2" { * ``` * @since v8.4.0 */ - export function getPackedSettings(settings: Settings): NonSharedBuffer; + function getPackedSettings(settings: Settings): NonSharedBuffer; /** * Returns a `HTTP/2 Settings Object` containing the deserialized settings from * the given `Buffer` as generated by `http2.getPackedSettings()`. * @since v8.4.0 * @param buf The packed settings. */ - export function getUnpackedSettings(buf: Uint8Array): Settings; + function getUnpackedSettings(buf: Uint8Array): Settings; /** * Returns a `net.Server` instance that creates and manages `Http2Session` instances. * @@ -2658,10 +2379,10 @@ declare module "http2" { * @since v8.4.0 * @param onRequestHandler See `Compatibility API` */ - export function createServer( + function createServer( onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, ): Http2Server; - export function createServer< + function createServer< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -2698,10 +2419,10 @@ declare module "http2" { * @since v8.4.0 * @param onRequestHandler See `Compatibility API` */ - export function createSecureServer( + function createSecureServer( onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, ): Http2SecureServer; - export function createSecureServer< + function createSecureServer< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -2726,11 +2447,11 @@ declare module "http2" { * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. */ - export function connect( + function connect( authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, ): ClientHttp2Session; - export function connect( + function connect( authority: string | url.URL, options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, @@ -2741,7 +2462,7 @@ declare module "http2" { * @param options Any `{@link createServer}` options can be provided. * @since v20.12.0 */ - export function performServerHandshake< + function performServerHandshake< Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Response extends typeof ServerResponse> = typeof ServerResponse, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, @@ -2752,5 +2473,8 @@ declare module "http2" { ): ServerHttp2Session; } declare module "node:http2" { - export * from "http2"; + export { OutgoingHttpHeaders } from "node:http"; +} +declare module "http2" { + export * from "node:http2"; } diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts index 53de0b9a..c4fbe8c0 100644 --- a/node_modules/@types/node/https.d.ts +++ b/node_modules/@types/node/https.d.ts @@ -1,13 +1,12 @@ /** * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a * separate module. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/https.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/https.js) */ -declare module "https" { - import { NonSharedBuffer } from "node:buffer"; +declare module "node:https" { + import * as http from "node:http"; import { Duplex } from "node:stream"; import * as tls from "node:tls"; - import * as http from "node:http"; import { URL } from "node:url"; interface ServerOptions< Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, @@ -36,10 +35,10 @@ declare module "https" { ): Duplex | null | undefined; getName(options?: RequestOptions): string; } - interface Server< + interface ServerEventMap< Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends http.Server {} + > extends http.ServerEventMap, tls.ServerEventMap {} /** * See `http.Server` for more information. * @since v0.3.4 @@ -63,245 +62,66 @@ declare module "https" { * @since v18.2.0 */ closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: NonSharedBuffer, - sessionData: NonSharedBuffer, - callback: () => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: NonSharedBuffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - on(event: "request", listener: http.RequestListener): this; - on( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - once(event: "request", listener: http.RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse> = typeof http.ServerResponse, + > extends http.Server {} /** * ```js * // curl -k https://localhost:8000/ @@ -574,6 +394,6 @@ declare module "https" { ): http.ClientRequest; let globalAgent: Agent; } -declare module "node:https" { - export * from "https"; +declare module "https" { + export * from "node:https"; } diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts index c140e0b4..08ab4f05 100644 --- a/node_modules/@types/node/index.d.ts +++ b/node_modules/@types/node/index.d.ts @@ -39,13 +39,21 @@ // Definitions for Node.js modules that are not specific to any version of TypeScript: /// /// +/// +/// /// /// +/// /// /// +/// +/// /// +/// /// /// +/// +/// /// /// /// @@ -68,25 +76,30 @@ /// /// /// +/// /// /// /// /// +/// +/// /// /// /// /// +/// /// /// /// /// /// /// -/// /// +/// /// /// /// +/// /// /// /// @@ -94,6 +107,7 @@ /// /// /// +/// /// /// /// diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts index dd0b8888..c3a7785e 100644 --- a/node_modules/@types/node/inspector.d.ts +++ b/node_modules/@types/node/inspector.d.ts @@ -1,10 +1,10 @@ /** * The `node:inspector` module provides an API for interacting with the V8 * inspector. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/inspector.js) */ -declare module "inspector" { - import EventEmitter = require("node:events"); +declare module "node:inspector" { + import { EventEmitter } from "node:events"; /** * The `inspector.Session` is used for dispatching messages to the V8 inspector * back-end and receiving message responses and notifications. @@ -39,7 +39,7 @@ declare module "inspector" { * If wait is `true`, will block until a client has connected to the inspect port * and flow control has been passed to the debugger client. * - * See the [security warning](https://nodejs.org/docs/latest-v24.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) + * See the [security warning](https://nodejs.org/docs/latest-v25.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) * regarding the `host` parameter usage. * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. @@ -219,59 +219,6 @@ declare module "inspector" { function put(url: string, data: string): void; } } - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - */ -declare module "node:inspector" { - export * from "inspector"; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js) - * @since v19.0.0 - */ -declare module "inspector/promises" { - import EventEmitter = require("node:events"); - export { close, console, NetworkResources, open, url, waitForDebugger } from "inspector"; - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - * @since v19.0.0 - */ - export class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - * @since v12.11.0 - */ - connectToMainThread(): void; - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - } -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @since v19.0.0 - */ -declare module "node:inspector/promises" { - export * from "inspector/promises"; +declare module "inspector" { + export * from "node:inspector"; } diff --git a/node_modules/@types/node/inspector.generated.d.ts b/node_modules/@types/node/inspector.generated.d.ts index 17352e79..84c482d6 100644 --- a/node_modules/@types/node/inspector.generated.d.ts +++ b/node_modules/@types/node/inspector.generated.d.ts @@ -3,12 +3,11 @@ // See scripts/generate-inspector/README.md for information on how to update the protocol definitions. // Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). -declare module "inspector" { +declare module "node:inspector" { interface InspectorNotification { method: string; params: T; } - namespace Schema { /** * Description of the protocol domain. @@ -2033,7 +2032,6 @@ declare module "inspector" { eof: boolean; } } - interface Session { /** * Posts a message to the inspector back-end. `callback` will be notified when @@ -2428,7 +2426,6 @@ declare module "inspector" { post(method: "IO.read", callback?: (err: Error | null, params: IO.ReadReturnType) => void): void; post(method: "IO.close", params?: IO.CloseParameterType, callback?: (err: Error | null) => void): void; post(method: "IO.close", callback?: (err: Error | null) => void): void; - addListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. @@ -3145,8 +3142,7 @@ declare module "inspector" { prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; } } - -declare module "inspector/promises" { +declare module "node:inspector/promises" { export { Schema, Runtime, @@ -3162,8 +3158,7 @@ declare module "inspector/promises" { IO, } from 'inspector'; } - -declare module "inspector/promises" { +declare module "node:inspector/promises" { import { InspectorNotification, Schema, @@ -3179,7 +3174,6 @@ declare module "inspector/promises" { Target, IO, } from "inspector"; - /** * The `inspector.Session` is used for dispatching messages to the V8 inspector * back-end and receiving message responses and notifications. @@ -3514,7 +3508,6 @@ declare module "inspector/promises" { */ post(method: "IO.read", params?: IO.ReadParameterType): Promise; post(method: "IO.close", params?: IO.CloseParameterType): Promise; - addListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. diff --git a/node_modules/@types/node/inspector/promises.d.ts b/node_modules/@types/node/inspector/promises.d.ts new file mode 100644 index 00000000..54e12506 --- /dev/null +++ b/node_modules/@types/node/inspector/promises.d.ts @@ -0,0 +1,41 @@ +/** + * The `node:inspector/promises` module provides an API for interacting with the V8 + * inspector. + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/inspector/promises.js) + * @since v19.0.0 + */ +declare module "node:inspector/promises" { + import { EventEmitter } from "node:events"; + export { close, console, NetworkResources, open, url, waitForDebugger } from "node:inspector"; + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + * @since v19.0.0 + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + */ + connect(): void; + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if this API was not called on a Worker thread. + * @since v12.11.0 + */ + connectToMainThread(): void; + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * `session.connect()` will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + } +} +declare module "inspector/promises" { + export * from "node:inspector/promises"; +} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts index b563b4be..14c898fa 100644 --- a/node_modules/@types/node/module.d.ts +++ b/node_modules/@types/node/module.d.ts @@ -1,7 +1,7 @@ /** * @since v0.3.7 */ -declare module "module" { +declare module "node:module" { import { URL } from "node:url"; class Module { constructor(id: string, parent?: Module); @@ -30,7 +30,7 @@ declare module "module" { /** * The following constants are returned as the `status` field in the object returned by * {@link enableCompileCache} to indicate the result of the attempt to enable the - * [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache). + * [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache). * @since v22.8.0 */ namespace compileCacheStatus { @@ -62,6 +62,24 @@ declare module "module" { const DISABLED: number; } } + interface EnableCompileCacheOptions { + /** + * Optional. Directory to store the compile cache. If not specified, + * the directory specified by the `NODE_COMPILE_CACHE=dir` environment variable + * will be used if it's set, or `path.join(os.tmpdir(), 'node-compile-cache')` + * otherwise. + * @since v25.0.0 + */ + directory?: string | undefined; + /** + * Optional. If `true`, enables portable compile cache so that + * the cache can be reused even if the project directory is moved. This is a best-effort + * feature. If not specified, it will depend on whether the environment variable + * `NODE_COMPILE_CACHE_PORTABLE=1` is set. + * @since v25.0.0 + */ + portable?: boolean | undefined; + } interface EnableCompileCacheResult { /** * One of the {@link constants.compileCacheStatus} @@ -81,25 +99,21 @@ declare module "module" { directory?: string; } /** - * Enable [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache) + * Enable [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) * in the current Node.js instance. * - * If `cacheDir` is not specified, Node.js will either use the directory specified by the - * `NODE_COMPILE_CACHE=dir` environment variable if it's set, or use - * `path.join(os.tmpdir(), 'node-compile-cache')` otherwise. For general use cases, it's - * recommended to call `module.enableCompileCache()` without specifying the `cacheDir`, - * so that the directory can be overridden by the `NODE_COMPILE_CACHE` environment - * variable when necessary. + * For general use cases, it's recommended to call `module.enableCompileCache()` without + * specifying the `options.directory`, so that the directory can be overridden by the + * `NODE_COMPILE_CACHE` environment variable when necessary. * - * Since compile cache is supposed to be a quiet optimization that is not required for the - * application to be functional, this method is designed to not throw any exception when the - * compile cache cannot be enabled. Instead, it will return an object containing an error - * message in the `message` field to aid debugging. - * If compile cache is enabled successfully, the `directory` field in the returned object - * contains the path to the directory where the compile cache is stored. The `status` - * field in the returned object would be one of the `module.constants.compileCacheStatus` + * Since compile cache is supposed to be a optimization that is not mission critical, this + * method is designed to not throw any exception when the compile cache cannot be enabled. + * Instead, it will return an object containing an error message in the `message` field to + * aid debugging. If compile cache is enabled successfully, the `directory` field in the + * returned object contains the path to the directory where the compile cache is stored. The + * `status` field in the returned object would be one of the `module.constants.compileCacheStatus` * values to indicate the result of the attempt to enable the - * [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache). + * [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache). * * This method only affects the current Node.js instance. To enable it in child worker threads, * either call this method in child worker threads too, or set the @@ -107,12 +121,11 @@ declare module "module" { * be inherited into the child workers. The directory can be obtained either from the * `directory` field returned by this method, or with {@link getCompileCacheDir}. * @since v22.8.0 - * @param cacheDir Optional path to specify the directory where the compile cache - * will be stored/retrieved. + * @param options Optional. If a string is passed, it is considered to be `options.directory`. */ - function enableCompileCache(cacheDir?: string): EnableCompileCacheResult; + function enableCompileCache(options?: string | EnableCompileCacheOptions): EnableCompileCacheResult; /** - * Flush the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache) + * Flush the [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) * accumulated from modules already loaded * in the current Node.js instance to disk. This returns after all the flushing * file system operations come to an end, no matter they succeed or not. If there @@ -123,7 +136,7 @@ declare module "module" { function flushCompileCache(): void; /** * @since v22.8.0 - * @return Path to the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache) + * @return Path to the [module compile cache](https://nodejs.org/docs/latest-v25.x/api/module.html#module-compile-cache) * directory if it is enabled, or `undefined` otherwise. */ function getCompileCacheDir(): string | undefined; @@ -194,7 +207,7 @@ declare module "module" { */ data?: Data | undefined; /** - * [Transferable objects](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#portpostmessagevalue-transferlist) + * [Transferable objects](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#portpostmessagevalue-transferlist) * to be passed into the `initialize` hook. */ transferList?: any[] | undefined; @@ -203,10 +216,10 @@ declare module "module" { /** * Register a module that exports hooks that customize Node.js module * resolution and loading behavior. See - * [Customization hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks). + * [Customization hooks](https://nodejs.org/docs/latest-v25.x/api/module.html#customization-hooks). * * This feature requires `--allow-worker` if used with the - * [Permission Model](https://nodejs.org/docs/latest-v24.x/api/permissions.html#permission-model). + * [Permission Model](https://nodejs.org/docs/latest-v25.x/api/permissions.html#permission-model). * @since v20.6.0, v18.19.0 * @param specifier Customization hooks to be registered; this should be * the same string that would be passed to `import()`, except that if it is @@ -222,12 +235,12 @@ declare module "module" { function register(specifier: string | URL, options?: RegisterOptions): void; interface RegisterHooksOptions { /** - * See [load hook](https://nodejs.org/docs/latest-v24.x/api/module.html#loadurl-context-nextload). + * See [load hook](https://nodejs.org/docs/latest-v25.x/api/module.html#loadurl-context-nextload). * @default undefined */ load?: LoadHookSync | undefined; /** - * See [resolve hook](https://nodejs.org/docs/latest-v24.x/api/module.html#resolvespecifier-context-nextresolve). + * See [resolve hook](https://nodejs.org/docs/latest-v25.x/api/module.html#resolvespecifier-context-nextresolve). * @default undefined */ resolve?: ResolveHookSync | undefined; @@ -239,7 +252,7 @@ declare module "module" { deregister(): void; } /** - * Register [hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks) + * Register [hooks](https://nodejs.org/docs/latest-v25.x/api/module.html#customization-hooks) * that customize Node.js module resolution and loading behavior. * @since v22.15.0 * @experimental @@ -270,9 +283,9 @@ declare module "module" { * with `vm.runInContext()` or `vm.compileFunction()`. * By default, it will throw an error if the code contains TypeScript features * that require transformation such as `Enums`, - * see [type-stripping](https://nodejs.org/docs/latest-v24.x/api/typescript.md#type-stripping) for more information. + * see [type-stripping](https://nodejs.org/docs/latest-v25.x/api/typescript.md#type-stripping) for more information. * When mode is `'transform'`, it also transforms TypeScript features to JavaScript, - * see [transform TypeScript features](https://nodejs.org/docs/latest-v24.x/api/typescript.md#typescript-features) for more information. + * see [transform TypeScript features](https://nodejs.org/docs/latest-v25.x/api/typescript.md#typescript-features) for more information. * When mode is `'strip'`, source maps are not generated, because locations are preserved. * If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown. * @@ -623,94 +636,6 @@ declare module "module" { function wrap(script: string): string; } global { - interface ImportMeta { - /** - * The directory name of the current module. - * - * This is the same as the `path.dirname()` of the `import.meta.filename`. - * - * > **Caveat**: only present on `file:` modules. - * @since v21.2.0, v20.11.0 - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with - * symlinks resolved. - * - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * - * > **Caveat** only local modules support this property. Modules not using the - * > `file:` protocol will not provide it. - * @since v21.2.0, v20.11.0 - */ - filename: string; - /** - * The absolute `file:` URL of the module. - * - * This is defined exactly the same as it is in browsers providing the URL of the - * current module file. - * - * This enables useful patterns such as relative file loading: - * - * ```js - * import { readFileSync } from 'node:fs'; - * const buffer = readFileSync(new URL('./data.proto', import.meta.url)); - * ``` - */ - url: string; - /** - * `import.meta.resolve` is a module-relative resolution function scoped to - * each module, returning the URL string. - * - * ```js - * const dependencyAsset = import.meta.resolve('component-lib/asset.css'); - * // file:///app/node_modules/component-lib/asset.css - * import.meta.resolve('./dep.js'); - * // file:///app/dep.js - * ``` - * - * All features of the Node.js module resolution are supported. Dependency - * resolutions are subject to the permitted exports resolutions within the package. - * - * **Caveats**: - * - * * This can result in synchronous file-system operations, which - * can impact performance similarly to `require.resolve`. - * * This feature is not available within custom loaders (it would - * create a deadlock). - * @since v13.9.0, v12.16.0 - * @param specifier The module specifier to resolve relative to the - * current module. - * @param parent An optional absolute parent module URL to resolve from. - * **Default:** `import.meta.url` - * @returns The absolute URL string that the specifier would resolve to. - */ - resolve(specifier: string, parent?: string | URL): string; - /** - * `true` when the current module is the entry point of the current process; `false` otherwise. - * - * Equivalent to `require.main === module` in CommonJS. - * - * Analogous to Python's `__name__ == "__main__"`. - * - * ```js - * export function foo() { - * return 'Hello, world'; - * } - * - * function main() { - * const message = foo(); - * console.log(message); - * } - * - * if (import.meta.main) main(); - * // `foo` can be imported from another module without possible side-effects from `main` - * ``` - * @since v24.2.0 - * @experimental - */ - main: boolean; - } namespace NodeJS { interface Module { /** @@ -784,7 +709,7 @@ declare module "module" { * Modules are cached in this object when they are required. By deleting a key * value from this object, the next `require` will reload the module. * This does not apply to - * [native addons](https://nodejs.org/docs/latest-v24.x/api/addons.html), + * [native addons](https://nodejs.org/docs/latest-v25.x/api/addons.html), * for which reloading will result in an error. * @since v0.3.0 */ @@ -818,7 +743,7 @@ declare module "module" { * Paths to resolve module location from. If present, these * paths are used instead of the default resolution paths, with the exception * of - * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v24.x/api/modules.html#loading-from-the-global-folders) + * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v25.x/api/modules.html#loading-from-the-global-folders) * like `$HOME/.node_modules`, which are * always included. Each of these paths is used as a starting point for * the module resolution algorithm, meaning that the `node_modules` hierarchy @@ -888,7 +813,7 @@ declare module "module" { } export = Module; } -declare module "node:module" { - import module = require("module"); +declare module "module" { + import module = require("node:module"); export = module; } diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts index 38c16275..e0cf8377 100644 --- a/node_modules/@types/node/net.d.ts +++ b/node_modules/@types/node/net.d.ts @@ -10,13 +10,13 @@ * ```js * import net from 'node:net'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/net.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/net.js) */ -declare module "net" { +declare module "node:net" { import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; import * as dns from "node:dns"; + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + import * as stream from "node:stream"; type LookupFunction = ( hostname: string, options: dns.LookupOptions, @@ -70,6 +70,17 @@ declare module "net" { } type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; + interface SocketEventMap extends Omit { + "close": [hadError: boolean]; + "connect": []; + "connectionAttempt": [ip: string, port: number, family: number]; + "connectionAttemptFailed": [ip: string, port: number, family: number, error: Error]; + "connectionAttemptTimeout": [ip: string, port: number, family: number]; + "data": [data: string | NonSharedBuffer]; + "lookup": [err: Error | null, address: string, family: number | null, host: string]; + "ready": []; + "timeout": []; + } /** * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also @@ -354,141 +365,45 @@ declare module "net" { end(callback?: () => void): this; end(buffer: Uint8Array | string, callback?: () => void): this; end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. connectionAttempt - * 4. connectionAttemptFailed - * 5. connectionAttemptTimeout - * 6. data - * 7. drain - * 8. end - * 9. error - * 10. lookup - * 11. ready - * 12. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - addListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - addListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean; - emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean; - emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean; - emit(event: "data", data: NonSharedBuffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - on( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - on(event: "data", listener: (data: NonSharedBuffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - once( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, + // #region InternalEventEmitter + addListener(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: SocketEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: SocketEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: SocketEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: SocketEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, ): this; - once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: NonSharedBuffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - prependListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: SocketEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: SocketEventMap[E]) => void, ): this; - prependListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener( - event: "connectionAttempt", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - prependOnceListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface ListenOptions extends Abortable { backlog?: number | undefined; @@ -536,7 +451,7 @@ declare module "net" { keepAliveInitialDelay?: number | undefined; /** * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). + * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). * @since v18.17.0, v20.1.0 */ highWaterMark?: number | undefined; @@ -558,11 +473,18 @@ declare module "net" { remotePort?: number; remoteFamily?: string; } + interface ServerEventMap { + "close": []; + "connection": [socket: Socket]; + "error": [err: Error]; + "listening": []; + "drop": [data?: DropArgument]; + } /** * This class is used to create a TCP or `IPC` server. * @since v0.1.90 */ - class Server extends EventEmitter { + class Server implements EventEmitter { constructor(connectionListener?: (socket: Socket) => void); constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); /** @@ -688,56 +610,13 @@ declare module "net" { * @since v5.7.0 */ readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; /** * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. * @since v20.5.0 */ [Symbol.asyncDispose](): Promise; } + interface Server extends InternalEventEmitter {} type IPVersion = "ipv4" | "ipv6"; /** * The `BlockList` object can be used with some network APIs to specify rules for @@ -1049,6 +928,6 @@ declare module "net" { static parse(input: string): SocketAddress | undefined; } } -declare module "node:net" { - export * from "net"; +declare module "net" { + export * from "node:net"; } diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts index 505f5b44..db86e9b3 100644 --- a/node_modules/@types/node/os.d.ts +++ b/node_modules/@types/node/os.d.ts @@ -5,9 +5,9 @@ * ```js * import os from 'node:os'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/os.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/os.js) */ -declare module "os" { +declare module "node:os" { import { NonSharedBuffer } from "buffer"; interface CpuInfo { model: string; @@ -251,7 +251,7 @@ declare module "os" { * environment variables for the home directory before falling back to the * operating system response. * - * Throws a [`SystemError`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. + * Throws a [`SystemError`](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. * @since v6.0.0 */ function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo; @@ -431,7 +431,7 @@ declare module "os" { * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, * `'mips'`, `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`. * - * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v24.x/api/process.html#processarch). + * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v25.x/api/process.html#processarch). * @since v0.5.0 */ function arch(): NodeJS.Architecture; @@ -502,6 +502,6 @@ declare module "os" { function setPriority(priority: number): void; function setPriority(pid: number, priority: number): void; } -declare module "node:os" { - export * from "os"; +declare module "os" { + export * from "node:os"; } diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 2d029392..752925ed 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "24.10.1", + "version": "25.0.3", "description": "TypeScript definitions for node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -150,6 +150,6 @@ "undici-types": "~7.16.0" }, "peerDependencies": {}, - "typesPublisherContentHash": "bf541e42e173a984f57b649839d3371001c98469b0e8944f7762074aed2acd2f", + "typesPublisherContentHash": "f232fc4d25235ca95f233b42be2cfd08c384791f716e60e2c105ff6db6b0bdc4", "typeScriptVersion": "5.2" } \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts index d363397f..c0b22f68 100644 --- a/node_modules/@types/node/path.d.ts +++ b/node_modules/@types/node/path.d.ts @@ -1,11 +1,3 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} /** * The `node:path` module provides utilities for working with file and directory * paths. It can be accessed using: @@ -13,9 +5,9 @@ declare module "path/win32" { * ```js * import path from 'node:path'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/path.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/path.js) */ -declare module "path" { +declare module "node:path" { namespace path { /** * A parsed path object generated by path.parse() or consumed by path.format(). @@ -64,137 +56,132 @@ declare module "path" { */ name?: string | undefined; } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * The `path.matchesGlob()` method determines if `path` matches the `pattern`. - * @param path The path to glob-match against. - * @param pattern The glob to check the path against. - * @returns Whether or not the `path` matched the `pattern`. - * @throws {TypeError} if `path` or `pattern` are not strings. - * @since v22.5.0 - */ - matchesGlob(path: string, pattern: string): boolean; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + function normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + function resolve(...paths: string[]): string; + /** + * The `path.matchesGlob()` method determines if `path` matches the `pattern`. + * @param path The path to glob-match against. + * @param pattern The glob to check the path against. + * @returns Whether or not the `path` matched the `pattern`. + * @throws {TypeError} if `path` or `pattern` are not strings. + * @since v22.5.0 + */ + function matchesGlob(path: string, pattern: string): boolean; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + function basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + const sep: "\\" | "/"; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + const delimiter: ";" | ":"; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + function parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + function format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + function toNamespacedPath(path: string): string; + } + namespace path { + export { /** - * Returns an object from a path string - the opposite of format(). + * The `path.posix` property provides access to POSIX specific implementations of the `path` methods. * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. + * The API is accessible via `require('node:path').posix` or `require('node:path/posix')`. */ - parse(path: string): ParsedPath; + path as posix, /** - * Returns a path string from an object - the opposite of parse(). + * The `path.win32` property provides access to Windows-specific implementations of the `path` methods. * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows + * The API is accessible via `require('node:path').win32` or `require('node:path/win32')`. */ - readonly win32: PlatformPath; - } + path as win32, + }; } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); export = path; } -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); +declare module "path" { + import path = require("node:path"); export = path; } diff --git a/node_modules/@types/node/path/posix.d.ts b/node_modules/@types/node/path/posix.d.ts new file mode 100644 index 00000000..d60f629f --- /dev/null +++ b/node_modules/@types/node/path/posix.d.ts @@ -0,0 +1,8 @@ +declare module "node:path/posix" { + import path = require("node:path"); + export = path.posix; +} +declare module "path/posix" { + import path = require("path"); + export = path.posix; +} diff --git a/node_modules/@types/node/path/win32.d.ts b/node_modules/@types/node/path/win32.d.ts new file mode 100644 index 00000000..e6aa9fa6 --- /dev/null +++ b/node_modules/@types/node/path/win32.d.ts @@ -0,0 +1,8 @@ +declare module "node:path/win32" { + import path = require("node:path"); + export = path.win32; +} +declare module "path/win32" { + import path = require("path"); + export = path.win32; +} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts index ba4b9ade..699f3bf5 100644 --- a/node_modules/@types/node/perf_hooks.d.ts +++ b/node_modules/@types/node/perf_hooks.d.ts @@ -27,10 +27,11 @@ * performance.measure('A to B', 'A', 'B'); * }); * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/perf_hooks.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/perf_hooks.js) */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; +declare module "node:perf_hooks" { + import { InternalEventTargetEventProperties } from "node:events"; + // #region web types type EntryType = | "dns" // Node.js only | "function" // Node.js only @@ -42,76 +43,291 @@ declare module "perf_hooks" { | "net" // Node.js only | "node" // Node.js only | "resource"; // available on the Web - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind: number; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags: number; + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; + interface ConnectionTimingInfo { + domainLookupStartTime: number; + domainLookupEndTime: number; + connectionStartTime: number; + connectionEndTime: number; + secureConnectionStartTime: number; + ALPNNegotiatedProtocol: string; + } + interface FetchTimingInfo { + startTime: number; + redirectStartTime: number; + redirectEndTime: number; + postRedirectStartTime: number; + finalServiceWorkerStartTime: number; + finalNetworkRequestStartTime: number; + finalNetworkResponseStartTime: number; + endTime: number; + finalConnectionTimingInfo: ConnectionTimingInfo | null; + encodedBodySize: number; + decodedBodySize: number; + } + type PerformanceEntryList = PerformanceEntry[]; + interface PerformanceMarkOptions { + detail?: any; + startTime?: number; + } + interface PerformanceMeasureOptions { + detail?: any; + duration?: number; + end?: string | number; + start?: string | number; + } + interface PerformanceObserverCallback { + (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void; + } + interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: EntryType[]; + type?: EntryType; + } + interface PerformanceEventMap { + "resourcetimingbufferfull": Event; + } + interface Performance extends EventTarget, InternalEventTargetEventProperties { + readonly nodeTiming: PerformanceNodeTiming; + readonly timeOrigin: number; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(resourceTimingName?: string): void; + getEntries(): PerformanceEntryList; + getEntriesByName(name: string, type?: EntryType): PerformanceEntryList; + getEntriesByType(type: EntryType): PerformanceEntryList; + mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark; + markResourceTiming( + timingInfo: FetchTimingInfo, + requestedUrl: string, + initiatorType: string, + global: unknown, + cacheMode: string, + bodyInfo: unknown, + responseStatus: number, + deliveryType?: string, + ): PerformanceResourceTiming; + measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(measureName: string, options: PerformanceMeasureOptions, endMark?: string): PerformanceMeasure; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; + addEventListener( + type: K, + listener: (ev: PerformanceEventMap[K]) => void, + options?: AddEventListenerOptions | boolean, + ): void; + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + removeEventListener( + type: K, + listener: (ev: PerformanceEventMap[K]) => void, + options?: EventListenerOptions | boolean, + ): void; + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 + * The `eventLoopUtilization()` method returns an object that contains the + * cumulative duration of time the event loop has been both idle and active as a + * high resolution milliseconds timer. The `utilization` value is the calculated + * Event Loop Utilization (ELU). + * + * If bootstrapping has not yet finished on the main thread the properties have + * the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since + * bootstrap happens within the event loop. + * + * Both `utilization1` and `utilization2` are optional parameters. + * + * If `utilization1` is passed, then the delta between the current call's `active` + * and `idle` times, as well as the corresponding `utilization` value are + * calculated and returned (similar to `process.hrtime()`). + * + * If `utilization1` and `utilization2` are both passed, then the delta is + * calculated between the two arguments. This is a convenience option because, + * unlike `process.hrtime()`, calculating the ELU is more complex than a + * single subtraction. + * + * ELU is similar to CPU utilization, except that it only measures event loop + * statistics and not CPU usage. It represents the percentage of time the event + * loop has spent outside the event loop's event provider (e.g. `epoll_wait`). + * No other CPU idle time is taken into consideration. The following is an example + * of how a mostly idle process will have a high ELU. + * + * ```js + * import { eventLoopUtilization } from 'node:perf_hooks'; + * import { spawnSync } from 'node:child_process'; + * + * setImmediate(() => { + * const elu = eventLoopUtilization(); + * spawnSync('sleep', ['5']); + * console.log(eventLoopUtilization(elu).utilization); + * }); + * ``` + * + * Although the CPU is mostly idle while running this script, the value of + * `utilization` is `1`. This is because the call to + * `child_process.spawnSync()` blocks the event loop from proceeding. + * + * Passing in a user-defined object instead of the result of a previous call to + * `eventLoopUtilization()` will lead to undefined behavior. The return values + * are not guaranteed to reflect any correct state of the event loop. + * @since v14.10.0, v12.19.0 + * @param utilization1 The result of a previous call to + * `eventLoopUtilization()`. + * @param utilization2 The result of a previous call to + * `eventLoopUtilization()` prior to `utilization1`. */ - readonly startTime: number; + eventLoopUtilization( + utilization1?: EventLoopUtilization, + utilization2?: EventLoopUtilization, + ): EventLoopUtilization; /** - * The type of the performance entry. It may be one of: + * _This property is an extension by Node.js. It is not available in Web browsers._ * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) + * Wraps a function within a new function that measures the running time of the + * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'` + * event type in order for the timing details to be accessed. + * + * ```js + * import { performance, PerformanceObserver } from 'node:perf_hooks'; + * + * function someFunction() { + * console.log('hello world'); + * } + * + * const wrapped = performance.timerify(someFunction); + * + * const obs = new PerformanceObserver((list) => { + * console.log(list.getEntries()[0].duration); + * + * performance.clearMarks(); + * performance.clearMeasures(); + * obs.disconnect(); + * }); + * obs.observe({ entryTypes: ['function'] }); + * + * // A performance timeline entry will be created + * wrapped(); + * ``` + * + * If the wrapped function returns a promise, a finally handler will be attached + * to the promise and the duration will be reported once the finally handler is + * invoked. * @since v8.5.0 */ + timerify any>(fn: T, options?: PerformanceTimerifyOptions): T; + } + var Performance: { + prototype: Performance; + new(): Performance; + }; + interface PerformanceEntry { + readonly duration: number; readonly entryType: EntryType; + readonly name: string; + readonly startTime: number; toJSON(): any; } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { + var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; + }; + interface PerformanceMark extends PerformanceEntry { readonly detail: any; - readonly duration: 0; readonly entryType: "mark"; } + var PerformanceMark: { + prototype: PerformanceMark; + new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark; + }; + interface PerformanceMeasure extends PerformanceEntry { + readonly detail: any; + readonly entryType: "measure"; + } + var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; + }; + interface PerformanceObserver { + disconnect(): void; + observe(options: PerformanceObserverInit): void; + takeRecords(): PerformanceEntryList; + } + var PerformanceObserver: { + prototype: PerformanceObserver; + new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: readonly EntryType[]; + }; + interface PerformanceObserverEntryList { + getEntries(): PerformanceEntryList; + getEntriesByName(name: string, type?: EntryType): PerformanceEntryList; + getEntriesByType(type: EntryType): PerformanceEntryList; + } + var PerformanceObserverEntryList: { + prototype: PerformanceObserverEntryList; + new(): PerformanceObserverEntryList; + }; + interface PerformanceResourceTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly decodedBodySize: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly encodedBodySize: number; + readonly entryType: "resource"; + readonly fetchStart: number; + readonly initiatorType: string; + readonly nextHopProtocol: string; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly responseStatus: number; + readonly secureConnectionStart: number; + readonly transferSize: number; + readonly workerStart: number; + toJSON(): any; + } + var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; + }; + var performance: Performance; + // #endregion + interface PerformanceTimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } /** - * Exposes measures created via the `Performance.measure()` method. + * _This class is an extension by Node.js. It is not available in Web browsers._ + * + * Provides detailed Node.js timing data. * * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 + * @since v19.0.0 */ - class PerformanceMeasure extends PerformanceEntry { + class PerformanceNodeEntry extends PerformanceEntry { + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ readonly detail: any; - readonly entryType: "measure"; + readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node"; } interface UVMetrics { /** @@ -127,7 +343,6 @@ declare module "perf_hooks" { */ readonly eventsWaiting: number; } - // TODO: PerformanceNodeEntry is missing /** * _This property is an extension by Node.js. It is not available in Web browsers._ * @@ -135,8 +350,7 @@ declare module "perf_hooks" { * is not exposed to users. * @since v8.5.0 */ - class PerformanceNodeTiming extends PerformanceEntry { - readonly entryType: "node"; + interface PerformanceNodeTiming extends PerformanceEntry { /** * The high resolution millisecond timestamp at which the Node.js process * completed bootstrapping. If bootstrapping has not yet finished, the property @@ -144,6 +358,7 @@ declare module "perf_hooks" { * @since v8.5.0 */ readonly bootstrapComplete: number; + readonly entryType: "node"; /** * The high resolution millisecond timestamp at which the Node.js environment was * initialized. @@ -195,507 +410,6 @@ declare module "perf_hooks" { */ readonly v8Start: number; } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param utilization1 The result of a previous call to `eventLoopUtilization()`. - * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. - */ - type EventLoopUtilityFunction = ( - utilization1?: EventLoopUtilization, - utilization2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()` - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using `perf_hooks.createHistogram()` that will record runtime - * durations in nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. - * If `name` is provided, removes only the named mark. - * @since v8.5.0 - */ - clearMarks(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. - * If `name` is provided, removes only the named measure. - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. - * If `name` is provided, removes only the named resource. - * @since v18.2.0, v16.17.0 - */ - clearResourceTimings(name?: string): void; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new `PerformanceMark` entry in the Performance Timeline. - * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, - * and whose `performanceEntry.duration` is always `0`. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * - * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with - * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is - * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. - * @param name - */ - mark(name: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline. - * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`. - * Performance resources are used to mark moments in the Resource Timeline. - * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info) - * @param requestedUrl The resource url - * @param initiatorType The initiator name, e.g: 'fetch' - * @param global - * @param cacheMode The cache mode must be an empty string ('') or 'local' - * @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info) - * @param responseStatus The response's status code - * @param deliveryType The delivery type. Default: ''. - * @since v18.2.0, v16.17.0 - */ - markResourceTiming( - timingInfo: object, - requestedUrl: string, - initiatorType: string, - global: object, - cacheMode: "" | "local", - bodyInfo: object, - responseStatus: number, - deliveryType?: string, - ): PerformanceResourceTiming; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. - * @since v8.5.0 - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. - * @since v8.5.0 - */ - now(): number; - /** - * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. - * - * By default the max buffer size is set to 250. - * @since v18.8.0 - */ - setResourceTimingBufferSize(maxSize: number): void; - /** - * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp - * at which the current `node` process began, measured in Unix time. - * @since v8.5.0 - */ - readonly timeOrigin: number; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Wraps a function within a new function that measures the running time of the wrapped function. - * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * function someFunction() { - * console.log('hello world'); - * } - * - * const wrapped = performance.timerify(someFunction); - * - * const obs = new PerformanceObserver((list) => { - * console.log(list.getEntries()[0].duration); - * - * performance.clearMarks(); - * performance.clearMeasures(); - * obs.disconnect(); - * }); - * obs.observe({ entryTypes: ['function'] }); - * - * // A performance timeline entry will be created - * wrapped(); - * ``` - * - * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported - * once the finally handler is invoked. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * An object which is JSON representation of the performance object. It is similar to - * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. - * @since v16.1.0 - */ - toJSON(): any; - } - class PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`: - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - /** - * @since v16.0.0 - * @returns Current list of entries stored in the performance observer, emptying it out. - */ - takeRecords(): PerformanceEntry[]; - } - /** - * Provides detailed network timing data regarding the loading of an application's resources. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceResourceTiming extends PerformanceEntry { - readonly entryType: "resource"; - protected constructor(); - /** - * The high resolution millisecond timestamp at immediately before dispatching the `fetch` - * request. If the resource is not intercepted by a worker the property will always return 0. - * @since v18.2.0, v16.17.0 - */ - readonly workerStart: number; - /** - * The high resolution millisecond timestamp that represents the start time of the fetch which - * initiates the redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectStart: number; - /** - * The high resolution millisecond timestamp that will be created immediately after receiving - * the last byte of the response of the last redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectEnd: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. - * @since v18.2.0, v16.17.0 - */ - readonly fetchStart: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup - * for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after the Node.js finished - * the domain name lookup for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts to - * establish the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js finishes - * establishing the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts the - * handshake process to secure the current connection. - * @since v18.2.0, v16.17.0 - */ - readonly secureConnectionStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js receives the - * first byte of the response from the server. - * @since v18.2.0, v16.17.0 - */ - readonly requestStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js receives the - * last byte of the resource or immediately before the transport connection is closed, whichever comes first. - * @since v18.2.0, v16.17.0 - */ - readonly responseEnd: number; - /** - * A number representing the size (in octets) of the fetched resource. The size includes the response header - * fields plus the response payload body. - * @since v18.2.0, v16.17.0 - */ - readonly transferSize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly encodedBodySize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly decodedBodySize: number; - /** - * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object - * @since v18.2.0, v16.17.0 - */ - toJSON(): any; - } namespace constants { const NODE_PERFORMANCE_GC_MAJOR: number; const NODE_PERFORMANCE_GC_MINOR: number; @@ -709,7 +423,6 @@ declare module "perf_hooks" { const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; } - const performance: Performance; interface EventLoopMonitorOptions { /** * The sampling rate in milliseconds. @@ -895,88 +608,14 @@ declare module "perf_hooks" { * @since v15.9.0, v14.18.0 */ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { - performance as _performance, - PerformanceEntry as _PerformanceEntry, - PerformanceMark as _PerformanceMark, - PerformanceMeasure as _PerformanceMeasure, - PerformanceObserver as _PerformanceObserver, - PerformanceObserverEntryList as _PerformanceObserverEntryList, - PerformanceResourceTiming as _PerformanceResourceTiming, - } from "perf_hooks"; - global { - /** - * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceentry - * @since v19.0.0 - */ - var PerformanceEntry: typeof globalThis extends { - onmessage: any; - PerformanceEntry: infer T; - } ? T - : typeof _PerformanceEntry; - /** - * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemark - * @since v19.0.0 - */ - var PerformanceMark: typeof globalThis extends { - onmessage: any; - PerformanceMark: infer T; - } ? T - : typeof _PerformanceMark; - /** - * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemeasure - * @since v19.0.0 - */ - var PerformanceMeasure: typeof globalThis extends { - onmessage: any; - PerformanceMeasure: infer T; - } ? T - : typeof _PerformanceMeasure; - /** - * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserver - * @since v19.0.0 - */ - var PerformanceObserver: typeof globalThis extends { - onmessage: any; - PerformanceObserver: infer T; - } ? T - : typeof _PerformanceObserver; - /** - * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserverentrylist - * @since v19.0.0 - */ - var PerformanceObserverEntryList: typeof globalThis extends { - onmessage: any; - PerformanceObserverEntryList: infer T; - } ? T - : typeof _PerformanceObserverEntryList; - /** - * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceresourcetiming - * @since v19.0.0 - */ - var PerformanceResourceTiming: typeof globalThis extends { - onmessage: any; - PerformanceResourceTiming: infer T; - } ? T - : typeof _PerformanceResourceTiming; - /** - * `performance` is a global reference for `import { performance } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } + // TODO: remove these in a future major + /** @deprecated Use the canonical `PerformanceMarkOptions` instead. */ + interface MarkOptions extends PerformanceMarkOptions {} + /** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */ + interface MeasureOptions extends PerformanceMeasureOptions {} + /** @deprecated Use `PerformanceTimerifyOptions` instead. */ + interface TimerifyOptions extends PerformanceTimerifyOptions {} } -declare module "node:perf_hooks" { - export * from "perf_hooks"; +declare module "perf_hooks" { + export * from "node:perf_hooks"; } diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts index 35f031c8..b3082eb7 100644 --- a/node_modules/@types/node/process.d.ts +++ b/node_modules/@types/node/process.d.ts @@ -1,9 +1,9 @@ -declare module "process" { +declare module "node:process" { import { Control, MessageOptions, SendHandle } from "node:child_process"; + import { InternalEventEmitter } from "node:events"; import { PathLike } from "node:fs"; import * as tty from "node:tty"; import { Worker } from "node:worker_threads"; - interface BuiltInModule { "assert": typeof import("assert"); "node:assert": typeof import("node:assert"); @@ -69,6 +69,7 @@ declare module "process" { "node:punycode": typeof import("node:punycode"); "querystring": typeof import("querystring"); "node:querystring": typeof import("node:querystring"); + "node:quic": typeof import("node:quic"); "readline": typeof import("readline"); "node:readline": typeof import("node:readline"); "readline/promises": typeof import("readline/promises"); @@ -103,8 +104,6 @@ declare module "process" { "node:url": typeof import("node:url"); "util": typeof import("util"); "node:util": typeof import("node:util"); - "sys": typeof import("util"); - "node:sys": typeof import("node:util"); "util/types": typeof import("util/types"); "node:util/types": typeof import("node:util/types"); "v8": typeof import("v8"); @@ -118,8 +117,28 @@ declare module "process" { "zlib": typeof import("zlib"); "node:zlib": typeof import("node:zlib"); } + type SignalsEventMap = { [S in NodeJS.Signals]: [signal: S] }; + interface ProcessEventMap extends SignalsEventMap { + "beforeExit": [code: number]; + "disconnect": []; + "exit": [code: number]; + "message": [ + message: object | boolean | number | string | null, + sendHandle: SendHandle | undefined, + ]; + "rejectionHandled": [promise: Promise]; + "uncaughtException": [error: Error, origin: NodeJS.UncaughtExceptionOrigin]; + "uncaughtExceptionMonitor": [error: Error, origin: NodeJS.UncaughtExceptionOrigin]; + "unhandledRejection": [reason: unknown, promise: Promise]; + "warning": [warning: Error]; + "worker": [worker: Worker]; + "workerMessage": [value: any, source: number]; + } global { var process: NodeJS.Process; + namespace process { + export { ProcessEventMap }; + } namespace NodeJS { // this namespace merge is here because these are specifically used // as the type for process.stdin, process.stdout, and process.stderr. @@ -196,7 +215,7 @@ declare module "process" { readonly ipv6: boolean; /** * A boolean value that is `true` if the current Node.js build supports - * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v24.x/api/modules.md#loading-ecmascript-modules-using-require). + * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v25.x/api/modules.md#loading-ecmascript-modules-using-require). * @since v22.10.0 */ readonly require_module: boolean; @@ -320,26 +339,129 @@ declare module "process" { | "SIGLOST" | "SIGINFO"; type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['beforeExit']) => { ... }; + * ``` + */ + type BeforeExitListener = (...args: ProcessEventMap["beforeExit"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['disconnect']) => { ... }; + * ``` + */ + type DisconnectListener = (...args: ProcessEventMap["disconnect"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['exit']) => { ... }; + * ``` + */ + type ExitListener = (...args: ProcessEventMap["exit"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['message']) => { ... }; + * ``` + */ + type MessageListener = (...args: ProcessEventMap["message"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['rejectionHandled']) => { ... }; + * ``` + */ + type RejectionHandledListener = (...args: ProcessEventMap["rejectionHandled"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: SendHandle) => void; type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['uncaughtException']) => { ... }; + * ``` + */ + type UncaughtExceptionListener = (...args: ProcessEventMap["uncaughtException"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['unhandledRejection']) => { ... }; + * ``` + */ + type UnhandledRejectionListener = (...args: ProcessEventMap["unhandledRejection"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['warning']) => { ... }; + * ``` + */ + type WarningListener = (...args: ProcessEventMap["warning"]) => void; + /** + * @deprecated Global listener types will be removed in a future version. + * Callbacks passed directly to `process`'s EventEmitter methods + * have their parameter types inferred automatically. + * + * `process` event types are also available via `ProcessEventMap`: + * + * ```ts + * import type { ProcessEventMap } from 'node:process'; + * const listener = (...args: ProcessEventMap['worker']) => { ... }; + * ``` + */ + type WorkerListener = (...args: ProcessEventMap["worker"]) => void; interface Socket extends ReadWriteStream { isTTY?: true | undefined; } @@ -560,7 +682,7 @@ declare module "process" { readonly visibility: string; }; } - interface Process extends EventEmitter { + interface Process extends InternalEventEmitter { /** * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is * a `Writable` stream. @@ -749,7 +871,7 @@ declare module "process" { * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()` * unless there are specific reasons such as custom dlopen flags or loading from ES modules. * - * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v24.x/api/os.html#dlopen-constants)` + * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v25.x/api/os.html#dlopen-constants)` * documentation for details. * * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon @@ -1584,7 +1706,7 @@ declare module "process" { constrainedMemory(): number; /** * Gets the amount of free memory that is still available to the process (in bytes). - * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v24.x/api/process.html#processavailablememory) for more information. + * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v25.x/api/process.html#processavailablememory) for more information. * @since v20.13.0 */ availableMemory(): number; @@ -1704,6 +1826,11 @@ declare module "process" { * @param args Additional arguments to pass when invoking the `callback` */ nextTick(callback: Function, ...args: any[]): void; + /** + * The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process. + * See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior. + */ + noDeprecation?: boolean; /** * This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag. * @@ -1790,7 +1917,7 @@ declare module "process" { * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. * @since v0.7.2 */ - disconnect(): void; + disconnect?(): void; /** * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC * channel is connected and will return `false` after `process.disconnect()` is called. @@ -1844,7 +1971,7 @@ declare module "process" { allowedNodeEnvironmentFlags: ReadonlySet; /** * `process.report` is an object whose methods are used to generate diagnostic reports for the current process. - * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v24.x/api/report.html). + * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v25.x/api/report.html). * @since v11.8.0 */ report: ProcessReport; @@ -1959,111 +2086,12 @@ declare module "process" { * **Default:** `process.env`. */ execve?(file: string, args?: readonly string[], env?: ProcessEnv): never; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: SendHandle): this; - emit(event: "workerMessage", value: any, source: number): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: "workerMessage", listener: (value: any, source: number) => void): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: "workerMessage", listener: (value: any, source: number) => void): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: "workerMessage"): ((value: any, source: number) => void)[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; } } } export = process; } -declare module "node:process" { - import process = require("process"); +declare module "process" { + import process = require("node:process"); export = process; } diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts index 7ac26c82..d293553f 100644 --- a/node_modules/@types/node/punycode.d.ts +++ b/node_modules/@types/node/punycode.d.ts @@ -23,10 +23,10 @@ * The `punycode` module is a third-party dependency used by Node.js and * made available to developers as a convenience. Fixes or other modifications to * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/punycode.js) + * @deprecated + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/punycode.js) */ -declare module "punycode" { +declare module "node:punycode" { /** * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only * characters to the equivalent string of Unicode codepoints. @@ -112,6 +112,6 @@ declare module "punycode" { */ const version: string; } -declare module "node:punycode" { - export * from "punycode"; +declare module "punycode" { + export * from "node:punycode"; } diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts index aaeefe8d..dc421bcc 100644 --- a/node_modules/@types/node/querystring.d.ts +++ b/node_modules/@types/node/querystring.d.ts @@ -9,9 +9,9 @@ * `querystring` is more performant than `URLSearchParams` but is not a * standardized API. Use `URLSearchParams` when performance is not critical or * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/querystring.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/querystring.js) */ -declare module "querystring" { +declare module "node:querystring" { interface StringifyOptions { /** * The function to use when converting URL-unsafe characters to percent-encoding in the query string. @@ -147,6 +147,6 @@ declare module "querystring" { */ function unescape(str: string): string; } -declare module "node:querystring" { - export * from "querystring"; +declare module "querystring" { + export * from "node:querystring"; } diff --git a/node_modules/@types/node/quic.d.ts b/node_modules/@types/node/quic.d.ts new file mode 100644 index 00000000..9a6fd97e --- /dev/null +++ b/node_modules/@types/node/quic.d.ts @@ -0,0 +1,910 @@ +/** + * The 'node:quic' module provides an implementation of the QUIC protocol. + * To access it, start Node.js with the `--experimental-quic` option and: + * + * ```js + * import quic from 'node:quic'; + * ``` + * + * The module is only available under the `node:` scheme. + * @since v23.8.0 + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/quic.js) + */ +declare module "node:quic" { + import { KeyObject, webcrypto } from "node:crypto"; + import { SocketAddress } from "node:net"; + import { ReadableStream } from "node:stream/web"; + /** + * @since v23.8.0 + */ + type OnSessionCallback = (this: QuicEndpoint, session: QuicSession) => void; + /** + * @since v23.8.0 + */ + type OnStreamCallback = (this: QuicSession, stream: QuicStream) => void; + /** + * @since v23.8.0 + */ + type OnDatagramCallback = (this: QuicSession, datagram: Uint8Array, early: boolean) => void; + /** + * @since v23.8.0 + */ + type OnDatagramStatusCallback = (this: QuicSession, id: bigint, status: "lost" | "acknowledged") => void; + /** + * @since v23.8.0 + */ + type OnPathValidationCallback = ( + this: QuicSession, + result: "success" | "failure" | "aborted", + newLocalAddress: SocketAddress, + newRemoteAddress: SocketAddress, + oldLocalAddress: SocketAddress, + oldRemoteAddress: SocketAddress, + preferredAddress: boolean, + ) => void; + /** + * @since v23.8.0 + */ + type OnSessionTicketCallback = (this: QuicSession, ticket: object) => void; + /** + * @since v23.8.0 + */ + type OnVersionNegotiationCallback = ( + this: QuicSession, + version: number, + requestedVersions: number[], + supportedVersions: number[], + ) => void; + /** + * @since v23.8.0 + */ + type OnHandshakeCallback = ( + this: QuicSession, + sni: string, + alpn: string, + cipher: string, + cipherVersion: string, + validationErrorReason: string, + validationErrorCode: number, + earlyDataAccepted: boolean, + ) => void; + /** + * @since v23.8.0 + */ + type OnBlockedCallback = (this: QuicStream) => void; + /** + * @since v23.8.0 + */ + type OnStreamErrorCallback = (this: QuicStream, error: any) => void; + /** + * @since v23.8.0 + */ + interface TransportParams { + /** + * The preferred IPv4 address to advertise. + * @since v23.8.0 + */ + preferredAddressIpv4?: SocketAddress | undefined; + /** + * The preferred IPv6 address to advertise. + * @since v23.8.0 + */ + preferredAddressIpv6?: SocketAddress | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataBidiLocal?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataBidiRemote?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamDataUni?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxData?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamsBidi?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + initialMaxStreamsUni?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxIdleTimeout?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + activeConnectionIDLimit?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + ackDelayExponent?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxAckDelay?: bigint | number | undefined; + /** + * @since v23.8.0 + */ + maxDatagramFrameSize?: bigint | number | undefined; + } + /** + * @since v23.8.0 + */ + interface SessionOptions { + /** + * An endpoint to use. + * @since v23.8.0 + */ + endpoint?: EndpointOptions | QuicEndpoint | undefined; + /** + * The ALPN protocol identifier. + * @since v23.8.0 + */ + alpn?: string | undefined; + /** + * The CA certificates to use for sessions. + * @since v23.8.0 + */ + ca?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * Specifies the congestion control algorithm that will be used. + * Must be set to one of either `'reno'`, `'cubic'`, or `'bbr'`. + * + * This is an advanced option that users typically won't have need to specify. + * @since v23.8.0 + */ + cc?: `${constants.cc}` | undefined; + /** + * The TLS certificates to use for sessions. + * @since v23.8.0 + */ + certs?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * The list of supported TLS 1.3 cipher algorithms. + * @since v23.8.0 + */ + ciphers?: string | undefined; + /** + * The CRL to use for sessions. + * @since v23.8.0 + */ + crl?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * The list of support TLS 1.3 cipher groups. + * @since v23.8.0 + */ + groups?: string | undefined; + /** + * True to enable TLS keylogging output. + * @since v23.8.0 + */ + keylog?: boolean | undefined; + /** + * The TLS crypto keys to use for sessions. + * @since v23.8.0 + */ + keys?: KeyObject | webcrypto.CryptoKey | ReadonlyArray | undefined; + /** + * Specifies the maximum UDP packet payload size. + * @since v23.8.0 + */ + maxPayloadSize?: bigint | number | undefined; + /** + * Specifies the maximum stream flow-control window size. + * @since v23.8.0 + */ + maxStreamWindow?: bigint | number | undefined; + /** + * Specifies the maximum session flow-control window size. + * @since v23.8.0 + */ + maxWindow?: bigint | number | undefined; + /** + * The minimum QUIC version number to allow. This is an advanced option that users + * typically won't have need to specify. + * @since v23.8.0 + */ + minVersion?: number | undefined; + /** + * When the remote peer advertises a preferred address, this option specifies whether + * to use it or ignore it. + * @since v23.8.0 + */ + preferredAddressPolicy?: "use" | "ignore" | "default" | undefined; + /** + * True if qlog output should be enabled. + * @since v23.8.0 + */ + qlog?: boolean | undefined; + /** + * A session ticket to use for 0RTT session resumption. + * @since v23.8.0 + */ + sessionTicket?: NodeJS.ArrayBufferView | undefined; + /** + * Specifies the maximum number of milliseconds a TLS handshake is permitted to take + * to complete before timing out. + * @since v23.8.0 + */ + handshakeTimeout?: bigint | number | undefined; + /** + * The peer server name to target. + * @since v23.8.0 + */ + sni?: string | undefined; + /** + * True to enable TLS tracing output. + * @since v23.8.0 + */ + tlsTrace?: boolean | undefined; + /** + * The QUIC transport parameters to use for the session. + * @since v23.8.0 + */ + transportParams?: TransportParams | undefined; + /** + * Specifies the maximum number of unacknowledged packets a session should allow. + * @since v23.8.0 + */ + unacknowledgedPacketThreshold?: bigint | number | undefined; + /** + * True to require verification of TLS client certificate. + * @since v23.8.0 + */ + verifyClient?: boolean | undefined; + /** + * True to require private key verification. + * @since v23.8.0 + */ + verifyPrivateKey?: boolean | undefined; + /** + * The QUIC version number to use. This is an advanced option that users typically + * won't have need to specify. + * @since v23.8.0 + */ + version?: number | undefined; + } + /** + * Initiate a new client-side session. + * + * ```js + * import { connect } from 'node:quic'; + * import { Buffer } from 'node:buffer'; + * + * const enc = new TextEncoder(); + * const alpn = 'foo'; + * const client = await connect('123.123.123.123:8888', { alpn }); + * await client.createUnidirectionalStream({ + * body: enc.encode('hello world'), + * }); + * ``` + * + * By default, every call to `connect(...)` will create a new local + * `QuicEndpoint` instance bound to a new random local IP port. To + * specify the exact local address to use, or to multiplex multiple + * QUIC sessions over a single local port, pass the `endpoint` option + * with either a `QuicEndpoint` or `EndpointOptions` as the argument. + * + * ```js + * import { QuicEndpoint, connect } from 'node:quic'; + * + * const endpoint = new QuicEndpoint({ + * address: '127.0.0.1:1234', + * }); + * + * const client = await connect('123.123.123.123:8888', { endpoint }); + * ``` + * @since v23.8.0 + */ + function connect(address: string | SocketAddress, options?: SessionOptions): Promise; + /** + * Configures the endpoint to listen as a server. When a new session is initiated by + * a remote peer, the given `onsession` callback will be invoked with the created + * session. + * + * ```js + * import { listen } from 'node:quic'; + * + * const endpoint = await listen((session) => { + * // ... handle the session + * }); + * + * // Closing the endpoint allows any sessions open when close is called + * // to complete naturally while preventing new sessions from being + * // initiated. Once all existing sessions have finished, the endpoint + * // will be destroyed. The call returns a promise that is resolved once + * // the endpoint is destroyed. + * await endpoint.close(); + * ``` + * + * By default, every call to `listen(...)` will create a new local + * `QuicEndpoint` instance bound to a new random local IP port. To + * specify the exact local address to use, or to multiplex multiple + * QUIC sessions over a single local port, pass the `endpoint` option + * with either a `QuicEndpoint` or `EndpointOptions` as the argument. + * + * At most, any single `QuicEndpoint` can only be configured to listen as + * a server once. + * @since v23.8.0 + */ + function listen(onsession: OnSessionCallback, options?: SessionOptions): Promise; + /** + * The endpoint configuration options passed when constructing a new `QuicEndpoint` instance. + * @since v23.8.0 + */ + interface EndpointOptions { + /** + * If not specified the endpoint will bind to IPv4 `localhost` on a random port. + * @since v23.8.0 + */ + address?: SocketAddress | string | undefined; + /** + * The endpoint maintains an internal cache of validated socket addresses as a + * performance optimization. This option sets the maximum number of addresses + * that are cache. This is an advanced option that users typically won't have + * need to specify. + * @since v23.8.0 + */ + addressLRUSize?: bigint | number | undefined; + /** + * When `true`, indicates that the endpoint should bind only to IPv6 addresses. + * @since v23.8.0 + */ + ipv6Only?: boolean | undefined; + /** + * Specifies the maximum number of concurrent sessions allowed per remote peer address. + * @since v23.8.0 + */ + maxConnectionsPerHost?: bigint | number | undefined; + /** + * Specifies the maximum total number of concurrent sessions. + * @since v23.8.0 + */ + maxConnectionsTotal?: bigint | number | undefined; + /** + * Specifies the maximum number of QUIC retry attempts allowed per remote peer address. + * @since v23.8.0 + */ + maxRetries?: bigint | number | undefined; + /** + * Specifies the maximum number of stateless resets that are allowed per remote peer address. + * @since v23.8.0 + */ + maxStatelessResetsPerHost?: bigint | number | undefined; + /** + * Specifies the length of time a QUIC retry token is considered valid. + * @since v23.8.0 + */ + retryTokenExpiration?: bigint | number | undefined; + /** + * Specifies the 16-byte secret used to generate QUIC retry tokens. + * @since v23.8.0 + */ + resetTokenSecret?: NodeJS.ArrayBufferView | undefined; + /** + * Specifies the length of time a QUIC token is considered valid. + * @since v23.8.0 + */ + tokenExpiration?: bigint | number | undefined; + /** + * Specifies the 16-byte secret used to generate QUIC tokens. + * @since v23.8.0 + */ + tokenSecret?: NodeJS.ArrayBufferView | undefined; + /** + * @since v23.8.0 + */ + udpReceiveBufferSize?: number | undefined; + /** + * @since v23.8.0 + */ + udpSendBufferSize?: number | undefined; + /** + * @since v23.8.0 + */ + udpTTL?: number | undefined; + /** + * When `true`, requires that the endpoint validate peer addresses using retry packets + * while establishing a new connection. + * @since v23.8.0 + */ + validateAddress?: boolean | undefined; + } + /** + * A `QuicEndpoint` encapsulates the local UDP-port binding for QUIC. It can be + * used as both a client and a server. + * @since v23.8.0 + */ + class QuicEndpoint implements AsyncDisposable { + constructor(options?: EndpointOptions); + /** + * The local UDP socket address to which the endpoint is bound, if any. + * + * If the endpoint is not currently bound then the value will be `undefined`. Read only. + * @since v23.8.0 + */ + readonly address: SocketAddress | undefined; + /** + * When `endpoint.busy` is set to true, the endpoint will temporarily reject + * new sessions from being created. Read/write. + * + * ```js + * // Mark the endpoint busy. New sessions will be prevented. + * endpoint.busy = true; + * + * // Mark the endpoint free. New session will be allowed. + * endpoint.busy = false; + * ``` + * + * The `busy` property is useful when the endpoint is under heavy load and needs to + * temporarily reject new sessions while it catches up. + * @since v23.8.0 + */ + busy: boolean; + /** + * Gracefully close the endpoint. The endpoint will close and destroy itself when + * all currently open sessions close. Once called, new sessions will be rejected. + * + * Returns a promise that is fulfilled when the endpoint is destroyed. + * @since v23.8.0 + */ + close(): Promise; + /** + * A promise that is fulfilled when the endpoint is destroyed. This will be the same promise that is + * returned by the `endpoint.close()` function. Read only. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * True if `endpoint.close()` has been called and closing the endpoint has not yet completed. + * Read only. + * @since v23.8.0 + */ + readonly closing: boolean; + /** + * Forcefully closes the endpoint by forcing all open sessions to be immediately + * closed. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `endpoint.destroy()` has been called. Read only. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The statistics collected for an active session. Read only. + * @since v23.8.0 + */ + readonly stats: QuicEndpoint.Stats; + /** + * Calls `endpoint.close()` and returns a promise that fulfills when the + * endpoint has closed. + * @since v23.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + namespace QuicEndpoint { + /** + * A view of the collected statistics for an endpoint. + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * A timestamp indicating the moment the endpoint was created. Read only. + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * A timestamp indicating the moment the endpoint was destroyed. Read only. + * @since v23.8.0 + */ + readonly destroyedAt: bigint; + /** + * The total number of bytes received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * The total number of bytes sent by this endpoint. Read only. + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * The total number of QUIC packets successfully received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly packetsReceived: bigint; + /** + * The total number of QUIC packets successfully sent by this endpoint. Read only. + * @since v23.8.0 + */ + readonly packetsSent: bigint; + /** + * The total number of peer-initiated sessions received by this endpoint. Read only. + * @since v23.8.0 + */ + readonly serverSessions: bigint; + /** + * The total number of sessions initiated by this endpoint. Read only. + * @since v23.8.0 + */ + readonly clientSessions: bigint; + /** + * The total number of times an initial packet was rejected due to the + * endpoint being marked busy. Read only. + * @since v23.8.0 + */ + readonly serverBusyCount: bigint; + /** + * The total number of QUIC retry attempts on this endpoint. Read only. + * @since v23.8.0 + */ + readonly retryCount: bigint; + /** + * The total number sessions rejected due to QUIC version mismatch. Read only. + * @since v23.8.0 + */ + readonly versionNegotiationCount: bigint; + /** + * The total number of stateless resets handled by this endpoint. Read only. + * @since v23.8.0 + */ + readonly statelessResetCount: bigint; + /** + * The total number of sessions that were closed before handshake completed. Read only. + * @since v23.8.0 + */ + readonly immediateCloseCount: bigint; + } + } + interface CreateStreamOptions { + body?: ArrayBuffer | NodeJS.ArrayBufferView | Blob | undefined; + sendOrder?: number | undefined; + } + interface SessionPath { + local: SocketAddress; + remote: SocketAddress; + } + /** + * A `QuicSession` represents the local side of a QUIC connection. + * @since v23.8.0 + */ + class QuicSession implements AsyncDisposable { + private constructor(); + /** + * Initiate a graceful close of the session. Existing streams will be allowed + * to complete but no new streams will be opened. Once all streams have closed, + * the session will be destroyed. The returned promise will be fulfilled once + * the session has been destroyed. + * @since v23.8.0 + */ + close(): Promise; + /** + * A promise that is fulfilled once the session is destroyed. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * Immediately destroy the session. All streams will be destroys and the + * session will be closed. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `session.destroy()` has been called. Read only. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The endpoint that created this session. Read only. + * @since v23.8.0 + */ + readonly endpoint: QuicEndpoint; + /** + * The callback to invoke when a new stream is initiated by a remote peer. Read/write. + * @since v23.8.0 + */ + onstream: OnStreamCallback | undefined; + /** + * The callback to invoke when a new datagram is received from a remote peer. Read/write. + * @since v23.8.0 + */ + ondatagram: OnDatagramCallback | undefined; + /** + * The callback to invoke when the status of a datagram is updated. Read/write. + * @since v23.8.0 + */ + ondatagramstatus: OnDatagramStatusCallback | undefined; + /** + * The callback to invoke when the path validation is updated. Read/write. + * @since v23.8.0 + */ + onpathvalidation: OnPathValidationCallback | undefined; + /** + * The callback to invoke when a new session ticket is received. Read/write. + * @since v23.8.0 + */ + onsessionticket: OnSessionTicketCallback | undefined; + /** + * The callback to invoke when a version negotiation is initiated. Read/write. + * @since v23.8.0 + */ + onversionnegotiation: OnVersionNegotiationCallback | undefined; + /** + * The callback to invoke when the TLS handshake is completed. Read/write. + * @since v23.8.0 + */ + onhandshake: OnHandshakeCallback | undefined; + /** + * Open a new bidirectional stream. If the `body` option is not specified, + * the outgoing stream will be half-closed. + * @since v23.8.0 + */ + createBidirectionalStream(options?: CreateStreamOptions): Promise; + /** + * Open a new unidirectional stream. If the `body` option is not specified, + * the outgoing stream will be closed. + * @since v23.8.0 + */ + createUnidirectionalStream(options?: CreateStreamOptions): Promise; + /** + * The local and remote socket addresses associated with the session. Read only. + * @since v23.8.0 + */ + path: SessionPath | undefined; + /** + * Sends an unreliable datagram to the remote peer, returning the datagram ID. + * If the datagram payload is specified as an `ArrayBufferView`, then ownership of + * that view will be transfered to the underlying stream. + * @since v23.8.0 + */ + sendDatagram(datagram: string | NodeJS.ArrayBufferView): bigint; + /** + * Return the current statistics for the session. Read only. + * @since v23.8.0 + */ + readonly stats: QuicSession.Stats; + /** + * Initiate a key update for the session. + * @since v23.8.0 + */ + updateKey(): void; + /** + * Calls `session.close()` and returns a promise that fulfills when the + * session has closed. + * @since v23.8.0 + */ + [Symbol.asyncDispose](): Promise; + } + namespace QuicSession { + /** + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * @since v23.8.0 + */ + readonly closingAt: bigint; + /** + * @since v23.8.0 + */ + readonly handshakeCompletedAt: bigint; + /** + * @since v23.8.0 + */ + readonly handshakeConfirmedAt: bigint; + /** + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * @since v23.8.0 + */ + readonly bidiInStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly bidiOutStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly uniInStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly uniOutStreamCount: bigint; + /** + * @since v23.8.0 + */ + readonly maxBytesInFlights: bigint; + /** + * @since v23.8.0 + */ + readonly bytesInFlight: bigint; + /** + * @since v23.8.0 + */ + readonly blockCount: bigint; + /** + * @since v23.8.0 + */ + readonly cwnd: bigint; + /** + * @since v23.8.0 + */ + readonly latestRtt: bigint; + /** + * @since v23.8.0 + */ + readonly minRtt: bigint; + /** + * @since v23.8.0 + */ + readonly rttVar: bigint; + /** + * @since v23.8.0 + */ + readonly smoothedRtt: bigint; + /** + * @since v23.8.0 + */ + readonly ssthresh: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsReceived: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsSent: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsAcknowledged: bigint; + /** + * @since v23.8.0 + */ + readonly datagramsLost: bigint; + } + } + /** + * @since v23.8.0 + */ + class QuicStream { + private constructor(); + /** + * A promise that is fulfilled when the stream is fully closed. + * @since v23.8.0 + */ + readonly closed: Promise; + /** + * Immediately and abruptly destroys the stream. + * @since v23.8.0 + */ + destroy(error?: any): void; + /** + * True if `stream.destroy()` has been called. + * @since v23.8.0 + */ + readonly destroyed: boolean; + /** + * The directionality of the stream. Read only. + * @since v23.8.0 + */ + readonly direction: "bidi" | "uni"; + /** + * The stream ID. Read only. + * @since v23.8.0 + */ + readonly id: bigint; + /** + * The callback to invoke when the stream is blocked. Read/write. + * @since v23.8.0 + */ + onblocked: OnBlockedCallback | undefined; + /** + * The callback to invoke when the stream is reset. Read/write. + * @since v23.8.0 + */ + onreset: OnStreamErrorCallback | undefined; + /** + * @since v23.8.0 + */ + readonly readable: ReadableStream; + /** + * The session that created this stream. Read only. + * @since v23.8.0 + */ + readonly session: QuicSession; + /** + * The current statistics for the stream. Read only. + * @since v23.8.0 + */ + readonly stats: QuicStream.Stats; + } + namespace QuicStream { + /** + * @since v23.8.0 + */ + class Stats { + private constructor(); + /** + * @since v23.8.0 + */ + readonly ackedAt: bigint; + /** + * @since v23.8.0 + */ + readonly bytesReceived: bigint; + /** + * @since v23.8.0 + */ + readonly bytesSent: bigint; + /** + * @since v23.8.0 + */ + readonly createdAt: bigint; + /** + * @since v23.8.0 + */ + readonly destroyedAt: bigint; + /** + * @since v23.8.0 + */ + readonly finalSize: bigint; + /** + * @since v23.8.0 + */ + readonly isConnected: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffset: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffsetAcknowledged: bigint; + /** + * @since v23.8.0 + */ + readonly maxOffsetReceived: bigint; + /** + * @since v23.8.0 + */ + readonly openedAt: bigint; + /** + * @since v23.8.0 + */ + readonly receivedAt: bigint; + } + } + namespace constants { + enum cc { + RENO = "reno", + CUBIC = "cubic", + BBR = "bbr", + } + const DEFAULT_CIPHERS: string; + const DEFAULT_GROUPS: string; + } +} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts index 519b4a46..a47e1855 100644 --- a/node_modules/@types/node/readline.d.ts +++ b/node_modules/@types/node/readline.d.ts @@ -1,6 +1,6 @@ /** - * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream - * (such as [`process.stdin`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdin)) one line at a time. + * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream + * (such as [`process.stdin`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdin)) one line at a time. * * To use the promise-based APIs: * @@ -31,27 +31,58 @@ * * Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/readline.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/readline.js) */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { +declare module "node:readline" { + import { Abortable, EventEmitter, InternalEventEmitter } from "node:events"; + interface Key { sequence?: string | undefined; name?: string | undefined; ctrl?: boolean | undefined; meta?: boolean | undefined; shift?: boolean | undefined; } + interface InterfaceEventMap { + "close": []; + "history": [history: string[]]; + "line": [input: string]; + "pause": []; + "resume": []; + "SIGCONT": []; + "SIGINT": []; + "SIGTSTP": []; + } /** * Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a - * single `input` [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream. + * single `input` [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream. * The `output` stream is used to print prompts for user input that arrives on, * and is read from, the `input` stream. * @since v0.1.104 */ - export class Interface extends EventEmitter implements Disposable { + class Interface implements EventEmitter, Disposable { + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer | AsyncCompleter, + terminal?: boolean, + ); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(options: ReadLineOptions); readonly terminal: boolean; /** * The current input data being processed by node. @@ -94,29 +125,6 @@ declare module "readline" { * @since v0.1.98 */ readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); /** * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. * @since v15.3.0, v14.17.0 @@ -244,87 +252,23 @@ declare module "readline" { * @since v13.5.0, v12.16.0 */ getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; [Symbol.asyncIterator](): NodeJS.AsyncIterator; } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( + interface Interface extends InternalEventEmitter {} + type ReadLine = Interface; // type forwarded for backwards compatibility + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = ( line: string, callback: (err?: null | Error, result?: CompleterResult) => void, ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { + type CompleterResult = [string[], string]; + interface ReadLineOptions { /** - * The [`Readable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream to listen to + * The [`Readable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream to listen to */ input: NodeJS.ReadableStream; /** - * The [`Writable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream to write readline data to. + * The [`Writable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream to write readline data to. */ output?: NodeJS.WritableStream | undefined; /** @@ -369,7 +313,7 @@ declare module "readline" { * `crlfDelay` will be coerced to a number no less than `100`. * It can be set to `Infinity`, in which case * `\r` followed by `\n` will always be considered a single newline - * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v24.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter). + * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v25.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter). * @default 100 */ crlfDelay?: number | undefined; @@ -422,13 +366,13 @@ declare module "readline" { * waiting for user input, call `process.stdin.unref()`. * @since v0.1.98 */ - export function createInterface( + function createInterface( input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean, ): Interface; - export function createInterface(options: ReadLineOptions): Interface; + function createInterface(options: ReadLineOptions): Interface; /** * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. * @@ -550,45 +494,48 @@ declare module "readline" { * ``` * @since v0.7.7 */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { + function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + type Direction = -1 | 0 | 1; + interface CursorPos { rows: number; cols: number; } /** - * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream + * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream * in a specified direction identified by `dir`. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; /** - * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream from + * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream from * the current position of the cursor down. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; /** * The `readline.cursorTo()` method moves cursor to the specified position in a - * given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`. + * given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; /** * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`. + * position in a given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; + function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; } declare module "node:readline" { - export * from "readline"; + export * as promises from "node:readline/promises"; +} +declare module "readline" { + export * from "node:readline"; } diff --git a/node_modules/@types/node/readline/promises.d.ts b/node_modules/@types/node/readline/promises.d.ts index 5bc9a0c2..f449e1bb 100644 --- a/node_modules/@types/node/readline/promises.d.ts +++ b/node_modules/@types/node/readline/promises.d.ts @@ -1,7 +1,7 @@ /** * @since v17.0.0 */ -declare module "readline/promises" { +declare module "node:readline/promises" { import { Abortable } from "node:events"; import { CompleterResult, @@ -156,6 +156,6 @@ declare module "readline/promises" { ): Interface; function createInterface(options: ReadLineOptions): Interface; } -declare module "node:readline/promises" { - export * from "readline/promises"; +declare module "readline/promises" { + export * from "node:readline/promises"; } diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts index 60dc94ad..2d06294f 100644 --- a/node_modules/@types/node/repl.d.ts +++ b/node_modules/@types/node/repl.d.ts @@ -6,12 +6,12 @@ * ```js * import repl from 'node:repl'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/repl.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/repl.js) */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; +declare module "node:repl" { + import { AsyncCompleter, Completer, Interface, InterfaceEventMap } from "node:readline"; import { InspectOptions } from "node:util"; + import { Context } from "node:vm"; interface ReplOptions { /** * The input prompt to display. @@ -39,7 +39,7 @@ declare module "repl" { * The function to be used when evaluating each given line of input. * **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#custom-evaluation-functions) + * additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#custom-evaluation-functions) * section for more details. */ eval?: REPLEval | undefined; @@ -72,13 +72,13 @@ declare module "repl" { * The function to invoke to format the output of each command before writing to `output`. * @default a wrapper for `util.inspect` * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_customizing_repl_output + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_customizing_repl_output */ writer?: REPLWriter | undefined; /** * An optional function used for custom Tab auto completion. * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#readline_use_of_the_completer_function + * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#readline_use_of_the_completer_function */ completer?: Completer | AsyncCompleter | undefined; /** @@ -129,6 +129,10 @@ declare module "repl" { removeHistoryDuplicates?: boolean | undefined; onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined; } + interface REPLServerEventMap extends InterfaceEventMap { + "exit": []; + "reset": [context: Context]; + } /** * Instances of `repl.REPLServer` are created using the {@link start} method * or directly using the JavaScript `new` keyword. @@ -144,6 +148,17 @@ declare module "repl" { * @since v0.1.91 */ class REPLServer extends Interface { + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); /** * The `vm.Context` provided to the `eval` function to be used for JavaScript * evaluation. @@ -172,33 +187,33 @@ declare module "repl" { /** * A value indicating whether the REPL is currently in "editor mode". * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_commands_and_special_keys + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_commands_and_special_keys */ readonly editorMode: boolean; /** * A value indicating whether the `_` variable has been assigned. * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable */ readonly underscoreAssigned: boolean; /** * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable */ readonly last: any; /** * A value indicating whether the `_error` variable has been assigned. * * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable */ readonly underscoreErrAssigned: boolean; /** * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). * * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable */ readonly lastError: any; /** @@ -242,17 +257,6 @@ declare module "repl" { * prefacing every repl statement with `'use strict'`. */ readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); /** * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following @@ -327,78 +331,51 @@ declare module "repl" { historyConfig?: REPLServerSetupHistoryOptions, callback?: (err: Error | null, repl: this) => void, ): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: REPLServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: REPLServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: REPLServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: REPLServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: REPLServerEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } /** * A flag passed in the REPL options. Evaluates expressions in sloppy mode. @@ -426,13 +403,13 @@ declare module "repl" { /** * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. * - * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_recoverable_errors + * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_recoverable_errors */ class Recoverable extends SyntaxError { err: Error; constructor(err: Error); } } -declare module "node:repl" { - export * from "repl"; +declare module "repl" { + export * from "node:repl"; } diff --git a/node_modules/@types/node/sea.d.ts b/node_modules/@types/node/sea.d.ts index 870c3045..2930c82b 100644 --- a/node_modules/@types/node/sea.d.ts +++ b/node_modules/@types/node/sea.d.ts @@ -111,7 +111,7 @@ * ``` * @since v19.7.0, v18.16.0 * @experimental - * @see [source](https://github.com/nodejs/node/blob/v24.x/src/node_sea.cc) + * @see [source](https://github.com/nodejs/node/blob/v25.x/src/node_sea.cc) */ declare module "node:sea" { type AssetKey = string; diff --git a/node_modules/@types/node/sqlite.d.ts b/node_modules/@types/node/sqlite.d.ts index 6ff7943a..76e585fe 100644 --- a/node_modules/@types/node/sqlite.d.ts +++ b/node_modules/@types/node/sqlite.d.ts @@ -40,7 +40,7 @@ * ``` * @since v22.5.0 * @experimental - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/sqlite.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/sqlite.js) */ declare module "node:sqlite" { import { PathLike } from "node:fs"; @@ -320,7 +320,7 @@ declare module "node:sqlite" { * @param func The JavaScript function to call when the SQLite * function is invoked. The return value of this function should be a valid * SQLite data type: see - * [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v24.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). + * [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v25.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). * The result defaults to `NULL` if the return value is `undefined`. */ function( diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts index 3b38302b..79ad890b 100644 --- a/node_modules/@types/node/stream.d.ts +++ b/node_modules/@types/node/stream.d.ts @@ -2,10 +2,10 @@ * A stream is an abstract interface for working with streaming data in Node.js. * The `node:stream` module provides an API for implementing the stream interface. * - * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v24.x/api/http.html#class-httpincomingmessage) - * and [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) are both stream instances. + * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v25.x/api/http.html#class-httpincomingmessage) + * and [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) are both stream instances. * - * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v24.x/api/events.html#class-eventemitter). + * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v25.x/api/events.html#class-eventemitter). * * To access the `node:stream` module: * @@ -15,32 +15,33 @@ * * The `node:stream` module is useful for creating new types of stream instances. * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/stream.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/stream.js) */ -declare module "stream" { +declare module "node:stream" { + import { Blob } from "node:buffer"; import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - + import * as promises from "node:stream/promises"; + import * as web from "node:stream/web"; class Stream extends EventEmitter { + /** + * @since v0.9.4 + */ pipe( destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, + options?: Stream.PipeOptions, ): T; } namespace Stream { - export { Stream, streamPromises as promises }; + export { promises, Stream }; } namespace Stream { + interface PipeOptions { + /** + * End the writer when the reader ends. + * @default true + */ + end?: boolean | undefined; + } interface StreamOptions extends Abortable { emitClose?: boolean | undefined; highWaterMark?: number | undefined; @@ -53,19 +54,48 @@ declare module "stream" { encoding?: BufferEncoding | undefined; read?: ((this: T, size: number) => void) | undefined; } - interface ArrayOptions { + interface ReadableIteratorOptions { /** - * The maximum concurrent invocations of `fn` to call on the stream at once. + * When set to `false`, calling `return` on the async iterator, + * or exiting a `for await...of` iteration using a `break`, + * `return`, or `throw` will not destroy the stream. + * @default true + */ + destroyOnReturn?: boolean | undefined; + } + interface ReadableOperatorOptions extends Abortable { + /** + * The maximum concurrent invocations of `fn` to call + * on the stream at once. * @default 1 */ concurrency?: number | undefined; - /** Allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal | undefined; + /** + * How many items to buffer while waiting for user consumption + * of the output. + * @default concurrency * 2 - 1 + */ + highWaterMark?: number | undefined; + } + /** @deprecated Use `ReadableOperatorOptions` instead. */ + interface ArrayOptions extends ReadableOperatorOptions {} + interface ReadableToWebOptions { + strategy?: web.QueuingStrategy | undefined; + } + interface ReadableEventMap { + "close": []; + "data": [chunk: any]; + "end": []; + "error": [err: Error]; + "pause": []; + "readable": []; + "resume": []; } /** * @since v0.9.4 */ class Readable extends Stream implements NodeJS.ReadableStream { + constructor(options?: ReadableOptions); /** * A utility method for creating Readable Streams out of iterators. * @since v12.3.0, v10.17.0 @@ -78,7 +108,7 @@ declare module "stream" { * @since v17.0.0 */ static fromWeb( - readableStream: streamWeb.ReadableStream, + readableStream: web.ReadableStream, options?: Pick, ): Readable; /** @@ -86,16 +116,14 @@ declare module "stream" { * @since v17.0.0 */ static toWeb( - streamReadable: Readable, - options?: { - strategy?: streamWeb.QueuingStrategy | undefined; - }, - ): streamWeb.ReadableStream; + streamReadable: NodeJS.ReadableStream, + options?: ReadableToWebOptions, + ): web.ReadableStream; /** * Returns whether the stream has been read from or cancelled. * @since v16.8.0 */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + static isDisturbed(stream: NodeJS.ReadableStream | web.ReadableStream): boolean; /** * Returns whether the stream was destroyed or errored before emitting `'end'`. * @since v16.8.0 @@ -118,16 +146,16 @@ declare module "stream" { */ readonly readableEncoding: BufferEncoding | null; /** - * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v24.x/api/stream.html#event-end) event is emitted. + * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v25.x/api/stream.html#event-end) event is emitted. * @since v12.9.0 */ readonly readableEnded: boolean; /** * This property reflects the current state of a `Readable` stream as described - * in the [Three states](https://nodejs.org/docs/latest-v24.x/api/stream.html#three-states) section. + * in the [Three states](https://nodejs.org/docs/latest-v25.x/api/stream.html#three-states) section. * @since v9.4.0 */ - readonly readableFlowing: boolean | null; + readableFlowing: boolean | null; /** * Returns the value of `highWaterMark` passed when creating this `Readable`. * @since v9.3.0 @@ -160,7 +188,6 @@ declare module "stream" { * @since v18.0.0 */ readonly errored: Error | null; - constructor(opts?: ReadableOptions); _construct?(callback: (error?: Error | null) => void): void; _read(size: number): void; /** @@ -444,16 +471,41 @@ declare module "stream" { */ wrap(stream: NodeJS.ReadableStream): this; push(chunk: any, encoding?: BufferEncoding): boolean; + /** + * ```js + * import { Readable } from 'node:stream'; + * + * async function* splitToWords(source) { + * for await (const chunk of source) { + * const words = String(chunk).split(' '); + * + * for (const word of words) { + * yield word; + * } + * } + * } + * + * const wordsStream = Readable.from(['this is', 'compose as operator']).compose(splitToWords); + * const words = await wordsStream.toArray(); + * + * console.log(words); // prints ['this', 'is', 'compose', 'as', 'operator'] + * ``` + * + * See [`stream.compose`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamcomposestreams) for more information. + * @since v19.1.0, v18.13.0 + * @returns a stream composed with the stream `stream`. + */ + compose( + stream: NodeJS.WritableStream | web.WritableStream | web.TransformStream | ((source: any) => void), + options?: Abortable, + ): Duplex; /** * The iterator created by this method gives users the option to cancel the destruction * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, * or if the iterator should destroy the stream if the stream emitted an error during iteration. * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. */ - iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator; + iterator(options?: ReadableIteratorOptions): NodeJS.AsyncIterator; /** * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. @@ -461,7 +513,7 @@ declare module "stream" { * @param fn a function to map over every chunk in the stream. Async or not. * @returns a stream mapped with the function *fn*. */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; + map(fn: (data: any, options?: Abortable) => any, options?: ReadableOperatorOptions): Readable; /** * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called * and if it returns a truthy value, the chunk will be passed to the result stream. @@ -471,8 +523,8 @@ declare module "stream" { * @returns a stream filtered with the predicate *fn*. */ filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: ReadableOperatorOptions, ): Readable; /** * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. @@ -490,8 +542,8 @@ declare module "stream" { * @returns a promise for when the stream has finished. */ forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => void | Promise, + options?: Pick, ): Promise; /** * This method allows easily obtaining the contents of a stream. @@ -501,7 +553,7 @@ declare module "stream" { * @since v17.5.0 * @returns a promise containing an array with the contents of the stream. */ - toArray(options?: Pick): Promise; + toArray(options?: Abortable): Promise; /** * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk @@ -512,8 +564,8 @@ declare module "stream" { * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. */ some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, ): Promise; /** * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream @@ -526,12 +578,12 @@ declare module "stream" { * or `undefined` if no element was found. */ find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => data is T, + options?: Pick, ): Promise; find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, ): Promise; /** * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream @@ -543,8 +595,8 @@ declare module "stream" { * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. */ every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, + fn: (data: any, options?: Abortable) => boolean | Promise, + options?: Pick, ): Promise; /** * This method returns a new stream by applying the given callback to each chunk of the stream @@ -556,28 +608,24 @@ declare module "stream" { * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. * @returns a stream flat-mapped with the function *fn*. */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; + flatMap( + fn: (data: any, options?: Abortable) => any, + options?: Pick, + ): Readable; /** * This method returns a new stream with the first *limit* chunks dropped from the start. * @since v17.5.0 * @param limit the number of chunks to drop from the readable. * @returns a stream with *limit* chunks dropped from the start. */ - drop(limit: number, options?: Pick): Readable; + drop(limit: number, options?: Abortable): Readable; /** * This method returns a new stream with the first *limit* chunks. * @since v17.5.0 * @param limit the number of chunks to take from the readable. * @returns a stream with *limit* chunks taken. */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; + take(limit: number, options?: Abortable): Readable; /** * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation * on the previous element. It returns a promise for the final value of the reduction. @@ -592,15 +640,11 @@ declare module "stream" { * @param initial the initial value to use in the reduction. * @returns a promise for the final value of the reduction. */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, + reduce(fn: (previous: any, data: any, options?: Abortable) => T): Promise; + reduce( + fn: (previous: T, data: any, options?: Abortable) => T, initial: T, - options?: Pick, + options?: Abortable, ): Promise; _destroy(error: Error | null, callback: (error?: Error | null) => void): void; /** @@ -626,73 +670,51 @@ declare module "stream" { * @since v20.4.0 */ [Symbol.asyncDispose](): Promise; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ReadableEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ReadableEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ReadableEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ReadableEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ReadableEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface WritableOptions extends StreamOptions { decodeStrings?: boolean | undefined; @@ -708,38 +730,47 @@ declare module "stream" { writev?: | (( this: T, - chunks: Array<{ + chunks: { chunk: any; encoding: BufferEncoding; - }>, + }[], callback: (error?: Error | null) => void, ) => void) | undefined; final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined; } + interface WritableEventMap { + "close": []; + "drain": []; + "error": [err: Error]; + "finish": []; + "pipe": [src: Readable]; + "unpipe": [src: Readable]; + } /** * @since v0.9.4 */ class Writable extends Stream implements NodeJS.WritableStream { + constructor(options?: WritableOptions); /** * A utility method for creating a `Writable` from a web `WritableStream`. * @since v17.0.0 */ static fromWeb( - writableStream: streamWeb.WritableStream, + writableStream: web.WritableStream, options?: Pick, ): Writable; /** * A utility method for creating a web `WritableStream` from a `Writable`. * @since v17.0.0 */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; + static toWeb(streamWritable: NodeJS.WritableStream): web.WritableStream; /** * Is `true` if it is safe to call `writable.write()`, which means * the stream has not been destroyed, errored, or ended. * @since v11.4.0 */ - readonly writable: boolean; + writable: boolean; /** * Returns whether the stream was destroyed or errored before emitting `'finish'`. * @since v18.0.0, v16.17.0 @@ -799,13 +830,12 @@ declare module "stream" { * @since v15.2.0, v14.17.0 */ readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; _writev?( - chunks: Array<{ + chunks: { chunk: any; encoding: BufferEncoding; - }>, + }[], callback: (error?: Error | null) => void, ): void; _construct?(callback: (error?: Error | null) => void): void; @@ -972,65 +1002,51 @@ declare module "stream" { * @since v22.4.0, v20.16.0 */ [Symbol.asyncDispose](): Promise; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WritableEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WritableEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WritableEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: WritableEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: WritableEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WritableEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WritableEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface DuplexOptions extends ReadableOptions, WritableOptions { allowHalfOpen?: boolean | undefined; @@ -1040,6 +1056,7 @@ declare module "stream" { writableHighWaterMark?: number | undefined; writableCorked?: number | undefined; } + interface DuplexEventMap extends ReadableEventMap, WritableEventMap {} /** * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. * @@ -1051,17 +1068,7 @@ declare module "stream" { * @since v0.9.4 */ class Duplex extends Stream implements NodeJS.ReadWriteStream { - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing - * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); + constructor(options?: DuplexOptions); /** * A utility method for creating duplex streams. * @@ -1085,137 +1092,87 @@ declare module "stream" { */ static from( src: - | Stream - | NodeBlob - | ArrayBuffer + | NodeJS.ReadableStream + | NodeJS.WritableStream + | Blob | string | Iterable | AsyncIterable - | AsyncGeneratorFunction + | ((source: AsyncIterable) => AsyncIterable) + | ((source: AsyncIterable) => Promise) | Promise - | Object, + | web.ReadableWritablePair + | web.ReadableStream + | web.WritableStream, ): Duplex; /** * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. * @since v17.0.0 */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; + static toWeb(streamDuplex: NodeJS.ReadWriteStream): web.ReadableWritablePair; /** * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. * @since v17.0.0 */ static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, + duplexStream: web.ReadableWritablePair, options?: Pick< DuplexOptions, "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" >, ): Duplex; /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `true`. + * + * This can be changed manually to change the half-open behavior of an existing + * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: DuplexEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: DuplexEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: DuplexEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: DuplexEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: DuplexEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface Duplex extends Readable, Writable {} /** @@ -1256,7 +1213,7 @@ declare module "stream" { * @since v0.9.4 */ class Transform extends Duplex { - constructor(opts?: TransformOptions); + constructor(options?: TransformOptions); _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; _flush(callback: TransformCallback): void; } @@ -1344,7 +1301,9 @@ declare module "stream" { * @param signal A signal representing possible cancellation * @param stream A stream to attach a signal to. */ - function addAbortSignal(signal: AbortSignal, stream: T): T; + function addAbortSignal< + T extends NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + >(signal: AbortSignal, stream: T): T; /** * Returns the default highWaterMark used by streams. * Defaults to `65536` (64 KiB), or `16` for `objectMode`. @@ -1388,7 +1347,7 @@ declare module "stream" { * Especially useful in error handling scenarios where a stream is destroyed * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. * - * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamfinishedstream-options). + * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options). * * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been * invoked. The reason for this is so that unexpected `'error'` events (due to @@ -1408,46 +1367,57 @@ declare module "stream" { * @returns A cleanup function which removes all registered listeners. */ function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void, ): () => void; function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, callback: (err?: NodeJS.ErrnoException | null) => void, ): () => void; namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; + import __promisify__ = promises.finished; + export { __promisify__ }; } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = + type PipelineSourceFunction = (options?: Abortable) => Iterable | AsyncIterable; + type PipelineSource = + | NodeJS.ReadableStream + | web.ReadableStream + | web.TransformStream + | Iterable + | AsyncIterable + | PipelineSourceFunction; + type PipelineSourceArgument = (T extends (...args: any[]) => infer R ? R : T) extends infer S + ? S extends web.TransformStream ? web.ReadableStream : S + : never; + type PipelineTransformGenerator, O> = ( + source: PipelineSourceArgument, + options?: Abortable, + ) => AsyncIterable; + type PipelineTransformStreams = | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? + | web.TransformStream; + type PipelineTransform, O> = S extends + PipelineSource | PipelineTransformStreams | ((...args: any[]) => infer I) + ? PipelineTransformStreams | PipelineTransformGenerator + : never; + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationFunction, R> = ( + source: PipelineSourceArgument, + options?: Abortable, + ) => R; + type PipelineDestination, R> = S extends + PipelineSource | PipelineTransform ? | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction + | web.WritableStream + | web.TransformStream + | PipelineDestinationFunction : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } + type PipelineCallback> = ( + err: NodeJS.ErrnoException | null, + value: S extends (...args: any[]) => PromiseLike ? R : undefined, + ) => void; + type PipelineResult> = S extends NodeJS.WritableStream ? S : Duplex; /** * A module method to pipe between streams and generators forwarding errors and * properly cleaning up and provide a callback when the pipeline is complete. @@ -1476,7 +1446,7 @@ declare module "stream" { * ); * ``` * - * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v24.x/api/stream.html#streampipelinesource-transforms-destination-options). + * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-options). * * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: * @@ -1513,171 +1483,278 @@ declare module "stream" { * @since v10.0.0 * @param callback Called when the pipeline is fully done. */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, D extends PipelineDestination>( + source: S, + destination: D, + callback: PipelineCallback, + ): PipelineResult; function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, + S extends PipelineSource, + T extends PipelineTransform, + D extends PipelineDestination, >( - source: A, - transform1: T1, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + source: S, + transform: T, + destination: D, + callback: PipelineCallback, + ): PipelineResult; function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, + S extends PipelineSource, + T1 extends PipelineTransform, T2 extends PipelineTransform, - B extends PipelineDestination, + D extends PipelineDestination, >( - source: A, + source: S, transform1: T1, transform2: T2, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + destination: D, + callback: PipelineCallback, + ): PipelineResult; function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, + S extends PipelineSource, + T1 extends PipelineTransform, T2 extends PipelineTransform, T3 extends PipelineTransform, - B extends PipelineDestination, + D extends PipelineDestination, >( - source: A, + source: S, transform1: T1, transform2: T2, transform3: T3, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + destination: D, + callback: PipelineCallback, + ): PipelineResult; function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, + S extends PipelineSource, + T1 extends PipelineTransform, T2 extends PipelineTransform, T3 extends PipelineTransform, T4 extends PipelineTransform, - B extends PipelineDestination, + D extends PipelineDestination, >( - source: A, + source: S, transform1: T1, transform2: T2, transform3: T3, transform4: T4, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + destination: D, + callback: PipelineCallback, + ): PipelineResult; function pipeline( - streams: ReadonlyArray, + streams: ReadonlyArray | PipelineTransform | PipelineDestination>, callback: (err: NodeJS.ErrnoException | null) => void, ): NodeJS.WritableStream; function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > + ...streams: [ + ...[PipelineSource, ...PipelineTransform[], PipelineDestination], + callback: ((err: NodeJS.ErrnoException | null) => void), + ] ): NodeJS.WritableStream; namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; + import __promisify__ = promises.pipeline; + export { __promisify__ }; } - // TODO: this interface never existed; remove in next major - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - // TODO: these should all take webstream arguments + type ComposeSource = + | NodeJS.ReadableStream + | web.ReadableStream + | Iterable + | AsyncIterable + | (() => AsyncIterable); + type ComposeTransformStreams = NodeJS.ReadWriteStream | web.TransformStream; + type ComposeTransformGenerator = (source: AsyncIterable) => AsyncIterable; + type ComposeTransform, O> = S extends + ComposeSource | ComposeTransformStreams | ComposeTransformGenerator + ? ComposeTransformStreams | ComposeTransformGenerator + : never; + type ComposeTransformSource = ComposeSource | ComposeTransform; + type ComposeDestination> = S extends ComposeTransformSource ? + | NodeJS.WritableStream + | web.WritableStream + | web.TransformStream + | ((source: AsyncIterable) => void) + : never; + /** + * Combines two or more streams into a `Duplex` stream that writes to the + * first stream and reads from the last. Each provided stream is piped into + * the next, using `stream.pipeline`. If any of the streams error then all + * are destroyed, including the outer `Duplex` stream. + * + * Because `stream.compose` returns a new stream that in turn can (and + * should) be piped into other streams, it enables composition. In contrast, + * when passing streams to `stream.pipeline`, typically the first stream is + * a readable stream and the last a writable stream, forming a closed + * circuit. + * + * If passed a `Function` it must be a factory method taking a `source` + * `Iterable`. + * + * ```js + * import { compose, Transform } from 'node:stream'; + * + * const removeSpaces = new Transform({ + * transform(chunk, encoding, callback) { + * callback(null, String(chunk).replace(' ', '')); + * }, + * }); + * + * async function* toUpper(source) { + * for await (const chunk of source) { + * yield String(chunk).toUpperCase(); + * } + * } + * + * let res = ''; + * for await (const buf of compose(removeSpaces, toUpper).end('hello world')) { + * res += buf; + * } + * + * console.log(res); // prints 'HELLOWORLD' + * ``` + * + * `stream.compose` can be used to convert async iterables, generators and + * functions into streams. + * + * * `AsyncIterable` converts into a readable `Duplex`. Cannot yield + * `null`. + * * `AsyncGeneratorFunction` converts into a readable/writable transform `Duplex`. + * Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * * `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined`. + * + * ```js + * import { compose } from 'node:stream'; + * import { finished } from 'node:stream/promises'; + * + * // Convert AsyncIterable into readable Duplex. + * const s1 = compose(async function*() { + * yield 'Hello'; + * yield 'World'; + * }()); + * + * // Convert AsyncGenerator into transform Duplex. + * const s2 = compose(async function*(source) { + * for await (const chunk of source) { + * yield String(chunk).toUpperCase(); + * } + * }); + * + * let res = ''; + * + * // Convert AsyncFunction into writable Duplex. + * const s3 = compose(async function(source) { + * for await (const chunk of source) { + * res += chunk; + * } + * }); + * + * await finished(compose(s1, s2, s3)); + * + * console.log(res); // prints 'HELLOWORLD' + * ``` + * + * See [`readable.compose(stream)`](https://nodejs.org/docs/latest-v25.x/api/stream.html#readablecomposestream-options) for `stream.compose` as operator. + * @since v16.9.0 + * @experimental + */ + /* eslint-disable @definitelytyped/no-unnecessary-generics */ + function compose(stream: ComposeSource | ComposeDestination): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >( + source: S, + destination: D, + ): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform: T, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + T3 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, transform3: T3, destination: D): Duplex; + function compose< + S extends ComposeSource | ComposeTransform, + T1 extends ComposeTransform, + T2 extends ComposeTransform, + T3 extends ComposeTransform, + T4 extends ComposeTransform, + D extends ComposeTransform | ComposeDestination, + >(source: S, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: D): Duplex; + function compose( + ...streams: [ + ComposeSource, + ...ComposeTransform[], + ComposeDestination, + ] + ): Duplex; + /* eslint-enable @definitelytyped/no-unnecessary-generics */ /** * Returns whether the stream has encountered an error. * @since v17.3.0, v16.14.0 */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; + function isErrored( + stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream, + ): boolean; /** * Returns whether the stream is readable. * @since v17.4.0, v16.14.0 * @returns Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`. */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean | null; + function isReadable(stream: NodeJS.ReadableStream | web.ReadableStream): boolean | null; /** * Returns whether the stream is writable. * @since v20.0.0 * @returns Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`. */ - function isWritable(stream: Writable | NodeJS.WritableStream): boolean | null; + function isWritable(stream: NodeJS.WritableStream | web.WritableStream): boolean | null; + } + global { + namespace NodeJS { + // These interfaces are vestigial, and correspond roughly to the "streams2" interfaces + // from early versions of Node.js, but they are still used widely across the ecosystem. + // Accordingly, they are commonly used as "in-types" for @types/node APIs, so that + // eg. streams returned from older libraries will still be considered valid input to + // functions which accept stream arguments. + // It's not possible to change or remove these without astronomical levels of breakage. + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + interface ReadWriteStream extends ReadableStream, WritableStream {} + } } export = Stream; } -declare module "node:stream" { - import stream = require("stream"); +declare module "stream" { + import stream = require("node:stream"); export = stream; } diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts index 05db0257..97f260da 100644 --- a/node_modules/@types/node/stream/consumers.d.ts +++ b/node_modules/@types/node/stream/consumers.d.ts @@ -3,36 +3,36 @@ * streams. * @since v16.7.0 */ -declare module "stream/consumers" { - import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; +declare module "node:stream/consumers" { + import { Blob, NonSharedBuffer } from "node:buffer"; + import { ReadableStream } from "node:stream/web"; /** * @since v16.7.0 * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. */ - function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + function arrayBuffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; /** * @since v16.7.0 * @returns Fulfills with a `Blob` containing the full contents of the stream. */ - function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + function blob(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; /** * @since v16.7.0 * @returns Fulfills with a `Buffer` containing the full contents of the stream. */ - function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + function buffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; /** * @since v16.7.0 * @returns Fulfills with the contents of the stream parsed as a * UTF-8 encoded string that is then passed through `JSON.parse()`. */ - function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + function json(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; /** * @since v16.7.0 * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. */ - function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + function text(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; } -declare module "node:stream/consumers" { - export * from "stream/consumers"; +declare module "stream/consumers" { + export * from "node:stream/consumers"; } diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts index d54c14c6..c4bd3ea2 100644 --- a/node_modules/@types/node/stream/promises.d.ts +++ b/node_modules/@types/node/stream/promises.d.ts @@ -1,12 +1,12 @@ -declare module "stream/promises" { +declare module "node:stream/promises" { + import { Abortable } from "node:events"; import { FinishedOptions as _FinishedOptions, PipelineDestination, - PipelineOptions, - PipelinePromise, PipelineSource, PipelineTransform, } from "node:stream"; + import { ReadableStream, WritableStream } from "node:stream/web"; interface FinishedOptions extends _FinishedOptions { /** * If true, removes the listeners registered by this function before the promise is fulfilled. @@ -14,15 +14,130 @@ declare module "stream/promises" { */ cleanup?: boolean | undefined; } + /** + * ```js + * import { finished } from 'node:stream/promises'; + * import { createReadStream } from 'node:fs'; + * + * const rs = createReadStream('archive.tar'); + * + * async function run() { + * await finished(rs); + * console.log('Stream is done reading.'); + * } + * + * run().catch(console.error); + * rs.resume(); // Drain the stream. + * ``` + * + * The `finished` API also provides a [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options-callback). + * + * `stream.finished()` leaves dangling event listeners (in particular + * `'error'`, `'end'`, `'finish'` and `'close'`) after the returned promise is + * resolved or rejected. The reason for this is so that unexpected `'error'` + * events (due to incorrect stream implementations) do not cause unexpected + * crashes. If this is unwanted behavior then `options.cleanup` should be set to + * `true`: + * + * ```js + * await finished(rs, { cleanup: true }); + * ``` + * @since v15.0.0 + * @returns Fulfills when the stream is no longer readable or writable. + */ function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, + stream: NodeJS.ReadableStream | NodeJS.WritableStream | ReadableStream | WritableStream, options?: FinishedOptions, ): Promise; + interface PipelineOptions extends Abortable { + end?: boolean | undefined; + } + type PipelineResult> = S extends (...args: any[]) => PromiseLike + ? Promise + : Promise; + /** + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * import { createGzip } from 'node:zlib'; + * + * await pipeline( + * createReadStream('archive.tar'), + * createGzip(), + * createWriteStream('archive.tar.gz'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * To use an `AbortSignal`, pass it inside an options object, as the last argument. + * When the signal is aborted, `destroy` will be called on the underlying pipeline, + * with an `AbortError`. + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * import { createGzip } from 'node:zlib'; + * + * const ac = new AbortController(); + * const { signal } = ac; + * setImmediate(() => ac.abort()); + * try { + * await pipeline( + * createReadStream('archive.tar'), + * createGzip(), + * createWriteStream('archive.tar.gz'), + * { signal }, + * ); + * } catch (err) { + * console.error(err); // AbortError + * } + * ``` + * + * The `pipeline` API also supports async generators: + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import { createReadStream, createWriteStream } from 'node:fs'; + * + * await pipeline( + * createReadStream('lowercase.txt'), + * async function* (source, { signal }) { + * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. + * for await (const chunk of source) { + * yield await processChunk(chunk, { signal }); + * } + * }, + * createWriteStream('uppercase.txt'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * Remember to handle the `signal` argument passed into the async generator. + * Especially in the case where the async generator is the source for the + * pipeline (i.e. first argument) or the pipeline will never complete. + * + * ```js + * import { pipeline } from 'node:stream/promises'; + * import fs from 'node:fs'; + * await pipeline( + * async function* ({ signal }) { + * await someLongRunningfn({ signal }); + * yield 'asd'; + * }, + * fs.createWriteStream('uppercase.txt'), + * ); + * console.log('Pipeline succeeded.'); + * ``` + * + * The `pipeline` API provides [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-callback): + * @since v15.0.0 + * @returns Fulfills when the pipeline is complete. + */ function pipeline, B extends PipelineDestination>( source: A, destination: B, options?: PipelineOptions, - ): PipelinePromise; + ): PipelineResult; function pipeline< A extends PipelineSource, T1 extends PipelineTransform, @@ -32,7 +147,7 @@ declare module "stream/promises" { transform1: T1, destination: B, options?: PipelineOptions, - ): PipelinePromise; + ): PipelineResult; function pipeline< A extends PipelineSource, T1 extends PipelineTransform, @@ -44,7 +159,7 @@ declare module "stream/promises" { transform2: T2, destination: B, options?: PipelineOptions, - ): PipelinePromise; + ): PipelineResult; function pipeline< A extends PipelineSource, T1 extends PipelineTransform, @@ -58,7 +173,7 @@ declare module "stream/promises" { transform3: T3, destination: B, options?: PipelineOptions, - ): PipelinePromise; + ): PipelineResult; function pipeline< A extends PipelineSource, T1 extends PipelineTransform, @@ -74,17 +189,23 @@ declare module "stream/promises" { transform4: T4, destination: B, options?: PipelineOptions, - ): PipelinePromise; + ): PipelineResult; function pipeline( - streams: ReadonlyArray, + streams: readonly [PipelineSource, ...PipelineTransform[], PipelineDestination], options?: PipelineOptions, ): Promise; function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array + ...streams: [PipelineSource, ...PipelineTransform[], PipelineDestination] + ): Promise; + function pipeline( + ...streams: [ + PipelineSource, + ...PipelineTransform[], + PipelineDestination, + options: PipelineOptions, + ] ): Promise; } -declare module "node:stream/promises" { - export * from "stream/promises"; +declare module "stream/promises" { + export * from "node:stream/promises"; } diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts index bc7c011c..32ce4069 100644 --- a/node_modules/@types/node/stream/web.d.ts +++ b/node_modules/@types/node/stream/web.d.ts @@ -1,115 +1,91 @@ -type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ByteLengthQueuingStrategy; -type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").CountQueuingStrategy; -type _QueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").QueuingStrategy; -type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableByteStreamController; -type _ReadableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStream; -type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBReader; -type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBRequest; -type _ReadableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultController; -type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultReader; -type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextDecoderStream; -type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextEncoderStream; -type _TransformStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStream; -type _TransformStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStreamDefaultController; -type _WritableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStream; -type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultController; -type _WritableStreamDefaultWriter = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultWriter; - -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts +declare module "node:stream/web" { + import { TextDecoderCommon, TextDecoderOptions, TextEncoderCommon } from "node:util"; + type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip"; + type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; + type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; + type ReadableStreamReaderMode = "byob"; + type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; + type ReadableStreamType = "bytes"; + interface GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategyInit { + highWaterMark: number; + } + interface QueuingStrategySize { + (chunk: T): number; + } + interface ReadableStreamBYOBReaderReadOptions { + min?: number; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamGetReaderOptions { + mode?: ReadableStreamReaderMode; + } + interface ReadableStreamIteratorOptions { + preventCancel?: boolean; + } + interface ReadableStreamReadDoneResult { + done: true; + value: T | undefined; + } + interface ReadableStreamReadValueResult { + done: false; + value: T; + } interface ReadableWritablePair { readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ writable: WritableStream; } interface StreamPipeOptions { preventAbort?: boolean; preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ preventClose?: boolean; signal?: AbortSignal; } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; } - type ReadableStreamController = ReadableStreamDefaultController; - interface ReadableStreamReadValueResult { - done: false; - value: T; + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableByteStreamController) => void | PromiseLike; + start?: (controller: ReadableByteStreamController) => any; + type: "bytes"; + } + interface UnderlyingDefaultSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableStreamDefaultController) => void | PromiseLike; + start?: (controller: ReadableStreamDefaultController) => any; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; } interface UnderlyingSinkAbortCallback { (reason?: any): void | PromiseLike; @@ -123,6 +99,13 @@ declare module "stream/web" { interface UnderlyingSinkWriteCallback { (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; } + interface UnderlyingSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: ReadableStreamType; + } interface UnderlyingSourceCancelCallback { (reason?: any): void | PromiseLike; } @@ -132,45 +115,49 @@ declare module "stream/web" { interface UnderlyingSourceStartCallback { (controller: ReadableStreamController): any; } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerCancelCallback { - (reason: any): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; + var ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; + var CompressionStream: { + prototype: CompressionStream; + new(format: CompressionFormat): CompressionStream; + }; + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; + var CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new(init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } - interface ReadableStreamAsyncIterator extends NodeJS.AsyncIterator { - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; + var DecompressionStream: { + prototype: DecompressionStream; + new(format: CompressionFormat): DecompressionStream; + }; + interface ReadableByteStreamController { + readonly byobRequest: ReadableStreamBYOBRequest | null; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: NodeJS.NonSharedArrayBufferView): void; + error(e?: any): void; } - /** This Streams API interface represents a readable stream of byte data. */ + var ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new(): ReadableByteStreamController; + }; interface ReadableStream { readonly locked: boolean; cancel(reason?: any): Promise; @@ -180,96 +167,81 @@ declare module "stream/web" { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator; - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; + [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; + values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator; } - const ReadableStream: { + var ReadableStream: { prototype: ReadableStream; - from(iterable: Iterable | AsyncIterable): ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new( + underlyingSource: UnderlyingByteSource, + strategy?: { highWaterMark?: number }, + ): ReadableStream; + new(underlyingSource: UnderlyingDefaultSource, strategy?: QueuingStrategy): ReadableStream; new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + from(iterable: Iterable | AsyncIterable): ReadableStream; }; - type ReadableStreamReaderMode = "byob"; - interface ReadableStreamGetReaderOptions { - /** - * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. - * - * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. - */ - mode?: ReadableStreamReaderMode; - } - type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; + interface ReadableStreamAsyncIterator extends NodeJS.AsyncIterator { + [Symbol.asyncIterator](): ReadableStreamAsyncIterator; } - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read( + read( view: T, - options?: { - min?: number; - }, + options?: ReadableStreamBYOBReaderReadOptions, ): Promise>; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: { + var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ interface ReadableStreamBYOBRequest { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */ - readonly view: ArrayBufferView | null; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */ + readonly view: NodeJS.NonSharedArrayBufferView | null; respond(bytesWritten: number): void; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */ - respondWithNewView(view: ArrayBufferView): void; + respondWithNewView(view: NodeJS.NonSharedArrayBufferView): void; } - const ReadableStreamBYOBRequest: { + var ReadableStreamBYOBRequest: { prototype: ReadableStreamBYOBRequest; new(): ReadableStreamBYOBRequest; }; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; interface ReadableStreamDefaultController { readonly desiredSize: number | null; close(): void; enqueue(chunk?: R): void; error(e?: any): void; } - const ReadableStreamDefaultController: { + var ReadableStreamDefaultController: { prototype: ReadableStreamDefaultController; new(): ReadableStreamDefaultController; }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - cancel?: TransformerCancelCallback; - writableType?: undefined; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + var ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new(stream: ReadableStream): ReadableStreamDefaultReader; + }; + interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { + readonly readable: ReadableStream; + readonly writable: WritableStream; } + var TextDecoderStream: { + prototype: TextDecoderStream; + new(label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; + interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + var TextEncoderStream: { + prototype: TextEncoderStream; + new(): TextEncoderStream; + }; interface TransformStream { readonly readable: ReadableStream; readonly writable: WritableStream; } - const TransformStream: { + var TransformStream: { prototype: TransformStream; new( transformer?: Transformer, @@ -283,31 +255,28 @@ declare module "stream/web" { error(reason?: any): void; terminate(): void; } - const TransformStreamDefaultController: { + var TransformStreamDefaultController: { prototype: TransformStreamDefaultController; new(): TransformStreamDefaultController; }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ interface WritableStream { readonly locked: boolean; abort(reason?: any): Promise; close(): Promise; getWriter(): WritableStreamDefaultWriter; } - const WritableStream: { + var WritableStream: { prototype: WritableStream; new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ + interface WritableStreamDefaultController { + readonly signal: AbortSignal; + error(e?: any): void; + } + var WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new(): WritableStreamDefaultController; + }; interface WritableStreamDefaultWriter { readonly closed: Promise; readonly desiredSize: number | null; @@ -317,257 +286,11 @@ declare module "stream/web" { releaseLock(): void; write(chunk?: W): Promise; } - const WritableStreamDefaultWriter: { + var WritableStreamDefaultWriter: { prototype: WritableStreamDefaultWriter; new(stream: WritableStream): WritableStreamDefaultWriter; }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip"; - class CompressionStream { - constructor(format: CompressionFormat); - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - class DecompressionStream { - constructor(format: CompressionFormat); - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - - global { - interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {} - /** - * `ByteLengthQueuingStrategy` class is a global reference for `import { ByteLengthQueuingStrategy } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy - * @since v18.0.0 - */ - var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T } - ? T - : typeof import("stream/web").ByteLengthQueuingStrategy; - - interface CountQueuingStrategy extends _CountQueuingStrategy {} - /** - * `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-countqueuingstrategy - * @since v18.0.0 - */ - var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T - : typeof import("stream/web").CountQueuingStrategy; - - interface QueuingStrategy extends _QueuingStrategy {} - - interface ReadableByteStreamController extends _ReadableByteStreamController {} - /** - * `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablebytestreamcontroller - * @since v18.0.0 - */ - var ReadableByteStreamController: typeof globalThis extends - { onmessage: any; ReadableByteStreamController: infer T } ? T - : typeof import("stream/web").ReadableByteStreamController; - - interface ReadableStream extends _ReadableStream {} - /** - * `ReadableStream` class is a global reference for `import { ReadableStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestream - * @since v18.0.0 - */ - var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T - : typeof import("stream/web").ReadableStream; - - interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {} - /** - * `ReadableStreamBYOBReader` class is a global reference for `import { ReadableStreamBYOBReader } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreambyobreader - * @since v18.0.0 - */ - var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBReader; - - interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {} - /** - * `ReadableStreamBYOBRequest` class is a global reference for `import { ReadableStreamBYOBRequest } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreambyobrequest - * @since v18.0.0 - */ - var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBRequest; - - interface ReadableStreamDefaultController extends _ReadableStreamDefaultController {} - /** - * `ReadableStreamDefaultController` class is a global reference for `import { ReadableStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller - * @since v18.0.0 - */ - var ReadableStreamDefaultController: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultController: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultController; - - interface ReadableStreamDefaultReader extends _ReadableStreamDefaultReader {} - /** - * `ReadableStreamDefaultReader` class is a global reference for `import { ReadableStreamDefaultReader } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreamdefaultreader - * @since v18.0.0 - */ - var ReadableStreamDefaultReader: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultReader: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultReader; - - interface TextDecoderStream extends _TextDecoderStream {} - /** - * `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-textdecoderstream - * @since v18.0.0 - */ - var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T - : typeof import("stream/web").TextDecoderStream; - - interface TextEncoderStream extends _TextEncoderStream {} - /** - * `TextEncoderStream` class is a global reference for `import { TextEncoderStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-textencoderstream - * @since v18.0.0 - */ - var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T - : typeof import("stream/web").TextEncoderStream; - - interface TransformStream extends _TransformStream {} - /** - * `TransformStream` class is a global reference for `import { TransformStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-transformstream - * @since v18.0.0 - */ - var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T - : typeof import("stream/web").TransformStream; - - interface TransformStreamDefaultController extends _TransformStreamDefaultController {} - /** - * `TransformStreamDefaultController` class is a global reference for `import { TransformStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-transformstreamdefaultcontroller - * @since v18.0.0 - */ - var TransformStreamDefaultController: typeof globalThis extends - { onmessage: any; TransformStreamDefaultController: infer T } ? T - : typeof import("stream/web").TransformStreamDefaultController; - - interface WritableStream extends _WritableStream {} - /** - * `WritableStream` class is a global reference for `import { WritableStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestream - * @since v18.0.0 - */ - var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T - : typeof import("stream/web").WritableStream; - - interface WritableStreamDefaultController extends _WritableStreamDefaultController {} - /** - * `WritableStreamDefaultController` class is a global reference for `import { WritableStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller - * @since v18.0.0 - */ - var WritableStreamDefaultController: typeof globalThis extends - { onmessage: any; WritableStreamDefaultController: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultController; - - interface WritableStreamDefaultWriter extends _WritableStreamDefaultWriter {} - /** - * `WritableStreamDefaultWriter` class is a global reference for `import { WritableStreamDefaultWriter } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter - * @since v18.0.0 - */ - var WritableStreamDefaultWriter: typeof globalThis extends - { onmessage: any; WritableStreamDefaultWriter: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultWriter; - } } -declare module "node:stream/web" { - export * from "stream/web"; +declare module "stream/web" { + export * from "node:stream/web"; } diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts index bcd64d5a..a72c3747 100644 --- a/node_modules/@types/node/string_decoder.d.ts +++ b/node_modules/@types/node/string_decoder.d.ts @@ -36,9 +36,9 @@ * decoder.write(Buffer.from([0x82])); * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/string_decoder.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/string_decoder.js) */ -declare module "string_decoder" { +declare module "node:string_decoder" { class StringDecoder { constructor(encoding?: BufferEncoding); /** @@ -62,6 +62,6 @@ declare module "string_decoder" { end(buffer?: string | NodeJS.ArrayBufferView): string; } } -declare module "node:string_decoder" { - export * from "string_decoder"; +declare module "string_decoder" { + export * from "node:string_decoder"; } diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts index e1f103d7..12d1af38 100644 --- a/node_modules/@types/node/test.d.ts +++ b/node_modules/@types/node/test.d.ts @@ -76,11 +76,12 @@ * * If any tests fail, the process exit code is set to `1`. * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/test.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test.js) */ declare module "node:test" { import { AssertMethodNames } from "node:assert"; - import { Readable } from "node:stream"; + import { Readable, ReadableEventMap } from "node:stream"; + import { TestEvent } from "node:test/reporters"; import TestFn = test.TestFn; import TestOptions = test.TestOptions; /** @@ -243,14 +244,14 @@ declare module "node:test" { /** * Specifies the current working directory to be used by the test runner. * Serves as the base path for resolving files according to the - * [test runner execution model](https://nodejs.org/docs/latest-v24.x/api/test.html#test-runner-execution-model). + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). * @since v23.0.0 * @default process.cwd() */ cwd?: string | undefined; /** * An array containing the list of files to run. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v24.x/api/test.html#test-runner-execution-model). + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). */ files?: readonly string[] | undefined; /** @@ -263,7 +264,7 @@ declare module "node:test" { /** * An array containing the list of glob patterns to match test files. * This option cannot be used together with `files`. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v24.x/api/test.html#test-runner-execution-model). + * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model). * @since v22.6.0 */ globPatterns?: readonly string[] | undefined; @@ -351,7 +352,7 @@ declare module "node:test" { */ rerunFailuresFilePath?: string | undefined; /** - * enable [code coverage](https://nodejs.org/docs/latest-v24.x/api/test.html#collecting-code-coverage) collection. + * enable [code coverage](https://nodejs.org/docs/latest-v25.x/api/test.html#collecting-code-coverage) collection. * @since v22.10.0 * @default false */ @@ -398,6 +399,23 @@ declare module "node:test" { */ functionCoverage?: number | undefined; } + interface TestsStreamEventMap extends ReadableEventMap { + "data": [data: TestEvent]; + "test:coverage": [data: EventData.TestCoverage]; + "test:complete": [data: EventData.TestComplete]; + "test:dequeue": [data: EventData.TestDequeue]; + "test:diagnostic": [data: EventData.TestDiagnostic]; + "test:enqueue": [data: EventData.TestEnqueue]; + "test:fail": [data: EventData.TestFail]; + "test:pass": [data: EventData.TestPass]; + "test:plan": [data: EventData.TestPlan]; + "test:start": [data: EventData.TestStart]; + "test:stderr": [data: EventData.TestStderr]; + "test:stdout": [data: EventData.TestStdout]; + "test:summary": [data: EventData.TestSummary]; + "test:watch:drained": []; + "test:watch:restarted": []; + } /** * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. * @@ -405,96 +423,59 @@ declare module "node:test" { * @since v18.9.0, v16.19.0 */ interface TestsStream extends Readable { - addListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - addListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - addListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - addListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - addListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - addListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - addListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - addListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - addListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - addListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this; - addListener(event: "test:watch:drained", listener: () => void): this; - addListener(event: "test:watch:restarted", listener: () => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:coverage", data: EventData.TestCoverage): boolean; - emit(event: "test:complete", data: EventData.TestComplete): boolean; - emit(event: "test:dequeue", data: EventData.TestDequeue): boolean; - emit(event: "test:diagnostic", data: EventData.TestDiagnostic): boolean; - emit(event: "test:enqueue", data: EventData.TestEnqueue): boolean; - emit(event: "test:fail", data: EventData.TestFail): boolean; - emit(event: "test:pass", data: EventData.TestPass): boolean; - emit(event: "test:plan", data: EventData.TestPlan): boolean; - emit(event: "test:start", data: EventData.TestStart): boolean; - emit(event: "test:stderr", data: EventData.TestStderr): boolean; - emit(event: "test:stdout", data: EventData.TestStdout): boolean; - emit(event: "test:summary", data: EventData.TestSummary): boolean; - emit(event: "test:watch:drained"): boolean; - emit(event: "test:watch:restarted"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - on(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - on(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - on(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - on(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - on(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - on(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - on(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - on(event: "test:start", listener: (data: EventData.TestStart) => void): this; - on(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - on(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - on(event: "test:summary", listener: (data: EventData.TestSummary) => void): this; - on(event: "test:watch:drained", listener: () => void): this; - on(event: "test:watch:restarted", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - once(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - once(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - once(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - once(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - once(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - once(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - once(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - once(event: "test:start", listener: (data: EventData.TestStart) => void): this; - once(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - once(event: "test:summary", listener: (data: EventData.TestSummary) => void): this; - once(event: "test:watch:drained", listener: () => void): this; - once(event: "test:watch:restarted", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - prependListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - prependListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - prependListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - prependListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - prependListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this; - prependListener(event: "test:watch:drained", listener: () => void): this; - prependListener(event: "test:watch:restarted", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - prependOnceListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - prependOnceListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - prependOnceListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - prependOnceListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this; - prependOnceListener(event: "test:watch:drained", listener: () => void): this; - prependOnceListener(event: "test:watch:restarted", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: TestsStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: TestsStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: TestsStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners( + eventName: E, + ): ((...args: TestsStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: TestsStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } namespace EventData { interface Error extends globalThis.Error { @@ -1218,7 +1199,7 @@ declare module "node:test" { * highlighting. * @since v22.14.0 * @param value A value to serialize to a string. If Node.js was started with - * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--test-update-snapshots) + * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots) * flag, the serialized value is written to * `path`. Otherwise, the serialized value is compared to the contents of the * existing snapshot file. @@ -1241,7 +1222,7 @@ declare module "node:test" { * ``` * @since v22.3.0 * @param value A value to serialize to a string. If Node.js was started with - * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--test-update-snapshots) + * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots) * flag, the serialized value is written to * the snapshot file. Otherwise, the serialized value is compared to the * corresponding value in the existing snapshot file. @@ -1672,7 +1653,7 @@ declare module "node:test" { * This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and * Node.js builtin modules. Any references to the original module prior to mocking are not impacted. In * order to enable module mocking, Node.js must be started with the - * [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--experimental-test-module-mocks) + * [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-module-mocks) * command-line flag. * * The following example demonstrates how a mock is created for a module. @@ -2256,84 +2237,3 @@ declare module "node:test" { }[keyof T]; export = test; } - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - import { EventData } from "node:test"; - - type TestEvent = - | { type: "test:coverage"; data: EventData.TestCoverage } - | { type: "test:complete"; data: EventData.TestComplete } - | { type: "test:dequeue"; data: EventData.TestDequeue } - | { type: "test:diagnostic"; data: EventData.TestDiagnostic } - | { type: "test:enqueue"; data: EventData.TestEnqueue } - | { type: "test:fail"; data: EventData.TestFail } - | { type: "test:pass"; data: EventData.TestPass } - | { type: "test:plan"; data: EventData.TestPlan } - | { type: "test:start"; data: EventData.TestStart } - | { type: "test:stderr"; data: EventData.TestStderr } - | { type: "test:stdout"; data: EventData.TestStdout } - | { type: "test:summary"; data: EventData.TestSummary } - | { type: "test:watch:drained"; data: undefined } - | { type: "test:watch:restarted"; data: undefined }; - type TestEventGenerator = AsyncGenerator; - - interface ReporterConstructorWrapper Transform> { - new(...args: ConstructorParameters): InstanceType; - (...args: ConstructorParameters): InstanceType; - } - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - * @since v20.0.0 - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - * @since v20.0.0 - */ - function tap(source: TestEventGenerator): AsyncGenerator; - class SpecReporter extends Transform { - constructor(); - } - /** - * The `spec` reporter outputs the test results in a human-readable format. - * @since v20.0.0 - */ - const spec: ReporterConstructorWrapper; - /** - * The `junit` reporter outputs test results in a jUnit XML format. - * @since v21.0.0 - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class LcovReporter extends Transform { - constructor(opts?: Omit); - } - /** - * The `lcov` reporter outputs test coverage when used with the - * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--experimental-test-coverage) flag. - * @since v22.0.0 - */ - const lcov: ReporterConstructorWrapper; - - export { dot, junit, lcov, spec, tap, TestEvent }; -} diff --git a/node_modules/@types/node/test/reporters.d.ts b/node_modules/@types/node/test/reporters.d.ts new file mode 100644 index 00000000..465e80d9 --- /dev/null +++ b/node_modules/@types/node/test/reporters.d.ts @@ -0,0 +1,96 @@ +/** + * The `node:test` module supports passing `--test-reporter` + * flags for the test runner to use a specific reporter. + * + * The following built-reporters are supported: + * + * * `spec` + * The `spec` reporter outputs the test results in a human-readable format. This + * is the default reporter. + * + * * `tap` + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + * + * * `dot` + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + * + * * `junit` + * The junit reporter outputs test results in a jUnit XML format + * + * * `lcov` + * The `lcov` reporter outputs test coverage when used with the + * `--experimental-test-coverage` flag. + * + * The exact output of these reporters is subject to change between versions of + * Node.js, and should not be relied on programmatically. If programmatic access + * to the test runner's output is required, use the events emitted by the + * `TestsStream`. + * + * The reporters are available via the `node:test/reporters` module: + * + * ```js + * import { tap, spec, dot, junit, lcov } from 'node:test/reporters'; + * ``` + * @since v19.9.0, v18.17.0 + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test/reporters.js) + */ +declare module "node:test/reporters" { + import { Transform, TransformOptions } from "node:stream"; + import { EventData } from "node:test"; + type TestEvent = + | { type: "test:coverage"; data: EventData.TestCoverage } + | { type: "test:complete"; data: EventData.TestComplete } + | { type: "test:dequeue"; data: EventData.TestDequeue } + | { type: "test:diagnostic"; data: EventData.TestDiagnostic } + | { type: "test:enqueue"; data: EventData.TestEnqueue } + | { type: "test:fail"; data: EventData.TestFail } + | { type: "test:pass"; data: EventData.TestPass } + | { type: "test:plan"; data: EventData.TestPlan } + | { type: "test:start"; data: EventData.TestStart } + | { type: "test:stderr"; data: EventData.TestStderr } + | { type: "test:stdout"; data: EventData.TestStdout } + | { type: "test:summary"; data: EventData.TestSummary } + | { type: "test:watch:drained"; data: undefined } + | { type: "test:watch:restarted"; data: undefined }; + interface ReporterConstructorWrapper Transform> { + new(...args: ConstructorParameters): InstanceType; + (...args: ConstructorParameters): InstanceType; + } + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + * @since v20.0.0 + */ + function dot(source: AsyncIterable): NodeJS.AsyncIterator; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + * @since v20.0.0 + */ + function tap(source: AsyncIterable): NodeJS.AsyncIterator; + class SpecReporter extends Transform { + constructor(); + } + /** + * The `spec` reporter outputs the test results in a human-readable format. + * @since v20.0.0 + */ + const spec: ReporterConstructorWrapper; + /** + * The `junit` reporter outputs test results in a jUnit XML format. + * @since v21.0.0 + */ + function junit(source: AsyncIterable): NodeJS.AsyncIterator; + class LcovReporter extends Transform { + constructor(options?: Omit); + } + /** + * The `lcov` reporter outputs test coverage when used with the + * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-coverage) flag. + * @since v22.0.0 + */ + const lcov: ReporterConstructorWrapper; + export { dot, junit, lcov, spec, tap, TestEvent }; +} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts index 30a91c06..00a8cd09 100644 --- a/node_modules/@types/node/timers.d.ts +++ b/node_modules/@types/node/timers.d.ts @@ -6,9 +6,9 @@ * The timer functions within Node.js implement a similar API as the timers API * provided by Web Browsers but use a different internal implementation that is * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js) */ -declare module "timers" { +declare module "node:timers" { import { Abortable } from "node:events"; import * as promises from "node:timers/promises"; export interface TimerOptions extends Abortable { @@ -145,132 +145,6 @@ declare module "timers" { _onTimeout(...args: any[]): void; } } - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of - * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout) - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearImmediate()` - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (_: void) => void): NodeJS.Immediate; - namespace setImmediate { - import __promisify__ = promises.setImmediate; - export { __promisify__ }; - } - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay` - * will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param delay The number of milliseconds to wait before calling the - * `callback`. **Default:** `1`. - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearInterval()` - */ - function setInterval( - callback: (...args: TArgs) => void, - delay?: number, - ...args: TArgs - ): NodeJS.Timeout; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout; - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay` - * will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param delay The number of milliseconds to wait before calling the - * `callback`. **Default:** `1`. - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearTimeout()` - */ - function setTimeout( - callback: (...args: TArgs) => void, - delay?: number, - ...args: TArgs - ): NodeJS.Timeout; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout; - namespace setTimeout { - import __promisify__ = promises.setTimeout; - export { __promisify__ }; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by `setImmediate()`. - */ - function clearImmediate(immediate: NodeJS.Immediate | undefined): void; - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by `setInterval()` - * or the primitive of the `Timeout` object as a string or a number. - */ - function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void; - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by `setTimeout()` - * or the primitive of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void; - /** - * The `queueMicrotask()` method queues a microtask to invoke `callback`. If - * `callback` throws an exception, the `process` object `'uncaughtException'` - * event will be emitted. - * - * The microtask queue is managed by V8 and may be used in a similar manner to - * the `process.nextTick()` queue, which is managed by Node.js. The - * `process.nextTick()` queue is always processed before the microtask queue - * within each turn of the Node.js event loop. - * @since v11.0.0 - * @param callback Function to be queued. - */ - function queueMicrotask(callback: () => void): void; } import clearImmediate = globalThis.clearImmediate; import clearInterval = globalThis.clearInterval; @@ -280,6 +154,6 @@ declare module "timers" { import setTimeout = globalThis.setTimeout; export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout }; } -declare module "node:timers" { - export * from "timers"; +declare module "timers" { + export * from "node:timers"; } diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts index 7ad2b297..85bc8317 100644 --- a/node_modules/@types/node/timers/promises.d.ts +++ b/node_modules/@types/node/timers/promises.d.ts @@ -11,9 +11,9 @@ * } from 'node:timers/promises'; * ``` * @since v15.0.0 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers/promises.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers/promises.js) */ -declare module "timers/promises" { +declare module "node:timers/promises" { import { TimerOptions } from "node:timers"; /** * ```js @@ -103,6 +103,6 @@ declare module "timers/promises" { } const scheduler: Scheduler; } -declare module "node:timers/promises" { - export * from "timers/promises"; +declare module "timers/promises" { + export * from "node:timers/promises"; } diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts index 5d52de81..8e2ffa7d 100644 --- a/node_modules/@types/node/tls.d.ts +++ b/node_modules/@types/node/tls.d.ts @@ -6,9 +6,9 @@ * ```js * import tls from 'node:tls'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js) */ -declare module "tls" { +declare module "node:tls" { import { NonSharedBuffer } from "node:buffer"; import { X509Certificate } from "node:crypto"; import * as net from "node:net"; @@ -207,6 +207,12 @@ declare module "tls" { */ requestOCSP?: boolean | undefined; } + interface TLSSocketEventMap extends net.SocketEventMap { + "keylog": [line: NonSharedBuffer]; + "OCSPResponse": [response: NonSharedBuffer]; + "secureConnect": []; + "session": [session: NonSharedBuffer]; + } /** * Performs transparent encryption of written data and all required TLS * negotiation. @@ -480,36 +486,48 @@ declare module "tls" { * @return requested bytes of the keying material */ exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: NonSharedBuffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: NonSharedBuffer): boolean; - emit(event: "keylog", line: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: NonSharedBuffer) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: NonSharedBuffer) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: TLSSocketEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: TLSSocketEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: TLSSocketEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } interface CommonConnectionOptions { /** @@ -630,6 +648,19 @@ declare module "tls" { */ pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined; } + interface ServerEventMap extends net.ServerEventMap { + "connection": [socket: net.Socket]; + "keylog": [line: NonSharedBuffer, tlsSocket: TLSSocket]; + "newSession": [sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void]; + "OCSPRequest": [ + certificate: NonSharedBuffer, + issuer: NonSharedBuffer, + callback: (err: Error | null, resp: Buffer | null) => void, + ]; + "resumeSession": [sessionId: Buffer, callback: (err: Error | null, sessionData?: Buffer) => void]; + "secureConnection": [tlsSocket: TLSSocket]; + "tlsClientError": [exception: Error, tlsSocket: TLSSocket]; + } /** * Accepts encrypted connections using TLS or SSL. * @since v0.3.2 @@ -675,151 +706,45 @@ declare module "tls" { * @param keys A 48-byte buffer containing the session ticket keys. */ setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, + // #region InternalEventEmitter + addListener(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: ServerEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: ServerEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: ServerEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: E, listener: (...args: ServerEventMap[E]) => void): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - addListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: ServerEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: ServerEventMap[E]) => void, ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit( - event: "newSession", - sessionId: NonSharedBuffer, - sessionData: NonSharedBuffer, - callback: () => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; interface SecureContextOptions { @@ -1175,7 +1100,7 @@ declare module "tls" { * the `ciphers` option of `{@link createSecureContext}`. * * Not all supported ciphers are enabled by default. See - * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite). + * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite). * * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for * TLSv1.2 and below. @@ -1264,6 +1189,6 @@ declare module "tls" { */ const rootCertificates: readonly string[]; } -declare module "node:tls" { - export * from "tls"; +declare module "tls" { + export * from "node:tls"; } diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts index 56e46209..b2c6b323 100644 --- a/node_modules/@types/node/trace_events.d.ts +++ b/node_modules/@types/node/trace_events.d.ts @@ -9,8 +9,8 @@ * The available categories are: * * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) trace data. - * The [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) trace data. + * The [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. * * `node.console`: Enables capture of `console.time()` and `console.count()` output. * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. @@ -22,7 +22,7 @@ * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods. * * `node.fs.async`: Enables capture of trace data for file system async methods. * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods. - * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v24.x/api/perf_hooks.html) measurements. + * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v25.x/api/perf_hooks.html) measurements. * * `node.perf.usertiming`: Enables capture of only Performance API User Timing * measures and marks. * * `node.perf.timerify`: Enables capture of only Performance API timerify @@ -30,7 +30,7 @@ * * `node.promises.rejections`: Enables capture of trace data tracking the number * of unhandled Promise rejections and handled-after-rejections. * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The [V8](https://nodejs.org/docs/latest-v24.x/api/v8.html) events are GC, compiling, and execution related. + * * `v8`: The [V8](https://nodejs.org/docs/latest-v25.x/api/v8.html) events are GC, compiling, and execution related. * * `node.http`: Enables capture of trace data for http request / response. * * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. @@ -88,11 +88,11 @@ * However the trace-event timestamps are expressed in microseconds, * unlike `process.hrtime()` which returns nanoseconds. * - * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#class-worker) threads. + * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#class-worker) threads. * @experimental - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/trace_events.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js) */ -declare module "trace_events" { +declare module "node:trace_events" { /** * The `Tracing` object is used to enable or disable tracing for sets of * categories. Instances are created using the @@ -192,6 +192,6 @@ declare module "trace_events" { */ function getEnabledCategories(): string | undefined; } -declare module "node:trace_events" { - export * from "trace_events"; +declare module "trace_events" { + export * from "node:trace_events"; } diff --git a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts b/node_modules/@types/node/ts5.6/buffer.buffer.d.ts index a5f67d7c..bd32dc68 100644 --- a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +++ b/node_modules/@types/node/ts5.6/buffer.buffer.d.ts @@ -1,4 +1,4 @@ -declare module "buffer" { +declare module "node:buffer" { global { interface BufferConstructor { // see ../buffer.d.ts for implementation shared with all TypeScript versions @@ -459,10 +459,4 @@ declare module "buffer" { */ type AllowSharedBuffer = Buffer; } - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - var SlowBuffer: { - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - new(size: number): Buffer; - prototype: Buffer; - }; } diff --git a/node_modules/@types/node/ts5.6/index.d.ts b/node_modules/@types/node/ts5.6/index.d.ts index 52c18699..a1576601 100644 --- a/node_modules/@types/node/ts5.6/index.d.ts +++ b/node_modules/@types/node/ts5.6/index.d.ts @@ -41,13 +41,21 @@ // Definitions for Node.js modules that are not specific to any version of TypeScript: /// /// +/// +/// /// /// +/// /// /// +/// +/// /// +/// /// /// +/// +/// /// /// /// @@ -70,25 +78,30 @@ /// /// /// +/// /// /// /// /// +/// +/// /// /// /// /// +/// /// /// /// /// /// /// -/// /// +/// /// /// /// +/// /// /// /// @@ -96,6 +109,7 @@ /// /// /// +/// /// /// /// diff --git a/node_modules/@types/node/ts5.7/index.d.ts b/node_modules/@types/node/ts5.7/index.d.ts index b3454a72..32c541ba 100644 --- a/node_modules/@types/node/ts5.7/index.d.ts +++ b/node_modules/@types/node/ts5.7/index.d.ts @@ -41,13 +41,21 @@ // Definitions for Node.js modules that are not specific to any version of TypeScript: /// /// +/// +/// /// /// +/// /// /// +/// +/// /// +/// /// /// +/// +/// /// /// /// @@ -70,25 +78,30 @@ /// /// /// +/// /// /// /// /// +/// +/// /// /// /// /// +/// /// /// /// /// /// /// -/// /// +/// /// /// /// +/// /// /// /// @@ -96,6 +109,7 @@ /// /// /// +/// /// /// /// diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts index 602324ab..9b97a1e1 100644 --- a/node_modules/@types/node/tty.d.ts +++ b/node_modules/@types/node/tty.d.ts @@ -21,9 +21,9 @@ * * In most cases, there should be little to no reason for an application to * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tty.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tty.js) */ -declare module "tty" { +declare module "node:tty" { import * as net from "node:net"; /** * The `tty.isatty()` method returns `true` if the given `fd` is associated with @@ -75,6 +75,9 @@ declare module "tty" { * 1 - to the right from cursor */ type Direction = -1 | 0 | 1; + interface WriteStreamEventMap extends net.SocketEventMap { + "resize": []; + } /** * Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there * should be no reason to create additional instances. @@ -82,18 +85,6 @@ declare module "tty" { */ class WriteStream extends net.Socket { constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; /** * `writeStream.clearLine()` clears the current line of this `WriteStream` in a * direction identified by `dir`. @@ -201,8 +192,59 @@ declare module "tty" { * @since v0.5.8 */ isTTY: boolean; + // #region InternalEventEmitter + addListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(eventName: E, ...args: WriteStreamEventMap[E]): boolean; + emit(eventName: string | symbol, ...args: any[]): boolean; + listenerCount( + eventName: E, + listener?: (...args: WriteStreamEventMap[E]) => void, + ): number; + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; + listeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; + off( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + on( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + once( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + rawListeners(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[]; + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + removeAllListeners(eventName?: E): this; + removeAllListeners(eventName?: string | symbol): this; + removeListener( + eventName: E, + listener: (...args: WriteStreamEventMap[E]) => void, + ): this; + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + // #endregion } } -declare module "node:tty" { - export * from "tty"; +declare module "tty" { + export * from "node:tty"; } diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts index 8d0fb658..6f5b8856 100644 --- a/node_modules/@types/node/url.d.ts +++ b/node_modules/@types/node/url.d.ts @@ -5,10 +5,10 @@ * ```js * import url from 'node:url'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/url.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/url.js) */ -declare module "url" { - import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer"; +declare module "node:url" { + import { Blob, NonSharedBuffer } from "node:buffer"; import { ClientRequestArgs } from "node:http"; import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; // Input to `url.format` @@ -74,7 +74,7 @@ declare module "url" { * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) * and incorrect handling of usernames and passwords. Do not use with untrusted * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the - * [WHATWG URL](https://nodejs.org/docs/latest-v24.x/api/url.html#the-whatwg-url-api) API instead, for example: + * [WHATWG URL](https://nodejs.org/docs/latest-v25.x/api/url.html#the-whatwg-url-api) API instead, for example: * * ```js * function getURL(req) { @@ -97,7 +97,7 @@ declare module "url" { * @deprecated Use the WHATWG URL API instead. * @param urlString The URL string to parse. * @param parseQueryString If `true`, the `query` property will always - * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v24.x/api/querystring.html) module's `parse()` + * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v25.x/api/querystring.html) module's `parse()` * method. If `false`, the `query` property on the returned URL object will be an * unparsed, undecoded string. **Default:** `false`. * @param slashesDenoteHost If `true`, the first token after the literal @@ -418,381 +418,8 @@ declare module "url" { */ unicode?: boolean | undefined; } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject`s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * import { - * Blob, - * resolveObjectURL, - * } from 'node:buffer'; - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn't registered will silently fail. - * @since v16.7.0 - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(id: string): void; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.0 - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - */ - static canParse(input: string, base?: string): boolean; - /** - * Parses a string as a URL. If `base` is provided, it will be used as the base - * URL for the purpose of resolving non-absolute `input` URLs. Returns `null` - * if the parameters can't be resolved to a valid URL. - * @since v22.1.0 - * @param input The absolute or relative input URL to parse. If `input` - * is relative, then `base` is required. If `input` is absolute, the `base` - * is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first. - * @param base The base URL to resolve against if the `input` is not - * absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first. - */ - static parse(input: string, base?: string): URL | null; - constructor(input: string | { toString: () => string }, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL` object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } + // #region web types + type URLPatternInput = string | URLPatternInit; interface URLPatternComponentResult { input: string; groups: Record; @@ -812,7 +439,7 @@ declare module "url" { ignoreCase?: boolean; } interface URLPatternResult { - inputs: (string | URLPatternInit)[]; + inputs: URLPatternInput[]; protocol: URLPatternComponentResult; username: URLPatternComponentResult; password: URLPatternComponentResult; @@ -822,14 +449,30 @@ declare module "url" { search: URLPatternComponentResult; hash: URLPatternComponentResult; } - /** - * @since v23.8.0 - * @experimental - */ - class URLPattern { - constructor(input: string | URLPatternInit, baseURL: string, options?: URLPatternOptions); - constructor(input?: string | URLPatternInit, options?: URLPatternOptions); - exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null; + interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toJSON(): string; + } + var URL: { + prototype: URL; + new(url: string | URL, base?: string | URL): URL; + canParse(input: string | URL, base?: string | URL): boolean; + createObjectURL(blob: Blob): string; + parse(input: string | URL, base?: string | URL): URL | null; + revokeObjectURL(id: string): void; + }; + interface URLPattern { readonly hasRegExpGroups: boolean; readonly hash: string; readonly hostname: string; @@ -838,220 +481,39 @@ declare module "url" { readonly port: string; readonly protocol: string; readonly search: string; - test(input?: string | URLPatternInit, baseURL?: string): boolean; readonly username: string; + exec(input?: URLPatternInput, baseURL?: string | URL): URLPatternResult | null; + test(input?: URLPatternInput, baseURL?: string | URL): boolean; } - interface URLSearchParamsIterator extends NodeJS.Iterator { - [Symbol.iterator](): URLSearchParamsIterator; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ + var URLPattern: { + prototype: URLPattern; + new(input: URLPatternInput, baseURL: string | URL, options?: URLPatternOptions): URLPattern; + new(input?: URLPatternInput, options?: URLPatternOptions): URLPattern; + }; + interface URLSearchParams { + readonly size: number; append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ delete(name: string, value?: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[Symbol.iterator]()`. - */ - entries(): URLSearchParamsIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): URLSearchParamsIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): URLSearchParamsIterator; + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; [Symbol.iterator](): URLSearchParamsIterator<[string, string]>; + entries(): URLSearchParamsIterator<[string, string]>; + keys(): URLSearchParamsIterator; + values(): URLSearchParamsIterator; } - import { - URL as _URL, - URLPattern as _URLPattern, - URLPatternInit as _URLPatternInit, - URLPatternResult as _URLPatternResult, - URLSearchParams as _URLSearchParams, - } from "url"; - global { - interface URL extends _URL {} - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } ? T - : typeof _URL; - interface URLSearchParams extends _URLSearchParams {} - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - interface URLPatternInit extends _URLPatternInit {} - interface URLPatternResult extends _URLPatternResult {} - interface URLPattern extends _URLPattern {} - var URLPattern: typeof globalThis extends { - onmessage: any; - scheduler: any; // Must be a var introduced at the same time as URLPattern. - URLPattern: infer T; - } ? T - : typeof _URLPattern; + var URLSearchParams: { + prototype: URLSearchParams; + new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams; + }; + interface URLSearchParamsIterator extends NodeJS.Iterator { + [Symbol.iterator](): URLSearchParamsIterator; } + // #endregion } -declare module "node:url" { - export * from "url"; +declare module "url" { + export * from "node:url"; } diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts index c825a79b..70fd51a0 100644 --- a/node_modules/@types/node/util.d.ts +++ b/node_modules/@types/node/util.d.ts @@ -6,10 +6,60 @@ * ```js * import util from 'node:util'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/util.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/util.js) */ -declare module "util" { - import * as types from "node:util/types"; +declare module "node:util" { + export * as types from "node:util/types"; + export type InspectStyle = + | "special" + | "number" + | "bigint" + | "boolean" + | "undefined" + | "null" + | "string" + | "symbol" + | "date" + | "name" + | "regexp" + | "module"; + export interface InspectStyles extends Record string)> { + regexp: { + (value: string): string; + colors: InspectColor[]; + }; + } + export type InspectColorModifier = + | "reset" + | "bold" + | "dim" + | "italic" + | "underline" + | "blink" + | "inverse" + | "hidden" + | "strikethrough" + | "doubleunderline"; + export type InspectColorForeground = + | "black" + | "red" + | "green" + | "yellow" + | "blue" + | "magenta" + | "cyan" + | "white" + | "gray" + | "redBright" + | "greenBright" + | "yellowBright" + | "blueBright" + | "magentaBright" + | "cyanBright" + | "whiteBright"; + export type InspectColorBackground = `bg${Capitalize}`; + export type InspectColor = InspectColorModifier | InspectColorForeground | InspectColorBackground; + export interface InspectColors extends Record {} export interface InspectOptions { /** * If `true`, object's non-enumerable symbols and properties are included in the formatted result. @@ -92,22 +142,26 @@ declare module "util" { */ numericSeparator?: boolean | undefined; } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; + export interface InspectContext extends Required { + stylize(text: string, styleType: InspectStyle): string; + } + import _inspect = inspect; + export interface Inspectable { + [inspect.custom](depth: number, options: InspectContext, inspect: typeof _inspect): any; } + // TODO: Remove these in a future major + /** @deprecated Use `InspectStyle` instead. */ + export type Style = Exclude; + /** @deprecated Use the `Inspectable` interface instead. */ + export type CustomInspectFunction = (depth: number, options: InspectContext) => any; + /** @deprecated Use `InspectContext` instead. */ + export interface InspectOptionsStylized extends InspectContext {} + /** @deprecated Use `InspectColorModifier` instead. */ + export type Modifiers = InspectColorModifier; + /** @deprecated Use `InspectColorForeground` instead. */ + export type ForegroundColors = InspectColorForeground; + /** @deprecated Use `InspectColorBackground` instead. */ + export type BackgroundColors = InspectColorBackground; export interface CallSiteObject { /** * Returns the name of the function associated with this call site. @@ -243,7 +297,7 @@ declare module "util" { * @since v10.0.0 */ export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - interface GetCallSitesOptions { + export interface GetCallSitesOptions { /** * Reconstruct the original location in the stacktrace from the source-map. * Enabled by default with the flag `--enable-source-maps`. @@ -609,19 +663,11 @@ declare module "util" { export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; export function inspect(object: any, options?: InspectOptions): string; export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; + const custom: unique symbol; + let colors: InspectColors; + let styles: InspectStyles; let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; } /** * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). @@ -1045,7 +1091,7 @@ declare module "util" { * ``` * * If there is an `original[util.promisify.custom]` property present, `promisify` - * will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v24.x/api/util.html#custom-promisified-functions). + * will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v25.x/api/util.html#custom-promisified-functions). * * `promisify()` assumes that `original` is a function taking a callback as its * final argument in all cases. If `original` is not a function, `promisify()` @@ -1136,61 +1182,6 @@ declare module "util" { * @since v20.12.0 */ export function parseEnv(content: string): NodeJS.Dict; - // https://nodejs.org/docs/latest/api/util.html#foreground-colors - type ForegroundColors = - | "black" - | "blackBright" - | "blue" - | "blueBright" - | "cyan" - | "cyanBright" - | "gray" - | "green" - | "greenBright" - | "grey" - | "magenta" - | "magentaBright" - | "red" - | "redBright" - | "white" - | "whiteBright" - | "yellow" - | "yellowBright"; - // https://nodejs.org/docs/latest/api/util.html#background-colors - type BackgroundColors = - | "bgBlack" - | "bgBlackBright" - | "bgBlue" - | "bgBlueBright" - | "bgCyan" - | "bgCyanBright" - | "bgGray" - | "bgGreen" - | "bgGreenBright" - | "bgGrey" - | "bgMagenta" - | "bgMagentaBright" - | "bgRed" - | "bgRedBright" - | "bgWhite" - | "bgWhiteBright" - | "bgYellow" - | "bgYellowBright"; - // https://nodejs.org/docs/latest/api/util.html#modifiers - type Modifiers = - | "blink" - | "bold" - | "dim" - | "doubleunderline" - | "framed" - | "hidden" - | "inverse" - | "italic" - | "none" - | "overlined" - | "reset" - | "strikethrough" - | "underline"; export interface StyleTextOptions { /** * When true, `stream` is checked to see if it can handle colors. @@ -1245,142 +1236,19 @@ declare module "util" { * * The special format value `none` applies no additional styling to the text. * - * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v24.x/api/util.html#modifiers). + * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v25.x/api/util.html#modifiers). * @param format A text format or an Array of text formats defined in `util.inspect.colors`. * @param text The text to to be formatted. * @since v20.12.0 */ export function styleText( - format: - | ForegroundColors - | BackgroundColors - | Modifiers - | Array, + format: InspectColor | readonly InspectColor[], text: string, options?: StyleTextOptions, ): string; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): NodeJS.NonSharedUint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - + /** @deprecated This alias will be removed in a future version. Use the canonical `TextEncoderEncodeIntoResult` instead. */ + // TODO: remove in future major + export interface EncodeIntoResult extends TextEncoderEncodeIntoResult {} //// parseArgs /** * Provides a higher level API for command-line argument parsing than interacting @@ -1411,12 +1279,10 @@ declare module "util" { * @return The parsed command line arguments: */ export function parseArgs(config?: T): ParsedResults; - /** * Type of argument used in {@link parseArgs}. */ export type ParseArgsOptionsType = "boolean" | "string"; - export interface ParseArgsOptionDescriptor { /** * Type of argument. @@ -1491,23 +1357,19 @@ declare module "util" { type IfDefaultsTrue = T extends true ? IfTrue : T extends false ? IfFalse : IfTrue; - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` type IfDefaultsFalse = T extends false ? IfFalse : T extends true ? IfTrue : IfFalse; - type ExtractOptionValue = IfDefaultsTrue< T["strict"], O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, string | boolean >; - type ApplyOptionalModifiers> = ( & { -readonly [LongOption in keyof O]?: V[LongOption] } & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] } ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object - type ParsedValues = & IfDefaultsTrue & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers< @@ -1521,13 +1383,11 @@ declare module "util" { } > : {}); - type ParsedPositionals = IfDefaultsTrue< T["strict"], IfDefaultsFalse, IfDefaultsTrue >; - type PreciseTokenForOptions< K extends string, O extends ParseArgsOptionDescriptor, @@ -1548,7 +1408,6 @@ declare module "util" { inlineValue: undefined; } : OptionToken & { name: K }; - type TokenForOptions< T extends ParseArgsConfig, K extends keyof T["options"] = keyof T["options"], @@ -1556,19 +1415,15 @@ declare module "util" { ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions : OptionToken : never; - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - type ParsedPositionalToken = IfDefaultsTrue< T["strict"], IfDefaultsFalse, IfDefaultsTrue >; - type ParsedTokens = Array< ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } >; - type PreciseParsedResults = IfDefaultsFalse< T["tokens"], { @@ -1581,7 +1436,6 @@ declare module "util" { positionals: ParsedPositionals; } >; - type OptionToken = | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } | { @@ -1592,12 +1446,10 @@ declare module "util" { value: undefined; inlineValue: undefined; }; - type Token = | OptionToken | { kind: "positional"; index: number; value: string } | { kind: "option-terminator"; index: number }; - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. type ParsedResults = ParseArgsConfig extends T ? { @@ -1608,7 +1460,6 @@ declare module "util" { tokens?: Token[]; } : PreciseParsedResults; - /** * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). * @@ -1630,7 +1481,6 @@ declare module "util" { * @param input The input MIME to parse. */ constructor(input: string | { toString: () => string }); - /** * Gets and sets the type portion of the MIME. * @@ -1761,565 +1611,43 @@ declare module "util" { */ [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>; } + // #region web types + export interface TextDecodeOptions { + stream?: boolean; + } + export interface TextDecoderCommon { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + } + export interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + export interface TextEncoderCommon { + readonly encoding: string; + } + export interface TextEncoderEncodeIntoResult { + read: number; + written: number; + } + export interface TextDecoder extends TextDecoderCommon { + decode(input?: NodeJS.AllowSharedBufferSource, options?: TextDecodeOptions): string; + } + export var TextDecoder: { + prototype: TextDecoder; + new(label?: string, options?: TextDecoderOptions): TextDecoder; + }; + export interface TextEncoder extends TextEncoderCommon { + encode(input?: string): NodeJS.NonSharedUint8Array; + encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult; + } + export var TextEncoder: { + prototype: TextEncoder; + new(): TextEncoder; + }; + // #endregion } -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a BigInt object, e.g. created - * by `Object(BigInt(123))`. - * - * ```js - * util.types.isBigIntObject(Object(BigInt(123))); // Returns true - * util.types.isBigIntObject(BigInt(123)); // Returns false - * util.types.isBigIntObject(123); // Returns false - * ``` - * @since v10.4.0 - */ - function isBigIntObject(object: unknown): object is BigInt; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are - * [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a - * `null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * import native from 'napi_addon.node'; - * import { types } from 'node:util'; - * - * const data = native.myNapi(); - * types.isExternal(data); // returns true - * types.isExternal(0); // returns false - * types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to - * [`napi_create_external()`](https://nodejs.org/docs/latest-v24.x/api/n-api.html#napi_create_external). - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array) instance. - * - * ```js - * util.types.isFloat16Array(new ArrayBuffer()); // Returns false - * util.types.isFloat16Array(new Float16Array()); // Returns true - * util.types.isFloat16Array(new Float32Array()); // Returns false - * ``` - * @since v24.0.0 - */ - function isFloat16Array(object: unknown): object is Float16Array; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a - * [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()` - * returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` - * for these errors: - * - * ```js - * import { createContext, runInContext } from 'node:vm'; - * import { types } from 'node:util'; - * - * const context = createContext({}); - * const myError = runInContext('new Error()', context); - * console.log(types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - * @deprecated The `util.types.isNativeError` API is deprecated. Please use `Error.isError` instead. - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; +declare module "util" { + export * from "node:util"; } diff --git a/node_modules/@types/node/util/types.d.ts b/node_modules/@types/node/util/types.d.ts new file mode 100644 index 00000000..818825bd --- /dev/null +++ b/node_modules/@types/node/util/types.d.ts @@ -0,0 +1,558 @@ +declare module "node:util/types" { + import { KeyObject, webcrypto } from "node:crypto"; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or + * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * + * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. + * + * ```js + * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; + /** + * Returns `true` if the value is an `arguments` object. + * + * ```js + * function foo() { + * util.types.isArgumentsObject(arguments); // Returns true + * } + * ``` + * @since v10.0.0 + */ + function isArgumentsObject(object: unknown): object is IArguments; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. + * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false + * ``` + * @since v10.0.0 + */ + function isArrayBuffer(object: unknown): object is ArrayBuffer; + /** + * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed + * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to + * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * + * ```js + * util.types.isArrayBufferView(new Int8Array()); // true + * util.types.isArrayBufferView(Buffer.from('hello world')); // true + * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true + * util.types.isArrayBufferView(new ArrayBuffer()); // false + * ``` + * @since v10.0.0 + */ + function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; + /** + * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isAsyncFunction(function foo() {}); // Returns false + * util.types.isAsyncFunction(async function foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isAsyncFunction(object: unknown): boolean; + /** + * Returns `true` if the value is a `BigInt64Array` instance. + * + * ```js + * util.types.isBigInt64Array(new BigInt64Array()); // Returns true + * util.types.isBigInt64Array(new BigUint64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isBigInt64Array(value: unknown): value is BigInt64Array; + /** + * Returns `true` if the value is a BigInt object, e.g. created + * by `Object(BigInt(123))`. + * + * ```js + * util.types.isBigIntObject(Object(BigInt(123))); // Returns true + * util.types.isBigIntObject(BigInt(123)); // Returns false + * util.types.isBigIntObject(123); // Returns false + * ``` + * @since v10.4.0 + */ + function isBigIntObject(object: unknown): object is BigInt; + /** + * Returns `true` if the value is a `BigUint64Array` instance. + * + * ```js + * util.types.isBigUint64Array(new BigInt64Array()); // Returns false + * util.types.isBigUint64Array(new BigUint64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isBigUint64Array(value: unknown): value is BigUint64Array; + /** + * Returns `true` if the value is a boolean object, e.g. created + * by `new Boolean()`. + * + * ```js + * util.types.isBooleanObject(false); // Returns false + * util.types.isBooleanObject(true); // Returns false + * util.types.isBooleanObject(new Boolean(false)); // Returns true + * util.types.isBooleanObject(new Boolean(true)); // Returns true + * util.types.isBooleanObject(Boolean(false)); // Returns false + * util.types.isBooleanObject(Boolean(true)); // Returns false + * ``` + * @since v10.0.0 + */ + function isBooleanObject(object: unknown): object is Boolean; + /** + * Returns `true` if the value is any boxed primitive object, e.g. created + * by `new Boolean()`, `new String()` or `Object(Symbol())`. + * + * For example: + * + * ```js + * util.types.isBoxedPrimitive(false); // Returns false + * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true + * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false + * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true + * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true + * ``` + * @since v10.11.0 + */ + function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; + /** + * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. + * + * ```js + * const ab = new ArrayBuffer(20); + * util.types.isDataView(new DataView(ab)); // Returns true + * util.types.isDataView(new Float64Array()); // Returns false + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isDataView(object: unknown): object is DataView; + /** + * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. + * + * ```js + * util.types.isDate(new Date()); // Returns true + * ``` + * @since v10.0.0 + */ + function isDate(object: unknown): object is Date; + /** + * Returns `true` if the value is a native `External` value. + * + * A native `External` value is a special type of object that contains a + * raw C++ pointer (`void*`) for access from native code, and has no other + * properties. Such objects are created either by Node.js internals or native + * addons. In JavaScript, they are + * [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a + * `null` prototype. + * + * ```c + * #include + * #include + * napi_value result; + * static napi_value MyNapi(napi_env env, napi_callback_info info) { + * int* raw = (int*) malloc(1024); + * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); + * if (status != napi_ok) { + * napi_throw_error(env, NULL, "napi_create_external failed"); + * return NULL; + * } + * return result; + * } + * ... + * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) + * ... + * ``` + * + * ```js + * import native from 'napi_addon.node'; + * import { types } from 'node:util'; + * + * const data = native.myNapi(); + * types.isExternal(data); // returns true + * types.isExternal(0); // returns false + * types.isExternal(new String('foo')); // returns false + * ``` + * + * For further information on `napi_create_external`, refer to + * [`napi_create_external()`](https://nodejs.org/docs/latest-v25.x/api/n-api.html#napi_create_external). + * @since v10.0.0 + */ + function isExternal(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`Float16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array) instance. + * + * ```js + * util.types.isFloat16Array(new ArrayBuffer()); // Returns false + * util.types.isFloat16Array(new Float16Array()); // Returns true + * util.types.isFloat16Array(new Float32Array()); // Returns false + * ``` + * @since v24.0.0 + */ + function isFloat16Array(object: unknown): object is Float16Array; + /** + * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. + * + * ```js + * util.types.isFloat32Array(new ArrayBuffer()); // Returns false + * util.types.isFloat32Array(new Float32Array()); // Returns true + * util.types.isFloat32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isFloat32Array(object: unknown): object is Float32Array; + /** + * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. + * + * ```js + * util.types.isFloat64Array(new ArrayBuffer()); // Returns false + * util.types.isFloat64Array(new Uint8Array()); // Returns false + * util.types.isFloat64Array(new Float64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isFloat64Array(object: unknown): object is Float64Array; + /** + * Returns `true` if the value is a generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isGeneratorFunction(function foo() {}); // Returns false + * util.types.isGeneratorFunction(function* foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorFunction(object: unknown): object is GeneratorFunction; + /** + * Returns `true` if the value is a generator object as returned from a + * built-in generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * function* foo() {} + * const generator = foo(); + * util.types.isGeneratorObject(generator); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorObject(object: unknown): object is Generator; + /** + * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. + * + * ```js + * util.types.isInt8Array(new ArrayBuffer()); // Returns false + * util.types.isInt8Array(new Int8Array()); // Returns true + * util.types.isInt8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt8Array(object: unknown): object is Int8Array; + /** + * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. + * + * ```js + * util.types.isInt16Array(new ArrayBuffer()); // Returns false + * util.types.isInt16Array(new Int16Array()); // Returns true + * util.types.isInt16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt16Array(object: unknown): object is Int16Array; + /** + * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. + * + * ```js + * util.types.isInt32Array(new ArrayBuffer()); // Returns false + * util.types.isInt32Array(new Int32Array()); // Returns true + * util.types.isInt32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt32Array(object: unknown): object is Int32Array; + /** + * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * util.types.isMap(new Map()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMap( + object: T | {}, + ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) + : Map; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * const map = new Map(); + * util.types.isMapIterator(map.keys()); // Returns true + * util.types.isMapIterator(map.values()); // Returns true + * util.types.isMapIterator(map.entries()); // Returns true + * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMapIterator(object: unknown): boolean; + /** + * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). + * + * ```js + * import * as ns from './a.js'; + * + * util.types.isModuleNamespaceObject(ns); // Returns true + * ``` + * @since v10.0.0 + */ + function isModuleNamespaceObject(value: unknown): boolean; + /** + * Returns `true` if the value was returned by the constructor of a + * [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). + * + * ```js + * console.log(util.types.isNativeError(new Error())); // true + * console.log(util.types.isNativeError(new TypeError())); // true + * console.log(util.types.isNativeError(new RangeError())); // true + * ``` + * + * Subclasses of the native error types are also native errors: + * + * ```js + * class MyError extends Error {} + * console.log(util.types.isNativeError(new MyError())); // true + * ``` + * + * A value being `instanceof` a native error class is not equivalent to `isNativeError()` + * returning `true` for that value. `isNativeError()` returns `true` for errors + * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` + * for these errors: + * + * ```js + * import { createContext, runInContext } from 'node:vm'; + * import { types } from 'node:util'; + * + * const context = createContext({}); + * const myError = runInContext('new Error()', context); + * console.log(types.isNativeError(myError)); // true + * console.log(myError instanceof Error); // false + * ``` + * + * Conversely, `isNativeError()` returns `false` for all objects which were not + * returned by the constructor of a native error. That includes values + * which are `instanceof` native errors: + * + * ```js + * const myError = { __proto__: Error.prototype }; + * console.log(util.types.isNativeError(myError)); // false + * console.log(myError instanceof Error); // true + * ``` + * @since v10.0.0 + * @deprecated The `util.types.isNativeError` API is deprecated. Please use `Error.isError` instead. + */ + function isNativeError(object: unknown): object is Error; + /** + * Returns `true` if the value is a number object, e.g. created + * by `new Number()`. + * + * ```js + * util.types.isNumberObject(0); // Returns false + * util.types.isNumberObject(new Number(0)); // Returns true + * ``` + * @since v10.0.0 + */ + function isNumberObject(object: unknown): object is Number; + /** + * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * ```js + * util.types.isPromise(Promise.resolve(42)); // Returns true + * ``` + * @since v10.0.0 + */ + function isPromise(object: unknown): object is Promise; + /** + * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. + * + * ```js + * const target = {}; + * const proxy = new Proxy(target, {}); + * util.types.isProxy(target); // Returns false + * util.types.isProxy(proxy); // Returns true + * ``` + * @since v10.0.0 + */ + function isProxy(object: unknown): boolean; + /** + * Returns `true` if the value is a regular expression object. + * + * ```js + * util.types.isRegExp(/abc/); // Returns true + * util.types.isRegExp(new RegExp('abc')); // Returns true + * ``` + * @since v10.0.0 + */ + function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * util.types.isSet(new Set()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSet( + object: T | {}, + ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * const set = new Set(); + * util.types.isSetIterator(set.keys()); // Returns true + * util.types.isSetIterator(set.values()); // Returns true + * util.types.isSetIterator(set.entries()); // Returns true + * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSetIterator(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false + * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; + /** + * Returns `true` if the value is a string object, e.g. created + * by `new String()`. + * + * ```js + * util.types.isStringObject('foo'); // Returns false + * util.types.isStringObject(new String('foo')); // Returns true + * ``` + * @since v10.0.0 + */ + function isStringObject(object: unknown): object is String; + /** + * Returns `true` if the value is a symbol object, created + * by calling `Object()` on a `Symbol` primitive. + * + * ```js + * const symbol = Symbol('foo'); + * util.types.isSymbolObject(symbol); // Returns false + * util.types.isSymbolObject(Object(symbol)); // Returns true + * ``` + * @since v10.0.0 + */ + function isSymbolObject(object: unknown): object is Symbol; + /** + * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. + * + * ```js + * util.types.isTypedArray(new ArrayBuffer()); // Returns false + * util.types.isTypedArray(new Uint8Array()); // Returns true + * util.types.isTypedArray(new Float64Array()); // Returns true + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isTypedArray(object: unknown): object is NodeJS.TypedArray; + /** + * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. + * + * ```js + * util.types.isUint8Array(new ArrayBuffer()); // Returns false + * util.types.isUint8Array(new Uint8Array()); // Returns true + * util.types.isUint8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8Array(object: unknown): object is Uint8Array; + /** + * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. + * + * ```js + * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false + * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true + * util.types.isUint8ClampedArray(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; + /** + * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. + * + * ```js + * util.types.isUint16Array(new ArrayBuffer()); // Returns false + * util.types.isUint16Array(new Uint16Array()); // Returns true + * util.types.isUint16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint16Array(object: unknown): object is Uint16Array; + /** + * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. + * + * ```js + * util.types.isUint32Array(new ArrayBuffer()); // Returns false + * util.types.isUint32Array(new Uint32Array()); // Returns true + * util.types.isUint32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint32Array(object: unknown): object is Uint32Array; + /** + * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. + * + * ```js + * util.types.isWeakMap(new WeakMap()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakMap(object: unknown): object is WeakMap; + /** + * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. + * + * ```js + * util.types.isWeakSet(new WeakSet()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakSet(object: unknown): object is WeakSet; + /** + * Returns `true` if `value` is a `KeyObject`, `false` otherwise. + * @since v16.2.0 + */ + function isKeyObject(object: unknown): object is KeyObject; + /** + * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. + * @since v16.2.0 + */ + function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; +} +declare module "util/types" { + export * from "node:util/types"; +} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts index d509ee13..9216587d 100644 --- a/node_modules/@types/node/v8.d.ts +++ b/node_modules/@types/node/v8.d.ts @@ -4,9 +4,9 @@ * ```js * import v8 from 'node:v8'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/v8.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/v8.js) */ -declare module "v8" { +declare module "node:v8" { import { NonSharedBuffer } from "node:buffer"; import { Readable } from "node:stream"; interface HeapSpaceInfo { @@ -401,6 +401,21 @@ declare module "v8" { * @since v12.8.0 */ function getHeapCodeStatistics(): HeapCodeStatistics; + /** + * @since v25.0.0 + */ + interface SyncCPUProfileHandle { + /** + * Stopping collecting the profile and return the profile data. + * @since v25.0.0 + */ + stop(): string; + /** + * Stopping collecting the profile and the profile will be discarded. + * @since v25.0.0 + */ + [Symbol.dispose](): void; + } /** * @since v24.8.0 */ @@ -433,6 +448,18 @@ declare module "v8" { */ [Symbol.asyncDispose](): Promise; } + /** + * Starting a CPU profile then return a `SyncCPUProfileHandle` object. + * This API supports `using` syntax. + * + * ```js + * const handle = v8.startCpuProfile(); + * const profile = handle.stop(); + * console.log(profile); + * ``` + * @since v25.0.0 + */ + function startCPUProfile(): SyncCPUProfileHandle; /** * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string. * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true; @@ -613,7 +640,7 @@ declare module "v8" { function stopCoverage(): void; /** * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once. - * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. + * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. * @since v18.10.0, v16.18.0 */ function setHeapSnapshotNearHeapLimit(limit: number): void; @@ -947,6 +974,6 @@ declare module "v8" { function isBuildingSnapshot(): boolean; } } -declare module "node:v8" { - export * from "v8"; +declare module "v8" { + export * from "node:v8"; } diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts index 50b7f09a..b096c917 100644 --- a/node_modules/@types/node/vm.d.ts +++ b/node_modules/@types/node/vm.d.ts @@ -34,9 +34,9 @@ * * console.log(x); // 1; y is not defined. * ``` - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/vm.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/vm.js) */ -declare module "vm" { +declare module "node:vm" { import { NonSharedBuffer } from "node:buffer"; import { ImportAttributes, ImportPhase } from "node:module"; interface Context extends NodeJS.Dict {} @@ -73,7 +73,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: @@ -119,7 +119,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: @@ -133,7 +133,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: @@ -153,7 +153,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: @@ -197,7 +197,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: @@ -400,9 +400,9 @@ declare module "vm" { } /** * If the given `contextObject` is an object, the `vm.createContext()` method will - * [prepare that object](https://nodejs.org/docs/latest-v24.x/api/vm.html#what-does-it-mean-to-contextify-an-object) + * [prepare that object](https://nodejs.org/docs/latest-v25.x/api/vm.html#what-does-it-mean-to-contextify-an-object) * and return a reference to it so that it can be used in calls to {@link runInContext} or - * [`script.runInContext()`](https://nodejs.org/docs/latest-v24.x/api/vm.html#scriptrunincontextcontextifiedobject-options). + * [`script.runInContext()`](https://nodejs.org/docs/latest-v25.x/api/vm.html#scriptrunincontextcontextifiedobject-options). * Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its * existing properties but also having the built-in objects and functions any standard * [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global @@ -887,7 +887,7 @@ declare module "vm" { /** * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @experimental */ importModuleDynamically?: DynamicModuleLoader | undefined; @@ -1156,7 +1156,7 @@ declare module "vm" { * and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main * context to load the requested module. * - * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). + * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). * @since v21.7.0, v20.12.0 */ const USE_MAIN_CONTEXT_DEFAULT_LOADER: number; @@ -1175,6 +1175,6 @@ declare module "vm" { const DONT_CONTEXTIFY: number; } } -declare module "node:vm" { - export * from "vm"; +declare module "vm" { + export * from "node:vm"; } diff --git a/node_modules/@types/node/wasi.d.ts b/node_modules/@types/node/wasi.d.ts index 7685c1e9..c206ae5d 100644 --- a/node_modules/@types/node/wasi.d.ts +++ b/node_modules/@types/node/wasi.d.ts @@ -67,9 +67,9 @@ * wat2wasm demo.wat * ``` * @experimental - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/wasi.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/wasi.js) */ -declare module "wasi" { +declare module "node:wasi" { interface WASIOptions { /** * An array of strings that the WebAssembly application will @@ -197,6 +197,6 @@ declare module "wasi" { readonly wasiImport: NodeJS.Dict; // TODO: Narrow to DOM types } } -declare module "node:wasi" { - export * from "wasi"; +declare module "wasi" { + export * from "node:wasi"; } diff --git a/node_modules/@types/node/web-globals/abortcontroller.d.ts b/node_modules/@types/node/web-globals/abortcontroller.d.ts index f36cb9ae..ad753c16 100644 --- a/node_modules/@types/node/web-globals/abortcontroller.d.ts +++ b/node_modules/@types/node/web-globals/abortcontroller.d.ts @@ -1,17 +1,42 @@ export {}; +import { InternalEventTargetEventProperties } from "node:events"; + type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController; interface AbortController { readonly signal: AbortSignal; abort(reason?: any): void; } +interface AbortSignalEventMap { + "abort": Event; +} + type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal; -interface AbortSignal extends EventTarget { +interface AbortSignal extends EventTarget, InternalEventTargetEventProperties { readonly aborted: boolean; - onabort: ((this: AbortSignal, ev: Event) => any) | null; readonly reason: any; throwIfAborted(): void; + addEventListener( + type: K, + listener: (ev: AbortSignalEventMap[K]) => void, + options?: AddEventListenerOptions | boolean, + ): void; + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + removeEventListener( + type: K, + listener: (ev: AbortSignalEventMap[K]) => void, + options?: EventListenerOptions | boolean, + ): void; + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; } declare global { diff --git a/node_modules/@types/node/web-globals/blob.d.ts b/node_modules/@types/node/web-globals/blob.d.ts new file mode 100644 index 00000000..04ff440a --- /dev/null +++ b/node_modules/@types/node/web-globals/blob.d.ts @@ -0,0 +1,23 @@ +export {}; + +import * as buffer from "node:buffer"; + +type _Blob = typeof globalThis extends { onmessage: any } ? {} : buffer.Blob; +type _BlobPropertyBag = typeof globalThis extends { onmessage: any } ? {} : buffer.BlobPropertyBag; +type _File = typeof globalThis extends { onmessage: any } ? {} : buffer.File; +type _FilePropertyBag = typeof globalThis extends { onmessage: any } ? {} : buffer.FilePropertyBag; + +declare global { + interface Blob extends _Blob {} + var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T : typeof buffer.Blob; + + interface BlobPropertyBag extends _BlobPropertyBag {} + + interface File extends _File {} + var File: typeof globalThis extends { onmessage: any; File: infer T } ? T : typeof buffer.File; + + interface FilePropertyBag extends _FilePropertyBag {} + + function atob(data: string): string; + function btoa(data: string): string; +} diff --git a/node_modules/@types/node/web-globals/console.d.ts b/node_modules/@types/node/web-globals/console.d.ts new file mode 100644 index 00000000..5492de33 --- /dev/null +++ b/node_modules/@types/node/web-globals/console.d.ts @@ -0,0 +1,9 @@ +export {}; + +import * as console from "node:console"; + +declare global { + interface Console extends console.Console {} + + var console: Console; +} diff --git a/node_modules/@types/node/web-globals/crypto.d.ts b/node_modules/@types/node/web-globals/crypto.d.ts index 9e572c53..f038a439 100644 --- a/node_modules/@types/node/web-globals/crypto.d.ts +++ b/node_modules/@types/node/web-globals/crypto.d.ts @@ -2,17 +2,24 @@ export {}; import { webcrypto } from "crypto"; +type _Crypto = typeof globalThis extends { onmessage: any } ? {} : webcrypto.Crypto; +type _CryptoKey = typeof globalThis extends { onmessage: any } ? {} : webcrypto.CryptoKey; +type _SubtleCrypto = typeof globalThis extends { onmessage: any } ? {} : webcrypto.SubtleCrypto; + declare global { + interface Crypto extends _Crypto {} var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : { prototype: webcrypto.Crypto; new(): webcrypto.Crypto; }; + interface CryptoKey extends _CryptoKey {} var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : { prototype: webcrypto.CryptoKey; new(): webcrypto.CryptoKey; }; + interface SubtleCrypto extends _SubtleCrypto {} var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : { prototype: webcrypto.SubtleCrypto; new(): webcrypto.SubtleCrypto; diff --git a/node_modules/@types/node/web-globals/encoding.d.ts b/node_modules/@types/node/web-globals/encoding.d.ts new file mode 100644 index 00000000..de5fa4f7 --- /dev/null +++ b/node_modules/@types/node/web-globals/encoding.d.ts @@ -0,0 +1,11 @@ +export {}; + +import * as util from "node:util"; + +declare global { + interface TextDecoder extends util.TextDecoder {} + var TextDecoder: typeof globalThis extends { onmessage: any; TextDecoder: infer T } ? T : typeof util.TextDecoder; + + interface TextEncoder extends util.TextEncoder {} + var TextEncoder: typeof globalThis extends { onmessage: any; TextEncoder: infer T } ? T : typeof util.TextEncoder; +} diff --git a/node_modules/@types/node/web-globals/events.d.ts b/node_modules/@types/node/web-globals/events.d.ts index fbc1d49f..cdbcc690 100644 --- a/node_modules/@types/node/web-globals/events.d.ts +++ b/node_modules/@types/node/web-globals/events.d.ts @@ -1,5 +1,6 @@ export {}; +type _AddEventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : AddEventListenerOptions; interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; @@ -43,10 +44,12 @@ interface EventInit { composed?: boolean; } +type _EventListener = typeof globalThis extends { onmessage: any } ? {} : EventListener; interface EventListener { (evt: Event): void; } +type _EventListenerObject = typeof globalThis extends { onmessage: any } ? {} : EventListenerObject; interface EventListenerObject { handleEvent(object: Event): void; } @@ -72,6 +75,8 @@ interface EventTarget { } declare global { + interface AddEventListenerOptions extends _AddEventListenerOptions {} + interface CustomEvent extends _CustomEvent {} var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T : { @@ -86,6 +91,10 @@ declare global { new(type: string, eventInitDict?: EventInit): Event; }; + interface EventListener extends _EventListener {} + + interface EventListenerObject extends _EventListenerObject {} + interface EventListenerOptions extends _EventListenerOptions {} interface EventTarget extends _EventTarget {} diff --git a/node_modules/@types/node/web-globals/fetch.d.ts b/node_modules/@types/node/web-globals/fetch.d.ts index 995cd723..804d2e55 100644 --- a/node_modules/@types/node/web-globals/fetch.d.ts +++ b/node_modules/@types/node/web-globals/fetch.d.ts @@ -3,6 +3,7 @@ export {}; import * as undici from "undici-types"; type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEvent; +type _ErrorEvent = typeof globalThis extends { onmessage: any } ? {} : undici.ErrorEvent; type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource; type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData; type _Headers = typeof globalThis extends { onmessage: any } ? {} : undici.Headers; @@ -22,6 +23,9 @@ declare global { interface CloseEvent extends _CloseEvent {} var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T : typeof undici.CloseEvent; + interface ErrorEvent extends _ErrorEvent {} + var ErrorEvent: typeof globalThis extends { onmessage: any; ErrorEvent: infer T } ? T : typeof undici.ErrorEvent; + interface EventSource extends _EventSource {} var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource; diff --git a/node_modules/@types/node/web-globals/importmeta.d.ts b/node_modules/@types/node/web-globals/importmeta.d.ts new file mode 100644 index 00000000..33deba14 --- /dev/null +++ b/node_modules/@types/node/web-globals/importmeta.d.ts @@ -0,0 +1,13 @@ +export {}; + +import { URL } from "node:url"; + +declare global { + interface ImportMeta { + dirname: string; + filename: string; + main: boolean; + url: string; + resolve(specifier: string, parent?: string | URL): string; + } +} diff --git a/node_modules/@types/node/web-globals/messaging.d.ts b/node_modules/@types/node/web-globals/messaging.d.ts new file mode 100644 index 00000000..c914582b --- /dev/null +++ b/node_modules/@types/node/web-globals/messaging.d.ts @@ -0,0 +1,23 @@ +export {}; + +import * as worker_threads from "node:worker_threads"; + +type _BroadcastChannel = typeof globalThis extends { onmessage: any } ? {} : worker_threads.BroadcastChannel; +type _MessageChannel = typeof globalThis extends { onmessage: any } ? {} : worker_threads.MessageChannel; +type _MessagePort = typeof globalThis extends { onmessage: any } ? {} : worker_threads.MessagePort; + +declare global { + function structuredClone(value: T, options?: worker_threads.StructuredSerializeOptions): T; + + interface BroadcastChannel extends _BroadcastChannel {} + var BroadcastChannel: typeof globalThis extends { onmessage: any; BroadcastChannel: infer T } ? T + : typeof worker_threads.BroadcastChannel; + + interface MessageChannel extends _MessageChannel {} + var MessageChannel: typeof globalThis extends { onmessage: any; MessageChannel: infer T } ? T + : typeof worker_threads.MessageChannel; + + interface MessagePort extends _MessagePort {} + var MessagePort: typeof globalThis extends { onmessage: any; MessagePort: infer T } ? T + : typeof worker_threads.MessagePort; +} diff --git a/node_modules/@types/node/web-globals/performance.d.ts b/node_modules/@types/node/web-globals/performance.d.ts new file mode 100644 index 00000000..b8f4e627 --- /dev/null +++ b/node_modules/@types/node/web-globals/performance.d.ts @@ -0,0 +1,45 @@ +export {}; + +import * as perf_hooks from "node:perf_hooks"; + +type _Performance = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.Performance; +type _PerformanceEntry = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceEntry; +type _PerformanceMark = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMark; +type _PerformanceMeasure = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMeasure; +type _PerformanceObserver = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceObserver; +type _PerformanceObserverEntryList = typeof globalThis extends { onmessage: any } ? {} + : perf_hooks.PerformanceObserverEntryList; +type _PerformanceResourceTiming = typeof globalThis extends { onmessage: any } ? {} + : perf_hooks.PerformanceResourceTiming; + +declare global { + interface Performance extends _Performance {} + var Performance: typeof globalThis extends { onmessage: any; Performance: infer T } ? T + : typeof perf_hooks.Performance; + + interface PerformanceEntry extends _PerformanceEntry {} + var PerformanceEntry: typeof globalThis extends { onmessage: any; PerformanceEntry: infer T } ? T + : typeof perf_hooks.PerformanceEntry; + + interface PerformanceMark extends _PerformanceMark {} + var PerformanceMark: typeof globalThis extends { onmessage: any; PerformanceMark: infer T } ? T + : typeof perf_hooks.PerformanceMark; + + interface PerformanceMeasure extends _PerformanceMeasure {} + var PerformanceMeasure: typeof globalThis extends { onmessage: any; PerformanceMeasure: infer T } ? T + : typeof perf_hooks.PerformanceMeasure; + + interface PerformanceObserver extends _PerformanceObserver {} + var PerformanceObserver: typeof globalThis extends { onmessage: any; PerformanceObserver: infer T } ? T + : typeof perf_hooks.PerformanceObserver; + + interface PerformanceObserverEntryList extends _PerformanceObserverEntryList {} + var PerformanceObserverEntryList: typeof globalThis extends + { onmessage: any; PerformanceObserverEntryList: infer T } ? T : typeof perf_hooks.PerformanceObserverEntryList; + + interface PerformanceResourceTiming extends _PerformanceResourceTiming {} + var PerformanceResourceTiming: typeof globalThis extends { onmessage: any; PerformanceResourceTiming: infer T } ? T + : typeof perf_hooks.PerformanceResourceTiming; + + var performance: typeof globalThis extends { onmessage: any; performance: infer T } ? T : perf_hooks.Performance; +} diff --git a/node_modules/@types/node/web-globals/streams.d.ts b/node_modules/@types/node/web-globals/streams.d.ts index a70dde56..9650ea8e 100644 --- a/node_modules/@types/node/web-globals/streams.d.ts +++ b/node_modules/@types/node/web-globals/streams.d.ts @@ -2,10 +2,40 @@ export {}; import * as webstreams from "stream/web"; +type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ByteLengthQueuingStrategy; type _CompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.CompressionStream; +type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} : webstreams.CountQueuingStrategy; type _DecompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.DecompressionStream; +type _QueuingStrategy = typeof globalThis extends { onmessage: any } ? {} : webstreams.QueuingStrategy; +type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableByteStreamController; +type _ReadableStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.ReadableStream; +type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableStreamBYOBReader; +type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableStreamBYOBRequest; +type _ReadableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableStreamDefaultController; +type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableStreamDefaultReader; +type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextDecoderStream; +type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextEncoderStream; +type _TransformStream = typeof globalThis extends { onmessage: any } ? {} + : webstreams.TransformStream; +type _TransformStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} + : webstreams.TransformStreamDefaultController; +type _WritableStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.WritableStream; +type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} + : webstreams.WritableStreamDefaultController; +type _WritableStreamDefaultWriter = typeof globalThis extends { onmessage: any } ? {} + : webstreams.WritableStreamDefaultWriter; declare global { + interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {} + var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T } ? T + : typeof webstreams.ByteLengthQueuingStrategy; + interface CompressionStream extends _CompressionStream {} var CompressionStream: typeof globalThis extends { onmessage: any; @@ -13,10 +43,73 @@ declare global { } ? T : typeof webstreams.CompressionStream; + interface CountQueuingStrategy extends _CountQueuingStrategy {} + var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T + : typeof webstreams.CountQueuingStrategy; + interface DecompressionStream extends _DecompressionStream {} var DecompressionStream: typeof globalThis extends { onmessage: any; DecompressionStream: infer T; } ? T : typeof webstreams.DecompressionStream; + + interface QueuingStrategy extends _QueuingStrategy {} + + interface ReadableByteStreamController extends _ReadableByteStreamController {} + var ReadableByteStreamController: typeof globalThis extends + { onmessage: any; ReadableByteStreamController: infer T } ? T : typeof webstreams.ReadableByteStreamController; + + interface ReadableStream extends _ReadableStream {} + var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T + : typeof webstreams.ReadableStream; + + interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {} + var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } ? T + : typeof webstreams.ReadableStreamBYOBReader; + + interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {} + var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } ? T + : typeof webstreams.ReadableStreamBYOBRequest; + + interface ReadableStreamDefaultController extends _ReadableStreamDefaultController {} + var ReadableStreamDefaultController: typeof globalThis extends + { onmessage: any; ReadableStreamDefaultController: infer T } ? T + : typeof webstreams.ReadableStreamDefaultController; + + interface ReadableStreamDefaultReader extends _ReadableStreamDefaultReader {} + var ReadableStreamDefaultReader: typeof globalThis extends { onmessage: any; ReadableStreamDefaultReader: infer T } + ? T + : typeof webstreams.ReadableStreamDefaultReader; + + interface TextDecoderStream extends _TextDecoderStream {} + var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T + : typeof webstreams.TextDecoderStream; + + interface TextEncoderStream extends _TextEncoderStream {} + var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T + : typeof webstreams.TextEncoderStream; + + interface TransformStream extends _TransformStream {} + var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T + : typeof webstreams.TransformStream; + + interface TransformStreamDefaultController extends _TransformStreamDefaultController {} + var TransformStreamDefaultController: typeof globalThis extends + { onmessage: any; TransformStreamDefaultController: infer T } ? T + : typeof webstreams.TransformStreamDefaultController; + + interface WritableStream extends _WritableStream {} + var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T + : typeof webstreams.WritableStream; + + interface WritableStreamDefaultController extends _WritableStreamDefaultController {} + var WritableStreamDefaultController: typeof globalThis extends + { onmessage: any; WritableStreamDefaultController: infer T } ? T + : typeof webstreams.WritableStreamDefaultController; + + interface WritableStreamDefaultWriter extends _WritableStreamDefaultWriter {} + var WritableStreamDefaultWriter: typeof globalThis extends { onmessage: any; WritableStreamDefaultWriter: infer T } + ? T + : typeof webstreams.WritableStreamDefaultWriter; } diff --git a/node_modules/@types/node/web-globals/timers.d.ts b/node_modules/@types/node/web-globals/timers.d.ts new file mode 100644 index 00000000..9f84a3e9 --- /dev/null +++ b/node_modules/@types/node/web-globals/timers.d.ts @@ -0,0 +1,44 @@ +export {}; + +import * as promises from "node:timers/promises"; + +// Note: The timer function definitions allow a single void-accepting argument +// to be optional in arguments lists. This allows usage such as +// `new Promise(resolve => setTimeout(resolve, ms))` (#54258) +// eslint-disable-next-line @typescript-eslint/no-invalid-void-type +type MakeVoidParameterOptional = [void] extends TArgs ? Partial : TArgs; + +declare global { + function setImmediate( + callback: (...args: TArgs) => void, + ...args: MakeVoidParameterOptional + ): NodeJS.Immediate; + namespace setImmediate { + import __promisify__ = promises.setImmediate; + export { __promisify__ }; + } + + function setInterval( + callback: (...args: TArgs) => void, + delay?: number, + ...args: MakeVoidParameterOptional + ): NodeJS.Timeout; + + function setTimeout( + callback: (...args: TArgs) => void, + delay?: number, + ...args: MakeVoidParameterOptional + ): NodeJS.Timeout; + namespace setTimeout { + import __promisify__ = promises.setTimeout; + export { __promisify__ }; + } + + function clearImmediate(immediate: NodeJS.Immediate | undefined): void; + + function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void; + + function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void; + + function queueMicrotask(callback: () => void): void; +} diff --git a/node_modules/@types/node/web-globals/url.d.ts b/node_modules/@types/node/web-globals/url.d.ts new file mode 100644 index 00000000..d30208ba --- /dev/null +++ b/node_modules/@types/node/web-globals/url.d.ts @@ -0,0 +1,24 @@ +export {}; + +import * as url from "node:url"; + +declare global { + interface URL extends url.URL {} + var URL: typeof globalThis extends { onmessage: any; URL: infer T } ? T : typeof url.URL; + + interface URLPattern extends url.URLPattern {} + var URLPattern: typeof globalThis extends { + onmessage: any; + scheduler: any; // Must be a var introduced at the same time as URLPattern. + URLPattern: infer T; + } ? T + : typeof url.URLPattern; + + interface URLPatternInit extends url.URLPatternInit {} + + interface URLPatternResult extends url.URLPatternResult {} + + interface URLSearchParams extends url.URLSearchParams {} + var URLSearchParams: typeof globalThis extends { onmessage: any; URLSearchParams: infer T } ? T + : typeof url.URLSearchParams; +} diff --git a/node_modules/@types/node/worker_threads.d.ts b/node_modules/@types/node/worker_threads.d.ts index cc947c04..bd96f068 100644 --- a/node_modules/@types/node/worker_threads.d.ts +++ b/node_modules/@types/node/worker_threads.d.ts @@ -52,17 +52,22 @@ * * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options, * specifically `argv` and `execArgv` options. - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/worker_threads.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/worker_threads.js) */ -declare module "worker_threads" { - import { Context } from "node:vm"; - import { EventEmitter, NodeEventTarget } from "node:events"; - import { EventLoopUtilityFunction } from "node:perf_hooks"; +declare module "node:worker_threads" { + import { + EventEmitter, + InternalEventEmitter, + InternalEventTargetEventProperties, + NodeEventTarget, + } from "node:events"; import { FileHandle } from "node:fs/promises"; + import { Performance } from "node:perf_hooks"; import { Readable, Writable } from "node:stream"; import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; import { URL } from "node:url"; import { CPUProfileHandle, HeapInfo, HeapProfileHandle } from "node:v8"; + import { Context } from "node:vm"; import { MessageEvent } from "undici-types"; const isInternalThread: boolean; const isMainThread: boolean; @@ -72,186 +77,10 @@ declare module "worker_threads" { const threadId: number; const threadName: string | null; const workerData: any; - /** - * Instances of the `worker.MessageChannel` class represent an asynchronous, - * two-way communications channel. - * The `MessageChannel` has no methods of its own. `new MessageChannel()` yields an object with `port1` and `port2` properties, which refer to linked `MessagePort` instances. - * - * ```js - * import { MessageChannel } from 'node:worker_threads'; - * - * const { port1, port2 } = new MessageChannel(); - * port1.on('message', (message) => console.log('received', message)); - * port2.postMessage({ foo: 'bar' }); - * // Prints: received { foo: 'bar' } from the `port1.on('message')` listener - * ``` - * @since v10.5.0 - */ - class MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; - } - interface WorkerPerformance { - eventLoopUtilization: EventLoopUtilityFunction; - } - type Transferable = - | ArrayBuffer - | MessagePort - | AbortSignal - | FileHandle - | ReadableStream - | WritableStream - | TransformStream; + interface WorkerPerformance extends Pick {} /** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */ // TODO: remove in a future major @types/node version. type TransferListItem = Transferable; - /** - * Instances of the `worker.MessagePort` class represent one end of an - * asynchronous, two-way communications channel. It can be used to transfer - * structured data, memory regions and other `MessagePort`s between different `Worker`s. - * - * This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s. - * @since v10.5.0 - */ - class MessagePort implements EventTarget { - /** - * Disables further sending of messages on either side of the connection. - * This method can be called when no further communication will happen over this `MessagePort`. - * - * The `'close' event` is emitted on both `MessagePort` instances that - * are part of the channel. - * @since v10.5.0 - */ - close(): void; - /** - * Sends a JavaScript value to the receiving side of this channel. `value` is transferred in a way which is compatible with - * the [HTML structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). - * - * In particular, the significant differences to `JSON` are: - * - * * `value` may contain circular references. - * * `value` may contain instances of builtin JS types such as `RegExp`s, `BigInt`s, `Map`s, `Set`s, etc. - * * `value` may contain typed arrays, both using `ArrayBuffer`s - * and `SharedArrayBuffer`s. - * * `value` may contain [`WebAssembly.Module`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) instances. - * * `value` may not contain native (C++-backed) objects other than: - * - * ```js - * import { MessageChannel } from 'node:worker_threads'; - * const { port1, port2 } = new MessageChannel(); - * - * port1.on('message', (message) => console.log(message)); - * - * const circularData = {}; - * circularData.foo = circularData; - * // Prints: { foo: [Circular] } - * port2.postMessage(circularData); - * ``` - * - * `transferList` may be a list of [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), `MessagePort`, and `FileHandle` objects. - * After transferring, they are not usable on the sending side of the channel - * anymore (even if they are not contained in `value`). Unlike with `child processes`, transferring handles such as network sockets is currently - * not supported. - * - * If `value` contains [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances, those are accessible - * from either thread. They cannot be listed in `transferList`. - * - * `value` may still contain `ArrayBuffer` instances that are not in `transferList`; in that case, the underlying memory is copied rather than moved. - * - * ```js - * import { MessageChannel } from 'node:worker_threads'; - * const { port1, port2 } = new MessageChannel(); - * - * port1.on('message', (message) => console.log(message)); - * - * const uint8Array = new Uint8Array([ 1, 2, 3, 4 ]); - * // This posts a copy of `uint8Array`: - * port2.postMessage(uint8Array); - * // This does not copy data, but renders `uint8Array` unusable: - * port2.postMessage(uint8Array, [ uint8Array.buffer ]); - * - * // The memory for the `sharedUint8Array` is accessible from both the - * // original and the copy received by `.on('message')`: - * const sharedUint8Array = new Uint8Array(new SharedArrayBuffer(4)); - * port2.postMessage(sharedUint8Array); - * - * // This transfers a freshly created message port to the receiver. - * // This can be used, for example, to create communication channels between - * // multiple `Worker` threads that are children of the same parent thread. - * const otherChannel = new MessageChannel(); - * port2.postMessage({ port: otherChannel.port1 }, [ otherChannel.port1 ]); - * ``` - * - * The message object is cloned immediately, and can be modified after - * posting without having side effects. - * - * For more information on the serialization and deserialization mechanisms - * behind this API, see the `serialization API of the node:v8 module`. - * @since v10.5.0 - */ - postMessage(value: any, transferList?: readonly Transferable[]): void; - /** - * If true, the `MessagePort` object will keep the Node.js event loop active. - * @since v18.1.0, v16.17.0 - */ - hasRef(): boolean; - /** - * Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default - * behavior). If the port is `ref()`ed, calling `ref()` again has no effect. - * - * If listeners are attached or removed using `.on('message')`, the port - * is `ref()`ed and `unref()`ed automatically depending on whether - * listeners for the event exist. - * @since v10.5.0 - */ - ref(): void; - /** - * Calling `unref()` on a port allows the thread to exit if this is the only - * active handle in the event system. If the port is already `unref()`ed calling `unref()` again has no effect. - * - * If listeners are attached or removed using `.on('message')`, the port is `ref()`ed and `unref()`ed automatically depending on whether - * listeners for the event exist. - * @since v10.5.0 - */ - unref(): void; - /** - * Starts receiving messages on this `MessagePort`. When using this port - * as an event emitter, this is called automatically once `'message'` listeners are attached. - * - * This method exists for parity with the Web `MessagePort` API. In Node.js, - * it is only useful for ignoring messages when no event listener is present. - * Node.js also diverges in its handling of `.onmessage`. Setting it - * automatically calls `.start()`, but unsetting it lets messages queue up - * until a new handler is set or the port is discarded. - * @since v10.5.0 - */ - start(): void; - addListener(event: "close", listener: (ev: Event) => void): this; - addListener(event: "message", listener: (value: any) => void): this; - addListener(event: "messageerror", listener: (error: Error) => void): this; - addListener(event: string, listener: (arg: any) => void): this; - emit(event: "close", ev: Event): boolean; - emit(event: "message", value: any): boolean; - emit(event: "messageerror", error: Error): boolean; - emit(event: string, arg: any): boolean; - off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this; - off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this; - off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this; - off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - on(event: "close", listener: (ev: Event) => void): this; - on(event: "message", listener: (value: any) => void): this; - on(event: "messageerror", listener: (error: Error) => void): this; - on(event: string, listener: (arg: any) => void): this; - once(event: "close", listener: (ev: Event) => void): this; - once(event: "message", listener: (value: any) => void): this; - once(event: "messageerror", listener: (error: Error) => void): this; - once(event: string, listener: (arg: any) => void): this; - removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this; - removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this; - removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this; - removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - } - interface MessagePort extends NodeEventTarget {} interface WorkerOptions { /** * List of arguments which would be stringified and appended to @@ -302,6 +131,13 @@ declare module "worker_threads" { */ stackSizeMb?: number | undefined; } + interface WorkerEventMap { + "error": [err: unknown]; + "exit": [exitCode: number]; + "message": [value: any]; + "messageerror": [error: Error]; + "online": []; + } /** * The `Worker` class represents an independent JavaScript execution thread. * Most Node.js APIs are available inside of it. @@ -366,7 +202,7 @@ declare module "worker_threads" { * ``` * @since v10.5.0 */ - class Worker extends EventEmitter { + class Worker implements EventEmitter { /** * If `stdin: true` was passed to the `Worker` constructor, this is a * writable stream. The data written to this stream will be made available in @@ -556,139 +392,8 @@ declare module "worker_threads" { * @since v24.2.0 */ [Symbol.asyncDispose](): Promise; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (exitCode: number) => void): this; - addListener(event: "message", listener: (value: any) => void): this; - addListener(event: "messageerror", listener: (error: Error) => void): this; - addListener(event: "online", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "error", err: Error): boolean; - emit(event: "exit", exitCode: number): boolean; - emit(event: "message", value: any): boolean; - emit(event: "messageerror", error: Error): boolean; - emit(event: "online"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (exitCode: number) => void): this; - on(event: "message", listener: (value: any) => void): this; - on(event: "messageerror", listener: (error: Error) => void): this; - on(event: "online", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (exitCode: number) => void): this; - once(event: "message", listener: (value: any) => void): this; - once(event: "messageerror", listener: (error: Error) => void): this; - once(event: "online", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (exitCode: number) => void): this; - prependListener(event: "message", listener: (value: any) => void): this; - prependListener(event: "messageerror", listener: (error: Error) => void): this; - prependListener(event: "online", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "exit", listener: (exitCode: number) => void): this; - prependOnceListener(event: "message", listener: (value: any) => void): this; - prependOnceListener(event: "messageerror", listener: (error: Error) => void): this; - prependOnceListener(event: "online", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "exit", listener: (exitCode: number) => void): this; - removeListener(event: "message", listener: (value: any) => void): this; - removeListener(event: "messageerror", listener: (error: Error) => void): this; - removeListener(event: "online", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - off(event: "error", listener: (err: Error) => void): this; - off(event: "exit", listener: (exitCode: number) => void): this; - off(event: "message", listener: (value: any) => void): this; - off(event: "messageerror", listener: (error: Error) => void): this; - off(event: "online", listener: () => void): this; - off(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface BroadcastChannel extends NodeJS.RefCounted {} - /** - * Instances of `BroadcastChannel` allow asynchronous one-to-many communication - * with all other `BroadcastChannel` instances bound to the same channel name. - * - * ```js - * 'use strict'; - * - * import { - * isMainThread, - * BroadcastChannel, - * Worker, - * } from 'node:worker_threads'; - * - * const bc = new BroadcastChannel('hello'); - * - * if (isMainThread) { - * let c = 0; - * bc.onmessage = (event) => { - * console.log(event.data); - * if (++c === 10) bc.close(); - * }; - * for (let n = 0; n < 10; n++) - * new Worker(__filename); - * } else { - * bc.postMessage('hello from every worker'); - * bc.close(); - * } - * ``` - * @since v15.4.0 - */ - class BroadcastChannel extends EventTarget { - readonly name: string; - /** - * Invoked with a single \`MessageEvent\` argument when a message is received. - * @since v15.4.0 - */ - onmessage: (message: MessageEvent) => void; - /** - * Invoked with a received message cannot be deserialized. - * @since v15.4.0 - */ - onmessageerror: (message: MessageEvent) => void; - constructor(name: string); - /** - * Closes the `BroadcastChannel` connection. - * @since v15.4.0 - */ - close(): void; - /** - * @since v15.4.0 - * @param message Any cloneable JavaScript value. - */ - postMessage(message: unknown): void; - } - interface Lock { - readonly mode: LockMode; - readonly name: string; } - interface LockGrantedCallback { - (lock: Lock | null): T; - } - interface LockInfo { - clientId: string; - mode: LockMode; - name: string; - } - interface LockManager { - query(): Promise; - request(name: string, callback: LockGrantedCallback): Promise>; - request(name: string, options: LockOptions, callback: LockGrantedCallback): Promise>; - } - interface LockManagerSnapshot { - held: LockInfo[]; - pending: LockInfo[]; - } - type LockMode = "exclusive" | "shared"; - interface LockOptions { - ifAvailable?: boolean; - mode?: LockMode; - signal?: AbortSignal; - steal?: boolean; - } - var locks: LockManager; + interface Worker extends InternalEventEmitter {} /** * Mark an object as not transferable. If `object` occurs in the transfer list of * a `port.postMessage()` call, it is ignored. @@ -848,49 +553,162 @@ declare module "worker_threads" { transferList: readonly Transferable[], timeout?: number, ): Promise; - - import { - BroadcastChannel as _BroadcastChannel, - MessageChannel as _MessageChannel, - MessagePort as _MessagePort, - } from "worker_threads"; - global { - function structuredClone( - value: T, - options?: { transfer?: Transferable[] }, - ): T; - /** - * `BroadcastChannel` class is a global reference for `import { BroadcastChannel } from 'worker_threads'` - * https://nodejs.org/api/globals.html#broadcastchannel - * @since v18.0.0 - */ - var BroadcastChannel: typeof globalThis extends { - onmessage: any; - BroadcastChannel: infer T; - } ? T - : typeof _BroadcastChannel; - /** - * `MessageChannel` class is a global reference for `import { MessageChannel } from 'worker_threads'` - * https://nodejs.org/api/globals.html#messagechannel - * @since v15.0.0 - */ - var MessageChannel: typeof globalThis extends { - onmessage: any; - MessageChannel: infer T; - } ? T - : typeof _MessageChannel; - /** - * `MessagePort` class is a global reference for `import { MessagePort } from 'worker_threads'` - * https://nodejs.org/api/globals.html#messageport - * @since v15.0.0 - */ - var MessagePort: typeof globalThis extends { - onmessage: any; - MessagePort: infer T; - } ? T - : typeof _MessagePort; + // #region web types + type LockMode = "exclusive" | "shared"; + type Transferable = + | ArrayBuffer + | MessagePort + | AbortSignal + | FileHandle + | ReadableStream + | WritableStream + | TransformStream; + interface LockGrantedCallback { + (lock: Lock | null): T; + } + interface LockInfo { + clientId: string; + mode: LockMode; + name: string; + } + interface LockManagerSnapshot { + held: LockInfo[]; + pending: LockInfo[]; + } + interface LockOptions { + ifAvailable?: boolean; + mode?: LockMode; + signal?: AbortSignal; + steal?: boolean; + } + interface StructuredSerializeOptions { + transfer?: Transferable[]; + } + interface BroadcastChannelEventMap { + "message": MessageEvent; + "messageerror": MessageEvent; + } + interface BroadcastChannel + extends EventTarget, InternalEventTargetEventProperties, NodeJS.RefCounted + { + readonly name: string; + close(): void; + postMessage(message: any): void; + addEventListener( + type: K, + listener: (ev: BroadcastChannelEventMap[K]) => void, + options?: AddEventListenerOptions | boolean, + ): void; + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + removeEventListener( + type: K, + listener: (ev: BroadcastChannelEventMap[K]) => void, + options?: EventListenerOptions | boolean, + ): void; + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; + } + var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; + }; + interface Lock { + readonly mode: LockMode; + readonly name: string; + } + // var Lock: { + // prototype: Lock; + // new(): Lock; + // }; + interface LockManager { + query(): Promise; + request(name: string, callback: LockGrantedCallback): Promise>; + request(name: string, options: LockOptions, callback: LockGrantedCallback): Promise>; + } + // var LockManager: { + // prototype: LockManager; + // new(): LockManager; + // }; + interface MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; + } + var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; + }; + interface MessagePortEventMap { + "close": Event; + "message": MessageEvent; + "messageerror": MessageEvent; } + interface MessagePort extends NodeEventTarget, InternalEventTargetEventProperties { + close(): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: StructuredSerializeOptions): void; + start(): void; + addEventListener( + type: K, + listener: (ev: MessagePortEventMap[K]) => void, + options?: AddEventListenerOptions | boolean, + ): void; + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + removeEventListener( + type: K, + listener: (ev: MessagePortEventMap[K]) => void, + options?: EventListenerOptions | boolean, + ): void; + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; + // #region NodeEventTarget + addListener(event: "close", listener: (ev: Event) => void): this; + addListener(event: "message", listener: (value: any) => void): this; + addListener(event: "messageerror", listener: (error: Error) => void): this; + addListener(event: string, listener: (arg: any) => void): this; + emit(event: "close", ev: Event): boolean; + emit(event: "message", value: any): boolean; + emit(event: "messageerror", error: Error): boolean; + emit(event: string, arg: any): boolean; + off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this; + off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this; + off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this; + off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + on(event: "close", listener: (ev: Event) => void): this; + on(event: "message", listener: (value: any) => void): this; + on(event: "messageerror", listener: (error: Error) => void): this; + on(event: string, listener: (arg: any) => void): this; + once(event: "close", listener: (ev: Event) => void): this; + once(event: "message", listener: (value: any) => void): this; + once(event: "messageerror", listener: (error: Error) => void): this; + once(event: string, listener: (arg: any) => void): this; + removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this; + removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this; + removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this; + removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this; + // #endregion + } + var MessagePort: { + prototype: MessagePort; + new(): MessagePort; + }; + var locks: LockManager; + export import structuredClone = globalThis.structuredClone; + // #endregion } -declare module "node:worker_threads" { - export * from "worker_threads"; +declare module "worker_threads" { + export * from "node:worker_threads"; } diff --git a/node_modules/@types/node/zlib.d.ts b/node_modules/@types/node/zlib.d.ts index 10f0e60e..51f1a229 100644 --- a/node_modules/@types/node/zlib.d.ts +++ b/node_modules/@types/node/zlib.d.ts @@ -9,7 +9,7 @@ * ``` * * Compression and decompression are built around the Node.js - * [Streams API](https://nodejs.org/docs/latest-v24.x/api/stream.html). + * [Streams API](https://nodejs.org/docs/latest-v25.x/api/stream.html). * * Compressing or decompressing a stream (such as a file) can be accomplished by * piping the source stream through a `zlib` `Transform` stream into a destination @@ -89,9 +89,9 @@ * }); * ``` * @since v0.5.8 - * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/zlib.js) + * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/zlib.js) */ -declare module "zlib" { +declare module "node:zlib" { import { NonSharedBuffer } from "node:buffer"; import * as stream from "node:stream"; interface ZlibOptions { @@ -144,7 +144,7 @@ declare module "zlib" { } | undefined; /** - * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods). + * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v25.x/api/zlib.html#convenience-methods). * @default buffer.kMaxLength */ maxOutputLength?: number | undefined; @@ -168,12 +168,12 @@ declare module "zlib" { chunkSize?: number | undefined; /** * Key-value object containing indexed - * [Zstd parameters](https://nodejs.org/docs/latest-v24.x/api/zlib.html#zstd-constants). + * [Zstd parameters](https://nodejs.org/docs/latest-v25.x/api/zlib.html#zstd-constants). */ params?: { [key: number]: number | boolean } | undefined; /** * Limits output size when using - * [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods). + * [convenience methods](https://nodejs.org/docs/latest-v25.x/api/zlib.html#convenience-methods). * @default buffer.kMaxLength */ maxOutputLength?: number | undefined; @@ -612,70 +612,7 @@ declare module "zlib" { const Z_SYNC_FLUSH: number; const Z_VERSION_ERROR: number; } - // Allowed flush values. - /** @deprecated Use `constants.Z_NO_FLUSH` */ - const Z_NO_FLUSH: number; - /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */ - const Z_PARTIAL_FLUSH: number; - /** @deprecated Use `constants.Z_SYNC_FLUSH` */ - const Z_SYNC_FLUSH: number; - /** @deprecated Use `constants.Z_FULL_FLUSH` */ - const Z_FULL_FLUSH: number; - /** @deprecated Use `constants.Z_FINISH` */ - const Z_FINISH: number; - /** @deprecated Use `constants.Z_BLOCK` */ - const Z_BLOCK: number; - // Return codes for the compression/decompression functions. - // Negative values are errors, positive values are used for special but normal events. - /** @deprecated Use `constants.Z_OK` */ - const Z_OK: number; - /** @deprecated Use `constants.Z_STREAM_END` */ - const Z_STREAM_END: number; - /** @deprecated Use `constants.Z_NEED_DICT` */ - const Z_NEED_DICT: number; - /** @deprecated Use `constants.Z_ERRNO` */ - const Z_ERRNO: number; - /** @deprecated Use `constants.Z_STREAM_ERROR` */ - const Z_STREAM_ERROR: number; - /** @deprecated Use `constants.Z_DATA_ERROR` */ - const Z_DATA_ERROR: number; - /** @deprecated Use `constants.Z_MEM_ERROR` */ - const Z_MEM_ERROR: number; - /** @deprecated Use `constants.Z_BUF_ERROR` */ - const Z_BUF_ERROR: number; - /** @deprecated Use `constants.Z_VERSION_ERROR` */ - const Z_VERSION_ERROR: number; - // Compression levels. - /** @deprecated Use `constants.Z_NO_COMPRESSION` */ - const Z_NO_COMPRESSION: number; - /** @deprecated Use `constants.Z_BEST_SPEED` */ - const Z_BEST_SPEED: number; - /** @deprecated Use `constants.Z_BEST_COMPRESSION` */ - const Z_BEST_COMPRESSION: number; - /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */ - const Z_DEFAULT_COMPRESSION: number; - // Compression strategy. - /** @deprecated Use `constants.Z_FILTERED` */ - const Z_FILTERED: number; - /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */ - const Z_HUFFMAN_ONLY: number; - /** @deprecated Use `constants.Z_RLE` */ - const Z_RLE: number; - /** @deprecated Use `constants.Z_FIXED` */ - const Z_FIXED: number; - /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */ - const Z_DEFAULT_STRATEGY: number; - /** @deprecated */ - const Z_BINARY: number; - /** @deprecated */ - const Z_TEXT: number; - /** @deprecated */ - const Z_ASCII: number; - /** @deprecated */ - const Z_UNKNOWN: number; - /** @deprecated */ - const Z_DEFLATED: number; } -declare module "node:zlib" { - export * from "zlib"; +declare module "zlib" { + export * from "node:zlib"; } diff --git a/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml b/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml new file mode 100644 index 00000000..73cf8d65 --- /dev/null +++ b/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: build + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test + - run: npm run coverage --if-present + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/@ungap/structured-clone/LICENSE b/node_modules/@ungap/structured-clone/LICENSE new file mode 100644 index 00000000..48afbe52 --- /dev/null +++ b/node_modules/@ungap/structured-clone/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021, Andrea Giammarchi, @WebReflection + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@ungap/structured-clone/README.md b/node_modules/@ungap/structured-clone/README.md new file mode 100644 index 00000000..07d15a25 --- /dev/null +++ b/node_modules/@ungap/structured-clone/README.md @@ -0,0 +1,95 @@ +# structuredClone polyfill + +[![Downloads](https://img.shields.io/npm/dm/@ungap/structured-clone.svg)](https://www.npmjs.com/package/@ungap/structured-clone) [![build status](https://github.com/ungap/structured-clone/actions/workflows/node.js.yml/badge.svg)](https://github.com/ungap/structured-clone/actions) [![Coverage Status](https://coveralls.io/repos/github/ungap/structured-clone/badge.svg?branch=main)](https://coveralls.io/github/ungap/structured-clone?branch=main) + +An env agnostic serializer and deserializer with recursion ability and types beyond *JSON* from the *HTML* standard itself. + + * [Supported Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types) + * *not supported yet*: Blob, File, FileList, ImageBitmap, ImageData or others non *JS* types but typed arrays are supported without major issues, but u/int8, u/int16, and u/int32 are the only safely suppored (right now). + * *not possible to implement*: the `{transfer: []}` option can be passed but it's completely ignored. + * [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) + * [Serializer](https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal) + * [Deserializer](https://html.spec.whatwg.org/multipage/structured-data.html#structureddeserialize) + +Serialized values can be safely stringified as *JSON* too, and deserialization resurrect all values, even recursive, or more complex than what *JSON* allows. + + +### Examples + +Check the [100% test coverage](./test/index.js) to know even more. + +```js +// as default export +import structuredClone from '@ungap/structured-clone'; +const cloned = structuredClone({any: 'serializable'}); + +// as independent serializer/deserializer +import {serialize, deserialize} from '@ungap/structured-clone'; + +// the result can be stringified as JSON without issues +// even if there is recursive data, bigint values, +// typed arrays, and so on +const serialized = serialize({any: 'serializable'}); + +// the result will be a replica of the original object +const deserialized = deserialize(serialized); +``` + +#### Global Polyfill +Note: Only monkey patch the global if needed. This polyfill works just fine as an explicit import: `import structuredClone from "@ungap/structured-clone"` +```js +// Attach the polyfill as a Global function +import structuredClone from "@ungap/structured-clone"; +if (!("structuredClone" in globalThis)) { + globalThis.structuredClone = structuredClone; +} + +// Or don't monkey patch +import structuredClone from "@ungap/structured-clone" +// Just use it in the file +structuredClone() +``` + +**Note**: Do not attach this module's default export directly to the global scope, whithout a conditional guard to detect a native implementation. In environments where there is a native global implementation of `structuredClone()` already, assignment to the global object will result in an infinite loop when `globalThis.structuredClone()` is called. See the example above for a safe way to provide the polyfill globally in your project. + +### Extra Features + +There is no middle-ground between the structured clone algorithm and JSON: + + * JSON is more relaxed about incompatible values: it just ignores these + * Structured clone is inflexible regarding incompatible values, yet it makes specialized instances impossible to reconstruct, plus it doesn't offer any helper, such as `toJSON()`, to make serialization possible, or better, with specific cases + +This module specialized `serialize` export offers, within the optional extra argument, a **lossy** property to avoid throwing when incompatible types are found down the road (function, symbol, ...), so that it is possible to send with less worrying about thrown errors. + +```js +// as default export +import structuredClone from '@ungap/structured-clone'; +const cloned = structuredClone( + { + method() { + // ignored, won't be cloned + }, + special: Symbol('also ignored') + }, + { + // avoid throwing + lossy: true, + // avoid throwing *and* looks for toJSON + json: true + } +); +``` + +The behavior is the same found in *JSON* when it comes to *Array*, so that unsupported values will result as `null` placeholders instead. + +#### toJSON + +If `lossy` option is not enough, `json` will actually enforce `lossy` and also check for `toJSON` method when objects are parsed. + +Alternative, the `json` exports combines all features: + +```js +import {stringify, parse} from '@ungap/structured-clone/json'; + +parse(stringify({any: 'serializable'})); +``` diff --git a/node_modules/@ungap/structured-clone/cjs/deserialize.js b/node_modules/@ungap/structured-clone/cjs/deserialize.js new file mode 100644 index 00000000..331b4b63 --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/deserialize.js @@ -0,0 +1,84 @@ +'use strict'; +const { + VOID, PRIMITIVE, ARRAY, OBJECT, DATE, REGEXP, MAP, SET, ERROR, BIGINT +} = require('./types.js'); + +const env = typeof self === 'object' ? self : globalThis; + +const deserializer = ($, _) => { + const as = (out, index) => { + $.set(index, out); + return out; + }; + + const unpair = index => { + if ($.has(index)) + return $.get(index); + + const [type, value] = _[index]; + switch (type) { + case PRIMITIVE: + case VOID: + return as(value, index); + case ARRAY: { + const arr = as([], index); + for (const index of value) + arr.push(unpair(index)); + return arr; + } + case OBJECT: { + const object = as({}, index); + for (const [key, index] of value) + object[unpair(key)] = unpair(index); + return object; + } + case DATE: + return as(new Date(value), index); + case REGEXP: { + const {source, flags} = value; + return as(new RegExp(source, flags), index); + } + case MAP: { + const map = as(new Map, index); + for (const [key, index] of value) + map.set(unpair(key), unpair(index)); + return map; + } + case SET: { + const set = as(new Set, index); + for (const index of value) + set.add(unpair(index)); + return set; + } + case ERROR: { + const {name, message} = value; + return as(new env[name](message), index); + } + case BIGINT: + return as(BigInt(value), index); + case 'BigInt': + return as(Object(BigInt(value)), index); + case 'ArrayBuffer': + return as(new Uint8Array(value).buffer, value); + case 'DataView': { + const { buffer } = new Uint8Array(value); + return as(new DataView(buffer), value); + } + } + return as(new env[type](value), index); + }; + + return unpair; +}; + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns a deserialized value from a serialized array of Records. + * @param {Record[]} serialized a previously serialized value. + * @returns {any} + */ +const deserialize = serialized => deserializer(new Map, serialized)(0); +exports.deserialize = deserialize; diff --git a/node_modules/@ungap/structured-clone/cjs/index.js b/node_modules/@ungap/structured-clone/cjs/index.js new file mode 100644 index 00000000..13d747c5 --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/index.js @@ -0,0 +1,27 @@ +'use strict'; +const {deserialize} = require('./deserialize.js'); +const {serialize} = require('./serialize.js'); + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns an array of serialized Records. + * @param {any} any a serializable value. + * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with + * a transfer option (ignored when polyfilled) and/or non standard fields that + * fallback to the polyfill if present. + * @returns {Record[]} + */ +Object.defineProperty(exports, '__esModule', {value: true}).default = typeof structuredClone === "function" ? + /* c8 ignore start */ + (any, options) => ( + options && ('json' in options || 'lossy' in options) ? + deserialize(serialize(any, options)) : structuredClone(any) + ) : + (any, options) => deserialize(serialize(any, options)); + /* c8 ignore stop */ + +exports.deserialize = deserialize; +exports.serialize = serialize; diff --git a/node_modules/@ungap/structured-clone/cjs/json.js b/node_modules/@ungap/structured-clone/cjs/json.js new file mode 100644 index 00000000..0038dcf9 --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/json.js @@ -0,0 +1,24 @@ +'use strict'; +/*! (c) Andrea Giammarchi - ISC */ + +const {deserialize} = require('./deserialize.js'); +const {serialize} = require('./serialize.js'); + +const {parse: $parse, stringify: $stringify} = JSON; +const options = {json: true, lossy: true}; + +/** + * Revive a previously stringified structured clone. + * @param {string} str previously stringified data as string. + * @returns {any} whatever was previously stringified as clone. + */ +const parse = str => deserialize($parse(str)); +exports.parse = parse; + +/** + * Represent a structured clone value as string. + * @param {any} any some clone-able value to stringify. + * @returns {string} the value stringified. + */ +const stringify = any => $stringify(serialize(any, options)); +exports.stringify = stringify; diff --git a/node_modules/@ungap/structured-clone/cjs/package.json b/node_modules/@ungap/structured-clone/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/node_modules/@ungap/structured-clone/cjs/serialize.js b/node_modules/@ungap/structured-clone/cjs/serialize.js new file mode 100644 index 00000000..59b2d383 --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/serialize.js @@ -0,0 +1,170 @@ +'use strict'; +const { + VOID, PRIMITIVE, ARRAY, OBJECT, DATE, REGEXP, MAP, SET, ERROR, BIGINT +} = require('./types.js'); + +const EMPTY = ''; + +const {toString} = {}; +const {keys} = Object; + +const typeOf = value => { + const type = typeof value; + if (type !== 'object' || !value) + return [PRIMITIVE, type]; + + const asString = toString.call(value).slice(8, -1); + switch (asString) { + case 'Array': + return [ARRAY, EMPTY]; + case 'Object': + return [OBJECT, EMPTY]; + case 'Date': + return [DATE, EMPTY]; + case 'RegExp': + return [REGEXP, EMPTY]; + case 'Map': + return [MAP, EMPTY]; + case 'Set': + return [SET, EMPTY]; + case 'DataView': + return [ARRAY, asString]; + } + + if (asString.includes('Array')) + return [ARRAY, asString]; + + if (asString.includes('Error')) + return [ERROR, asString]; + + return [OBJECT, asString]; +}; + +const shouldSkip = ([TYPE, type]) => ( + TYPE === PRIMITIVE && + (type === 'function' || type === 'symbol') +); + +const serializer = (strict, json, $, _) => { + + const as = (out, value) => { + const index = _.push(out) - 1; + $.set(value, index); + return index; + }; + + const pair = value => { + if ($.has(value)) + return $.get(value); + + let [TYPE, type] = typeOf(value); + switch (TYPE) { + case PRIMITIVE: { + let entry = value; + switch (type) { + case 'bigint': + TYPE = BIGINT; + entry = value.toString(); + break; + case 'function': + case 'symbol': + if (strict) + throw new TypeError('unable to serialize ' + type); + entry = null; + break; + case 'undefined': + return as([VOID], value); + } + return as([TYPE, entry], value); + } + case ARRAY: { + if (type) { + let spread = value; + if (type === 'DataView') { + spread = new Uint8Array(value.buffer); + } + else if (type === 'ArrayBuffer') { + spread = new Uint8Array(value); + } + return as([type, [...spread]], value); + } + + const arr = []; + const index = as([TYPE, arr], value); + for (const entry of value) + arr.push(pair(entry)); + return index; + } + case OBJECT: { + if (type) { + switch (type) { + case 'BigInt': + return as([type, value.toString()], value); + case 'Boolean': + case 'Number': + case 'String': + return as([type, value.valueOf()], value); + } + } + + if (json && ('toJSON' in value)) + return pair(value.toJSON()); + + const entries = []; + const index = as([TYPE, entries], value); + for (const key of keys(value)) { + if (strict || !shouldSkip(typeOf(value[key]))) + entries.push([pair(key), pair(value[key])]); + } + return index; + } + case DATE: + return as([TYPE, value.toISOString()], value); + case REGEXP: { + const {source, flags} = value; + return as([TYPE, {source, flags}], value); + } + case MAP: { + const entries = []; + const index = as([TYPE, entries], value); + for (const [key, entry] of value) { + if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) + entries.push([pair(key), pair(entry)]); + } + return index; + } + case SET: { + const entries = []; + const index = as([TYPE, entries], value); + for (const entry of value) { + if (strict || !shouldSkip(typeOf(entry))) + entries.push(pair(entry)); + } + return index; + } + } + + const {message} = value; + return as([TYPE, {name: type, message}], value); + }; + + return pair; +}; + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns an array of serialized Records. + * @param {any} value a serializable value. + * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that, + * if `true`, will not throw errors on incompatible types, and behave more + * like JSON stringify would behave. Symbol and Function will be discarded. + * @returns {Record[]} + */ + const serialize = (value, {json, lossy} = {}) => { + const _ = []; + return serializer(!(json || lossy), !!json, new Map, _)(value), _; +}; +exports.serialize = serialize; diff --git a/node_modules/@ungap/structured-clone/cjs/types.js b/node_modules/@ungap/structured-clone/cjs/types.js new file mode 100644 index 00000000..8284be3d --- /dev/null +++ b/node_modules/@ungap/structured-clone/cjs/types.js @@ -0,0 +1,22 @@ +'use strict'; +const VOID = -1; +exports.VOID = VOID; +const PRIMITIVE = 0; +exports.PRIMITIVE = PRIMITIVE; +const ARRAY = 1; +exports.ARRAY = ARRAY; +const OBJECT = 2; +exports.OBJECT = OBJECT; +const DATE = 3; +exports.DATE = DATE; +const REGEXP = 4; +exports.REGEXP = REGEXP; +const MAP = 5; +exports.MAP = MAP; +const SET = 6; +exports.SET = SET; +const ERROR = 7; +exports.ERROR = ERROR; +const BIGINT = 8; +exports.BIGINT = BIGINT; +// export const SYMBOL = 9; diff --git a/node_modules/@ungap/structured-clone/esm/deserialize.js b/node_modules/@ungap/structured-clone/esm/deserialize.js new file mode 100644 index 00000000..2e73eeab --- /dev/null +++ b/node_modules/@ungap/structured-clone/esm/deserialize.js @@ -0,0 +1,85 @@ +import { + VOID, PRIMITIVE, + ARRAY, OBJECT, + DATE, REGEXP, MAP, SET, + ERROR, BIGINT +} from './types.js'; + +const env = typeof self === 'object' ? self : globalThis; + +const deserializer = ($, _) => { + const as = (out, index) => { + $.set(index, out); + return out; + }; + + const unpair = index => { + if ($.has(index)) + return $.get(index); + + const [type, value] = _[index]; + switch (type) { + case PRIMITIVE: + case VOID: + return as(value, index); + case ARRAY: { + const arr = as([], index); + for (const index of value) + arr.push(unpair(index)); + return arr; + } + case OBJECT: { + const object = as({}, index); + for (const [key, index] of value) + object[unpair(key)] = unpair(index); + return object; + } + case DATE: + return as(new Date(value), index); + case REGEXP: { + const {source, flags} = value; + return as(new RegExp(source, flags), index); + } + case MAP: { + const map = as(new Map, index); + for (const [key, index] of value) + map.set(unpair(key), unpair(index)); + return map; + } + case SET: { + const set = as(new Set, index); + for (const index of value) + set.add(unpair(index)); + return set; + } + case ERROR: { + const {name, message} = value; + return as(new env[name](message), index); + } + case BIGINT: + return as(BigInt(value), index); + case 'BigInt': + return as(Object(BigInt(value)), index); + case 'ArrayBuffer': + return as(new Uint8Array(value).buffer, value); + case 'DataView': { + const { buffer } = new Uint8Array(value); + return as(new DataView(buffer), value); + } + } + return as(new env[type](value), index); + }; + + return unpair; +}; + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns a deserialized value from a serialized array of Records. + * @param {Record[]} serialized a previously serialized value. + * @returns {any} + */ +export const deserialize = serialized => deserializer(new Map, serialized)(0); diff --git a/node_modules/@ungap/structured-clone/esm/index.js b/node_modules/@ungap/structured-clone/esm/index.js new file mode 100644 index 00000000..d3b47479 --- /dev/null +++ b/node_modules/@ungap/structured-clone/esm/index.js @@ -0,0 +1,25 @@ +import {deserialize} from './deserialize.js'; +import {serialize} from './serialize.js'; + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns an array of serialized Records. + * @param {any} any a serializable value. + * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with + * a transfer option (ignored when polyfilled) and/or non standard fields that + * fallback to the polyfill if present. + * @returns {Record[]} + */ +export default typeof structuredClone === "function" ? + /* c8 ignore start */ + (any, options) => ( + options && ('json' in options || 'lossy' in options) ? + deserialize(serialize(any, options)) : structuredClone(any) + ) : + (any, options) => deserialize(serialize(any, options)); + /* c8 ignore stop */ + +export {deserialize, serialize}; diff --git a/node_modules/@ungap/structured-clone/esm/json.js b/node_modules/@ungap/structured-clone/esm/json.js new file mode 100644 index 00000000..23eb9522 --- /dev/null +++ b/node_modules/@ungap/structured-clone/esm/json.js @@ -0,0 +1,21 @@ +/*! (c) Andrea Giammarchi - ISC */ + +import {deserialize} from './deserialize.js'; +import {serialize} from './serialize.js'; + +const {parse: $parse, stringify: $stringify} = JSON; +const options = {json: true, lossy: true}; + +/** + * Revive a previously stringified structured clone. + * @param {string} str previously stringified data as string. + * @returns {any} whatever was previously stringified as clone. + */ +export const parse = str => deserialize($parse(str)); + +/** + * Represent a structured clone value as string. + * @param {any} any some clone-able value to stringify. + * @returns {string} the value stringified. + */ +export const stringify = any => $stringify(serialize(any, options)); diff --git a/node_modules/@ungap/structured-clone/esm/serialize.js b/node_modules/@ungap/structured-clone/esm/serialize.js new file mode 100644 index 00000000..6286047a --- /dev/null +++ b/node_modules/@ungap/structured-clone/esm/serialize.js @@ -0,0 +1,171 @@ +import { + VOID, PRIMITIVE, + ARRAY, OBJECT, + DATE, REGEXP, MAP, SET, + ERROR, BIGINT +} from './types.js'; + +const EMPTY = ''; + +const {toString} = {}; +const {keys} = Object; + +const typeOf = value => { + const type = typeof value; + if (type !== 'object' || !value) + return [PRIMITIVE, type]; + + const asString = toString.call(value).slice(8, -1); + switch (asString) { + case 'Array': + return [ARRAY, EMPTY]; + case 'Object': + return [OBJECT, EMPTY]; + case 'Date': + return [DATE, EMPTY]; + case 'RegExp': + return [REGEXP, EMPTY]; + case 'Map': + return [MAP, EMPTY]; + case 'Set': + return [SET, EMPTY]; + case 'DataView': + return [ARRAY, asString]; + } + + if (asString.includes('Array')) + return [ARRAY, asString]; + + if (asString.includes('Error')) + return [ERROR, asString]; + + return [OBJECT, asString]; +}; + +const shouldSkip = ([TYPE, type]) => ( + TYPE === PRIMITIVE && + (type === 'function' || type === 'symbol') +); + +const serializer = (strict, json, $, _) => { + + const as = (out, value) => { + const index = _.push(out) - 1; + $.set(value, index); + return index; + }; + + const pair = value => { + if ($.has(value)) + return $.get(value); + + let [TYPE, type] = typeOf(value); + switch (TYPE) { + case PRIMITIVE: { + let entry = value; + switch (type) { + case 'bigint': + TYPE = BIGINT; + entry = value.toString(); + break; + case 'function': + case 'symbol': + if (strict) + throw new TypeError('unable to serialize ' + type); + entry = null; + break; + case 'undefined': + return as([VOID], value); + } + return as([TYPE, entry], value); + } + case ARRAY: { + if (type) { + let spread = value; + if (type === 'DataView') { + spread = new Uint8Array(value.buffer); + } + else if (type === 'ArrayBuffer') { + spread = new Uint8Array(value); + } + return as([type, [...spread]], value); + } + + const arr = []; + const index = as([TYPE, arr], value); + for (const entry of value) + arr.push(pair(entry)); + return index; + } + case OBJECT: { + if (type) { + switch (type) { + case 'BigInt': + return as([type, value.toString()], value); + case 'Boolean': + case 'Number': + case 'String': + return as([type, value.valueOf()], value); + } + } + + if (json && ('toJSON' in value)) + return pair(value.toJSON()); + + const entries = []; + const index = as([TYPE, entries], value); + for (const key of keys(value)) { + if (strict || !shouldSkip(typeOf(value[key]))) + entries.push([pair(key), pair(value[key])]); + } + return index; + } + case DATE: + return as([TYPE, value.toISOString()], value); + case REGEXP: { + const {source, flags} = value; + return as([TYPE, {source, flags}], value); + } + case MAP: { + const entries = []; + const index = as([TYPE, entries], value); + for (const [key, entry] of value) { + if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) + entries.push([pair(key), pair(entry)]); + } + return index; + } + case SET: { + const entries = []; + const index = as([TYPE, entries], value); + for (const entry of value) { + if (strict || !shouldSkip(typeOf(entry))) + entries.push(pair(entry)); + } + return index; + } + } + + const {message} = value; + return as([TYPE, {name: type, message}], value); + }; + + return pair; +}; + +/** + * @typedef {Array} Record a type representation + */ + +/** + * Returns an array of serialized Records. + * @param {any} value a serializable value. + * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that, + * if `true`, will not throw errors on incompatible types, and behave more + * like JSON stringify would behave. Symbol and Function will be discarded. + * @returns {Record[]} + */ + export const serialize = (value, {json, lossy} = {}) => { + const _ = []; + return serializer(!(json || lossy), !!json, new Map, _)(value), _; +}; diff --git a/node_modules/@ungap/structured-clone/esm/types.js b/node_modules/@ungap/structured-clone/esm/types.js new file mode 100644 index 00000000..50e60ca0 --- /dev/null +++ b/node_modules/@ungap/structured-clone/esm/types.js @@ -0,0 +1,11 @@ +export const VOID = -1; +export const PRIMITIVE = 0; +export const ARRAY = 1; +export const OBJECT = 2; +export const DATE = 3; +export const REGEXP = 4; +export const MAP = 5; +export const SET = 6; +export const ERROR = 7; +export const BIGINT = 8; +// export const SYMBOL = 9; diff --git a/node_modules/@ungap/structured-clone/package.json b/node_modules/@ungap/structured-clone/package.json new file mode 100644 index 00000000..d85636f1 --- /dev/null +++ b/node_modules/@ungap/structured-clone/package.json @@ -0,0 +1,54 @@ +{ + "name": "@ungap/structured-clone", + "version": "1.3.0", + "description": "A structuredClone polyfill", + "main": "./cjs/index.js", + "scripts": { + "build": "npm run cjs && npm run rollup:json && npm run test", + "cjs": "ascjs esm cjs", + "coverage": "c8 report --reporter=text-lcov > ./coverage/lcov.info", + "rollup:json": "rollup --config rollup/json.config.js", + "test": "c8 node test/index.js" + }, + "keywords": [ + "recursion", + "structured", + "clone", + "algorithm" + ], + "author": "Andrea Giammarchi", + "license": "ISC", + "devDependencies": { + "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-terser": "^0.4.4", + "ascjs": "^6.0.3", + "c8": "^10.1.3", + "coveralls": "^3.1.1", + "rollup": "^4.31.0" + }, + "module": "./esm/index.js", + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "import": "./esm/index.js", + "default": "./cjs/index.js" + }, + "./json": { + "import": "./esm/json.js", + "default": "./cjs/json.js" + }, + "./package.json": "./package.json" + }, + "directories": { + "test": "test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ungap/structured-clone.git" + }, + "bugs": { + "url": "https://github.com/ungap/structured-clone/issues" + }, + "homepage": "https://github.com/ungap/structured-clone#readme" +} diff --git a/node_modules/@ungap/structured-clone/structured-json.js b/node_modules/@ungap/structured-clone/structured-json.js new file mode 100644 index 00000000..d5f7d9c7 --- /dev/null +++ b/node_modules/@ungap/structured-clone/structured-json.js @@ -0,0 +1 @@ +var StructuredJSON=function(e){"use strict";const r="object"==typeof self?self:globalThis,t=e=>((e,t)=>{const n=(r,t)=>(e.set(t,r),r),s=c=>{if(e.has(c))return e.get(c);const[a,o]=t[c];switch(a){case 0:case-1:return n(o,c);case 1:{const e=n([],c);for(const r of o)e.push(s(r));return e}case 2:{const e=n({},c);for(const[r,t]of o)e[s(r)]=s(t);return e}case 3:return n(new Date(o),c);case 4:{const{source:e,flags:r}=o;return n(new RegExp(e,r),c)}case 5:{const e=n(new Map,c);for(const[r,t]of o)e.set(s(r),s(t));return e}case 6:{const e=n(new Set,c);for(const r of o)e.add(s(r));return e}case 7:{const{name:e,message:t}=o;return n(new r[e](t),c)}case 8:return n(BigInt(o),c);case"BigInt":return n(Object(BigInt(o)),c);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new r[a](o),c)};return s})(new Map,e)(0),n="",{toString:s}={},{keys:c}=Object,a=e=>{const r=typeof e;if("object"!==r||!e)return[0,r];const t=s.call(e).slice(8,-1);switch(t){case"Array":return[1,n];case"Object":return[2,n];case"Date":return[3,n];case"RegExp":return[4,n];case"Map":return[5,n];case"Set":return[6,n];case"DataView":return[1,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},o=([e,r])=>0===e&&("function"===r||"symbol"===r),u=(e,{json:r,lossy:t}={})=>{const n=[];return((e,r,t,n)=>{const s=(e,r)=>{const s=n.push(e)-1;return t.set(r,s),s},u=n=>{if(t.has(n))return t.get(n);let[f,i]=a(n);switch(f){case 0:{let r=n;switch(i){case"bigint":f=8,r=n.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+i);r=null;break;case"undefined":return s([-1],n)}return s([f,r],n)}case 1:{if(i){let e=n;return"DataView"===i?e=new Uint8Array(n.buffer):"ArrayBuffer"===i&&(e=new Uint8Array(n)),s([i,[...e]],n)}const e=[],r=s([f,e],n);for(const r of n)e.push(u(r));return r}case 2:{if(i)switch(i){case"BigInt":return s([i,n.toString()],n);case"Boolean":case"Number":case"String":return s([i,n.valueOf()],n)}if(r&&"toJSON"in n)return u(n.toJSON());const t=[],l=s([f,t],n);for(const r of c(n))!e&&o(a(n[r]))||t.push([u(r),u(n[r])]);return l}case 3:return s([f,n.toISOString()],n);case 4:{const{source:e,flags:r}=n;return s([f,{source:e,flags:r}],n)}case 5:{const r=[],t=s([f,r],n);for(const[t,s]of n)(e||!o(a(t))&&!o(a(s)))&&r.push([u(t),u(s)]);return t}case 6:{const r=[],t=s([f,r],n);for(const t of n)!e&&o(a(t))||r.push(u(t));return t}}const{message:l}=n;return s([f,{name:i,message:l}],n)};return u})(!(r||t),!!r,new Map,n)(e),n},{parse:f,stringify:i}=JSON,l={json:!0,lossy:!0};return e.parse=e=>t(f(e)),e.stringify=e=>i(u(e,l)),e}({}); diff --git a/node_modules/@unrs/resolver-binding-linux-x64-gnu/README.md b/node_modules/@unrs/resolver-binding-linux-x64-gnu/README.md new file mode 100644 index 00000000..4051db30 --- /dev/null +++ b/node_modules/@unrs/resolver-binding-linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@unrs/resolver-binding-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `@unrs/resolver-binding` diff --git a/node_modules/@unrs/resolver-binding-linux-x64-gnu/package.json b/node_modules/@unrs/resolver-binding-linux-x64-gnu/package.json new file mode 100644 index 00000000..61b8720d --- /dev/null +++ b/node_modules/@unrs/resolver-binding-linux-x64-gnu/package.json @@ -0,0 +1,26 @@ +{ + "name": "@unrs/resolver-binding-linux-x64-gnu", + "version": "1.11.1", + "cpu": [ + "x64" + ], + "main": "resolver.linux-x64-gnu.node", + "files": [ + "resolver.linux-x64-gnu.node" + ], + "description": "UnRS Resolver Node API with PNP support", + "author": "JounQin (https://www.1stG.me)", + "homepage": "https://github.com/unrs/unrs-resolver#readme", + "license": "MIT", + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public" + }, + "repository": "git+https://github.com/unrs/unrs-resolver.git", + "os": [ + "linux" + ], + "libc": [ + "glibc" + ] +} \ No newline at end of file diff --git a/node_modules/@unrs/resolver-binding-linux-x64-gnu/resolver.linux-x64-gnu.node b/node_modules/@unrs/resolver-binding-linux-x64-gnu/resolver.linux-x64-gnu.node new file mode 100644 index 0000000000000000000000000000000000000000..0fff14d98fdf9223dd690a9c6454b190a4bc2922 GIT binary patch literal 2272024 zcmd4ad7L9v*)Q;74||X;EJ87CQMRxMQBg}!34$6CC9Yk=OhZOyDQ9{hC~DjTDsPFX zc@?n~k%)*vQRC}Y3StD5s3;K;0)hl&DFigK=&khm9qjtu{(bKK+`n#XNb>EcpL))7 zPA#3zbieoIC%$6C4K{G>$41VJo$0f|`!<{>51%MpvILJD$8*Zg=IMW3XV3ZAji33< z|Nfx*4wJ{;J9!f`-Nq)ChC;O+?AKOgrM+`k6*Z%yxCj>prxqte^j17lCugUR4_@$`AHET= zReFCW9`Cy#=tX!uv%n5o@c94q@SSPEv(wuO1fH7SFURBQ-Ej*ZADupa4xYavy)UM> zLV7zMX765QAK-qv=9i|olhfPY>1}m-TljHg`s9V_?XdK=OL|+A-WGnWOP_25C@uWN zg2&tA@e9)X{TBH2;q*v2m)@qkel@*4H@z+Vz>#nvJ@dGMN2fg_j&tCG$J2+ePj7D^ z`~TtTw*L=B9PFs6H2jXMv)Td*f9uKB#eE!(dG-u4IO+Ws$_Z|xm?*#ASpHDdbGsPtf$5~! z`B*sSUyA%2rw7r+#(QL%f3bQ_NGEnN|4Q12#q#VZ;vY(VvH0oyy9*1)gqvvj$Ir@mO8 z7m0QCT(N$pJzgyT2gG<|(N9mTx1WeUpC$6&B>FZzrz}?I??pYYNaL5JH~yGjM=!Rn zR*CJF)BKC|`EoI?_oW+LEdH)^yNme&q7Tm(zJc%=QRi30de~Itxm)z%H)32@3ExxH z^H-67Eb4i?n6H``*DfN@Nn*Z!DC&Q^$bY=p@AeUOZZGnDO4M_q=+Anw&L0+eE)jj$ zRn)&ry4}V0i!((%{}%o(G2VTJKP>tmroLD`9kJcd2|q#gLCn`9X}p_mn?F7$`v09Y zaIyV*BI-F!)bl3c)0Ybt>%$RZ9#0Z^?oRu^Se>V&buO0wPpL0@y&=}yfg;ZVX`Op< zGt=iE68*d?9q(dwJ|g-s6#f5)n8$s^ap`+vz77-H{kiC8PxuE#p3Ou(zZ8AAT#WaZ z!fzGp;rC*Gr{Cv3%SpeResKEAhU0vxG=JwfGc%{JTC;j)-Q3c(b2Br}%<(6`YG(QD z+S$`rtecx%d-AJ}UAboU?8!?{T{&w$xAUTnFhY{%$bvr;n#z0U2~dwykgzV z(zR=sp6#rfU9~JY+c|aFs$l-Hxm&g7%vopM+3S|AS$&$bYSq&8b1T;@JHrX)>T740 zE}vPoer~q0bZ&0#%!<`3<`&^~vvbqUWj~{Wm(Q-7Tf63LXX&YH*3Oywmd~!7otsTZ zc3RrB)yrn>K=E{D{p$2n2GdQ=tX{fmcKJ-Oc1*r1@n<)5# z$m!QLmdyrpE7CO=%&uOZe!+jLT)KMs%(9iUOV`e%i)QXWktQOY(KTn$Jk8JbssQZzcDgv0rgf+5C!K&yVQWsEwm3tltzW%tTHJq%TE9A-mldn+v|vo>CReRk zhrYphR^G9GcKz(k0!`brGFUoSPZxdKlhtcx(gK&xZ*6AAEbp0R^)sAwer8vnnFg7X z=WS-Xhb}u~`grEFr7Kp_Sna}0r(osmYG>Wt@-^${rg!Of(z~_k|EG6zYtk=VyKFA) z#`@LsJIm7LXHJK)Y}%^nUO2a6)$Fu@wd>a{J$=?WEm%Ld?wM_!F?;rm8Eb~jqI`zZ zF0Tt_m#sK$#j zYgf#r$6erYvvV(7I=A$s*_FpEO(%B&pFG=`vz*R(`pIBTx^JXMqt!t<)qNR!Q%bfz;s z3a3lC5u839%>1EXX03DD+S%Fp!*v?CAn%DwSD(H%3zp6`=2v)nv{|z%Ep2-0!r3A{iZxcu z&8%1ztaO&IoJo7Sc6wk7>gky&-Dg*yxnga4Xh=sh%`z>0=CuDjTxlP!Tyg5@%a+Zo zJ9yoigAaAmXKUx4d5H7U^m%FespTuD4-cC@TsD1lq_cAQL204u8wWMYM;>(K5$4m! zop}5)$Icvf@L>l(&#{jWcaA&u*qI|zE6qPT{9q%8PoE?H&?BCC_@76IA8dYll3t3W z9~-5w_AppP(PM4_+5PCAlG+$9hh9UU)&cE4(PYB)lx#6J8Ns6!;XUE8@V@YY@S*UL@Uiej_(ZsKqgemK^TG?lUExLHCE;b^ zp74tBs_>d{UwB=3AiN>GDZC{-6y6pd3GWE+3hxPzh4+OIgb#&}gpY+M!Y9I=UyAiF zJTJT;+!bCFUJ_mw?g_65uL`dT_l4Jm2f`b|o5EYdL*Z@Vk?@Z2uJE4lSa@IfK=@Gj zNcdQIB77p;`IT7z!t=rl!d>A-;U(c^;hyk{@T%~da9?;`cp$tXyeYgTJQUs*9trOV z?+Wh;kA?Sz4}=eekA#nfC&DMfbHC57|8JaWzAtdemz-t1EW9ebF1#tcExb$qUeptl zUkV?P+xo}kTQ$tMCge6x?v`wSY#vv5nfxf^uaaK_uakSfn7(%4I8E~SW$Cxe=|_t^ zJl1$fUj4es(~@fKO5dBZ^9Gu;7C)?gxrodKXm8EVZRUkAo956Hoi=5 z>#2}Gg*-L#P2Oq7TPNQJ9+Kz3X6kQ~+j_d>+au4A+(92k; z@SgC2@G<#Mu-yrHfcee+G26Ed-)rhDkZ%Mp39ktEg*V8396v*H=cwr`r;gJm_ct{j zkq-*SJLJhG#=GSCU5xk0{q2p%FGzGe1!Z1@;vek$=$6@o)LKo`N!n`#wI=? zZ|-G$LLS1M+uZqj?QuImo*a1yFOvHw?>hhW74|F4d8$qx!dv9tM@)Q&JVtzjsi_-h#KtoAx+N z{yD^V$ghC+$V24mllKrmB)DO|;brnw@Cx}lc#Zr_c%3{%oelB^;#=hJhquW;2Jeu68r~yM>~#qF=Mg_7 zpCEorej)0gkav(LH_G-u!hTmEzY_69@*l#>9zwZQv8~JUn-2w*MDly9M&++T#y-g7b(+?je7j z{RDG9YLRy@H{Tb87JAY@_Z3NGecj0+* z`~7d3d~mGUA8X`IxKD25>*Ow;2jt1$Hkq%xL7soqc$0jD_!ha%6Ouc~(AUERUjDer9R+?VZJ6R!ii>?_TFT_hhMe~sL|(!~4Z z$qM6ja+{|~zW0Bb`rE?0~#Mcu9CgxG%gRJS2Y#b#};)56%1z$s@e( zJt6m}|8Q{n@qjyjmz)1@`a2tLHhn9Qk6yd^e1uD$@0<8C`REjrzee6&W!xtZ@cLnc zyn3>UZ<9A`#v^jKYwGEd2e=LylIMMsXG9)M|A9{WF=4mYKM%U|pSOKWZbje7!>^kB zWpW?K2ao*ePndbElJ9bXai4rwctCzEyh;8(c$@qwc!zx3Pnzxa$oGH`$alTa#E-~r z{key-eY1VYlg}WJOK$U&$UlsDkKD#r$-jtrpWMa=gX8Cj zJPOVFaURb0C%nYCOFsCFagRLtq;a2ogzYxTJ;b-jkNu3PKN8*}|0v@7gs^vQ3556SO?kI5(S3HhcMnf|+v zW&4)Ldh^(i+IYVH3V8`$C9lG3iko+dZcZA2}2VQLI8IapNW8u!d_k`T;@6JE6eX#p=p4{%&F1g*WOXR^j%y>QW_-?aqYvj=~bG-7&li!*6 z2Dy8wiEop~A2IPg@;r{iL-G)Pn~-;L{Zp7^`;*6hS7!ed#zo%zFXKLWatp>q?%}r~ zHpxqWG4XBk5#l5A!PO?dNAA7R^etw;$HWiGyZF9oMBYUG6Y>G_7yg;;+W_AOx#an) z%y!GKKTvsfc$sxCi!jf zko+NdME*3qOTN{Y%sj^A1^9s6$9PBN&qjPgejwa=GTZ;7;Cb>o@|VdIoPTTNCA>c7 zljpB7>%T!>n#J*uJi&1_V#j{bBM)&r8Ilh!HQODLH!!Y*{8HPWr?UOI-1dk3YPd^& z1H43j7u+L%8eS#e^O9ZDqe=SjVab=k1M-95P4bt*L-Ld05qTZnC4Ub*CU3(BZQ5n0Mg~ayzaLd4%=fC(q;i{V}=!Q8TXGziC_-7%!6N z@qK88ycwDJI(Z&>TI3;KC-0C~FEhu7F8LOhn*Q{KkAzQz=kZ&a?CYF1e^Izc-aX6I zQxhHtZwc>_J6Kmkavy!0kh}JEwhi{0-*4==?nU47f|2c z1M(;~@gaF&{~ZB&_eUnaNA4qkOdd{u5o!7{B9D-NOkP6%g#3WZOdp&Lvwb@bULb!H zyhv{2J#zcHYnA+b2W$iLMw;~J9x20kHw2wvDI+lTyDO`bCO z^WZh|x4;|ZAAq;XFN62UZ-5WU6ZnLDyUR_Tg^jcIm*8dc*TZY%y?2>B4e~P)-zL8h z-Xs4$d`LcmPslg<8tUI9TYnK=CVv^cM!pQ*AaB9j*TGO9^ z-2VHfki2@GiSLll{M>ktyovmM^7kWtNN(fDqdcv#Z zUq-x7-iHU|cfyWpDp1L`TLQlM{e^B$Ztgah*&qtmr`Q#>( z-zT^64f1~?PmBCXc$@rR@D90itJ!W}_>jE!M-x9L{~mlIJhy$e5C4Ps0(lvA7KN9| zcf#?!LjHZ^uaS>#GxZ1L^*o6j(wv2bk??RrK{8hJ`{6pcn9kTt2&olY+ z@u{!QdBk#BN`*=~h=IlMvccFlI%dBFN@H}}F z+bxjWJT7?&dCKJ5+;93>A$PuK>ha0D*BP&qH-Bb4ARm3pc!T_SY&Rso5Z)0U3m=mI z8F_MrY@dDGPx27!p-4V@$kbmVxAj-Z&-kn9r%(QUctCzVyh(loJS4vr9+BSz?~>d6 zG5OySKOo=i0aO2oe0%tW+|E~imu#P{7uk`=6J8^?+YN-b$lv^+sXror9NX;)9|#`{ zcXrK=*XA#gdpJ*3$?f?oAa@WSlIP)F@+N#hKEio0A@>oV-z{5zg8j5W?!0k}`Qu@k z+{Sz4HoijsUCfIwyg|P0LuMXB;T>}ObA%rG=E&10FTsc8Gw_7m#yh)b`}TIk=gDoJ zBDp=TdgS(fxfSx}oj9HdZwL>CcZA2nhve&Qe}w0ro$Zf}cgfF3o-%oe@m9z$Lwt?= z`|vusjc<_u0P!tyo2N~F3*tNE_rrVS`#fyst51GBd`RBKbzlKOiyvX_3Di-X=d8-XUKJ?~%V7-Y35p zJ|zDRd`v#~h^ccz{&{$A&usrMh8M`MffvbdftSf2f!D~l{+p?%PJRTuLB1`ne_G@< z#J9=qxH{zacomcTxZWF)cX1wZ+-!fkIPc`hfBvW$SAqPcj~OqL&*D5@CVv;=ee(E- zE$7c)b@J*-=DZe=H@{}C_gdtqBY&HGHM~P^>+X>czp`Y$o|wFX=Y4XUe@Om8Y&RkQ z65QD<+ke})Jh|g33>i;b9~6}o$bH%BKhd=CcZ}Q3HQiDc!fNISIN6@pZtqYV80-b(Z_)NJBV+SyVy^AYU&2laQ!?eA+Hu%BSo;gG!br0M6F{9JgUm>pMOk8k7& zuJ>x>{wvIOeey26PVO9M;sf$3yg}ZDH_7uAlcz=Q!$a~I-X?eP`)?!i(JM{2v3-68(~d`Rvg|Aah7e&@N_KG^&P;U(b};lA*O@KAV1cuYRKsp-#Pg!_XcwKl?cw2Z^cwhKP_(XXAz-%Avc#Gs0p${JU6Y!ewKzK`d zB)lhlAbc#`IVd~cChE_V+i?|zd%|nN1K};7c?jD}4|C~pRm&vdFm+?CJQ(HZIe!NZL zZQ)(vec>bWA8&28n~>+XG433Z9oK1yF9rH-v}6JHlh(L*a?=-18RigDbo& zyehmdyeYg*?&ZyVb;ys0$HIr?9mFT(J8Wn2=Z?(wVL99--)=_}Un0K}@fG2|@Q^%u z*c@-WNrl8-QtHS*%_X1f9TN8nBJ5Z)z^pT>G1uRdfv zCjT1p4237;)h)K3KW^uqpY20w594`q=h?;!eCi%`7`V1h1vd$FkeOTF6O;L9-;qr@+Q_* zi#++8na2)!^$FvBau+^kf8509j?UKaBY%;+i}(t89`RLntj{{Rhkmx$(Vq@^{20c? zJ~2KfZ~hbGdQo;=9|C%3=vrA0o%`Kv=-LOosbO|V~#$V>mgxX6#) z*X%FOi?idhULyCfzgNizs3#zgF~1G+>#^Mqd4xQD@&xlWCU-He+)J|chv-|8JV8Ar z@>6l%tO)moH-vY{n>erag^$Ty)SvUR_rg2m zAA|SEKMC)Xe-=I@zXU!e|0;Y!ekDA2Y_^|2ffvZHg%`;O@G|-D;T7`R;5G8w;dSyK z;^zeo^7|0qB7X?pCVv#(A%6FU$6SH+X@3 zUwDz+{vEn9`GJV9klVjQS0g_P@pbZ5xNdBaR}kMKw|}3mP5x@ccgWug?~$Jl?~|{G z56K(wG5LGo6Y`J4b1%>KKZF;^FM=1zzW^_jzXN@%kbepBHS#Oqb@D6W4e~C$MZO-} zZIj#Yzq;fo?LJ8xa7Y5 z{(`)O_!4;xFO%Ezlt*s+QxhJLH@7zD_ZGSH9rN$MLUJ45As;;7cg*Sz_ zg?Guz2by|@y*|J|X`L+^J;ybLK%Nf1dn@aF_g^L(w1MRpE8vP4dqof17;y zVP?Bs@~h!}a$Dz!eCBYIXF~oj-Uh~ zC3g|;k;mwpPo7}?H_6?d&3cQ-|K~gA=dCfhKQwjr$>%;|*29qez3?&ldGHDOZ{WF8 zvVFJ{ULa54Me>bWSfAuuBECYt6XI*+2f*v($H5!quZBnD&I6`zG5HAVuuq;mZQ@7d z!L!VKjmb;@!uqLY`<5U+N1lJ!#Jl7r9Dj=B(UT_LBM)6uPlepp?~{-6CcaKSz<8VF z)xAx8i~XObo``(3hl!8L<3E}BKKTbQUqkX1d`x~md_sO9Jomv4yO{Se zd4P53yeZq~67uKBUDV@}5B4W?UokZ9#^j~Pu@2vw?WeyR)**TR zb`$TBN7%1@@-E`*~+ z&c7|&AKT{w`G22hj!Px-N8uInSAEpP*T{E9opo}XrzyNGyie}ox@b(^#Pw=!COh5| zj?a1WJo-~44|Xu~QX&sAj}`X4OnjX@!nzH}OE@33$nV+Q{N1q*c?sj~lE;skb=4>L zahx2G+wqRc101(=eztETtp6hU4ttq8E95@Tr&V%$zNnK2*xv*4tv_bgRYV@*x;G{- z+3PfNH!=Mgktdj6XK8l4&DWWK=bIysaXxa%9eh9Tk>~OKqfb7<>jq8oCceLGk=yra zcgS-eH~oo)4}~YfbEjteVDr1e%fhR|>%yDD+rqoT`{ZY!KO^B2;rV6RKG-}(;hylC z@IZJ=cqF_hd?0)*+*!W(cniWy!Yjgk;SJ#-dGmZ62gs9m8t;;S_`k4UkZ&CtACMmo zACd3;2@{`?9}0J7vwb@po+p1L+$H}5yezybye_;cye+&dyf1ttd?Gx5TDCuSyhZXC zU10iLCb#ib;dS9n;cekv;eFvF;S=Hc(?uVId%|nN1K};5M6_MLId%_38$HJX67Vkqrcu9CgxG%gxehT`~BDd$Y zHo5IjhunFW>1U7J_H9J|CiFQWe=FQsneC6=Zl2ucFOu7zw|c^Bq-FT;8W$d}^!q$NBO-V;6$J{In*&i299QxIMf?voGjbHFA$ zUN>lwcPDt=hJ3KQ`F_7ce)DI|ei4%&{yF1A@=wDP;kh;0KG=Adym(-K{&n>tx&8jJ zLjE+i+aSMYcax`0etyAtkNn+x8XuDHdz5*7U_!p?*(SaaWXE*?yiC6Nz9zm#ekS4@ zdwl?$Vtj*T{(R)q2OMc=K6JI3X=5Q15k-uSA6YrD9$kQbML*B$k zNRNrdO-vg5V!F8P*`$x|Y?@fG2|@P_bEct?0F zd?-8-o?9>aAiONRD!eYdDZDMbE4)u`&r>7e6XE$Yvwc|qB{T0u@}Iyx@+~eg@ip?3 z;dSx`yiLAtZ1$sw{KE$s?~(8KHseF`gO?bekbmiZ}>tVz{}(x+6DEK?}qD#2KiB#_cr-W$loJhi~bDB zS3h93J0Z94gDSi;TmQW~nRu7{i z?2i%olZfw<=R2m(nEXKafc$Xyi2N<^iSYcpvVHy*;)~?=_~Qw$kw1+*E%Kdly&aMt zx#f2A*Wqp9J@N++FzX>EFCb4}_?X<*laSkbCc+EnWc&6n)Z>z$jCwrsn-O0jKNInF za+^OOxA`07H-6QupBDKnJQCg$J`g@8fAQsJyAyJ|-Tb?=eY0K^?g_664}`abN5cE$ zyME1#Ye;VEPlV^*v-o&j@(Yo_L>|FC@-M=xhC**d!`DV6nKSaDsZsW_stHSH#Hz9w6+~yC-??!w?ZsU8x z2g1j~o%dz?VDlG*mxNb@`@$Q-L-MzO-K^(`+}7C>J`g?@?z~_0L3l}cMYu1#Av_e` z5grR43QvURK9KFhmFRzg-1fgDydvBe-Vh!N?+A~D4}~Yfb05t1;hFK0KaBo(ieruC|3i&(apMm$t{~O*X{~UZs9^txW zOnwpKC*<~cl0R4UncN<4%j91~{tEe*;5G6~;dS!g!<*zUy2{LNNN(dh!ejC;AkR>E zB0P6qwm+MG)6`QSxA{xt`yk#UxA8UMf$)~_NO({9K=@d=^U-V{Z2bk{CE*qFqtTxl zxy>I4Z;`(NdD`SQPgi)K{F(iW{4>a(kh|Y9>%sY0wm(bYdGdYWF8O}&5_u8skv|t+ zB|i}ElOF^R$Pb3Mgh#@A!Uw{~!kv$2`)2DY2rmh*2=~b^#&{dTL*X6avGAerM0oD} zY#(f$uJE$(s_?q-rtr4#uJFF_k?@J|{C_RphoW##cuja9yd^vm-V;6$J{InTi;uS; zyd=CL+!x*u9t!UWkA)9~C&F`|SiBFe@Url#@VfA(@V4--@V@Yo@QLvJ1&jBgDBL5@ zU2V=sHQ|Bqmheb;k9;k*I}kn=?tC&kUYn;terV5(t0cT4+!x*u9t!UWkA)9~C&F_V zX8T~r>yj_|9{NCT<14~_;SJ%T@Q(0U_)vHvJol+=AC_ah1#&yy68Tw(_sDI0O?V)@ zMSeB%x5;h(uJFF_k?@J|{HL@1vD+<@_x{JM6OVk!_i=n6|2Vu(ZsVK6+rqoT`@%=U zC&Kfe$@an4StS28##JW27hWMR|G@OeCy(F_;i2%3@R)pyADZnBg(t#u?Q9>m!TV}l z^7HZY-y(V8&*tagCE;cAwWza7eiythyh(lv-e=e*|MO1feKisJIosm*QIMYt?~=FS zJ@Sj;G5Htaee%oT1M*7V)H5W%3qB%0bvqM3CcolY#uM^S9cJEdko)iK{JJ}v{^ZH8 z+R@}GkpBqolK&E3B>yeEM1Cv0OuorZX1gAFeP`np@+%6)tKOli%f-zV*qkM}J1-dthCS$vyNT zA^#M7LT>xxd@j4*jzS-D}k`V68YOUzJ0iOF}u{?#Y9{TYzk{tU@&e@5h&qYq>9AHx&!ebI*rc@FExxhT6n|AFw0CAY_)8oAxSeDa@T{nW`%K_3G0 zA-qApH;z9|@`KTz7P(zN5&4g>e|5<1`stF}_0uD_{fWtYSSNk*>)-?O7vcCbBtHS` zXGFd|*2$Q>jr}Vje-u6;x9cbW`Rw|<4*OSu+^!#&+^(M@x$RGh+^(N8xm`aV`8&~{ z3i%FLCsp!8(4QLl`>=j|au>(vI=MaXH_3m2>w%Em#&?9rEwhuPHE4(bcD!eYdDZDMb zE4(j!Bzz(~|E0zIP$VCt|DNy~dGlhkpVrB3o~H1&@UHN_@R9I|@cbp&KG-^o!ad4;XUC4;bY;>*A^ddL3l}cMYu1#Av_e`5grR4 z3QvURu2{SeuJE$(s_?q-rtr4#uJFF_k?@J|{MWO6*zy{4oGc3Wgx7=z!dt>4;XUC4 z;bY;>m5YzJAiN~JBHS0=5FQHe2#j@(ACz=B~>2!T!690=ex^ ziTt<7?~&Vo_faLc`J3$c_ZJ~M{=INSZtLj@9|#`{cfOhJgUw$MUJ_mr?vn>UGwVDc zx9^{ClAne6ko?{7h}`Dsl79g4F}eMB+yio(XG9(%PeNY06xZ9|%J%aj#OKK`fxF~G z{Cn*Zx&8O)9=WZvN^a+|PTs+Go5I_|yTbdzN5UuMyIg1bmb*IJH(RGGyezybye_;c zye+&dyf1ttd?Gym?Zx|06z&PH2@iy~gh%8nFke041L0%g&UdoowfPIeOTsI{ec=t^ zq419ISolzQB0Trq#rxn2FAJ}dZ}4-ofBEFL&kf-y-=L54$oH~+*ck4T=iw#t9pP1S`|mM*@|_SLklQ+2!Xx1W z^3ML|eThSIn?E5x#E$oWvVA!4A(O`=zXX4G%qRc&&&~U7n&b~ZVDd!dPiS z^~A!5!V}@S?`Owl^Si>!!mGmT!kfa|!n?xz!bidmJ&+?m2iwh)UkERdUjcW?uZ4T$XJNY)^4kz!C4UTFBj4(J zvmSi%ec(;g>K^kGE4JA6!j z^o`~?Fd;u4p1UTy9$pD|g_ng_g*VAR^`Kd|E%F~@yOHpo@PY8LaOc|Wcq&~ zZGUC9TOl98Yvd2Y>*Qy_L-I{-GWjF&&EQ>fo2M^)Bz!`CEb{02+5Rkt7s%JZi{u}L zm&q@NSI94i*T`>$*U57O)1LtN6Y25&4ht`|vyDcN}8!$K+RSYpxIb@g3;wQ3g?zW)nt7>_?**@uf9VSB7v%dOzD0fzyiI-tyhHv%_<+2G^X8EJZk%Tm z^3{mX-JRd*tW9`{cHt zL-J1`eoSurJR$EOKKILP-+lrwklzaT$Tz_LSRp_EVC;9~8*O9uizfLI*ncDPZ(@J! zkdN(tN509ku-}nygzK&m`BC_LBF?X}eRv4#Bu8%Ny+B^R+3YVx@?+p-a=T6{x_k$(){CjZ>GO#L153lQHUkKldsZ@`D--+_%T03o{d+`iU&n~a?duF9a{GO;GsxCyUx&$&e-rClJK{U!``f?6MIIu) zPySQ;ceu#EgLvoH**~|e81wsw?0A3FGF~Eo`?d$6eq419ISoo0qWaLlCBY5uC?0D^Zc7>OP*U1mX{?a11f5$K+AH2x) zr$c@)`rIeK0sG6C-2NTI+#j>!vVRw~NWMM(?r??N{$0g7x&1rEE%Jw-WB%@HNdCUN zv2Mvf2=9{H{k<=IL~iGCB0PUvwhtk;TNLgIuL%!?w}eOJkJ~;fe6vU$T9$^}E8$!mGmT~Byezybye_;cye+&dyf1ttd?Gym*Twr# z6z&PH2@iy~gh#@A!Uw{~!kq^eA8$c;Nq9xLFT5c<6y6aY3m*zk$Y1zZbG*tunC*jg zS9n=?Rd`)^Q+Qi=S9o9eNcco}{-MSDP!#S7uL%!?w}eN+d%_38$HJY57awmycu9Cg zxG%gRJQUs$9t$4|Psqy;n)UA_**+|V7s#)N7s+kBNB$JztK>GmPJX~cxXvWE@gez} z5Fe4-_#XKO5#J}b@gw0A;rT}v?^{v0C%h&+5Z)3V3GWFX2pq!eavPtJzX9>iGmPX4k4$4_z_ zACg~$_=w!b_sAbae4pILkH}y6h^Z$bxAD2ZXZv<8;tS+9zC`{T#Czm6zDB3XQ$Zv;N$ zKL?(BI@^a2!wcjq@xBg^{0Y?QlOJsRKz7I`M*zk@sf&i45hc#ixJ@H}}RKbJ3%{}J&n`MvNW`2cxJ3 z4RB|JY~LP*7s!u!!fdxlZsTj@qhFhG`Q#zIPQDKLo5I`V*CD=3zT=ao&OUkRH>REu zx%XS+WAZlgI2&gBQ+UecFOa_nUL?2ip75IRfcy&NZwZgcmlgJy-xGS|;lIpy2js~| zcbbnMlE>#6ACV94GkKhivi))HG@c{>JL++TmxWi!-@S_&SDpMJc$56dT}^yQ{t|dc zcud|!--hJLPj{a0+lV~xn7&QOqa`N3uyM9;;qwdgdCKG^^s`3p+-3UglW&YZH-v}e z#obJQI^^EdCVxyGUSZxp+$Xp3Bl0fd$K*CoLT>ArkPo&o{d6|T_AP#9TUW1aWONAMB(* z7x}B?)w@mp8hMEPKDo``Aa};5{wBFMHu+oRUE~kRZT=2<_g<5~OJ2o1_Q(U|kI8NR zA$frMN94&prv5Q`75Ni#dw$8~vh!};C4XkWCb#ib@_%Bz)rB{Ow}p3w_l1vyPlV?; z&-TIH!|X3b;hylC@IZJ=cqF_hd?0)*+}UFB@fL)a$d5yRD#Cr?4dJ2ij__FcP-jNxgzNU)*4gov zkiSSi8kys*NB-D8rv57Vzu`W)voFR=z8gFg-XT8{@jdd#aDCe+xA{lpuScGV@ccH} z{;Wp4OK$U&g;&Y1MIN8r=4p`s74a?dZT2($jL2=Cp6~(rn~`Tk{xbMPcz)Y#e{6hF zxF@_OJP_Uz9trOW9|#`{ck+vmw;;SkZjV0|a@#kb+{TCGZesSwHhJOhwu*hhcK=_`Td9=lK&e%Cb#hu@~w-e&fK%I{oEDqlKcNQeJhi@ zH<;^lk357|$demQe3iWWE8{hC=a=baTjb$VGruAE2;L?yor-l%?!i0c zF}{!Jk~i-&_4L>uFdma1hW-!8KZ^6tnEYJCPslH@^Sga^eviSrDv(ErFOu8yyGI`3 zeC?CR@Fsb1py_9e+<}MWRd}1+hezagfA5h;2bk@~8I;gxopU z#81eBgN!>nWcxpY=g4jTJo(o#FD|*A#}c`nN00nS%zKsG=JCm|!*&Dmf5MyO`#r}T zPeSrH!+Yd;oL^${a2L!A`Dw_LklX9A{Epc^4-oH?+t+PMi5W>g4cux!dv8f z9BA@KfkSDkv zXp%c8n(elPcgVXqFL%jZ!{O^dblG{9W z;Z5@V!Ppi5Z4!5hLu^4k#KAwTjk zlRqZ+wl>};KLM{Z49MRCACgy*XGHG9$KqX%;@-v#|=k*Qp%MUi*CchTmBmdHKP5hAD{ywn@x$|BV@9dGS|2YR3 z&yoKbo+p21yuv;5;6BRm#9 z6rKprxr_I~CBGc=TNYjwUKidJ-WJ{!-WNU+J|Tbki_N;t?Un7ru^4ZG{5^;-l1K0| zx$Rq3cwKl?cw2Z^cwhKP_=NmrFERbeFUj`DdQrGXel_}2AwLd%u9BZ%k0<1}AdgRe z6}(P<-7w``Gjd=fUmwW*4k^d2S2ISv?56Q2CkH}q| z*T&?xA$~&s1GuwycHVD<=g4n`=gIRgHS5PEKM-CfzYSg?e+2H6d&ijk4dJ2ij__Fc zPMle@@Y zCAaVIt&!XKfZV=MxIu37G|6opEpi|Agycv7E4tan)UGgK)pT6*s@Co@z z$dh|cc3yr5cgY{L^FqGaE6jXV$&Z5jAgqX(7@S5;IcuROByeE7hd@S5KVDa%5gqMU@g!{r9!b9O5 z;W2ss&1Qaw!V}@S1G9awd0gRT;Z@;v;Z5Of;a%Z<;UnP_;rW9W??X|zC%h&+5Z)3V zkqdi4W8u!h+40)^1>qj~*>Az|le`J{$v*%O$ghI8$nS->$^QxOksl533m*y} zlegb$#^oH6?az1N1@g_`X5vf2E97P5sgdu8JWcXs>8|tt?kOT4oNBy7-aXFL(l z^7qNV3?Gu)JY(`0`6uLGN1j|M+c%rPL_WZ{D&%(}PeATIXs+KHqI){9ny@tK?D6jJHM}q7Od# z1HS1)NFFaUdD`SQzAOBHvG*?UO;uU{cLGJCq6uoX?${_p4WzVAn7YfTuLRuS(!a8P^){e@Z>Iz#kP}5Byo-O~A|CeBCzSA4vIj;Q8xz0MB2y6Zj`m zPY>{XJ-xtpKcCx^0lrh}u^d+@=RCIqUwg606ZrUr%r)RX;kCeT67ah@b@yO zfv0wt^*itfcJlYcWr3UalKqX9h3yIW*}hqT+uqnspJ#2r57TmQlL6##zKAGw|;;LZzKZb9ICUBKnrfcy5e>er0{zi2(nArAZm>Gw|HmmkJ@ zk^p`{57*NJJSFjpByj(uT)r3hZ9_zFf#11`?<);_??&cX;O8yndQ4S?`uX)_?k@}Q zxIEWj1AcTp*Ix#F*GA@c;BVf*+yOjV!sEpWd~rFqvl4joEcyO%;Nw%wHQ@7Z5&Z;S z@;?6Yyxt+@=fUlNu-2>eA9=9h6{Ke~8|9gS|_-p1V;NQ;XdeXp$ z$$N@2z-<*QpDb{DFOL_~35EI`5WTVh?;pq4wF4jC%zEMg{&gqU?*v}@Fprl?;9JLY z|GI$p{hRC2fTura`TKy|H*)z};O}O+{eIxiGetjvFOzW;0Dh}nw+Z<8Gx)xOz@t|V z*Y&>*_yJdQd!oQ?%edd$fj=wuAqG73PnJUm@PD1c{SpW6>Sy_M0>A1=E}sCNc$xL5 z2l(8z-2No+-Dhw=_5%O>Y%ZSye(Rt3x@q8}WPeT;xNAE51EvXudV6aH*JA;m>EJgg z*?`;KT#p@i@LPV4#sPfe&3s=@;QsSiK9#^d0lr@saO;oEHQ@F**Y5+Kx}M9|0*}7M z+zPexdty})}$%e)VK_xW5;8u;I)bN^<5 z2VZ8pmjxck+s_jV_3);H`MMV1*(>_pUjVr00d8j#@c1;D_ksU&HMge?_}J$} zuYgA;art)O=XCIOW56$XjCmaRw0pUpPT)h{Wu5>Y*uw4U0Umvu<(vd=n$P{%3w+69 z9!DwQcihSHNdxz-<@RTQw=HL$1)kcI+iyClP;XPR9=8Aw$b0Z?z)vaT`pbY%-^J?! zJ96)b*54c+N9QYrHa6N6n zpWmP5-wxc>!1omc{*m}&ap03)X1R3&|L_x*Ljri|Fy=|%wll;I1CKw(b~^?9b!kr; zxc^fwp8@{*XqHbFxcw_`zsXgopRZpg`U(6T(PtZQ(IBx6*ULyW~J@Dqe`Mv_c z`@}vp0l!<~FhSt4R=#c<@WgpM9;3j!&t^Su2Y&l*tZy;kDY1tgz|UR7a)<-JP3&za zaMuW)?-IaoI*;q=0lxN4=1JgJrF(fg^lZR0k<#U_G`c|UBdPIfY({X-U2_Z zh0FVa-zW1(J@B#r^#p)hPvv@= zfFE-bmk$EJ|1ln4ZNPh9PBlf(|R1Mk0)%g2E4b12)r4&Y~;!tIO$56b()JAq%Z zAJ?A%Ue?I<_W&Q-#q}qFXD$@~1o-iiUrqtPZhz5d;D36Mc^3HFed32qF4Sk&X66>) zwhK7UZv*a+ik<_1D#>!N1GgW}_vHW{c%R$p1a6xvdJcR>n(KD~e?j6=8t|>M4)pSf^&J^&B zynieWJmF$FXMmfQuspNCpSX?XW13Q^=k_z%9$J7WZR}s!fd6;|_hT9G&C|I3cHpO7 z$=m_l-_QP}6ZmdpxqKyXv*g)bz=v<(@*42qe%yW^@EhJ_y{!eFn8D-A58PSD?W{+B z`w)G;3jj~fV|g|KKUvmgLEy&?;r6!yKSAQRQQ(1%JkPcRPf8vn2K>iae7_yQ?eB~J z1OH0$m7T!HzQXNH0KZV|a1ZcDB@UAW?z)BL(+m8TkGcL7aQl<2&uQS}@8kQ*0FO!j zC=2{Ku>+=>LjBL2!RtE<@Hb=~X9Hg6PzIE?d6waCRE^8^wxQf#wZKhF*>3oOA0c_Vdf-V9+w%bM;3+)b zn}DyA^>q-qOXBKnz~d7Ci~|3*Tl^5<-$}kT2HYn3iw@v3XR#j`2mXoV2Rnf~f6M-4 z0{D$%xII0P%J1ro35 z0KU3`>yHDsjpg=q0(YIu_nQE|^!I$-9^h+sFi!%v{f+HmFYwegY?o5Vj}*NHUMBu? z2KY($vi@g*2X1G5Giil-8#tKf1q<*F**|Fmew^(0D+3-ji{1i%^)r@(6Zl@gW%*YE zkDV#@8F*qA+hGm3|5cWc5BS?MU)KV^?-Op1ANa*GztjUSJ)GMa0KP!xGC@ zJDY&typ#1X2t1JFanuIVf&K?9+iE78Q>n7AG5%pk~oiPdZB&>Uf_6( z1-NY<+cz8Vq~yEHfX5edf7yWtOx%74@YHB7??k?k%U1%QSjGM80-lleyAOE$C7xgW zz^&q6)dR0QjOU#I@Qvqle>DM*KgazQ1pb#laQQaiM;tAB3;b{QvpsAFe%i-u-(tWI zJB91-0G^L0#DQPl#d_Nb{33ZCBmq1icAy9NZyWf!Dd0gj>q#2;E3)q{1H5{7t|tpT zFpT{i(~Ls>JYDiN7T~72EKeKoe7vFz_-@bgb)CRBlyE(j!0(aurVDs#gUtKD?;FGQ z`+%P}nRzYnu;`&5_$NLtUl06n6Sp$}{6|@TH39#Z1I~ZNS&aKDQ|FN7wOq zYzOYz#r+ine$ghG_kkbr9$z;O{EzayPbct)B@WXAJhB(plLB7)6!SFjJw(qlz(-1) zDhvD(@qbL7LOuMA_+u8}0a;(zfM=>$Ps)IY?QA#f!2fd*x8DIgxS8#<6L@1jt_3_; z!+Agr_!XD1{`i2eljkOCfnOnUKR@u-PGfsj58NVh3jn|Wa=x!7;OEQ!&miy%#UE}1 z9+iFIQQ+}^@;ay;cOm-v%O;Hf5- ze=qR27K=Uuw~HT=27c_fTs{Ll@+jN+Ebv*fUNCtJ^*Q;B%=^HzmE2An@V?F5?`6Pi zM4oowmp{Pe9l)RdUh)^ftvTkE!1Mb6UBF{bwm%y1+#G~TCTO{w<2|P7M;$y%^E#~(00KaND%O?qZf2qG0xJ}+amI7WS`?Au&-<5rC z8Q{q%_j?xjK9g7vO{Wyy0sS*HYmFY4j;Hvv!1=kXW> z?#r^Cv;n_$2GZhv0%9JuoX<}u*+Oy~aX0G^cmOC0!cnRhyYCztU$E&=>VdGB-& zaJz@+*(C7SWWQw!_#OHEa==q3a=&DNm%q>Q$pSxXKbC`OW}!Zhk>_+Q!0(dhyKTUq zlKpsPz+DgXII;sj`dXHACGfx!Zl?zP89(z{;Q9Tre&Ai=*VO}m<_fMS0DRvuJieNM zzqO3*PaE(XWZz&E_~m2R{>OkvZ(=*#0lZtrV;p!w_L+17FO#@#0=Rz|uQz*uf7HVF zl?1*}{NY~Udz7(0q=1`N^7=Ooyi4Mo8Q{sI*q_M)w@Y5k570pLk_-mnR{Ci7hoc>Oc1w{5`3$onp$z!x0I<=cVZwT1gD2K?qL z`F=ZqpDy+@4%{Vi*B;=Py~*__fqyCcc6x!2koQ-lfZr?64W)tm*R$Qu0Dn*R>t=yF z@8I=<>C{4f_DfvL0(_dR`)t6sia%2Z-1Y?Pn;rPn2gM%-Zk6ZAoWNaU*bk`$9_Zk8 zr3?5uGQViRca!*)4|r-j+l^Y_ODA%_`++~4X1iJs+;$(YkD7qn7jk|u2>iHHx&Aib zNB>Rq6S!%#tmAiL?7@AWSv_J-1Y{~Uw+_zEB9AD z@Q);37XTjJ%HyI5_(It?6$JjI*uys9x3%$ji2{G|W|n6=@H5V19s}kq~U>=W`6mYM^In%)XQ~AC!z%P>g zQ5LxELLNt^*@gP=vq-)ec$4J0Y`|;x;C?9s{*>&4vIDOi%j47m{Np`&+&O{oE6;0G z0uRaaATHpmHgkJ4;6o2!J@f(pZT|gKz@4%m#t%I3E!R^I{9@Uc7yuq0$M+iqK0*A_ zHsCEUv;IVZUpJq5JMd#9P7(tik^Q|Lz-LMxISxEo#r@t1yy`R_M+x9jjrFGoc%!V3 zlE4psi2Jt}c(cS&Q@~%A=djYi%Oo$E0sgx$#oq?LNaSpqQ>f=F<19}L@R!72wE