@roberttlange/agentlens 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +26 -0
- package/dist/browser.js +216 -0
- package/dist/browser.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +394 -0
- package/dist/main.js.map +1 -0
- package/dist/main.test.d.ts +1 -0
- package/dist/main.test.js +403 -0
- package/dist/main.test.js.map +1 -0
- package/node_modules/@agentlens/contracts/dist/index.d.ts +221 -0
- package/node_modules/@agentlens/contracts/dist/index.js +2 -0
- package/node_modules/@agentlens/contracts/dist/index.js.map +1 -0
- package/node_modules/@agentlens/contracts/package.json +22 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.js +485 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.js +121 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.js +2058 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/config.d.ts +9 -0
- package/node_modules/@agentlens/core/dist/config.js +273 -0
- package/node_modules/@agentlens/core/dist/config.js.map +1 -0
- package/node_modules/@agentlens/core/dist/discovery.d.ts +13 -0
- package/node_modules/@agentlens/core/dist/discovery.js +177 -0
- package/node_modules/@agentlens/core/dist/discovery.js.map +1 -0
- package/node_modules/@agentlens/core/dist/index.d.ts +6 -0
- package/node_modules/@agentlens/core/dist/index.js +7 -0
- package/node_modules/@agentlens/core/dist/index.js.map +1 -0
- package/node_modules/@agentlens/core/dist/metrics.d.ts +10 -0
- package/node_modules/@agentlens/core/dist/metrics.js +445 -0
- package/node_modules/@agentlens/core/dist/metrics.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.js +264 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.js +87 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.js +526 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/common.d.ts +35 -0
- package/node_modules/@agentlens/core/dist/parsers/common.js +138 -0
- package/node_modules/@agentlens/core/dist/parsers/common.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.js +511 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.js +179 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.d.ts +9 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.js +403 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.js +107 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.js +32 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/index.d.ts +11 -0
- package/node_modules/@agentlens/core/dist/parsers/index.js +59 -0
- package/node_modules/@agentlens/core/dist/parsers/index.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.js +591 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.js +219 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/types.d.ts +15 -0
- package/node_modules/@agentlens/core/dist/parsers/types.js +2 -0
- package/node_modules/@agentlens/core/dist/parsers/types.js.map +1 -0
- package/node_modules/@agentlens/core/dist/redaction.d.ts +3 -0
- package/node_modules/@agentlens/core/dist/redaction.js +97 -0
- package/node_modules/@agentlens/core/dist/redaction.js.map +1 -0
- package/node_modules/@agentlens/core/dist/snapshot.d.ts +2 -0
- package/node_modules/@agentlens/core/dist/snapshot.js +9 -0
- package/node_modules/@agentlens/core/dist/snapshot.js.map +1 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.d.ts +4 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.js +176 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.js.map +1 -0
- package/node_modules/@agentlens/core/dist/traceIndex.d.ts +66 -0
- package/node_modules/@agentlens/core/dist/traceIndex.js +1281 -0
- package/node_modules/@agentlens/core/dist/traceIndex.js.map +1 -0
- package/node_modules/@agentlens/core/dist/utils.d.ts +10 -0
- package/node_modules/@agentlens/core/dist/utils.js +125 -0
- package/node_modules/@agentlens/core/dist/utils.js.map +1 -0
- package/node_modules/@agentlens/core/package.json +28 -0
- package/node_modules/@agentlens/server/dist/app.d.ts +133 -0
- package/node_modules/@agentlens/server/dist/app.js +1939 -0
- package/node_modules/@agentlens/server/dist/app.js.map +1 -0
- package/node_modules/@agentlens/server/dist/app.test.d.ts +1 -0
- package/node_modules/@agentlens/server/dist/app.test.js +925 -0
- package/node_modules/@agentlens/server/dist/app.test.js.map +1 -0
- package/node_modules/@agentlens/server/dist/main.d.ts +1 -0
- package/node_modules/@agentlens/server/dist/main.js +3 -0
- package/node_modules/@agentlens/server/dist/main.js.map +1 -0
- package/node_modules/@agentlens/server/dist/web/assets/index-B9pmgl04.js +52 -0
- package/node_modules/@agentlens/server/dist/web/assets/index-Dwy5TIZL.css +1 -0
- package/node_modules/@agentlens/server/dist/web/favicon.png +0 -0
- package/node_modules/@agentlens/server/dist/web/favicon.svg +37 -0
- package/node_modules/@agentlens/server/dist/web/icons/claude.svg +7 -0
- package/node_modules/@agentlens/server/dist/web/icons/cursor.jpeg +0 -0
- package/node_modules/@agentlens/server/dist/web/icons/cursor.svg +5 -0
- package/node_modules/@agentlens/server/dist/web/icons/gemini.jpeg +0 -0
- package/node_modules/@agentlens/server/dist/web/icons/gemini.svg +37 -0
- package/node_modules/@agentlens/server/dist/web/icons/openai.svg +2 -0
- package/node_modules/@agentlens/server/dist/web/icons/opencode.png +0 -0
- package/node_modules/@agentlens/server/dist/web/index.html +17 -0
- package/node_modules/@agentlens/server/package.json +24 -0
- package/node_modules/@fastify/accept-negotiator/LICENSE +22 -0
- package/node_modules/@fastify/accept-negotiator/README.md +52 -0
- package/node_modules/@fastify/accept-negotiator/index.js +170 -0
- package/node_modules/@fastify/accept-negotiator/package.json +77 -0
- package/node_modules/@fastify/accept-negotiator/types/index.d.ts +17 -0
- package/node_modules/@fastify/ajv-compiler/.gitattributes +2 -0
- package/node_modules/@fastify/ajv-compiler/.github/.stale.yml +21 -0
- package/node_modules/@fastify/ajv-compiler/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/ajv-compiler/.github/tests_checker.yml +8 -0
- package/node_modules/@fastify/ajv-compiler/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/ajv-compiler/LICENSE +23 -0
- package/node_modules/@fastify/ajv-compiler/README.md +237 -0
- package/node_modules/@fastify/ajv-compiler/benchmark/small-object.mjs +37 -0
- package/node_modules/@fastify/ajv-compiler/eslint.config.js +6 -0
- package/node_modules/@fastify/ajv-compiler/index.js +53 -0
- package/node_modules/@fastify/ajv-compiler/lib/default-ajv-options.js +14 -0
- package/node_modules/@fastify/ajv-compiler/lib/serializer-compiler.js +27 -0
- package/node_modules/@fastify/ajv-compiler/lib/validator-compiler.js +58 -0
- package/node_modules/@fastify/ajv-compiler/package.json +84 -0
- package/node_modules/@fastify/ajv-compiler/standalone.js +44 -0
- package/node_modules/@fastify/ajv-compiler/test/.gitkeep +0 -0
- package/node_modules/@fastify/ajv-compiler/test/duplicated-id-compile.test.js +55 -0
- package/node_modules/@fastify/ajv-compiler/test/index.test.js +307 -0
- package/node_modules/@fastify/ajv-compiler/test/plugins.test.js +246 -0
- package/node_modules/@fastify/ajv-compiler/test/serialization.test.js +279 -0
- package/node_modules/@fastify/ajv-compiler/test/standalone.test.js +203 -0
- package/node_modules/@fastify/ajv-compiler/types/index.d.ts +87 -0
- package/node_modules/@fastify/ajv-compiler/types/index.test-d.ts +302 -0
- package/node_modules/@fastify/error/.gitattributes +2 -0
- package/node_modules/@fastify/error/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/error/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/error/LICENSE +21 -0
- package/node_modules/@fastify/error/README.md +140 -0
- package/node_modules/@fastify/error/benchmarks/create.js +9 -0
- package/node_modules/@fastify/error/benchmarks/instantiate.js +18 -0
- package/node_modules/@fastify/error/benchmarks/no-stack.js +13 -0
- package/node_modules/@fastify/error/benchmarks/toString.js +11 -0
- package/node_modules/@fastify/error/eslint.config.js +6 -0
- package/node_modules/@fastify/error/index.js +100 -0
- package/node_modules/@fastify/error/package.json +75 -0
- package/node_modules/@fastify/error/test/index.test.js +232 -0
- package/node_modules/@fastify/error/test/instanceof.test.js +263 -0
- package/node_modules/@fastify/error/types/index.d.ts +49 -0
- package/node_modules/@fastify/error/types/index.test-d.ts +92 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.eslintrc +1 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.gitattributes +2 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/LICENSE +21 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/README.md +128 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/eslint.config.js +6 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/index.js +8 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/package.json +71 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/standalone.js +58 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/duplicate-schema.test.js +26 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/plugin.test.js +78 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/standalone.test.js +230 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/types/index.d.ts +41 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/types/index.test-d.ts +142 -0
- package/node_modules/@fastify/forwarded/LICENSE +24 -0
- package/node_modules/@fastify/forwarded/README.md +43 -0
- package/node_modules/@fastify/forwarded/index.js +59 -0
- package/node_modules/@fastify/forwarded/package.json +74 -0
- package/node_modules/@fastify/forwarded/types/index.d.ts +14 -0
- package/node_modules/@fastify/merge-json-schemas/.gitattributes +2 -0
- package/node_modules/@fastify/merge-json-schemas/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/merge-json-schemas/.github/workflows/ci.yml +23 -0
- package/node_modules/@fastify/merge-json-schemas/LICENSE +21 -0
- package/node_modules/@fastify/merge-json-schemas/README.md +119 -0
- package/node_modules/@fastify/merge-json-schemas/eslint.config.js +6 -0
- package/node_modules/@fastify/merge-json-schemas/index.js +357 -0
- package/node_modules/@fastify/merge-json-schemas/lib/errors.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/lib/resolvers.js +127 -0
- package/node_modules/@fastify/merge-json-schemas/package.json +67 -0
- package/node_modules/@fastify/merge-json-schemas/test/additional-items.test.js +164 -0
- package/node_modules/@fastify/merge-json-schemas/test/additional-properties.test.js +129 -0
- package/node_modules/@fastify/merge-json-schemas/test/all-of.test.js +43 -0
- package/node_modules/@fastify/merge-json-schemas/test/any-of.test.js +81 -0
- package/node_modules/@fastify/merge-json-schemas/test/const.test.js +58 -0
- package/node_modules/@fastify/merge-json-schemas/test/contains.test.js +55 -0
- package/node_modules/@fastify/merge-json-schemas/test/custom-resolvers.test.js +50 -0
- package/node_modules/@fastify/merge-json-schemas/test/default-resolver.test.js +111 -0
- package/node_modules/@fastify/merge-json-schemas/test/default.test.js +50 -0
- package/node_modules/@fastify/merge-json-schemas/test/definitions.test.js +46 -0
- package/node_modules/@fastify/merge-json-schemas/test/defs.test.js +46 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependencies.test.js +75 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependent-required.test.js +75 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependent-schemas.test.js +76 -0
- package/node_modules/@fastify/merge-json-schemas/test/enum.test.js +44 -0
- package/node_modules/@fastify/merge-json-schemas/test/exclusive-maximum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/exclusive-minimum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/format.test.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/test/id.test.js +22 -0
- package/node_modules/@fastify/merge-json-schemas/test/if-then-else.test.js +550 -0
- package/node_modules/@fastify/merge-json-schemas/test/items.test.js +152 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-items.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-length.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-properties.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/maximum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/merge-schema.test.js +29 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-items.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-length.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-properties.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/minimum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/multiple-of.test.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/test/not.test.js +29 -0
- package/node_modules/@fastify/merge-json-schemas/test/nullable.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/one-of.test.js +144 -0
- package/node_modules/@fastify/merge-json-schemas/test/properties.test.js +312 -0
- package/node_modules/@fastify/merge-json-schemas/test/property-names.test.js +49 -0
- package/node_modules/@fastify/merge-json-schemas/test/required.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/type.test.js +52 -0
- package/node_modules/@fastify/merge-json-schemas/test/unique-items.test.js +38 -0
- package/node_modules/@fastify/merge-json-schemas/test/utils.js +9 -0
- package/node_modules/@fastify/merge-json-schemas/types/index.d.ts +61 -0
- package/node_modules/@fastify/merge-json-schemas/types/index.test-d.ts +52 -0
- package/node_modules/@fastify/proxy-addr/.gitattributes +2 -0
- package/node_modules/@fastify/proxy-addr/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/proxy-addr/.github/stale.yml +21 -0
- package/node_modules/@fastify/proxy-addr/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/proxy-addr/LICENSE +24 -0
- package/node_modules/@fastify/proxy-addr/README.md +141 -0
- package/node_modules/@fastify/proxy-addr/benchmark/compiling.js +50 -0
- package/node_modules/@fastify/proxy-addr/benchmark/index.js +30 -0
- package/node_modules/@fastify/proxy-addr/benchmark/kind.js +57 -0
- package/node_modules/@fastify/proxy-addr/benchmark/matching.js +78 -0
- package/node_modules/@fastify/proxy-addr/eslint.config.js +6 -0
- package/node_modules/@fastify/proxy-addr/index.js +331 -0
- package/node_modules/@fastify/proxy-addr/package.json +73 -0
- package/node_modules/@fastify/proxy-addr/test/all.test.js +55 -0
- package/node_modules/@fastify/proxy-addr/test/base.test.js +365 -0
- package/node_modules/@fastify/proxy-addr/test/compile.test.js +58 -0
- package/node_modules/@fastify/proxy-addr/types/index.d.ts +18 -0
- package/node_modules/@fastify/proxy-addr/types/index.test-d.ts +27 -0
- package/node_modules/@fastify/send/.gitattributes +2 -0
- package/node_modules/@fastify/send/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/send/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/send/HISTORY.md +521 -0
- package/node_modules/@fastify/send/LICENSE +23 -0
- package/node_modules/@fastify/send/README.md +310 -0
- package/node_modules/@fastify/send/benchmarks/collapseLeadingSlashes.js +13 -0
- package/node_modules/@fastify/send/benchmarks/containsDotFile.js +15 -0
- package/node_modules/@fastify/send/benchmarks/isUtf8MimeType.js +23 -0
- package/node_modules/@fastify/send/benchmarks/normalizeList.js +14 -0
- package/node_modules/@fastify/send/benchmarks/parseBytesRange.js +15 -0
- package/node_modules/@fastify/send/eslint.config.js +6 -0
- package/node_modules/@fastify/send/examples/index.html +1 -0
- package/node_modules/@fastify/send/examples/simple.js +15 -0
- package/node_modules/@fastify/send/index.js +28 -0
- package/node_modules/@fastify/send/lib/collapseLeadingSlashes.js +25 -0
- package/node_modules/@fastify/send/lib/containsDotFile.js +23 -0
- package/node_modules/@fastify/send/lib/contentRange.js +18 -0
- package/node_modules/@fastify/send/lib/createHtmlDocument.js +29 -0
- package/node_modules/@fastify/send/lib/createHttpError.js +23 -0
- package/node_modules/@fastify/send/lib/isUtf8MimeType.js +12 -0
- package/node_modules/@fastify/send/lib/normalizeList.js +28 -0
- package/node_modules/@fastify/send/lib/parseBytesRange.js +133 -0
- package/node_modules/@fastify/send/lib/parseTokenList.js +46 -0
- package/node_modules/@fastify/send/lib/send.js +729 -0
- package/node_modules/@fastify/send/package.json +81 -0
- package/node_modules/@fastify/send/test/collapseLeadingSlashes.test.js +22 -0
- package/node_modules/@fastify/send/test/containsDotFile.test.js +18 -0
- package/node_modules/@fastify/send/test/fixtures/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/.mine/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/.mine/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/do..ts.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/empty.txt +0 -0
- package/node_modules/@fastify/send/test/fixtures/images/node-js.png +0 -0
- package/node_modules/@fastify/send/test/fixtures/name.d/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.dir/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.html +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/no_ext +1 -0
- package/node_modules/@fastify/send/test/fixtures/nums.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/pets/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/pets/index.html +3 -0
- package/node_modules/@fastify/send/test/fixtures/snow /342/230/203/index.html +0 -0
- package/node_modules/@fastify/send/test/fixtures/some thing.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/thing.html.html +1 -0
- package/node_modules/@fastify/send/test/fixtures/tobi.html +1 -0
- package/node_modules/@fastify/send/test/isUtf8MimeType.test.js +22 -0
- package/node_modules/@fastify/send/test/mime.test.js +56 -0
- package/node_modules/@fastify/send/test/normalizeList.test.js +28 -0
- package/node_modules/@fastify/send/test/parseBytesRange.test.js +103 -0
- package/node_modules/@fastify/send/test/send.1.test.js +646 -0
- package/node_modules/@fastify/send/test/send.2.test.js +977 -0
- package/node_modules/@fastify/send/test/send.3.test.js +133 -0
- package/node_modules/@fastify/send/test/utils.js +36 -0
- package/node_modules/@fastify/send/types/index.d.ts +167 -0
- package/node_modules/@fastify/send/types/index.test-d.ts +67 -0
- package/node_modules/@fastify/static/.gitattributes +5 -0
- package/node_modules/@fastify/static/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/static/.github/stale.yml +21 -0
- package/node_modules/@fastify/static/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/static/LICENSE +23 -0
- package/node_modules/@fastify/static/README.md +538 -0
- package/node_modules/@fastify/static/eslint.config.js +7 -0
- package/node_modules/@fastify/static/example/public/.hidden/sample.json +1 -0
- package/node_modules/@fastify/static/example/public/images/sample.jpg +0 -0
- package/node_modules/@fastify/static/example/public/index.css +9 -0
- package/node_modules/@fastify/static/example/public/index.html +11 -0
- package/node_modules/@fastify/static/example/public/index.js +8 -0
- package/node_modules/@fastify/static/example/public2/test.css +4 -0
- package/node_modules/@fastify/static/example/public2/test.html +8 -0
- package/node_modules/@fastify/static/example/server-compress.js +15 -0
- package/node_modules/@fastify/static/example/server-dir-list.js +38 -0
- package/node_modules/@fastify/static/example/server-hidden-file.js +15 -0
- package/node_modules/@fastify/static/example/server.js +13 -0
- package/node_modules/@fastify/static/index.js +580 -0
- package/node_modules/@fastify/static/lib/dirList.js +211 -0
- package/node_modules/@fastify/static/package.json +87 -0
- package/node_modules/@fastify/static/test/content-type/binary +0 -0
- package/node_modules/@fastify/static/test/content-type/binary.br +1 -0
- package/node_modules/@fastify/static/test/content-type/index.css +0 -0
- package/node_modules/@fastify/static/test/content-type/index.css.br +1 -0
- package/node_modules/@fastify/static/test/content-type/index.html +5 -0
- package/node_modules/@fastify/static/test/content-type/index.html.br +0 -0
- package/node_modules/@fastify/static/test/content-type/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/content-type/test.txt +0 -0
- package/node_modules/@fastify/static/test/content-type/test.txt.br +1 -0
- package/node_modules/@fastify/static/test/content-type.test.js +144 -0
- package/node_modules/@fastify/static/test/dir-list.test.js +738 -0
- package/node_modules/@fastify/static/test/static/.example +1 -0
- package/node_modules/@fastify/static/test/static/100%.txt +1 -0
- package/node_modules/@fastify/static/test/static/a .md +1 -0
- package/node_modules/@fastify/static/test/static/deep/path/for/test/index.html +5 -0
- package/node_modules/@fastify/static/test/static/deep/path/for/test/purpose/foo.html +5 -0
- package/node_modules/@fastify/static/test/static/foo.html +3 -0
- package/node_modules/@fastify/static/test/static/foobar.html +3 -0
- package/node_modules/@fastify/static/test/static/index.css +0 -0
- package/node_modules/@fastify/static/test/static/index.html +5 -0
- package/node_modules/@fastify/static/test/static/shallow/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/.aaa +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/dir/index.html +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/test.txt +0 -0
- package/node_modules/@fastify/static/test/static-encode/[...]/a .md +1 -0
- package/node_modules/@fastify/static/test/static-filtered/bar.private +1 -0
- package/node_modules/@fastify/static/test/static-filtered/deep/path/to/baz.html +3 -0
- package/node_modules/@fastify/static/test/static-filtered/deep/path/to/baz.private +1 -0
- package/node_modules/@fastify/static/test/static-filtered/index.html +3 -0
- package/node_modules/@fastify/static/test/static-hidden/.hidden/sample.json +1 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/baz.json +3 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir/index.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir-gz/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir-gz/index.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/empty/.gitkeep +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/gzip-only.html +3 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/gzip-only.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/index.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/sample.jpg.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/uncompressed.html +3 -0
- package/node_modules/@fastify/static/test/static-symbolic-link/origin/subdir/subdir/index.html +3 -0
- package/node_modules/@fastify/static/test/static.test.js +3793 -0
- package/node_modules/@fastify/static/test/static2/bar.html +3 -0
- package/node_modules/@fastify/static/test/static2/index.html +3 -0
- package/node_modules/@fastify/static/types/index.d.ts +140 -0
- package/node_modules/@fastify/static/types/index.test-d.ts +240 -0
- package/node_modules/@iarna/toml/LICENSE +14 -0
- package/node_modules/@iarna/toml/README.md +301 -0
- package/node_modules/@iarna/toml/index.d.ts +57 -0
- package/node_modules/@iarna/toml/lib/create-date.js +23 -0
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
- package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
- package/node_modules/@iarna/toml/lib/create-time.js +22 -0
- package/node_modules/@iarna/toml/lib/format-num.js +6 -0
- package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
- package/node_modules/@iarna/toml/lib/parser.js +127 -0
- package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
- package/node_modules/@iarna/toml/package.json +82 -0
- package/node_modules/@iarna/toml/parse-async.js +30 -0
- package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
- package/node_modules/@iarna/toml/parse-stream.js +80 -0
- package/node_modules/@iarna/toml/parse-string.js +18 -0
- package/node_modules/@iarna/toml/parse.js +5 -0
- package/node_modules/@iarna/toml/stringify.js +296 -0
- package/node_modules/@iarna/toml/toml.js +3 -0
- package/node_modules/@isaacs/balanced-match/LICENSE.md +23 -0
- package/node_modules/@isaacs/balanced-match/README.md +60 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js +59 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js +54 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/package.json +79 -0
- package/node_modules/@isaacs/brace-expansion/LICENSE +23 -0
- package/node_modules/@isaacs/brace-expansion/README.md +97 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +199 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js +195 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/package.json +60 -0
- package/node_modules/@isaacs/cliui/LICENSE.md +63 -0
- package/node_modules/@isaacs/cliui/README.md +151 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts +4 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +16 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts +34 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +170 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts +6 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +307 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts +41 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js +322 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +12 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts +5 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +49 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +8 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +176 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts +4 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +12 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts +34 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +167 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts +6 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +299 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +3 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts +41 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.js +317 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js +12 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js.map +7 -0
- package/node_modules/@isaacs/cliui/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts +5 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +46 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +4 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts +7 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +172 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/package.json +163 -0
- package/node_modules/@lukeed/ms/dist/index.js +37 -0
- package/node_modules/@lukeed/ms/dist/index.min.js +1 -0
- package/node_modules/@lukeed/ms/dist/index.mjs +34 -0
- package/node_modules/@lukeed/ms/index.d.ts +2 -0
- package/node_modules/@lukeed/ms/license +9 -0
- package/node_modules/@lukeed/ms/package.json +48 -0
- package/node_modules/@lukeed/ms/readme.md +133 -0
- package/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/node_modules/@pinojs/redact/.github/dependabot.yml +13 -0
- package/node_modules/@pinojs/redact/.github/workflows/ci.yml +48 -0
- package/node_modules/@pinojs/redact/.github/workflows/publish-release.yml +43 -0
- package/node_modules/@pinojs/redact/LICENSE +21 -0
- package/node_modules/@pinojs/redact/README.md +350 -0
- package/node_modules/@pinojs/redact/benchmarks/basic.js +184 -0
- package/node_modules/@pinojs/redact/eslint.config.js +1 -0
- package/node_modules/@pinojs/redact/index.d.ts +52 -0
- package/node_modules/@pinojs/redact/index.js +529 -0
- package/node_modules/@pinojs/redact/index.test-d.ts +22 -0
- package/node_modules/@pinojs/redact/package.json +37 -0
- package/node_modules/@pinojs/redact/scripts/sync-version.mjs +20 -0
- package/node_modules/@pinojs/redact/test/actual-redact-comparison.test.js +211 -0
- package/node_modules/@pinojs/redact/test/index.test.js +824 -0
- package/node_modules/@pinojs/redact/test/integration.test.js +390 -0
- package/node_modules/@pinojs/redact/test/multiple-wildcards.test.js +227 -0
- package/node_modules/@pinojs/redact/test/prototype-pollution.test.js +223 -0
- package/node_modules/@pinojs/redact/test/selective-clone.test.js +115 -0
- package/node_modules/@pinojs/redact/tsconfig.json +19 -0
- package/node_modules/abstract-logging/Readme.md +47 -0
- package/node_modules/abstract-logging/index.js +18 -0
- package/node_modules/abstract-logging/package.json +25 -0
- package/node_modules/abstract-logging/test.js +17 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +229 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +173 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +266 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +891 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ajv-formats/LICENSE +21 -0
- package/node_modules/ajv-formats/README.md +125 -0
- package/node_modules/ajv-formats/dist/formats.d.ts +9 -0
- package/node_modules/ajv-formats/dist/formats.js +208 -0
- package/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/node_modules/ajv-formats/dist/index.d.ts +15 -0
- package/node_modules/ajv-formats/dist/index.js +37 -0
- package/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/node_modules/ajv-formats/dist/limit.d.ts +10 -0
- package/node_modules/ajv-formats/dist/limit.js +69 -0
- package/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/node_modules/ajv-formats/package.json +74 -0
- package/node_modules/ajv-formats/src/formats.ts +269 -0
- package/node_modules/ajv-formats/src/index.ts +62 -0
- package/node_modules/ajv-formats/src/limit.ts +99 -0
- package/node_modules/atomic-sleep/.travis.yml +11 -0
- package/node_modules/atomic-sleep/LICENSE +22 -0
- package/node_modules/atomic-sleep/index.js +38 -0
- package/node_modules/atomic-sleep/package.json +37 -0
- package/node_modules/atomic-sleep/readme.md +58 -0
- package/node_modules/atomic-sleep/test.js +47 -0
- package/node_modules/avvio/.gitattributes +2 -0
- package/node_modules/avvio/.github/dependabot.yml +13 -0
- package/node_modules/avvio/.github/release-drafter.yml +4 -0
- package/node_modules/avvio/.github/tests_checker.yml +3 -0
- package/node_modules/avvio/.github/workflows/ci.yml +24 -0
- package/node_modules/avvio/.taprc +3 -0
- package/node_modules/avvio/LICENSE +24 -0
- package/node_modules/avvio/README.md +670 -0
- package/node_modules/avvio/boot.js +607 -0
- package/node_modules/avvio/examples/example.js +72 -0
- package/node_modules/avvio/index.d.ts +92 -0
- package/node_modules/avvio/lib/create-promise.js +45 -0
- package/node_modules/avvio/lib/debug.js +19 -0
- package/node_modules/avvio/lib/errors.js +38 -0
- package/node_modules/avvio/lib/execute-with-thenable.js +28 -0
- package/node_modules/avvio/lib/get-plugin-name.js +34 -0
- package/node_modules/avvio/lib/is-bundled-or-typescript-plugin.js +23 -0
- package/node_modules/avvio/lib/is-promise-like.js +17 -0
- package/node_modules/avvio/lib/plugin.js +279 -0
- package/node_modules/avvio/lib/symbols.js +26 -0
- package/node_modules/avvio/lib/thenify.js +60 -0
- package/node_modules/avvio/lib/time-tree.js +200 -0
- package/node_modules/avvio/lib/validate-plugin.js +26 -0
- package/node_modules/avvio/package.json +51 -0
- package/node_modules/avvio/test/after-and-ready.test.js +864 -0
- package/node_modules/avvio/test/after-pass-through.test.js +32 -0
- package/node_modules/avvio/test/after-self-promise.test.js +20 -0
- package/node_modules/avvio/test/after-throw.test.js +24 -0
- package/node_modules/avvio/test/after-use-after.test.js +90 -0
- package/node_modules/avvio/test/async-await.test.js +325 -0
- package/node_modules/avvio/test/await-after.test.js +449 -0
- package/node_modules/avvio/test/await-self.test.js +31 -0
- package/node_modules/avvio/test/await-use.test.js +294 -0
- package/node_modules/avvio/test/basic.test.js +439 -0
- package/node_modules/avvio/test/callbacks.test.js +113 -0
- package/node_modules/avvio/test/catch-override-exception.test.js +26 -0
- package/node_modules/avvio/test/chainable.test.js +67 -0
- package/node_modules/avvio/test/close.test.js +544 -0
- package/node_modules/avvio/test/errors.test.js +26 -0
- package/node_modules/avvio/test/esm.mjs +12 -0
- package/node_modules/avvio/test/esm.test.js +14 -0
- package/node_modules/avvio/test/events-listeners.test.js +23 -0
- package/node_modules/avvio/test/expose.test.js +80 -0
- package/node_modules/avvio/test/fixtures/dummy.txt +1 -0
- package/node_modules/avvio/test/fixtures/esm.mjs +3 -0
- package/node_modules/avvio/test/fixtures/plugin-no-next.js +5 -0
- package/node_modules/avvio/test/gh-issues/bug-205.test.js +16 -0
- package/node_modules/avvio/test/lib/create-promise.test.js +55 -0
- package/node_modules/avvio/test/lib/execute-with-thenable.test.js +82 -0
- package/node_modules/avvio/test/lib/get-plugin-name.test.js +67 -0
- package/node_modules/avvio/test/lib/is-bundled-or-typescript-plugin.test.js +20 -0
- package/node_modules/avvio/test/lib/is-promise-like.test.js +20 -0
- package/node_modules/avvio/test/lib/thenify.test.js +123 -0
- package/node_modules/avvio/test/lib/time-tree.test.js +391 -0
- package/node_modules/avvio/test/lib/validate-plugin.test.js +19 -0
- package/node_modules/avvio/test/load-plugin.test.js +123 -0
- package/node_modules/avvio/test/no-done.test.js +18 -0
- package/node_modules/avvio/test/on-ready-timeout-await.test.js +33 -0
- package/node_modules/avvio/test/override.test.js +374 -0
- package/node_modules/avvio/test/plugin-loaded-so-far.test.js +84 -0
- package/node_modules/avvio/test/plugin-name.test.js +69 -0
- package/node_modules/avvio/test/plugin-timeout-await.test.js +33 -0
- package/node_modules/avvio/test/plugin-timeout.test.js +218 -0
- package/node_modules/avvio/test/pretty-print.test.js +75 -0
- package/node_modules/avvio/test/reentrant.test.js +124 -0
- package/node_modules/avvio/test/to-json.test.js +151 -0
- package/node_modules/avvio/test/twice-done.test.js +22 -0
- package/node_modules/avvio/test/types/index.ts +411 -0
- package/node_modules/avvio/test/types/tsconfig.json +9 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +586 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +60 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +331 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +122 -0
- package/node_modules/braces/package.json +77 -0
- package/node_modules/chokidar/LICENSE +21 -0
- package/node_modules/chokidar/README.md +305 -0
- package/node_modules/chokidar/handler.d.ts +90 -0
- package/node_modules/chokidar/handler.js +632 -0
- package/node_modules/chokidar/index.d.ts +217 -0
- package/node_modules/chokidar/index.js +822 -0
- package/node_modules/chokidar/package.json +63 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1149 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +709 -0
- package/node_modules/commander/lib/option.js +367 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/content-disposition/HISTORY.md +60 -0
- package/node_modules/content-disposition/LICENSE +22 -0
- package/node_modules/content-disposition/README.md +142 -0
- package/node_modules/content-disposition/index.js +458 -0
- package/node_modules/content-disposition/package.json +44 -0
- package/node_modules/cookie/LICENSE +24 -0
- package/node_modules/cookie/README.md +295 -0
- package/node_modules/cookie/dist/index.d.ts +148 -0
- package/node_modules/cookie/dist/index.js +350 -0
- package/node_modules/cookie/dist/index.js.map +1 -0
- package/node_modules/cookie/package.json +47 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/index.d.ts +1 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.d.ts +1 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +57 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/fast-decode-uri-component/.travis.yml +12 -0
- package/node_modules/fast-decode-uri-component/LICENSE +23 -0
- package/node_modules/fast-decode-uri-component/README.md +43 -0
- package/node_modules/fast-decode-uri-component/bench.js +35 -0
- package/node_modules/fast-decode-uri-component/index.js +115 -0
- package/node_modules/fast-decode-uri-component/package.json +33 -0
- package/node_modules/fast-decode-uri-component/test.js +32 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-glob/LICENSE +21 -0
- package/node_modules/fast-glob/README.md +830 -0
- package/node_modules/fast-glob/out/index.d.ts +40 -0
- package/node_modules/fast-glob/out/index.js +102 -0
- package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/async.js +23 -0
- package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
- package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
- package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/node_modules/fast-glob/out/readers/async.js +35 -0
- package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/node_modules/fast-glob/out/settings.js +59 -0
- package/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/node_modules/fast-glob/out/types/index.js +2 -0
- package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/array.js +22 -0
- package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/node_modules/fast-glob/out/utils/index.js +17 -0
- package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/node_modules/fast-glob/out/utils/path.js +68 -0
- package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
- package/node_modules/fast-glob/out/utils/pattern.js +206 -0
- package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/string.js +11 -0
- package/node_modules/fast-glob/package.json +81 -0
- package/node_modules/fast-json-stringify/.gitattributes +2 -0
- package/node_modules/fast-json-stringify/.github/dependabot.yml +13 -0
- package/node_modules/fast-json-stringify/.github/stale.yml +21 -0
- package/node_modules/fast-json-stringify/.github/workflows/ci.yml +33 -0
- package/node_modules/fast-json-stringify/LICENSE +24 -0
- package/node_modules/fast-json-stringify/README.md +742 -0
- package/node_modules/fast-json-stringify/benchmark/bench-cmp-branch.js +116 -0
- package/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +323 -0
- package/node_modules/fast-json-stringify/benchmark/bench-thread.js +33 -0
- package/node_modules/fast-json-stringify/benchmark/bench.js +391 -0
- package/node_modules/fast-json-stringify/build/build-schema-validator.js +26 -0
- package/node_modules/fast-json-stringify/eslint.config.js +9 -0
- package/node_modules/fast-json-stringify/examples/example.js +81 -0
- package/node_modules/fast-json-stringify/examples/server.js +42 -0
- package/node_modules/fast-json-stringify/index.js +1312 -0
- package/node_modules/fast-json-stringify/lib/location.js +24 -0
- package/node_modules/fast-json-stringify/lib/merge-schemas.js +9 -0
- package/node_modules/fast-json-stringify/lib/schema-validator.js +1134 -0
- package/node_modules/fast-json-stringify/lib/serializer.js +141 -0
- package/node_modules/fast-json-stringify/lib/standalone.js +34 -0
- package/node_modules/fast-json-stringify/lib/validator.js +96 -0
- package/node_modules/fast-json-stringify/package.json +89 -0
- package/node_modules/fast-json-stringify/test/additionalProperties.test.js +332 -0
- package/node_modules/fast-json-stringify/test/allof.test.js +751 -0
- package/node_modules/fast-json-stringify/test/any.test.js +231 -0
- package/node_modules/fast-json-stringify/test/anyof.test.js +792 -0
- package/node_modules/fast-json-stringify/test/array.test.js +666 -0
- package/node_modules/fast-json-stringify/test/asNumber.test.js +13 -0
- package/node_modules/fast-json-stringify/test/basic.test.js +400 -0
- package/node_modules/fast-json-stringify/test/bigint.test.js +76 -0
- package/node_modules/fast-json-stringify/test/clean-cache.test.js +47 -0
- package/node_modules/fast-json-stringify/test/const.test.js +314 -0
- package/node_modules/fast-json-stringify/test/date.test.js +639 -0
- package/node_modules/fast-json-stringify/test/debug-mode.test.js +121 -0
- package/node_modules/fast-json-stringify/test/defaults.test.js +376 -0
- package/node_modules/fast-json-stringify/test/enum.test.js +37 -0
- package/node_modules/fast-json-stringify/test/fix-604.test.js +25 -0
- package/node_modules/fast-json-stringify/test/fixtures/.keep +0 -0
- package/node_modules/fast-json-stringify/test/if-then-else.test.js +468 -0
- package/node_modules/fast-json-stringify/test/inferType.test.js +92 -0
- package/node_modules/fast-json-stringify/test/infinity.test.js +55 -0
- package/node_modules/fast-json-stringify/test/integer.test.js +194 -0
- package/node_modules/fast-json-stringify/test/invalidSchema.test.js +18 -0
- package/node_modules/fast-json-stringify/test/issue-479.test.js +57 -0
- package/node_modules/fast-json-stringify/test/issue-793.test.js +107 -0
- package/node_modules/fast-json-stringify/test/issue-794.test.js +177 -0
- package/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/README.md +10 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4/required.json +54 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6/required.json +70 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7/required.json +70 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/util.js +31 -0
- package/node_modules/fast-json-stringify/test/missing-values.test.js +88 -0
- package/node_modules/fast-json-stringify/test/multi-type-serializer.test.js +19 -0
- package/node_modules/fast-json-stringify/test/nestedObjects.test.js +63 -0
- package/node_modules/fast-json-stringify/test/nullable.test.js +543 -0
- package/node_modules/fast-json-stringify/test/oneof.test.js +490 -0
- package/node_modules/fast-json-stringify/test/patternProperties.test.js +168 -0
- package/node_modules/fast-json-stringify/test/recursion.test.js +245 -0
- package/node_modules/fast-json-stringify/test/ref.json +12 -0
- package/node_modules/fast-json-stringify/test/ref.test.js +2046 -0
- package/node_modules/fast-json-stringify/test/regex.test.js +32 -0
- package/node_modules/fast-json-stringify/test/required.test.js +204 -0
- package/node_modules/fast-json-stringify/test/requiresAjv.test.js +50 -0
- package/node_modules/fast-json-stringify/test/sanitize.test.js +141 -0
- package/node_modules/fast-json-stringify/test/sanitize2.test.js +18 -0
- package/node_modules/fast-json-stringify/test/sanitize3.test.js +17 -0
- package/node_modules/fast-json-stringify/test/sanitize4.test.js +16 -0
- package/node_modules/fast-json-stringify/test/sanitize5.test.js +16 -0
- package/node_modules/fast-json-stringify/test/sanitize6.test.js +22 -0
- package/node_modules/fast-json-stringify/test/sanitize7.test.js +68 -0
- package/node_modules/fast-json-stringify/test/side-effect.test.js +196 -0
- package/node_modules/fast-json-stringify/test/standalone-mode.test.js +219 -0
- package/node_modules/fast-json-stringify/test/string.test.js +84 -0
- package/node_modules/fast-json-stringify/test/surrogate.test.js +67 -0
- package/node_modules/fast-json-stringify/test/toJSON.test.js +203 -0
- package/node_modules/fast-json-stringify/test/typebox.test.js +36 -0
- package/node_modules/fast-json-stringify/test/typesArray.test.js +550 -0
- package/node_modules/fast-json-stringify/test/unknownFormats.test.js +27 -0
- package/node_modules/fast-json-stringify/test/webpack.test.js +50 -0
- package/node_modules/fast-json-stringify/types/index.d.ts +231 -0
- package/node_modules/fast-json-stringify/types/index.test-d.ts +259 -0
- package/node_modules/fast-querystring/LICENSE +25 -0
- package/node_modules/fast-querystring/README.md +114 -0
- package/node_modules/fast-querystring/lib/index.d.ts +14 -0
- package/node_modules/fast-querystring/lib/index.js +20 -0
- package/node_modules/fast-querystring/lib/internals/querystring.js +96 -0
- package/node_modules/fast-querystring/lib/parse.js +126 -0
- package/node_modules/fast-querystring/lib/stringify.js +69 -0
- package/node_modules/fast-querystring/package.json +56 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/.stale.yml +21 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/tests_checker.yml +8 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +101 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +32 -0
- package/node_modules/fast-uri/README.md +143 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +340 -0
- package/node_modules/fast-uri/lib/schemes.js +267 -0
- package/node_modules/fast-uri/lib/utils.js +336 -0
- package/node_modules/fast-uri/package.json +69 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/equal.test.js +108 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +318 -0
- package/node_modules/fast-uri/test/resolve.test.js +78 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/fastify/.borp.yaml +3 -0
- package/node_modules/fastify/.markdownlint-cli2.yaml +22 -0
- package/node_modules/fastify/.prettierignore +1 -0
- package/node_modules/fastify/AGENTS.md +290 -0
- package/node_modules/fastify/GOVERNANCE.md +4 -0
- package/node_modules/fastify/LICENSE +21 -0
- package/node_modules/fastify/PROJECT_CHARTER.md +126 -0
- package/node_modules/fastify/README.md +422 -0
- package/node_modules/fastify/SECURITY.md +211 -0
- package/node_modules/fastify/SPONSORS.md +24 -0
- package/node_modules/fastify/build/build-error-serializer.js +35 -0
- package/node_modules/fastify/build/build-validation.js +167 -0
- package/node_modules/fastify/build/sync-version.js +11 -0
- package/node_modules/fastify/docs/Guides/Benchmarking.md +60 -0
- package/node_modules/fastify/docs/Guides/Database.md +321 -0
- package/node_modules/fastify/docs/Guides/Delay-Accepting-Requests.md +608 -0
- package/node_modules/fastify/docs/Guides/Detecting-When-Clients-Abort.md +172 -0
- package/node_modules/fastify/docs/Guides/Ecosystem.md +768 -0
- package/node_modules/fastify/docs/Guides/Fluent-Schema.md +126 -0
- package/node_modules/fastify/docs/Guides/Getting-Started.md +620 -0
- package/node_modules/fastify/docs/Guides/Index.md +43 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V3.md +287 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V4.md +271 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V5.md +727 -0
- package/node_modules/fastify/docs/Guides/Plugins-Guide.md +520 -0
- package/node_modules/fastify/docs/Guides/Prototype-Poisoning.md +383 -0
- package/node_modules/fastify/docs/Guides/Recommendations.md +353 -0
- package/node_modules/fastify/docs/Guides/Serverless.md +604 -0
- package/node_modules/fastify/docs/Guides/Style-Guide.md +246 -0
- package/node_modules/fastify/docs/Guides/Testing.md +481 -0
- package/node_modules/fastify/docs/Guides/Write-Plugin.md +103 -0
- package/node_modules/fastify/docs/Guides/Write-Type-Provider.md +34 -0
- package/node_modules/fastify/docs/Reference/ContentTypeParser.md +255 -0
- package/node_modules/fastify/docs/Reference/Decorators.md +434 -0
- package/node_modules/fastify/docs/Reference/Encapsulation.md +194 -0
- package/node_modules/fastify/docs/Reference/Errors.md +372 -0
- package/node_modules/fastify/docs/Reference/HTTP2.md +94 -0
- package/node_modules/fastify/docs/Reference/Hooks.md +896 -0
- package/node_modules/fastify/docs/Reference/Index.md +73 -0
- package/node_modules/fastify/docs/Reference/LTS.md +86 -0
- package/node_modules/fastify/docs/Reference/Lifecycle.md +84 -0
- package/node_modules/fastify/docs/Reference/Logging.md +264 -0
- package/node_modules/fastify/docs/Reference/Middleware.md +78 -0
- package/node_modules/fastify/docs/Reference/Plugins.md +245 -0
- package/node_modules/fastify/docs/Reference/Principles.md +73 -0
- package/node_modules/fastify/docs/Reference/Reply.md +994 -0
- package/node_modules/fastify/docs/Reference/Request.md +279 -0
- package/node_modules/fastify/docs/Reference/Routes.md +793 -0
- package/node_modules/fastify/docs/Reference/Server.md +2265 -0
- package/node_modules/fastify/docs/Reference/Type-Providers.md +256 -0
- package/node_modules/fastify/docs/Reference/TypeScript.md +1725 -0
- package/node_modules/fastify/docs/Reference/Validation-and-Serialization.md +1057 -0
- package/node_modules/fastify/docs/Reference/Warnings.md +58 -0
- package/node_modules/fastify/docs/index.md +24 -0
- package/node_modules/fastify/docs/resources/encapsulation_context.drawio +1 -0
- package/node_modules/fastify/docs/resources/encapsulation_context.svg +3 -0
- package/node_modules/fastify/eslint.config.js +35 -0
- package/node_modules/fastify/examples/asyncawait.js +38 -0
- package/node_modules/fastify/examples/benchmark/body.json +3 -0
- package/node_modules/fastify/examples/benchmark/hooks-benchmark-async-await.js +44 -0
- package/node_modules/fastify/examples/benchmark/hooks-benchmark.js +52 -0
- package/node_modules/fastify/examples/benchmark/parser.js +47 -0
- package/node_modules/fastify/examples/benchmark/simple.js +30 -0
- package/node_modules/fastify/examples/benchmark/webstream.js +27 -0
- package/node_modules/fastify/examples/hooks.js +91 -0
- package/node_modules/fastify/examples/http2.js +39 -0
- package/node_modules/fastify/examples/https.js +38 -0
- package/node_modules/fastify/examples/parser.js +53 -0
- package/node_modules/fastify/examples/plugin.js +12 -0
- package/node_modules/fastify/examples/route-prefix.js +38 -0
- package/node_modules/fastify/examples/shared-schema.js +38 -0
- package/node_modules/fastify/examples/simple-stream.js +20 -0
- package/node_modules/fastify/examples/simple.js +32 -0
- package/node_modules/fastify/examples/simple.mjs +27 -0
- package/node_modules/fastify/examples/typescript-server.ts +79 -0
- package/node_modules/fastify/examples/use-plugin.js +29 -0
- package/node_modules/fastify/fastify.d.ts +252 -0
- package/node_modules/fastify/fastify.js +983 -0
- package/node_modules/fastify/integration/server.js +29 -0
- package/node_modules/fastify/integration/test.sh +23 -0
- package/node_modules/fastify/lib/config-validator.js +1238 -0
- package/node_modules/fastify/lib/content-type-parser.js +413 -0
- package/node_modules/fastify/lib/content-type.js +152 -0
- package/node_modules/fastify/lib/context.js +95 -0
- package/node_modules/fastify/lib/decorate.js +152 -0
- package/node_modules/fastify/lib/error-handler.js +173 -0
- package/node_modules/fastify/lib/error-serializer.js +134 -0
- package/node_modules/fastify/lib/error-status.js +14 -0
- package/node_modules/fastify/lib/errors.js +505 -0
- package/node_modules/fastify/lib/four-oh-four.js +190 -0
- package/node_modules/fastify/lib/handle-request.js +195 -0
- package/node_modules/fastify/lib/head-route.js +45 -0
- package/node_modules/fastify/lib/hooks.js +429 -0
- package/node_modules/fastify/lib/initial-config-validation.js +37 -0
- package/node_modules/fastify/lib/logger-factory.js +136 -0
- package/node_modules/fastify/lib/logger-pino.js +68 -0
- package/node_modules/fastify/lib/noop-set.js +10 -0
- package/node_modules/fastify/lib/plugin-override.js +90 -0
- package/node_modules/fastify/lib/plugin-utils.js +169 -0
- package/node_modules/fastify/lib/promise.js +23 -0
- package/node_modules/fastify/lib/reply.js +1008 -0
- package/node_modules/fastify/lib/req-id-gen-factory.js +52 -0
- package/node_modules/fastify/lib/request.js +374 -0
- package/node_modules/fastify/lib/route.js +645 -0
- package/node_modules/fastify/lib/schema-controller.js +164 -0
- package/node_modules/fastify/lib/schemas.js +207 -0
- package/node_modules/fastify/lib/server.js +441 -0
- package/node_modules/fastify/lib/symbols.js +67 -0
- package/node_modules/fastify/lib/validation.js +280 -0
- package/node_modules/fastify/lib/warnings.js +57 -0
- package/node_modules/fastify/lib/wrap-thenable.js +84 -0
- package/node_modules/fastify/node_modules/semver/LICENSE +15 -0
- package/node_modules/fastify/node_modules/semver/README.md +665 -0
- package/node_modules/fastify/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/fastify/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/fastify/node_modules/semver/classes/index.js +7 -0
- package/node_modules/fastify/node_modules/semver/classes/range.js +557 -0
- package/node_modules/fastify/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/fastify/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/fastify/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/fastify/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/fastify/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/fastify/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/fastify/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/fastify/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/fastify/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/major.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/fastify/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/fastify/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/fastify/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/fastify/node_modules/semver/index.js +91 -0
- package/node_modules/fastify/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/fastify/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/fastify/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/fastify/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/fastify/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/fastify/node_modules/semver/internal/re.js +223 -0
- package/node_modules/fastify/node_modules/semver/package.json +78 -0
- package/node_modules/fastify/node_modules/semver/preload.js +4 -0
- package/node_modules/fastify/node_modules/semver/range.bnf +16 -0
- package/node_modules/fastify/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/fastify/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/fastify/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/fastify/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/fastify/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/fastify/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/fastify/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/fastify/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/fastify/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/fastify/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/fastify/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/fastify/package.json +225 -0
- package/node_modules/fastify/test/404s.test.js +2035 -0
- package/node_modules/fastify/test/500s.test.js +422 -0
- package/node_modules/fastify/test/allow-unsafe-regex.test.js +92 -0
- package/node_modules/fastify/test/als.test.js +65 -0
- package/node_modules/fastify/test/async-await.test.js +705 -0
- package/node_modules/fastify/test/async-dispose.test.js +20 -0
- package/node_modules/fastify/test/async_hooks.test.js +52 -0
- package/node_modules/fastify/test/body-limit.test.js +224 -0
- package/node_modules/fastify/test/buffer.test.js +74 -0
- package/node_modules/fastify/test/build/error-serializer.test.js +36 -0
- package/node_modules/fastify/test/build/version.test.js +14 -0
- package/node_modules/fastify/test/build-certificate.js +109 -0
- package/node_modules/fastify/test/bundler/README.md +29 -0
- package/node_modules/fastify/test/bundler/esbuild/bundler-test.js +32 -0
- package/node_modules/fastify/test/bundler/esbuild/package.json +10 -0
- package/node_modules/fastify/test/bundler/esbuild/src/fail-plugin-version.js +14 -0
- package/node_modules/fastify/test/bundler/esbuild/src/index.js +9 -0
- package/node_modules/fastify/test/bundler/webpack/bundler-test.js +32 -0
- package/node_modules/fastify/test/bundler/webpack/package.json +11 -0
- package/node_modules/fastify/test/bundler/webpack/src/fail-plugin-version.js +14 -0
- package/node_modules/fastify/test/bundler/webpack/src/index.js +9 -0
- package/node_modules/fastify/test/bundler/webpack/webpack.config.js +15 -0
- package/node_modules/fastify/test/case-insensitive.test.js +102 -0
- package/node_modules/fastify/test/chainable.test.js +40 -0
- package/node_modules/fastify/test/child-logger-factory.test.js +128 -0
- package/node_modules/fastify/test/client-timeout.test.js +38 -0
- package/node_modules/fastify/test/close-pipelining.test.js +78 -0
- package/node_modules/fastify/test/close.test.js +706 -0
- package/node_modules/fastify/test/conditional-pino.test.js +47 -0
- package/node_modules/fastify/test/connection-timeout.test.js +42 -0
- package/node_modules/fastify/test/constrained-routes.test.js +1138 -0
- package/node_modules/fastify/test/content-length.test.js +174 -0
- package/node_modules/fastify/test/content-parser.test.js +715 -0
- package/node_modules/fastify/test/content-type.test.js +143 -0
- package/node_modules/fastify/test/context-config.test.js +164 -0
- package/node_modules/fastify/test/custom-http-server.test.js +118 -0
- package/node_modules/fastify/test/custom-parser-async.test.js +59 -0
- package/node_modules/fastify/test/custom-parser.0.test.js +701 -0
- package/node_modules/fastify/test/custom-parser.1.test.js +266 -0
- package/node_modules/fastify/test/custom-parser.2.test.js +91 -0
- package/node_modules/fastify/test/custom-parser.3.test.js +208 -0
- package/node_modules/fastify/test/custom-parser.4.test.js +218 -0
- package/node_modules/fastify/test/custom-parser.5.test.js +130 -0
- package/node_modules/fastify/test/custom-querystring-parser.test.js +129 -0
- package/node_modules/fastify/test/decorator.test.js +1330 -0
- package/node_modules/fastify/test/delete.test.js +344 -0
- package/node_modules/fastify/test/diagnostics-channel/404.test.js +49 -0
- package/node_modules/fastify/test/diagnostics-channel/async-delay-request.test.js +65 -0
- package/node_modules/fastify/test/diagnostics-channel/async-request.test.js +64 -0
- package/node_modules/fastify/test/diagnostics-channel/error-before-handler.test.js +35 -0
- package/node_modules/fastify/test/diagnostics-channel/error-request.test.js +53 -0
- package/node_modules/fastify/test/diagnostics-channel/error-status.test.js +123 -0
- package/node_modules/fastify/test/diagnostics-channel/init.test.js +50 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-delay-request.test.js +49 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-request-reply.test.js +51 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-request.test.js +54 -0
- package/node_modules/fastify/test/encapsulated-child-logger-factory.test.js +69 -0
- package/node_modules/fastify/test/encapsulated-error-handler.test.js +237 -0
- package/node_modules/fastify/test/esm/errorCodes.test.mjs +10 -0
- package/node_modules/fastify/test/esm/esm.test.mjs +13 -0
- package/node_modules/fastify/test/esm/index.test.js +8 -0
- package/node_modules/fastify/test/esm/named-exports.mjs +14 -0
- package/node_modules/fastify/test/esm/other.mjs +8 -0
- package/node_modules/fastify/test/esm/plugin.mjs +8 -0
- package/node_modules/fastify/test/fastify-instance.test.js +300 -0
- package/node_modules/fastify/test/find-route.test.js +152 -0
- package/node_modules/fastify/test/fluent-schema.test.js +209 -0
- package/node_modules/fastify/test/genReqId.test.js +426 -0
- package/node_modules/fastify/test/handler-context.test.js +45 -0
- package/node_modules/fastify/test/has-route.test.js +88 -0
- package/node_modules/fastify/test/header-overflow.test.js +55 -0
- package/node_modules/fastify/test/helper.js +496 -0
- package/node_modules/fastify/test/hooks-async.test.js +1099 -0
- package/node_modules/fastify/test/hooks.on-listen.test.js +1162 -0
- package/node_modules/fastify/test/hooks.on-ready.test.js +421 -0
- package/node_modules/fastify/test/hooks.test.js +3578 -0
- package/node_modules/fastify/test/http-methods/copy.test.js +35 -0
- package/node_modules/fastify/test/http-methods/custom-http-methods.test.js +114 -0
- package/node_modules/fastify/test/http-methods/get.test.js +412 -0
- package/node_modules/fastify/test/http-methods/head.test.js +263 -0
- package/node_modules/fastify/test/http-methods/lock.test.js +108 -0
- package/node_modules/fastify/test/http-methods/mkcalendar.test.js +143 -0
- package/node_modules/fastify/test/http-methods/mkcol.test.js +35 -0
- package/node_modules/fastify/test/http-methods/move.test.js +42 -0
- package/node_modules/fastify/test/http-methods/propfind.test.js +136 -0
- package/node_modules/fastify/test/http-methods/proppatch.test.js +105 -0
- package/node_modules/fastify/test/http-methods/report.test.js +142 -0
- package/node_modules/fastify/test/http-methods/search.test.js +233 -0
- package/node_modules/fastify/test/http-methods/trace.test.js +21 -0
- package/node_modules/fastify/test/http-methods/unlock.test.js +38 -0
- package/node_modules/fastify/test/http2/closing.test.js +270 -0
- package/node_modules/fastify/test/http2/constraint.test.js +109 -0
- package/node_modules/fastify/test/http2/head.test.js +34 -0
- package/node_modules/fastify/test/http2/plain.test.js +68 -0
- package/node_modules/fastify/test/http2/secure-with-fallback.test.js +113 -0
- package/node_modules/fastify/test/http2/secure.test.js +67 -0
- package/node_modules/fastify/test/http2/unknown-http-method.test.js +34 -0
- package/node_modules/fastify/test/https/custom-https-server.test.js +58 -0
- package/node_modules/fastify/test/https/https.test.js +136 -0
- package/node_modules/fastify/test/imports.test.js +17 -0
- package/node_modules/fastify/test/inject.test.js +502 -0
- package/node_modules/fastify/test/input-validation.js +335 -0
- package/node_modules/fastify/test/internals/all.test.js +38 -0
- package/node_modules/fastify/test/internals/content-type-parser.test.js +111 -0
- package/node_modules/fastify/test/internals/context.test.js +31 -0
- package/node_modules/fastify/test/internals/decorator.test.js +156 -0
- package/node_modules/fastify/test/internals/errors.test.js +982 -0
- package/node_modules/fastify/test/internals/handle-request.test.js +270 -0
- package/node_modules/fastify/test/internals/hook-runner.test.js +449 -0
- package/node_modules/fastify/test/internals/hooks.test.js +96 -0
- package/node_modules/fastify/test/internals/initial-config.test.js +381 -0
- package/node_modules/fastify/test/internals/logger.test.js +163 -0
- package/node_modules/fastify/test/internals/plugin.test.js +170 -0
- package/node_modules/fastify/test/internals/promise.test.js +63 -0
- package/node_modules/fastify/test/internals/reply-serialize.test.js +714 -0
- package/node_modules/fastify/test/internals/reply.test.js +1920 -0
- package/node_modules/fastify/test/internals/req-id-gen-factory.test.js +133 -0
- package/node_modules/fastify/test/internals/request-validate.test.js +1402 -0
- package/node_modules/fastify/test/internals/request.test.js +506 -0
- package/node_modules/fastify/test/internals/schema-controller-perf.test.js +40 -0
- package/node_modules/fastify/test/internals/server.test.js +91 -0
- package/node_modules/fastify/test/internals/validation.test.js +352 -0
- package/node_modules/fastify/test/issue-4959.test.js +118 -0
- package/node_modules/fastify/test/keep-alive-timeout.test.js +42 -0
- package/node_modules/fastify/test/listen.1.test.js +154 -0
- package/node_modules/fastify/test/listen.2.test.js +113 -0
- package/node_modules/fastify/test/listen.3.test.js +83 -0
- package/node_modules/fastify/test/listen.4.test.js +168 -0
- package/node_modules/fastify/test/listen.5.test.js +122 -0
- package/node_modules/fastify/test/logger/instantiation.test.js +341 -0
- package/node_modules/fastify/test/logger/logger-test-utils.js +47 -0
- package/node_modules/fastify/test/logger/logging.test.js +460 -0
- package/node_modules/fastify/test/logger/options.test.js +579 -0
- package/node_modules/fastify/test/logger/request.test.js +292 -0
- package/node_modules/fastify/test/logger/response.test.js +183 -0
- package/node_modules/fastify/test/logger/tap-parallel-not-ok +0 -0
- package/node_modules/fastify/test/max-requests-per-socket.test.js +113 -0
- package/node_modules/fastify/test/middleware.test.js +37 -0
- package/node_modules/fastify/test/noop-set.test.js +19 -0
- package/node_modules/fastify/test/nullable-validation.test.js +187 -0
- package/node_modules/fastify/test/options.error-handler.test.js +5 -0
- package/node_modules/fastify/test/options.test.js +5 -0
- package/node_modules/fastify/test/output-validation.test.js +140 -0
- package/node_modules/fastify/test/patch.error-handler.test.js +5 -0
- package/node_modules/fastify/test/patch.test.js +5 -0
- package/node_modules/fastify/test/plugin.1.test.js +230 -0
- package/node_modules/fastify/test/plugin.2.test.js +314 -0
- package/node_modules/fastify/test/plugin.3.test.js +287 -0
- package/node_modules/fastify/test/plugin.4.test.js +504 -0
- package/node_modules/fastify/test/plugin.helper.js +8 -0
- package/node_modules/fastify/test/plugin.name.display.js +10 -0
- package/node_modules/fastify/test/post-empty-body.test.js +38 -0
- package/node_modules/fastify/test/pretty-print.test.js +366 -0
- package/node_modules/fastify/test/promises.test.js +125 -0
- package/node_modules/fastify/test/proto-poisoning.test.js +145 -0
- package/node_modules/fastify/test/put.error-handler.test.js +5 -0
- package/node_modules/fastify/test/put.test.js +5 -0
- package/node_modules/fastify/test/register.test.js +184 -0
- package/node_modules/fastify/test/reply-code.test.js +148 -0
- package/node_modules/fastify/test/reply-early-hints.test.js +100 -0
- package/node_modules/fastify/test/reply-error.test.js +815 -0
- package/node_modules/fastify/test/reply-trailers.test.js +445 -0
- package/node_modules/fastify/test/reply-web-stream-locked.test.js +37 -0
- package/node_modules/fastify/test/request-error.test.js +583 -0
- package/node_modules/fastify/test/request-header-host.test.js +339 -0
- package/node_modules/fastify/test/request-id.test.js +118 -0
- package/node_modules/fastify/test/request-timeout.test.js +53 -0
- package/node_modules/fastify/test/route-hooks.test.js +635 -0
- package/node_modules/fastify/test/route-prefix.test.js +904 -0
- package/node_modules/fastify/test/route-shorthand.test.js +48 -0
- package/node_modules/fastify/test/route.1.test.js +259 -0
- package/node_modules/fastify/test/route.2.test.js +100 -0
- package/node_modules/fastify/test/route.3.test.js +213 -0
- package/node_modules/fastify/test/route.4.test.js +127 -0
- package/node_modules/fastify/test/route.5.test.js +211 -0
- package/node_modules/fastify/test/route.6.test.js +306 -0
- package/node_modules/fastify/test/route.7.test.js +406 -0
- package/node_modules/fastify/test/route.8.test.js +225 -0
- package/node_modules/fastify/test/router-options.test.js +1066 -0
- package/node_modules/fastify/test/same-shape.test.js +124 -0
- package/node_modules/fastify/test/schema-examples.test.js +661 -0
- package/node_modules/fastify/test/schema-feature.test.js +2198 -0
- package/node_modules/fastify/test/schema-serialization.test.js +1171 -0
- package/node_modules/fastify/test/schema-special-usage.test.js +1348 -0
- package/node_modules/fastify/test/schema-validation.test.js +1572 -0
- package/node_modules/fastify/test/serialize-response.test.js +186 -0
- package/node_modules/fastify/test/server.test.js +347 -0
- package/node_modules/fastify/test/set-error-handler.test.js +69 -0
- package/node_modules/fastify/test/skip-reply-send.test.js +317 -0
- package/node_modules/fastify/test/stream-serializers.test.js +40 -0
- package/node_modules/fastify/test/stream.1.test.js +94 -0
- package/node_modules/fastify/test/stream.2.test.js +129 -0
- package/node_modules/fastify/test/stream.3.test.js +198 -0
- package/node_modules/fastify/test/stream.4.test.js +176 -0
- package/node_modules/fastify/test/stream.5.test.js +188 -0
- package/node_modules/fastify/test/sync-routes.test.js +32 -0
- package/node_modules/fastify/test/throw.test.js +359 -0
- package/node_modules/fastify/test/toolkit.js +63 -0
- package/node_modules/fastify/test/trust-proxy.test.js +162 -0
- package/node_modules/fastify/test/type-provider.test.js +22 -0
- package/node_modules/fastify/test/types/content-type-parser.test-d.ts +72 -0
- package/node_modules/fastify/test/types/decorate-request-reply.test-d.ts +18 -0
- package/node_modules/fastify/test/types/dummy-plugin.ts +9 -0
- package/node_modules/fastify/test/types/errors.test-d.ts +90 -0
- package/node_modules/fastify/test/types/fastify.test-d.ts +351 -0
- package/node_modules/fastify/test/types/hooks.test-d.ts +550 -0
- package/node_modules/fastify/test/types/import.ts +2 -0
- package/node_modules/fastify/test/types/instance.test-d.ts +588 -0
- package/node_modules/fastify/test/types/logger.test-d.ts +278 -0
- package/node_modules/fastify/test/types/plugin.test-d.ts +97 -0
- package/node_modules/fastify/test/types/register.test-d.ts +237 -0
- package/node_modules/fastify/test/types/reply.test-d.ts +254 -0
- package/node_modules/fastify/test/types/request.test-d.ts +187 -0
- package/node_modules/fastify/test/types/route.test-d.ts +547 -0
- package/node_modules/fastify/test/types/schema.test-d.ts +135 -0
- package/node_modules/fastify/test/types/serverFactory.test-d.ts +37 -0
- package/node_modules/fastify/test/types/type-provider.test-d.ts +1213 -0
- package/node_modules/fastify/test/types/using.test-d.ts +17 -0
- package/node_modules/fastify/test/upgrade.test.js +52 -0
- package/node_modules/fastify/test/url-rewriting.test.js +122 -0
- package/node_modules/fastify/test/use-semicolon-delimiter.test.js +168 -0
- package/node_modules/fastify/test/validation-error-handling.test.js +900 -0
- package/node_modules/fastify/test/versioned-routes.test.js +603 -0
- package/node_modules/fastify/test/web-api.test.js +541 -0
- package/node_modules/fastify/test/wrap-thenable.test.js +30 -0
- package/node_modules/fastify/types/content-type-parser.d.ts +75 -0
- package/node_modules/fastify/types/context.d.ts +22 -0
- package/node_modules/fastify/types/errors.d.ts +90 -0
- package/node_modules/fastify/types/hooks.d.ts +875 -0
- package/node_modules/fastify/types/instance.d.ts +609 -0
- package/node_modules/fastify/types/logger.d.ts +107 -0
- package/node_modules/fastify/types/plugin.d.ts +44 -0
- package/node_modules/fastify/types/register.d.ts +42 -0
- package/node_modules/fastify/types/reply.d.ts +81 -0
- package/node_modules/fastify/types/request.d.ts +93 -0
- package/node_modules/fastify/types/route.d.ts +185 -0
- package/node_modules/fastify/types/schema.d.ts +61 -0
- package/node_modules/fastify/types/server-factory.d.ts +19 -0
- package/node_modules/fastify/types/tsconfig.eslint.json +13 -0
- package/node_modules/fastify/types/type-provider.d.ts +130 -0
- package/node_modules/fastify/types/utils.d.ts +98 -0
- package/node_modules/fastify-plugin/.gitattributes +2 -0
- package/node_modules/fastify-plugin/.github/dependabot.yml +13 -0
- package/node_modules/fastify-plugin/.github/stale.yml +21 -0
- package/node_modules/fastify-plugin/.github/workflows/ci.yml +28 -0
- package/node_modules/fastify-plugin/LICENSE +23 -0
- package/node_modules/fastify-plugin/README.md +188 -0
- package/node_modules/fastify-plugin/eslint.config.js +6 -0
- package/node_modules/fastify-plugin/lib/getPluginName.js +25 -0
- package/node_modules/fastify-plugin/lib/toCamelCase.js +10 -0
- package/node_modules/fastify-plugin/package.json +70 -0
- package/node_modules/fastify-plugin/plugin.js +67 -0
- package/node_modules/fastify-plugin/test/bundlers.test.js +110 -0
- package/node_modules/fastify-plugin/test/checkVersion.test.js +67 -0
- package/node_modules/fastify-plugin/test/composite.test.js +14 -0
- package/node_modules/fastify-plugin/test/esm/esm.mjs +11 -0
- package/node_modules/fastify-plugin/test/esm/index.test.js +11 -0
- package/node_modules/fastify-plugin/test/extractPluginName.test.js +49 -0
- package/node_modules/fastify-plugin/test/mu1tip1e.composite.test.js +15 -0
- package/node_modules/fastify-plugin/test/test.js +396 -0
- package/node_modules/fastify-plugin/test/toCamelCase.test.js +24 -0
- package/node_modules/fastify-plugin/types/example-async.test-d.ts +19 -0
- package/node_modules/fastify-plugin/types/example-callback.test-d.ts +19 -0
- package/node_modules/fastify-plugin/types/plugin.d.ts +61 -0
- package/node_modules/fastify-plugin/types/plugin.test-d.ts +166 -0
- package/node_modules/fastq/LICENSE +13 -0
- package/node_modules/fastq/README.md +310 -0
- package/node_modules/fastq/SECURITY.md +15 -0
- package/node_modules/fastq/bench.js +66 -0
- package/node_modules/fastq/eslint.config.js +11 -0
- package/node_modules/fastq/example.js +14 -0
- package/node_modules/fastq/example.mjs +9 -0
- package/node_modules/fastq/index.d.ts +59 -0
- package/node_modules/fastq/package.json +49 -0
- package/node_modules/fastq/queue.js +346 -0
- package/node_modules/fastq/test/example.ts +83 -0
- package/node_modules/fastq/test/promise.js +325 -0
- package/node_modules/fastq/test/test.js +733 -0
- package/node_modules/fastq/test/tsconfig.json +11 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +248 -0
- package/node_modules/fill-range/package.json +74 -0
- package/node_modules/find-my-way/.github/dependabot.yml +34 -0
- package/node_modules/find-my-way/.github/workflows/node.js.yml +68 -0
- package/node_modules/find-my-way/LICENSE +21 -0
- package/node_modules/find-my-way/README.md +845 -0
- package/node_modules/find-my-way/benchmark/bench-thread.js +35 -0
- package/node_modules/find-my-way/benchmark/bench.js +156 -0
- package/node_modules/find-my-way/benchmark/compare-branches.js +113 -0
- package/node_modules/find-my-way/benchmark/uri-decoding.js +55 -0
- package/node_modules/find-my-way/example.js +29 -0
- package/node_modules/find-my-way/index.d.ts +237 -0
- package/node_modules/find-my-way/index.js +836 -0
- package/node_modules/find-my-way/lib/constrainer.js +170 -0
- package/node_modules/find-my-way/lib/handler-storage.js +174 -0
- package/node_modules/find-my-way/lib/http-methods.js +13 -0
- package/node_modules/find-my-way/lib/node.js +228 -0
- package/node_modules/find-my-way/lib/null-object.js +8 -0
- package/node_modules/find-my-way/lib/pretty-print.js +168 -0
- package/node_modules/find-my-way/lib/strategies/accept-host.js +36 -0
- package/node_modules/find-my-way/lib/strategies/accept-version.js +64 -0
- package/node_modules/find-my-way/lib/strategies/http-method.js +15 -0
- package/node_modules/find-my-way/lib/url-sanitizer.js +105 -0
- package/node_modules/find-my-way/package.json +57 -0
- package/node_modules/find-my-way/test/case-insensitive.test.js +230 -0
- package/node_modules/find-my-way/test/constraint.custom-versioning.test.js +130 -0
- package/node_modules/find-my-way/test/constraint.custom.async.test.js +111 -0
- package/node_modules/find-my-way/test/constraint.custom.test.js +273 -0
- package/node_modules/find-my-way/test/constraint.default-versioning.test.js +289 -0
- package/node_modules/find-my-way/test/constraint.host.test.js +104 -0
- package/node_modules/find-my-way/test/constraints.test.js +108 -0
- package/node_modules/find-my-way/test/custom-querystring-parser.test.js +46 -0
- package/node_modules/find-my-way/test/errors.test.js +484 -0
- package/node_modules/find-my-way/test/fastify-issue-3129.test.js +34 -0
- package/node_modules/find-my-way/test/fastify-issue-3957.test.js +23 -0
- package/node_modules/find-my-way/test/find-route.test.js +275 -0
- package/node_modules/find-my-way/test/find.test.js +16 -0
- package/node_modules/find-my-way/test/for-in-loop.test.js +13 -0
- package/node_modules/find-my-way/test/full-url.test.js +30 -0
- package/node_modules/find-my-way/test/has-route.test.js +218 -0
- package/node_modules/find-my-way/test/host-storage.test.js +27 -0
- package/node_modules/find-my-way/test/http2/constraint.host.test.js +44 -0
- package/node_modules/find-my-way/test/issue-101.test.js +31 -0
- package/node_modules/find-my-way/test/issue-104.test.js +206 -0
- package/node_modules/find-my-way/test/issue-110.test.js +31 -0
- package/node_modules/find-my-way/test/issue-132.test.js +80 -0
- package/node_modules/find-my-way/test/issue-145.test.js +24 -0
- package/node_modules/find-my-way/test/issue-149.test.js +21 -0
- package/node_modules/find-my-way/test/issue-151.test.js +54 -0
- package/node_modules/find-my-way/test/issue-154.test.js +21 -0
- package/node_modules/find-my-way/test/issue-161.test.js +88 -0
- package/node_modules/find-my-way/test/issue-17.test.js +397 -0
- package/node_modules/find-my-way/test/issue-175.test.js +80 -0
- package/node_modules/find-my-way/test/issue-182.test.js +18 -0
- package/node_modules/find-my-way/test/issue-190.test.js +44 -0
- package/node_modules/find-my-way/test/issue-20.test.js +79 -0
- package/node_modules/find-my-way/test/issue-206.test.js +121 -0
- package/node_modules/find-my-way/test/issue-221.test.js +50 -0
- package/node_modules/find-my-way/test/issue-234.test.js +94 -0
- package/node_modules/find-my-way/test/issue-238.test.js +119 -0
- package/node_modules/find-my-way/test/issue-240.test.js +30 -0
- package/node_modules/find-my-way/test/issue-241.test.js +32 -0
- package/node_modules/find-my-way/test/issue-247.test.js +51 -0
- package/node_modules/find-my-way/test/issue-254.test.js +31 -0
- package/node_modules/find-my-way/test/issue-28.test.js +618 -0
- package/node_modules/find-my-way/test/issue-280.test.js +14 -0
- package/node_modules/find-my-way/test/issue-285.test.js +37 -0
- package/node_modules/find-my-way/test/issue-330.test.js +231 -0
- package/node_modules/find-my-way/test/issue-44.test.js +149 -0
- package/node_modules/find-my-way/test/issue-46.test.js +75 -0
- package/node_modules/find-my-way/test/issue-49.test.js +108 -0
- package/node_modules/find-my-way/test/issue-59.test.js +131 -0
- package/node_modules/find-my-way/test/issue-62.test.js +28 -0
- package/node_modules/find-my-way/test/issue-63.test.js +23 -0
- package/node_modules/find-my-way/test/issue-67.test.js +50 -0
- package/node_modules/find-my-way/test/issue-93.test.js +19 -0
- package/node_modules/find-my-way/test/lookup-async.test.js +29 -0
- package/node_modules/find-my-way/test/lookup.test.js +58 -0
- package/node_modules/find-my-way/test/matching-order.test.js +17 -0
- package/node_modules/find-my-way/test/max-param-length.test.js +44 -0
- package/node_modules/find-my-way/test/methods.test.js +830 -0
- package/node_modules/find-my-way/test/null-object.test.js +36 -0
- package/node_modules/find-my-way/test/on-bad-url.test.js +72 -0
- package/node_modules/find-my-way/test/optional-params.test.js +216 -0
- package/node_modules/find-my-way/test/params-collisions.test.js +126 -0
- package/node_modules/find-my-way/test/path-params-match.test.js +53 -0
- package/node_modules/find-my-way/test/pretty-print-tree.test.js +596 -0
- package/node_modules/find-my-way/test/pretty-print.test.js +680 -0
- package/node_modules/find-my-way/test/querystring.test.js +54 -0
- package/node_modules/find-my-way/test/regex.test.js +269 -0
- package/node_modules/find-my-way/test/routes-registered.test.js +45 -0
- package/node_modules/find-my-way/test/server.test.js +368 -0
- package/node_modules/find-my-way/test/shorthands.test.js +44 -0
- package/node_modules/find-my-way/test/store.test.js +49 -0
- package/node_modules/find-my-way/test/types/router.test-d.ts +182 -0
- package/node_modules/find-my-way/test/url-sanitizer.test.js +43 -0
- package/node_modules/foreground-child/LICENSE +15 -0
- package/node_modules/foreground-child/README.md +128 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +2 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.js +58 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/index.d.ts +58 -0
- package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/index.js +123 -0
- package/node_modules/foreground-child/dist/commonjs/index.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/package.json +3 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +6 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js +38 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +10 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.js +50 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts +2 -0
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/all-signals.js +52 -0
- package/node_modules/foreground-child/dist/esm/all-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/index.d.ts +58 -0
- package/node_modules/foreground-child/dist/esm/index.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/index.js +115 -0
- package/node_modules/foreground-child/dist/esm/index.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/package.json +3 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +6 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.js +34 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts +10 -0
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/watchdog.js +46 -0
- package/node_modules/foreground-child/dist/esm/watchdog.js.map +1 -0
- package/node_modules/foreground-child/package.json +106 -0
- package/node_modules/glob/LICENSE.md +63 -0
- package/node_modules/glob/README.md +1294 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/index.js +68 -0
- package/node_modules/glob/dist/commonjs/index.js.map +1 -0
- package/node_modules/glob/dist/commonjs/package.json +3 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- package/node_modules/glob/dist/esm/bin.d.mts +3 -0
- package/node_modules/glob/dist/esm/bin.d.mts.map +1 -0
- package/node_modules/glob/dist/esm/bin.mjs +346 -0
- package/node_modules/glob/dist/esm/bin.mjs.map +1 -0
- package/node_modules/glob/dist/esm/glob.d.ts +388 -0
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/glob.js +243 -0
- package/node_modules/glob/dist/esm/glob.js.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
- package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/ignore.js +115 -0
- package/node_modules/glob/dist/esm/ignore.js.map +1 -0
- package/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/index.js +55 -0
- package/node_modules/glob/dist/esm/index.js.map +1 -0
- package/node_modules/glob/dist/esm/package.json +3 -0
- package/node_modules/glob/dist/esm/pattern.d.ts +76 -0
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/pattern.js +215 -0
- package/node_modules/glob/dist/esm/pattern.js.map +1 -0
- package/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/processor.js +294 -0
- package/node_modules/glob/dist/esm/processor.js.map +1 -0
- package/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/walker.js +381 -0
- package/node_modules/glob/dist/esm/walker.js.map +1 -0
- package/node_modules/glob/package.json +97 -0
- package/node_modules/glob-parent/LICENSE +15 -0
- package/node_modules/glob-parent/README.md +137 -0
- package/node_modules/glob-parent/index.js +42 -0
- package/node_modules/glob-parent/package.json +48 -0
- package/node_modules/http-errors/HISTORY.md +186 -0
- package/node_modules/http-errors/LICENSE +23 -0
- package/node_modules/http-errors/README.md +169 -0
- package/node_modules/http-errors/index.js +290 -0
- package/node_modules/http-errors/package.json +54 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ipaddr.js/LICENSE +19 -0
- package/node_modules/ipaddr.js/README.md +233 -0
- package/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js +1067 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +72 -0
- package/node_modules/ipaddr.js/package.json +36 -0
- package/node_modules/is-extglob/LICENSE +21 -0
- package/node_modules/is-extglob/README.md +107 -0
- package/node_modules/is-extglob/index.js +20 -0
- package/node_modules/is-extglob/package.json +69 -0
- package/node_modules/is-glob/LICENSE +21 -0
- package/node_modules/is-glob/README.md +206 -0
- package/node_modules/is-glob/index.js +150 -0
- package/node_modules/is-glob/package.json +81 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +82 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jackspeak/LICENSE.md +55 -0
- package/node_modules/jackspeak/README.md +394 -0
- package/node_modules/jackspeak/dist/commonjs/index.d.ts +323 -0
- package/node_modules/jackspeak/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/jackspeak/dist/commonjs/index.js +944 -0
- package/node_modules/jackspeak/dist/commonjs/index.js.map +1 -0
- package/node_modules/jackspeak/dist/commonjs/index.min.js +33 -0
- package/node_modules/jackspeak/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/jackspeak/dist/commonjs/package.json +3 -0
- package/node_modules/jackspeak/dist/esm/index.d.ts +323 -0
- package/node_modules/jackspeak/dist/esm/index.d.ts.map +1 -0
- package/node_modules/jackspeak/dist/esm/index.js +936 -0
- package/node_modules/jackspeak/dist/esm/index.js.map +1 -0
- package/node_modules/jackspeak/dist/esm/index.min.js +33 -0
- package/node_modules/jackspeak/dist/esm/index.min.js.map +7 -0
- package/node_modules/jackspeak/dist/esm/package.json +3 -0
- package/node_modules/jackspeak/package.json +115 -0
- package/node_modules/json-schema-ref-resolver/.gitattributes +2 -0
- package/node_modules/json-schema-ref-resolver/.github/dependabot.yml +13 -0
- package/node_modules/json-schema-ref-resolver/.github/workflows/ci.yml +25 -0
- package/node_modules/json-schema-ref-resolver/LICENSE +21 -0
- package/node_modules/json-schema-ref-resolver/README.md +406 -0
- package/node_modules/json-schema-ref-resolver/eslint.config.js +6 -0
- package/node_modules/json-schema-ref-resolver/index.js +284 -0
- package/node_modules/json-schema-ref-resolver/package.json +76 -0
- package/node_modules/json-schema-ref-resolver/test/anchor.test.js +56 -0
- package/node_modules/json-schema-ref-resolver/test/collisions.test.js +199 -0
- package/node_modules/json-schema-ref-resolver/test/deref-schema.test.js +287 -0
- package/node_modules/json-schema-ref-resolver/test/get-deref-schema.test.js +363 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema-dependencies.test.js +158 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema-refs.test.js +87 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema.test.js +222 -0
- package/node_modules/json-schema-ref-resolver/test/has-schema.test.js +28 -0
- package/node_modules/json-schema-ref-resolver/types/index.d.ts +67 -0
- package/node_modules/json-schema-ref-resolver/types/index.test-d.ts +23 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/light-my-request/.gitattributes +2 -0
- package/node_modules/light-my-request/.github/dependabot.yml +13 -0
- package/node_modules/light-my-request/.github/stale.yml +21 -0
- package/node_modules/light-my-request/.github/workflows/benchmark.yml +30 -0
- package/node_modules/light-my-request/.github/workflows/ci.yml +23 -0
- package/node_modules/light-my-request/LICENSE +32 -0
- package/node_modules/light-my-request/README.md +261 -0
- package/node_modules/light-my-request/benchmark/benchmark.js +164 -0
- package/node_modules/light-my-request/build/build-validation.js +100 -0
- package/node_modules/light-my-request/eslint.config.js +9 -0
- package/node_modules/light-my-request/index.js +194 -0
- package/node_modules/light-my-request/lib/config-validator.js +919 -0
- package/node_modules/light-my-request/lib/form-data.js +79 -0
- package/node_modules/light-my-request/lib/parse-url.js +47 -0
- package/node_modules/light-my-request/lib/request.js +290 -0
- package/node_modules/light-my-request/lib/response.js +240 -0
- package/node_modules/light-my-request/node_modules/process-warning/.gitattributes +2 -0
- package/node_modules/light-my-request/node_modules/process-warning/.github/dependabot.yml +13 -0
- package/node_modules/light-my-request/node_modules/process-warning/.github/workflows/ci.yml +24 -0
- package/node_modules/light-my-request/node_modules/process-warning/.taprc +2 -0
- package/node_modules/light-my-request/node_modules/process-warning/LICENSE +21 -0
- package/node_modules/light-my-request/node_modules/process-warning/README.md +118 -0
- package/node_modules/light-my-request/node_modules/process-warning/benchmarks/warn.js +25 -0
- package/node_modules/light-my-request/node_modules/process-warning/eslint.config.js +6 -0
- package/node_modules/light-my-request/node_modules/process-warning/examples/example.js +11 -0
- package/node_modules/light-my-request/node_modules/process-warning/index.js +124 -0
- package/node_modules/light-my-request/node_modules/process-warning/package.json +73 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-interpolated-string.test.js +29 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-once-only.test.js +28 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-reset.test.js +36 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-set.test.js +30 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-unlimited.test.js +37 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/index.test.js +99 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/issue-88.test.js +33 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/jest.test.js +22 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/no-warnings.test.js +80 -0
- package/node_modules/light-my-request/node_modules/process-warning/types/index.d.ts +37 -0
- package/node_modules/light-my-request/node_modules/process-warning/types/index.test-d.ts +36 -0
- package/node_modules/light-my-request/package.json +85 -0
- package/node_modules/light-my-request/test/async-await.test.js +55 -0
- package/node_modules/light-my-request/test/index.test.js +2316 -0
- package/node_modules/light-my-request/test/request.test.js +16 -0
- package/node_modules/light-my-request/test/response.test.js +19 -0
- package/node_modules/light-my-request/test/stream.test.js +359 -0
- package/node_modules/light-my-request/types/index.d.ts +128 -0
- package/node_modules/light-my-request/types/index.test-d.ts +149 -0
- package/node_modules/merge2/LICENSE +21 -0
- package/node_modules/merge2/README.md +144 -0
- package/node_modules/merge2/index.js +144 -0
- package/node_modules/merge2/package.json +43 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1024 -0
- package/node_modules/micromatch/index.js +474 -0
- package/node_modules/micromatch/package.json +119 -0
- package/node_modules/mime/LICENSE +21 -0
- package/node_modules/mime/Mime.js +97 -0
- package/node_modules/mime/README.md +178 -0
- package/node_modules/mime/cli.js +46 -0
- package/node_modules/mime/index.js +4 -0
- package/node_modules/mime/lite.js +4 -0
- package/node_modules/mime/package.json +52 -0
- package/node_modules/mime/types/other.js +1 -0
- package/node_modules/mime/types/standard.js +1 -0
- package/node_modules/minimatch/LICENSE.md +55 -0
- package/node_modules/minimatch/README.md +453 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.js +591 -0
- package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1029 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.js +587 -0
- package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1016 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +67 -0
- package/node_modules/minipass/LICENSE +15 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +549 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1018 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +82 -0
- package/node_modules/on-exit-leak-free/.github/dependabot.yml +12 -0
- package/node_modules/on-exit-leak-free/.github/workflows/ci.yml +46 -0
- package/node_modules/on-exit-leak-free/LICENSE +21 -0
- package/node_modules/on-exit-leak-free/README.md +54 -0
- package/node_modules/on-exit-leak-free/index.js +108 -0
- package/node_modules/on-exit-leak-free/package.json +37 -0
- package/node_modules/on-exit-leak-free/test/base.test.js +30 -0
- package/node_modules/on-exit-leak-free/test/event-emitter-leak.test.js +23 -0
- package/node_modules/on-exit-leak-free/test/fixtures/beforeExit.js +33 -0
- package/node_modules/on-exit-leak-free/test/fixtures/close.js +21 -0
- package/node_modules/on-exit-leak-free/test/fixtures/gc-not-close.js +24 -0
- package/node_modules/on-exit-leak-free/test/fixtures/unregister.js +24 -0
- package/node_modules/package-json-from-dist/LICENSE.md +63 -0
- package/node_modules/package-json-from-dist/README.md +110 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js +134 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/package.json +3 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js +129 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/package.json +3 -0
- package/node_modules/package-json-from-dist/package.json +68 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/path-scurry/LICENSE.md +55 -0
- package/node_modules/path-scurry/README.md +636 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/LICENSE.md +55 -0
- package/node_modules/path-scurry/node_modules/lru-cache/README.md +383 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1589 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1585 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/package.json +101 -0
- package/node_modules/path-scurry/package.json +88 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +708 -0
- package/node_modules/picomatch/index.js +3 -0
- package/node_modules/picomatch/lib/constants.js +179 -0
- package/node_modules/picomatch/lib/parse.js +1091 -0
- package/node_modules/picomatch/lib/picomatch.js +342 -0
- package/node_modules/picomatch/lib/scan.js +391 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +81 -0
- package/node_modules/pino/.nojekyll +0 -0
- package/node_modules/pino/.prettierignore +1 -0
- package/node_modules/pino/CNAME +1 -0
- package/node_modules/pino/CONTRIBUTING.md +30 -0
- package/node_modules/pino/LICENSE +21 -0
- package/node_modules/pino/README.md +177 -0
- package/node_modules/pino/SECURITY.md +87 -0
- package/node_modules/pino/benchmarks/basic.bench.js +95 -0
- package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
- package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
- package/node_modules/pino/benchmarks/child.bench.js +62 -0
- package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
- package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
- package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
- package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
- package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
- package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
- package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
- package/node_modules/pino/benchmarks/multistream.js +98 -0
- package/node_modules/pino/benchmarks/object.bench.js +82 -0
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
- package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
- package/node_modules/pino/bin.js +6 -0
- package/node_modules/pino/browser.js +547 -0
- package/node_modules/pino/build/sync-version.js +25 -0
- package/node_modules/pino/docs/api.md +1593 -0
- package/node_modules/pino/docs/asynchronous.md +40 -0
- package/node_modules/pino/docs/benchmarks.md +55 -0
- package/node_modules/pino/docs/browser.md +278 -0
- package/node_modules/pino/docs/bundling.md +40 -0
- package/node_modules/pino/docs/child-loggers.md +95 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +86 -0
- package/node_modules/pino/docs/help.md +345 -0
- package/node_modules/pino/docs/lts.md +64 -0
- package/node_modules/pino/docs/pretty.md +35 -0
- package/node_modules/pino/docs/redaction.md +135 -0
- package/node_modules/pino/docs/transports.md +1376 -0
- package/node_modules/pino/docs/web.md +309 -0
- package/node_modules/pino/eslint.config.js +28 -0
- package/node_modules/pino/examples/basic.js +43 -0
- package/node_modules/pino/examples/transport.js +68 -0
- package/node_modules/pino/favicon.ico +0 -0
- package/node_modules/pino/file.js +12 -0
- package/node_modules/pino/inc-version.sh +42 -0
- package/node_modules/pino/index.html +55 -0
- package/node_modules/pino/lib/caller.js +30 -0
- package/node_modules/pino/lib/constants.js +28 -0
- package/node_modules/pino/lib/deprecations.js +8 -0
- package/node_modules/pino/lib/levels.js +241 -0
- package/node_modules/pino/lib/meta.js +3 -0
- package/node_modules/pino/lib/multistream.js +203 -0
- package/node_modules/pino/lib/proto.js +256 -0
- package/node_modules/pino/lib/redaction.js +114 -0
- package/node_modules/pino/lib/symbols.js +74 -0
- package/node_modules/pino/lib/time.js +39 -0
- package/node_modules/pino/lib/tools.js +427 -0
- package/node_modules/pino/lib/transport-stream.js +56 -0
- package/node_modules/pino/lib/transport.js +289 -0
- package/node_modules/pino/lib/worker.js +194 -0
- package/node_modules/pino/package.json +120 -0
- package/node_modules/pino/pino.d.ts +908 -0
- package/node_modules/pino/pino.js +234 -0
- package/node_modules/pino/test/basic.test.js +886 -0
- package/node_modules/pino/test/broken-pipe.test.js +59 -0
- package/node_modules/pino/test/browser-child.test.js +132 -0
- package/node_modules/pino/test/browser-disabled.test.js +87 -0
- package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-levels.test.js +241 -0
- package/node_modules/pino/test/browser-serializers.test.js +352 -0
- package/node_modules/pino/test/browser-timestamp.test.js +88 -0
- package/node_modules/pino/test/browser-transmit.test.js +417 -0
- package/node_modules/pino/test/browser.test.js +698 -0
- package/node_modules/pino/test/complex-objects.test.js +36 -0
- package/node_modules/pino/test/crlf.test.js +34 -0
- package/node_modules/pino/test/custom-levels.test.js +267 -0
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +403 -0
- package/node_modules/pino/test/escaping.test.js +93 -0
- package/node_modules/pino/test/esm/esm.mjs +14 -0
- package/node_modules/pino/test/esm/index.test.js +21 -0
- package/node_modules/pino/test/esm/named-exports.mjs +29 -0
- package/node_modules/pino/test/exit.test.js +79 -0
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
- package/node_modules/pino/test/fixtures/console-transport.js +13 -0
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +8 -0
- package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
- package/node_modules/pino/test/fixtures/eval/index.js +13 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
- package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
- package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
- package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
- package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
- package/node_modules/pino/test/fixtures/transport/index.js +12 -0
- package/node_modules/pino/test/fixtures/transport/package.json +5 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
- package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-main.js +9 -0
- package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
- package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
- package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
- package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
- package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
- package/node_modules/pino/test/formatters.test.js +364 -0
- package/node_modules/pino/test/helper.d.ts +4 -0
- package/node_modules/pino/test/helper.js +155 -0
- package/node_modules/pino/test/hooks.test.js +114 -0
- package/node_modules/pino/test/http.test.js +214 -0
- package/node_modules/pino/test/internals/version.test.js +17 -0
- package/node_modules/pino/test/is-level-enabled.test.js +179 -0
- package/node_modules/pino/test/jest/basic.spec.js +10 -0
- package/node_modules/pino/test/levels.test.js +810 -0
- package/node_modules/pino/test/metadata.test.js +120 -0
- package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
- package/node_modules/pino/test/mixin.test.js +241 -0
- package/node_modules/pino/test/multistream.test.js +729 -0
- package/node_modules/pino/test/redact.test.js +893 -0
- package/node_modules/pino/test/serializers.test.js +257 -0
- package/node_modules/pino/test/stdout-protection.test.js +41 -0
- package/node_modules/pino/test/syncfalse.test.js +186 -0
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +124 -0
- package/node_modules/pino/test/transport/big.test.js +42 -0
- package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
- package/node_modules/pino/test/transport/caller.test.js +24 -0
- package/node_modules/pino/test/transport/core.test.js +733 -0
- package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +241 -0
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +137 -0
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +15 -0
- package/node_modules/pino/test/transport/sync-false.test.js +67 -0
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +48 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/pino-import.test-d.cts +30 -0
- package/node_modules/pino/test/types/pino-multistream.test-d.ts +28 -0
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +34 -0
- package/node_modules/pino/test/types/pino-transport.test-d.ts +156 -0
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +75 -0
- package/node_modules/pino/test/types/pino.test-d.ts +683 -0
- package/node_modules/pino/test/types/pino.ts +91 -0
- package/node_modules/pino/tsconfig.json +14 -0
- package/node_modules/pino-abstract-transport/.github/dependabot.yml +13 -0
- package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +80 -0
- package/node_modules/pino-abstract-transport/.husky/pre-commit +4 -0
- package/node_modules/pino-abstract-transport/LICENSE +21 -0
- package/node_modules/pino-abstract-transport/README.md +171 -0
- package/node_modules/pino-abstract-transport/index.d.ts +122 -0
- package/node_modules/pino-abstract-transport/index.js +128 -0
- package/node_modules/pino-abstract-transport/package.json +41 -0
- package/node_modules/pino-abstract-transport/test/base.test.js +473 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-async-iteration.js +22 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-on-data.js +22 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-transform.js +24 -0
- package/node_modules/pino-abstract-transport/test/fixtures/worker-pipeline.js +15 -0
- package/node_modules/pino-abstract-transport/test/match.js +24 -0
- package/node_modules/pino-abstract-transport/test/types/index.test-d.ts +31 -0
- package/node_modules/pino-abstract-transport/test/worker.test.js +372 -0
- package/node_modules/pino-std-serializers/.editorconfig +13 -0
- package/node_modules/pino-std-serializers/.github/dependabot.yml +13 -0
- package/node_modules/pino-std-serializers/.github/workflows/ci.yml +81 -0
- package/node_modules/pino-std-serializers/LICENSE +7 -0
- package/node_modules/pino-std-serializers/Readme.md +182 -0
- package/node_modules/pino-std-serializers/eslint.config.js +7 -0
- package/node_modules/pino-std-serializers/index.d.ts +145 -0
- package/node_modules/pino-std-serializers/index.js +36 -0
- package/node_modules/pino-std-serializers/lib/err-helpers.js +118 -0
- package/node_modules/pino-std-serializers/lib/err-proto.js +48 -0
- package/node_modules/pino-std-serializers/lib/err-with-cause.js +48 -0
- package/node_modules/pino-std-serializers/lib/err.js +45 -0
- package/node_modules/pino-std-serializers/lib/req.js +100 -0
- package/node_modules/pino-std-serializers/lib/res.js +47 -0
- package/node_modules/pino-std-serializers/package.json +42 -0
- package/node_modules/pino-std-serializers/test/err-with-cause.test.js +187 -0
- package/node_modules/pino-std-serializers/test/err.test.js +200 -0
- package/node_modules/pino-std-serializers/test/req.test.js +477 -0
- package/node_modules/pino-std-serializers/test/res.test.js +120 -0
- package/node_modules/pino-std-serializers/test/types/index.test-d.ts +71 -0
- package/node_modules/pino-std-serializers/tsconfig.json +13 -0
- package/node_modules/process-warning/.gitattributes +2 -0
- package/node_modules/process-warning/.github/dependabot.yml +13 -0
- package/node_modules/process-warning/.github/workflows/ci.yml +22 -0
- package/node_modules/process-warning/LICENSE +21 -0
- package/node_modules/process-warning/README.md +118 -0
- package/node_modules/process-warning/benchmarks/warn.js +25 -0
- package/node_modules/process-warning/eslint.config.js +6 -0
- package/node_modules/process-warning/examples/example.js +11 -0
- package/node_modules/process-warning/index.js +124 -0
- package/node_modules/process-warning/package.json +73 -0
- package/node_modules/process-warning/test/emit-interpolated-string.test.js +34 -0
- package/node_modules/process-warning/test/emit-once-only.test.js +33 -0
- package/node_modules/process-warning/test/emit-reset.test.js +40 -0
- package/node_modules/process-warning/test/emit-set.test.js +35 -0
- package/node_modules/process-warning/test/emit-unlimited.test.js +42 -0
- package/node_modules/process-warning/test/index.test.js +99 -0
- package/node_modules/process-warning/test/issue-88.test.js +38 -0
- package/node_modules/process-warning/test/jest.test.js +24 -0
- package/node_modules/process-warning/test/no-warnings.test.js +80 -0
- package/node_modules/process-warning/test/promise.js +10 -0
- package/node_modules/process-warning/types/index.d.ts +37 -0
- package/node_modules/process-warning/types/index.test-d.ts +36 -0
- package/node_modules/queue-microtask/LICENSE +20 -0
- package/node_modules/queue-microtask/README.md +90 -0
- package/node_modules/queue-microtask/index.d.ts +2 -0
- package/node_modules/queue-microtask/index.js +9 -0
- package/node_modules/queue-microtask/package.json +55 -0
- package/node_modules/quick-format-unescaped/.github/workflows/ci.yml +21 -0
- package/node_modules/quick-format-unescaped/LICENSE +21 -0
- package/node_modules/quick-format-unescaped/benchmark.js +24 -0
- package/node_modules/quick-format-unescaped/index.js +109 -0
- package/node_modules/quick-format-unescaped/package.json +29 -0
- package/node_modules/quick-format-unescaped/readme.md +66 -0
- package/node_modules/quick-format-unescaped/test/index.js +136 -0
- package/node_modules/readdirp/LICENSE +21 -0
- package/node_modules/readdirp/README.md +120 -0
- package/node_modules/readdirp/index.d.ts +108 -0
- package/node_modules/readdirp/index.js +272 -0
- package/node_modules/readdirp/package.json +66 -0
- package/node_modules/real-require/LICENSE.md +21 -0
- package/node_modules/real-require/README.md +51 -0
- package/node_modules/real-require/package.json +49 -0
- package/node_modules/real-require/src/index.js +14 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/node_modules/ret/LICENSE +21 -0
- package/node_modules/ret/README.md +539 -0
- package/node_modules/ret/dist/index.d.ts +7 -0
- package/node_modules/ret/dist/index.js +26 -0
- package/node_modules/ret/dist/index.js.map +1 -0
- package/node_modules/ret/dist/reconstruct.d.ts +2 -0
- package/node_modules/ret/dist/reconstruct.js +77 -0
- package/node_modules/ret/dist/reconstruct.js.map +1 -0
- package/node_modules/ret/dist/sets-lookup.d.ts +5 -0
- package/node_modules/ret/dist/sets-lookup.js +51 -0
- package/node_modules/ret/dist/sets-lookup.js.map +1 -0
- package/node_modules/ret/dist/sets.d.ts +9 -0
- package/node_modules/ret/dist/sets.js +43 -0
- package/node_modules/ret/dist/sets.js.map +1 -0
- package/node_modules/ret/dist/tokenizer.d.ts +8 -0
- package/node_modules/ret/dist/tokenizer.js +361 -0
- package/node_modules/ret/dist/tokenizer.js.map +1 -0
- package/node_modules/ret/dist/types/index.d.ts +3 -0
- package/node_modules/ret/dist/types/index.js +16 -0
- package/node_modules/ret/dist/types/index.js.map +1 -0
- package/node_modules/ret/dist/types/set-lookup.d.ts +8 -0
- package/node_modules/ret/dist/types/set-lookup.js +3 -0
- package/node_modules/ret/dist/types/set-lookup.js.map +1 -0
- package/node_modules/ret/dist/types/tokens.d.ts +41 -0
- package/node_modules/ret/dist/types/tokens.js +3 -0
- package/node_modules/ret/dist/types/tokens.js.map +1 -0
- package/node_modules/ret/dist/types/types.d.ts +10 -0
- package/node_modules/ret/dist/types/types.js +15 -0
- package/node_modules/ret/dist/types/types.js.map +1 -0
- package/node_modules/ret/dist/util.d.ts +18 -0
- package/node_modules/ret/dist/util.js +82 -0
- package/node_modules/ret/dist/util.js.map +1 -0
- package/node_modules/ret/dist/write-set-tokens.d.ts +14 -0
- package/node_modules/ret/dist/write-set-tokens.js +108 -0
- package/node_modules/ret/dist/write-set-tokens.js.map +1 -0
- package/node_modules/ret/package.json +42 -0
- package/node_modules/reusify/.github/dependabot.yml +7 -0
- package/node_modules/reusify/.github/workflows/ci.yml +96 -0
- package/node_modules/reusify/LICENSE +22 -0
- package/node_modules/reusify/README.md +139 -0
- package/node_modules/reusify/SECURITY.md +15 -0
- package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/node_modules/reusify/benchmarks/fib.js +13 -0
- package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/node_modules/reusify/eslint.config.js +14 -0
- package/node_modules/reusify/package.json +50 -0
- package/node_modules/reusify/reusify.d.ts +14 -0
- package/node_modules/reusify/reusify.js +33 -0
- package/node_modules/reusify/test.js +66 -0
- package/node_modules/reusify/tsconfig.json +11 -0
- package/node_modules/rfdc/.github/workflows/ci.yml +21 -0
- package/node_modules/rfdc/LICENSE +15 -0
- package/node_modules/rfdc/default.js +3 -0
- package/node_modules/rfdc/index.d.ts +13 -0
- package/node_modules/rfdc/index.js +198 -0
- package/node_modules/rfdc/index.test-d.ts +13 -0
- package/node_modules/rfdc/package.json +73 -0
- package/node_modules/rfdc/readme.md +181 -0
- package/node_modules/rfdc/test/index.js +306 -0
- package/node_modules/run-parallel/LICENSE +20 -0
- package/node_modules/run-parallel/README.md +85 -0
- package/node_modules/run-parallel/index.js +51 -0
- package/node_modules/run-parallel/package.json +58 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/safe-regex2/.gitattributes +2 -0
- package/node_modules/safe-regex2/.github/dependabot.yml +13 -0
- package/node_modules/safe-regex2/.github/stale.yml +21 -0
- package/node_modules/safe-regex2/.github/workflows/ci.yml +25 -0
- package/node_modules/safe-regex2/LICENSE +18 -0
- package/node_modules/safe-regex2/README.md +59 -0
- package/node_modules/safe-regex2/eslint.config.js +6 -0
- package/node_modules/safe-regex2/example/safe.js +5 -0
- package/node_modules/safe-regex2/index.js +54 -0
- package/node_modules/safe-regex2/package.json +77 -0
- package/node_modules/safe-regex2/test/regex.js +51 -0
- package/node_modules/safe-regex2/types/index.d.ts +9 -0
- package/node_modules/safe-regex2/types/index.test-d.ts +12 -0
- package/node_modules/safe-stable-stringify/LICENSE +21 -0
- package/node_modules/safe-stable-stringify/esm/package.json +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.d.ts +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
- package/node_modules/safe-stable-stringify/index.d.ts +22 -0
- package/node_modules/safe-stable-stringify/index.js +625 -0
- package/node_modules/safe-stable-stringify/package.json +65 -0
- package/node_modules/safe-stable-stringify/readme.md +179 -0
- package/node_modules/secure-json-parse/.airtap.yml +7 -0
- package/node_modules/secure-json-parse/.gitattributes +2 -0
- package/node_modules/secure-json-parse/.github/dependabot.yml +13 -0
- package/node_modules/secure-json-parse/.github/stale.yml +21 -0
- package/node_modules/secure-json-parse/.github/workflows/ci.yml +149 -0
- package/node_modules/secure-json-parse/LICENSE +19 -0
- package/node_modules/secure-json-parse/README.md +132 -0
- package/node_modules/secure-json-parse/benchmarks/ignore.js +35 -0
- package/node_modules/secure-json-parse/benchmarks/no__proto__.js +40 -0
- package/node_modules/secure-json-parse/benchmarks/package.json +15 -0
- package/node_modules/secure-json-parse/benchmarks/remove.js +39 -0
- package/node_modules/secure-json-parse/benchmarks/throw.js +49 -0
- package/node_modules/secure-json-parse/benchmarks/valid.js +49 -0
- package/node_modules/secure-json-parse/eslint.config.js +6 -0
- package/node_modules/secure-json-parse/index.js +161 -0
- package/node_modules/secure-json-parse/package.json +74 -0
- package/node_modules/secure-json-parse/test/index.test.js +649 -0
- package/node_modules/secure-json-parse/types/index.d.ts +60 -0
- package/node_modules/secure-json-parse/types/index.test-d.ts +43 -0
- package/node_modules/set-cookie-parser/LICENSE +21 -0
- package/node_modules/set-cookie-parser/README.md +202 -0
- package/node_modules/set-cookie-parser/lib/set-cookie.js +242 -0
- package/node_modules/set-cookie-parser/package.json +45 -0
- package/node_modules/setprototypeof/LICENSE +13 -0
- package/node_modules/setprototypeof/README.md +31 -0
- package/node_modules/setprototypeof/index.d.ts +2 -0
- package/node_modules/setprototypeof/index.js +17 -0
- package/node_modules/setprototypeof/package.json +38 -0
- package/node_modules/setprototypeof/test/index.js +24 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +74 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/node_modules/signal-exit/package.json +106 -0
- package/node_modules/sonic-boom/.eslintignore +2 -0
- package/node_modules/sonic-boom/.taprc +3 -0
- package/node_modules/sonic-boom/LICENSE +21 -0
- package/node_modules/sonic-boom/README.md +153 -0
- package/node_modules/sonic-boom/bench.js +98 -0
- package/node_modules/sonic-boom/check.js +18 -0
- package/node_modules/sonic-boom/example.js +8 -0
- package/node_modules/sonic-boom/fixtures/firehose.js +22 -0
- package/node_modules/sonic-boom/index.js +733 -0
- package/node_modules/sonic-boom/package.json +52 -0
- package/node_modules/sonic-boom/test/destroy.test.js +49 -0
- package/node_modules/sonic-boom/test/end.test.js +98 -0
- package/node_modules/sonic-boom/test/flush-sync.test.js +140 -0
- package/node_modules/sonic-boom/test/flush.test.js +419 -0
- package/node_modules/sonic-boom/test/fsync.test.js +63 -0
- package/node_modules/sonic-boom/test/helper.js +42 -0
- package/node_modules/sonic-boom/test/minlength.test.js +35 -0
- package/node_modules/sonic-boom/test/mode.test.js +116 -0
- package/node_modules/sonic-boom/test/periodicflush.test.js +61 -0
- package/node_modules/sonic-boom/test/reopen.test.js +239 -0
- package/node_modules/sonic-boom/test/retry.test.js +414 -0
- package/node_modules/sonic-boom/test/sync.test.js +261 -0
- package/node_modules/sonic-boom/test/write.test.js +515 -0
- package/node_modules/sonic-boom/types/index.d.ts +63 -0
- package/node_modules/sonic-boom/types/tests/test.ts +4 -0
- package/node_modules/split2/LICENSE +13 -0
- package/node_modules/split2/README.md +85 -0
- package/node_modules/split2/bench.js +27 -0
- package/node_modules/split2/index.js +141 -0
- package/node_modules/split2/package.json +39 -0
- package/node_modules/split2/test.js +409 -0
- package/node_modules/statuses/HISTORY.md +87 -0
- package/node_modules/statuses/LICENSE +23 -0
- package/node_modules/statuses/README.md +139 -0
- package/node_modules/statuses/codes.json +65 -0
- package/node_modules/statuses/index.js +146 -0
- package/node_modules/statuses/package.json +49 -0
- package/node_modules/thread-stream/.github/dependabot.yml +13 -0
- package/node_modules/thread-stream/.github/workflows/ci.yml +74 -0
- package/node_modules/thread-stream/.husky/pre-commit +4 -0
- package/node_modules/thread-stream/CLAUDE.md +53 -0
- package/node_modules/thread-stream/LICENSE +21 -0
- package/node_modules/thread-stream/README.md +135 -0
- package/node_modules/thread-stream/bench.js +85 -0
- package/node_modules/thread-stream/eslint.config.js +10 -0
- package/node_modules/thread-stream/index.d.ts +92 -0
- package/node_modules/thread-stream/index.js +541 -0
- package/node_modules/thread-stream/lib/indexes.js +9 -0
- package/node_modules/thread-stream/lib/wait.js +68 -0
- package/node_modules/thread-stream/lib/worker.js +179 -0
- package/node_modules/thread-stream/package.json +52 -0
- package/node_modules/thread-stream/test/base.test.js +259 -0
- package/node_modules/thread-stream/test/bench.test.js +38 -0
- package/node_modules/thread-stream/test/bundlers.test.js +59 -0
- package/node_modules/thread-stream/test/close-on-gc.js +37 -0
- package/node_modules/thread-stream/test/commonjs-fallback.test.js +75 -0
- package/node_modules/thread-stream/test/context.test.js +21 -0
- package/node_modules/thread-stream/test/create-and-exit.js +16 -0
- package/node_modules/thread-stream/test/custom-worker.js +9 -0
- package/node_modules/thread-stream/test/dir with spaces/test-package.zip +0 -0
- package/node_modules/thread-stream/test/emit-event.js +22 -0
- package/node_modules/thread-stream/test/end.test.js +56 -0
- package/node_modules/thread-stream/test/error.js +14 -0
- package/node_modules/thread-stream/test/esm.test.mjs +46 -0
- package/node_modules/thread-stream/test/event.test.js +24 -0
- package/node_modules/thread-stream/test/exit.js +14 -0
- package/node_modules/thread-stream/test/get-context.js +22 -0
- package/node_modules/thread-stream/test/helper.d.ts +1 -0
- package/node_modules/thread-stream/test/helper.js +26 -0
- package/node_modules/thread-stream/test/indexes.test.js +11 -0
- package/node_modules/thread-stream/test/multibyte-chars.test.mjs +75 -0
- package/node_modules/thread-stream/test/on-message.js +18 -0
- package/node_modules/thread-stream/test/pkg/index.js +37 -0
- package/node_modules/thread-stream/test/pkg/pkg.config.json +14 -0
- package/node_modules/thread-stream/test/pkg/pkg.test.js +45 -0
- package/node_modules/thread-stream/test/port.js +16 -0
- package/node_modules/thread-stream/test/post-message.test.js +23 -0
- package/node_modules/thread-stream/test/string-limit-2.test.js +35 -0
- package/node_modules/thread-stream/test/string-limit.test.js +37 -0
- package/node_modules/thread-stream/test/syntax-error.mjs +2 -0
- package/node_modules/thread-stream/test/thread-management.test.js +138 -0
- package/node_modules/thread-stream/test/to-file-on-destroy.js +23 -0
- package/node_modules/thread-stream/test/to-file-on-final.js +24 -0
- package/node_modules/thread-stream/test/to-file.js +12 -0
- package/node_modules/thread-stream/test/to-file.mjs +8 -0
- package/node_modules/thread-stream/test/to-next.js +9 -0
- package/node_modules/thread-stream/test/transpiled.test.js +29 -0
- package/node_modules/thread-stream/test/ts/to-file.ts +10 -0
- package/node_modules/thread-stream/test/ts/transpile.sh +19 -0
- package/node_modules/thread-stream/test/ts-commonjs-default-export.zip +0 -0
- package/node_modules/thread-stream/test/ts-native.test.mjs +35 -0
- package/node_modules/thread-stream/test/ts-node-fallback.test.js +35 -0
- package/node_modules/thread-stream/test/uncaughtException.js +21 -0
- package/node_modules/thread-stream/test/unhandledRejection.js +21 -0
- package/node_modules/thread-stream/test/yarnrc.yml +7 -0
- package/node_modules/thread-stream/tsconfig.json +8 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +88 -0
- package/node_modules/toad-cache/LICENSE +21 -0
- package/node_modules/toad-cache/README.md +265 -0
- package/node_modules/toad-cache/dist/toad-cache.cjs +878 -0
- package/node_modules/toad-cache/dist/toad-cache.mjs +852 -0
- package/node_modules/toad-cache/package.json +82 -0
- package/node_modules/toad-cache/toad-cache.d.cts +138 -0
- package/node_modules/toad-cache/toad-cache.d.ts +128 -0
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/LICENSE +21 -0
- package/node_modules/toidentifier/README.md +61 -0
- package/node_modules/toidentifier/index.js +32 -0
- package/node_modules/toidentifier/package.json +38 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/package.json +45 -0
|
@@ -0,0 +1,2662 @@
|
|
|
1
|
+
const EventEmitter = require('node:events').EventEmitter;
|
|
2
|
+
const childProcess = require('node:child_process');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const process = require('node:process');
|
|
6
|
+
|
|
7
|
+
const { Argument, humanReadableArgName } = require('./argument.js');
|
|
8
|
+
const { CommanderError } = require('./error.js');
|
|
9
|
+
const { Help, stripColor } = require('./help.js');
|
|
10
|
+
const { Option, DualOptions } = require('./option.js');
|
|
11
|
+
const { suggestSimilar } = require('./suggestSimilar');
|
|
12
|
+
|
|
13
|
+
class Command extends EventEmitter {
|
|
14
|
+
/**
|
|
15
|
+
* Initialize a new `Command`.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} [name]
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
constructor(name) {
|
|
21
|
+
super();
|
|
22
|
+
/** @type {Command[]} */
|
|
23
|
+
this.commands = [];
|
|
24
|
+
/** @type {Option[]} */
|
|
25
|
+
this.options = [];
|
|
26
|
+
this.parent = null;
|
|
27
|
+
this._allowUnknownOption = false;
|
|
28
|
+
this._allowExcessArguments = false;
|
|
29
|
+
/** @type {Argument[]} */
|
|
30
|
+
this.registeredArguments = [];
|
|
31
|
+
this._args = this.registeredArguments; // deprecated old name
|
|
32
|
+
/** @type {string[]} */
|
|
33
|
+
this.args = []; // cli args with options removed
|
|
34
|
+
this.rawArgs = [];
|
|
35
|
+
this.processedArgs = []; // like .args but after custom processing and collecting variadic
|
|
36
|
+
this._scriptPath = null;
|
|
37
|
+
this._name = name || '';
|
|
38
|
+
this._optionValues = {};
|
|
39
|
+
this._optionValueSources = {}; // default, env, cli etc
|
|
40
|
+
this._storeOptionsAsProperties = false;
|
|
41
|
+
this._actionHandler = null;
|
|
42
|
+
this._executableHandler = false;
|
|
43
|
+
this._executableFile = null; // custom name for executable
|
|
44
|
+
this._executableDir = null; // custom search directory for subcommands
|
|
45
|
+
this._defaultCommandName = null;
|
|
46
|
+
this._exitCallback = null;
|
|
47
|
+
this._aliases = [];
|
|
48
|
+
this._combineFlagAndOptionalValue = true;
|
|
49
|
+
this._description = '';
|
|
50
|
+
this._summary = '';
|
|
51
|
+
this._argsDescription = undefined; // legacy
|
|
52
|
+
this._enablePositionalOptions = false;
|
|
53
|
+
this._passThroughOptions = false;
|
|
54
|
+
this._lifeCycleHooks = {}; // a hash of arrays
|
|
55
|
+
/** @type {(boolean | string)} */
|
|
56
|
+
this._showHelpAfterError = false;
|
|
57
|
+
this._showSuggestionAfterError = true;
|
|
58
|
+
this._savedState = null; // used in save/restoreStateBeforeParse
|
|
59
|
+
|
|
60
|
+
// see configureOutput() for docs
|
|
61
|
+
this._outputConfiguration = {
|
|
62
|
+
writeOut: (str) => process.stdout.write(str),
|
|
63
|
+
writeErr: (str) => process.stderr.write(str),
|
|
64
|
+
outputError: (str, write) => write(str),
|
|
65
|
+
getOutHelpWidth: () =>
|
|
66
|
+
process.stdout.isTTY ? process.stdout.columns : undefined,
|
|
67
|
+
getErrHelpWidth: () =>
|
|
68
|
+
process.stderr.isTTY ? process.stderr.columns : undefined,
|
|
69
|
+
getOutHasColors: () =>
|
|
70
|
+
useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),
|
|
71
|
+
getErrHasColors: () =>
|
|
72
|
+
useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),
|
|
73
|
+
stripColor: (str) => stripColor(str),
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this._hidden = false;
|
|
77
|
+
/** @type {(Option | null | undefined)} */
|
|
78
|
+
this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.
|
|
79
|
+
this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited
|
|
80
|
+
/** @type {Command} */
|
|
81
|
+
this._helpCommand = undefined; // lazy initialised, inherited
|
|
82
|
+
this._helpConfiguration = {};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Copy settings that are useful to have in common across root command and subcommands.
|
|
87
|
+
*
|
|
88
|
+
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
|
89
|
+
*
|
|
90
|
+
* @param {Command} sourceCommand
|
|
91
|
+
* @return {Command} `this` command for chaining
|
|
92
|
+
*/
|
|
93
|
+
copyInheritedSettings(sourceCommand) {
|
|
94
|
+
this._outputConfiguration = sourceCommand._outputConfiguration;
|
|
95
|
+
this._helpOption = sourceCommand._helpOption;
|
|
96
|
+
this._helpCommand = sourceCommand._helpCommand;
|
|
97
|
+
this._helpConfiguration = sourceCommand._helpConfiguration;
|
|
98
|
+
this._exitCallback = sourceCommand._exitCallback;
|
|
99
|
+
this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
|
|
100
|
+
this._combineFlagAndOptionalValue =
|
|
101
|
+
sourceCommand._combineFlagAndOptionalValue;
|
|
102
|
+
this._allowExcessArguments = sourceCommand._allowExcessArguments;
|
|
103
|
+
this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
|
|
104
|
+
this._showHelpAfterError = sourceCommand._showHelpAfterError;
|
|
105
|
+
this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
|
|
106
|
+
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @returns {Command[]}
|
|
112
|
+
* @private
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
_getCommandAndAncestors() {
|
|
116
|
+
const result = [];
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
118
|
+
for (let command = this; command; command = command.parent) {
|
|
119
|
+
result.push(command);
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Define a command.
|
|
126
|
+
*
|
|
127
|
+
* There are two styles of command: pay attention to where to put the description.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* // Command implemented using action handler (description is supplied separately to `.command`)
|
|
131
|
+
* program
|
|
132
|
+
* .command('clone <source> [destination]')
|
|
133
|
+
* .description('clone a repository into a newly created directory')
|
|
134
|
+
* .action((source, destination) => {
|
|
135
|
+
* console.log('clone command called');
|
|
136
|
+
* });
|
|
137
|
+
*
|
|
138
|
+
* // Command implemented using separate executable file (description is second parameter to `.command`)
|
|
139
|
+
* program
|
|
140
|
+
* .command('start <service>', 'start named service')
|
|
141
|
+
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
|
142
|
+
*
|
|
143
|
+
* @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
144
|
+
* @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
|
|
145
|
+
* @param {object} [execOpts] - configuration options (for executable)
|
|
146
|
+
* @return {Command} returns new command for action handler, or `this` for executable command
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
|
|
150
|
+
let desc = actionOptsOrExecDesc;
|
|
151
|
+
let opts = execOpts;
|
|
152
|
+
if (typeof desc === 'object' && desc !== null) {
|
|
153
|
+
opts = desc;
|
|
154
|
+
desc = null;
|
|
155
|
+
}
|
|
156
|
+
opts = opts || {};
|
|
157
|
+
const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
158
|
+
|
|
159
|
+
const cmd = this.createCommand(name);
|
|
160
|
+
if (desc) {
|
|
161
|
+
cmd.description(desc);
|
|
162
|
+
cmd._executableHandler = true;
|
|
163
|
+
}
|
|
164
|
+
if (opts.isDefault) this._defaultCommandName = cmd._name;
|
|
165
|
+
cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden
|
|
166
|
+
cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor
|
|
167
|
+
if (args) cmd.arguments(args);
|
|
168
|
+
this._registerCommand(cmd);
|
|
169
|
+
cmd.parent = this;
|
|
170
|
+
cmd.copyInheritedSettings(this);
|
|
171
|
+
|
|
172
|
+
if (desc) return this;
|
|
173
|
+
return cmd;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Factory routine to create a new unattached command.
|
|
178
|
+
*
|
|
179
|
+
* See .command() for creating an attached subcommand, which uses this routine to
|
|
180
|
+
* create the command. You can override createCommand to customise subcommands.
|
|
181
|
+
*
|
|
182
|
+
* @param {string} [name]
|
|
183
|
+
* @return {Command} new command
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
createCommand(name) {
|
|
187
|
+
return new Command(name);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
192
|
+
* or by overriding Help properties using configureHelp().
|
|
193
|
+
*
|
|
194
|
+
* @return {Help}
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
createHelp() {
|
|
198
|
+
return Object.assign(new Help(), this.configureHelp());
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* You can customise the help by overriding Help properties using configureHelp(),
|
|
203
|
+
* or with a subclass of Help by overriding createHelp().
|
|
204
|
+
*
|
|
205
|
+
* @param {object} [configuration] - configuration options
|
|
206
|
+
* @return {(Command | object)} `this` command for chaining, or stored configuration
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
configureHelp(configuration) {
|
|
210
|
+
if (configuration === undefined) return this._helpConfiguration;
|
|
211
|
+
|
|
212
|
+
this._helpConfiguration = configuration;
|
|
213
|
+
return this;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The default output goes to stdout and stderr. You can customise this for special
|
|
218
|
+
* applications. You can also customise the display of errors by overriding outputError.
|
|
219
|
+
*
|
|
220
|
+
* The configuration properties are all functions:
|
|
221
|
+
*
|
|
222
|
+
* // change how output being written, defaults to stdout and stderr
|
|
223
|
+
* writeOut(str)
|
|
224
|
+
* writeErr(str)
|
|
225
|
+
* // change how output being written for errors, defaults to writeErr
|
|
226
|
+
* outputError(str, write) // used for displaying errors and not used for displaying help
|
|
227
|
+
* // specify width for wrapping help
|
|
228
|
+
* getOutHelpWidth()
|
|
229
|
+
* getErrHelpWidth()
|
|
230
|
+
* // color support, currently only used with Help
|
|
231
|
+
* getOutHasColors()
|
|
232
|
+
* getErrHasColors()
|
|
233
|
+
* stripColor() // used to remove ANSI escape codes if output does not have colors
|
|
234
|
+
*
|
|
235
|
+
* @param {object} [configuration] - configuration options
|
|
236
|
+
* @return {(Command | object)} `this` command for chaining, or stored configuration
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
configureOutput(configuration) {
|
|
240
|
+
if (configuration === undefined) return this._outputConfiguration;
|
|
241
|
+
|
|
242
|
+
Object.assign(this._outputConfiguration, configuration);
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Display the help or a custom message after an error occurs.
|
|
248
|
+
*
|
|
249
|
+
* @param {(boolean|string)} [displayHelp]
|
|
250
|
+
* @return {Command} `this` command for chaining
|
|
251
|
+
*/
|
|
252
|
+
showHelpAfterError(displayHelp = true) {
|
|
253
|
+
if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;
|
|
254
|
+
this._showHelpAfterError = displayHelp;
|
|
255
|
+
return this;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
|
260
|
+
*
|
|
261
|
+
* @param {boolean} [displaySuggestion]
|
|
262
|
+
* @return {Command} `this` command for chaining
|
|
263
|
+
*/
|
|
264
|
+
showSuggestionAfterError(displaySuggestion = true) {
|
|
265
|
+
this._showSuggestionAfterError = !!displaySuggestion;
|
|
266
|
+
return this;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Add a prepared subcommand.
|
|
271
|
+
*
|
|
272
|
+
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
|
273
|
+
*
|
|
274
|
+
* @param {Command} cmd - new subcommand
|
|
275
|
+
* @param {object} [opts] - configuration options
|
|
276
|
+
* @return {Command} `this` command for chaining
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
addCommand(cmd, opts) {
|
|
280
|
+
if (!cmd._name) {
|
|
281
|
+
throw new Error(`Command passed to .addCommand() must have a name
|
|
282
|
+
- specify the name in Command constructor or using .name()`);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
opts = opts || {};
|
|
286
|
+
if (opts.isDefault) this._defaultCommandName = cmd._name;
|
|
287
|
+
if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation
|
|
288
|
+
|
|
289
|
+
this._registerCommand(cmd);
|
|
290
|
+
cmd.parent = this;
|
|
291
|
+
cmd._checkForBrokenPassThrough();
|
|
292
|
+
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Factory routine to create a new unattached argument.
|
|
298
|
+
*
|
|
299
|
+
* See .argument() for creating an attached argument, which uses this routine to
|
|
300
|
+
* create the argument. You can override createArgument to return a custom argument.
|
|
301
|
+
*
|
|
302
|
+
* @param {string} name
|
|
303
|
+
* @param {string} [description]
|
|
304
|
+
* @return {Argument} new argument
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
createArgument(name, description) {
|
|
308
|
+
return new Argument(name, description);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Define argument syntax for command.
|
|
313
|
+
*
|
|
314
|
+
* The default is that the argument is required, and you can explicitly
|
|
315
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* program.argument('<input-file>');
|
|
319
|
+
* program.argument('[output-file]');
|
|
320
|
+
*
|
|
321
|
+
* @param {string} name
|
|
322
|
+
* @param {string} [description]
|
|
323
|
+
* @param {(Function|*)} [fn] - custom argument processing function
|
|
324
|
+
* @param {*} [defaultValue]
|
|
325
|
+
* @return {Command} `this` command for chaining
|
|
326
|
+
*/
|
|
327
|
+
argument(name, description, fn, defaultValue) {
|
|
328
|
+
const argument = this.createArgument(name, description);
|
|
329
|
+
if (typeof fn === 'function') {
|
|
330
|
+
argument.default(defaultValue).argParser(fn);
|
|
331
|
+
} else {
|
|
332
|
+
argument.default(fn);
|
|
333
|
+
}
|
|
334
|
+
this.addArgument(argument);
|
|
335
|
+
return this;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
340
|
+
*
|
|
341
|
+
* See also .argument().
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* program.arguments('<cmd> [env]');
|
|
345
|
+
*
|
|
346
|
+
* @param {string} names
|
|
347
|
+
* @return {Command} `this` command for chaining
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
arguments(names) {
|
|
351
|
+
names
|
|
352
|
+
.trim()
|
|
353
|
+
.split(/ +/)
|
|
354
|
+
.forEach((detail) => {
|
|
355
|
+
this.argument(detail);
|
|
356
|
+
});
|
|
357
|
+
return this;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Define argument syntax for command, adding a prepared argument.
|
|
362
|
+
*
|
|
363
|
+
* @param {Argument} argument
|
|
364
|
+
* @return {Command} `this` command for chaining
|
|
365
|
+
*/
|
|
366
|
+
addArgument(argument) {
|
|
367
|
+
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
368
|
+
if (previousArgument && previousArgument.variadic) {
|
|
369
|
+
throw new Error(
|
|
370
|
+
`only the last argument can be variadic '${previousArgument.name()}'`,
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
if (
|
|
374
|
+
argument.required &&
|
|
375
|
+
argument.defaultValue !== undefined &&
|
|
376
|
+
argument.parseArg === undefined
|
|
377
|
+
) {
|
|
378
|
+
throw new Error(
|
|
379
|
+
`a default value for a required argument is never used: '${argument.name()}'`,
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
this.registeredArguments.push(argument);
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* program.helpCommand('help [cmd]');
|
|
391
|
+
* program.helpCommand('help [cmd]', 'show help');
|
|
392
|
+
* program.helpCommand(false); // suppress default help command
|
|
393
|
+
* program.helpCommand(true); // add help command even if no subcommands
|
|
394
|
+
*
|
|
395
|
+
* @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added
|
|
396
|
+
* @param {string} [description] - custom description
|
|
397
|
+
* @return {Command} `this` command for chaining
|
|
398
|
+
*/
|
|
399
|
+
|
|
400
|
+
helpCommand(enableOrNameAndArgs, description) {
|
|
401
|
+
if (typeof enableOrNameAndArgs === 'boolean') {
|
|
402
|
+
this._addImplicitHelpCommand = enableOrNameAndArgs;
|
|
403
|
+
return this;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';
|
|
407
|
+
const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);
|
|
408
|
+
const helpDescription = description ?? 'display help for command';
|
|
409
|
+
|
|
410
|
+
const helpCommand = this.createCommand(helpName);
|
|
411
|
+
helpCommand.helpOption(false);
|
|
412
|
+
if (helpArgs) helpCommand.arguments(helpArgs);
|
|
413
|
+
if (helpDescription) helpCommand.description(helpDescription);
|
|
414
|
+
|
|
415
|
+
this._addImplicitHelpCommand = true;
|
|
416
|
+
this._helpCommand = helpCommand;
|
|
417
|
+
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Add prepared custom help command.
|
|
423
|
+
*
|
|
424
|
+
* @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`
|
|
425
|
+
* @param {string} [deprecatedDescription] - deprecated custom description used with custom name only
|
|
426
|
+
* @return {Command} `this` command for chaining
|
|
427
|
+
*/
|
|
428
|
+
addHelpCommand(helpCommand, deprecatedDescription) {
|
|
429
|
+
// If not passed an object, call through to helpCommand for backwards compatibility,
|
|
430
|
+
// as addHelpCommand was originally used like helpCommand is now.
|
|
431
|
+
if (typeof helpCommand !== 'object') {
|
|
432
|
+
this.helpCommand(helpCommand, deprecatedDescription);
|
|
433
|
+
return this;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
this._addImplicitHelpCommand = true;
|
|
437
|
+
this._helpCommand = helpCommand;
|
|
438
|
+
return this;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Lazy create help command.
|
|
443
|
+
*
|
|
444
|
+
* @return {(Command|null)}
|
|
445
|
+
* @package
|
|
446
|
+
*/
|
|
447
|
+
_getHelpCommand() {
|
|
448
|
+
const hasImplicitHelpCommand =
|
|
449
|
+
this._addImplicitHelpCommand ??
|
|
450
|
+
(this.commands.length &&
|
|
451
|
+
!this._actionHandler &&
|
|
452
|
+
!this._findCommand('help'));
|
|
453
|
+
|
|
454
|
+
if (hasImplicitHelpCommand) {
|
|
455
|
+
if (this._helpCommand === undefined) {
|
|
456
|
+
this.helpCommand(undefined, undefined); // use default name and description
|
|
457
|
+
}
|
|
458
|
+
return this._helpCommand;
|
|
459
|
+
}
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Add hook for life cycle event.
|
|
465
|
+
*
|
|
466
|
+
* @param {string} event
|
|
467
|
+
* @param {Function} listener
|
|
468
|
+
* @return {Command} `this` command for chaining
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
hook(event, listener) {
|
|
472
|
+
const allowedValues = ['preSubcommand', 'preAction', 'postAction'];
|
|
473
|
+
if (!allowedValues.includes(event)) {
|
|
474
|
+
throw new Error(`Unexpected value for event passed to hook : '${event}'.
|
|
475
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
476
|
+
}
|
|
477
|
+
if (this._lifeCycleHooks[event]) {
|
|
478
|
+
this._lifeCycleHooks[event].push(listener);
|
|
479
|
+
} else {
|
|
480
|
+
this._lifeCycleHooks[event] = [listener];
|
|
481
|
+
}
|
|
482
|
+
return this;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Register callback to use as replacement for calling process.exit.
|
|
487
|
+
*
|
|
488
|
+
* @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
|
|
489
|
+
* @return {Command} `this` command for chaining
|
|
490
|
+
*/
|
|
491
|
+
|
|
492
|
+
exitOverride(fn) {
|
|
493
|
+
if (fn) {
|
|
494
|
+
this._exitCallback = fn;
|
|
495
|
+
} else {
|
|
496
|
+
this._exitCallback = (err) => {
|
|
497
|
+
if (err.code !== 'commander.executeSubCommandAsync') {
|
|
498
|
+
throw err;
|
|
499
|
+
} else {
|
|
500
|
+
// Async callback from spawn events, not useful to throw.
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
return this;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Call process.exit, and _exitCallback if defined.
|
|
509
|
+
*
|
|
510
|
+
* @param {number} exitCode exit code for using with process.exit
|
|
511
|
+
* @param {string} code an id string representing the error
|
|
512
|
+
* @param {string} message human-readable description of the error
|
|
513
|
+
* @return never
|
|
514
|
+
* @private
|
|
515
|
+
*/
|
|
516
|
+
|
|
517
|
+
_exit(exitCode, code, message) {
|
|
518
|
+
if (this._exitCallback) {
|
|
519
|
+
this._exitCallback(new CommanderError(exitCode, code, message));
|
|
520
|
+
// Expecting this line is not reached.
|
|
521
|
+
}
|
|
522
|
+
process.exit(exitCode);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Register callback `fn` for the command.
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
* program
|
|
530
|
+
* .command('serve')
|
|
531
|
+
* .description('start service')
|
|
532
|
+
* .action(function() {
|
|
533
|
+
* // do work here
|
|
534
|
+
* });
|
|
535
|
+
*
|
|
536
|
+
* @param {Function} fn
|
|
537
|
+
* @return {Command} `this` command for chaining
|
|
538
|
+
*/
|
|
539
|
+
|
|
540
|
+
action(fn) {
|
|
541
|
+
const listener = (args) => {
|
|
542
|
+
// The .action callback takes an extra parameter which is the command or options.
|
|
543
|
+
const expectedArgsCount = this.registeredArguments.length;
|
|
544
|
+
const actionArgs = args.slice(0, expectedArgsCount);
|
|
545
|
+
if (this._storeOptionsAsProperties) {
|
|
546
|
+
actionArgs[expectedArgsCount] = this; // backwards compatible "options"
|
|
547
|
+
} else {
|
|
548
|
+
actionArgs[expectedArgsCount] = this.opts();
|
|
549
|
+
}
|
|
550
|
+
actionArgs.push(this);
|
|
551
|
+
|
|
552
|
+
return fn.apply(this, actionArgs);
|
|
553
|
+
};
|
|
554
|
+
this._actionHandler = listener;
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Factory routine to create a new unattached option.
|
|
560
|
+
*
|
|
561
|
+
* See .option() for creating an attached option, which uses this routine to
|
|
562
|
+
* create the option. You can override createOption to return a custom option.
|
|
563
|
+
*
|
|
564
|
+
* @param {string} flags
|
|
565
|
+
* @param {string} [description]
|
|
566
|
+
* @return {Option} new option
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
createOption(flags, description) {
|
|
570
|
+
return new Option(flags, description);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
575
|
+
*
|
|
576
|
+
* @param {(Option | Argument)} target
|
|
577
|
+
* @param {string} value
|
|
578
|
+
* @param {*} previous
|
|
579
|
+
* @param {string} invalidArgumentMessage
|
|
580
|
+
* @private
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
_callParseArg(target, value, previous, invalidArgumentMessage) {
|
|
584
|
+
try {
|
|
585
|
+
return target.parseArg(value, previous);
|
|
586
|
+
} catch (err) {
|
|
587
|
+
if (err.code === 'commander.invalidArgument') {
|
|
588
|
+
const message = `${invalidArgumentMessage} ${err.message}`;
|
|
589
|
+
this.error(message, { exitCode: err.exitCode, code: err.code });
|
|
590
|
+
}
|
|
591
|
+
throw err;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Check for option flag conflicts.
|
|
597
|
+
* Register option if no conflicts found, or throw on conflict.
|
|
598
|
+
*
|
|
599
|
+
* @param {Option} option
|
|
600
|
+
* @private
|
|
601
|
+
*/
|
|
602
|
+
|
|
603
|
+
_registerOption(option) {
|
|
604
|
+
const matchingOption =
|
|
605
|
+
(option.short && this._findOption(option.short)) ||
|
|
606
|
+
(option.long && this._findOption(option.long));
|
|
607
|
+
if (matchingOption) {
|
|
608
|
+
const matchingFlag =
|
|
609
|
+
option.long && this._findOption(option.long)
|
|
610
|
+
? option.long
|
|
611
|
+
: option.short;
|
|
612
|
+
throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
|
|
613
|
+
- already used by option '${matchingOption.flags}'`);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
this.options.push(option);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Check for command name and alias conflicts with existing commands.
|
|
621
|
+
* Register command if no conflicts found, or throw on conflict.
|
|
622
|
+
*
|
|
623
|
+
* @param {Command} command
|
|
624
|
+
* @private
|
|
625
|
+
*/
|
|
626
|
+
|
|
627
|
+
_registerCommand(command) {
|
|
628
|
+
const knownBy = (cmd) => {
|
|
629
|
+
return [cmd.name()].concat(cmd.aliases());
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
const alreadyUsed = knownBy(command).find((name) =>
|
|
633
|
+
this._findCommand(name),
|
|
634
|
+
);
|
|
635
|
+
if (alreadyUsed) {
|
|
636
|
+
const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');
|
|
637
|
+
const newCmd = knownBy(command).join('|');
|
|
638
|
+
throw new Error(
|
|
639
|
+
`cannot add command '${newCmd}' as already have command '${existingCmd}'`,
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
this.commands.push(command);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Add an option.
|
|
648
|
+
*
|
|
649
|
+
* @param {Option} option
|
|
650
|
+
* @return {Command} `this` command for chaining
|
|
651
|
+
*/
|
|
652
|
+
addOption(option) {
|
|
653
|
+
this._registerOption(option);
|
|
654
|
+
|
|
655
|
+
const oname = option.name();
|
|
656
|
+
const name = option.attributeName();
|
|
657
|
+
|
|
658
|
+
// store default value
|
|
659
|
+
if (option.negate) {
|
|
660
|
+
// --no-foo is special and defaults foo to true, unless a --foo option is already defined
|
|
661
|
+
const positiveLongFlag = option.long.replace(/^--no-/, '--');
|
|
662
|
+
if (!this._findOption(positiveLongFlag)) {
|
|
663
|
+
this.setOptionValueWithSource(
|
|
664
|
+
name,
|
|
665
|
+
option.defaultValue === undefined ? true : option.defaultValue,
|
|
666
|
+
'default',
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
} else if (option.defaultValue !== undefined) {
|
|
670
|
+
this.setOptionValueWithSource(name, option.defaultValue, 'default');
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// handler for cli and env supplied values
|
|
674
|
+
const handleOptionValue = (val, invalidValueMessage, valueSource) => {
|
|
675
|
+
// val is null for optional option used without an optional-argument.
|
|
676
|
+
// val is undefined for boolean and negated option.
|
|
677
|
+
if (val == null && option.presetArg !== undefined) {
|
|
678
|
+
val = option.presetArg;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// custom processing
|
|
682
|
+
const oldValue = this.getOptionValue(name);
|
|
683
|
+
if (val !== null && option.parseArg) {
|
|
684
|
+
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
685
|
+
} else if (val !== null && option.variadic) {
|
|
686
|
+
val = option._concatValue(val, oldValue);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// Fill-in appropriate missing values. Long winded but easy to follow.
|
|
690
|
+
if (val == null) {
|
|
691
|
+
if (option.negate) {
|
|
692
|
+
val = false;
|
|
693
|
+
} else if (option.isBoolean() || option.optional) {
|
|
694
|
+
val = true;
|
|
695
|
+
} else {
|
|
696
|
+
val = ''; // not normal, parseArg might have failed or be a mock function for testing
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
this.setOptionValueWithSource(name, val, valueSource);
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
this.on('option:' + oname, (val) => {
|
|
703
|
+
const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
|
|
704
|
+
handleOptionValue(val, invalidValueMessage, 'cli');
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
if (option.envVar) {
|
|
708
|
+
this.on('optionEnv:' + oname, (val) => {
|
|
709
|
+
const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
|
|
710
|
+
handleOptionValue(val, invalidValueMessage, 'env');
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
return this;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Internal implementation shared by .option() and .requiredOption()
|
|
719
|
+
*
|
|
720
|
+
* @return {Command} `this` command for chaining
|
|
721
|
+
* @private
|
|
722
|
+
*/
|
|
723
|
+
_optionEx(config, flags, description, fn, defaultValue) {
|
|
724
|
+
if (typeof flags === 'object' && flags instanceof Option) {
|
|
725
|
+
throw new Error(
|
|
726
|
+
'To add an Option object use addOption() instead of option() or requiredOption()',
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
const option = this.createOption(flags, description);
|
|
730
|
+
option.makeOptionMandatory(!!config.mandatory);
|
|
731
|
+
if (typeof fn === 'function') {
|
|
732
|
+
option.default(defaultValue).argParser(fn);
|
|
733
|
+
} else if (fn instanceof RegExp) {
|
|
734
|
+
// deprecated
|
|
735
|
+
const regex = fn;
|
|
736
|
+
fn = (val, def) => {
|
|
737
|
+
const m = regex.exec(val);
|
|
738
|
+
return m ? m[0] : def;
|
|
739
|
+
};
|
|
740
|
+
option.default(defaultValue).argParser(fn);
|
|
741
|
+
} else {
|
|
742
|
+
option.default(fn);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
return this.addOption(option);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
750
|
+
*
|
|
751
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
|
752
|
+
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
|
753
|
+
*
|
|
754
|
+
* See the README for more details, and see also addOption() and requiredOption().
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* program
|
|
758
|
+
* .option('-p, --pepper', 'add pepper')
|
|
759
|
+
* .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
760
|
+
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
761
|
+
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
762
|
+
*
|
|
763
|
+
* @param {string} flags
|
|
764
|
+
* @param {string} [description]
|
|
765
|
+
* @param {(Function|*)} [parseArg] - custom option processing function or default value
|
|
766
|
+
* @param {*} [defaultValue]
|
|
767
|
+
* @return {Command} `this` command for chaining
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
option(flags, description, parseArg, defaultValue) {
|
|
771
|
+
return this._optionEx({}, flags, description, parseArg, defaultValue);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Add a required option which must have a value after parsing. This usually means
|
|
776
|
+
* the option must be specified on the command line. (Otherwise the same as .option().)
|
|
777
|
+
*
|
|
778
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
|
779
|
+
*
|
|
780
|
+
* @param {string} flags
|
|
781
|
+
* @param {string} [description]
|
|
782
|
+
* @param {(Function|*)} [parseArg] - custom option processing function or default value
|
|
783
|
+
* @param {*} [defaultValue]
|
|
784
|
+
* @return {Command} `this` command for chaining
|
|
785
|
+
*/
|
|
786
|
+
|
|
787
|
+
requiredOption(flags, description, parseArg, defaultValue) {
|
|
788
|
+
return this._optionEx(
|
|
789
|
+
{ mandatory: true },
|
|
790
|
+
flags,
|
|
791
|
+
description,
|
|
792
|
+
parseArg,
|
|
793
|
+
defaultValue,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Alter parsing of short flags with optional values.
|
|
799
|
+
*
|
|
800
|
+
* @example
|
|
801
|
+
* // for `.option('-f,--flag [value]'):
|
|
802
|
+
* program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour
|
|
803
|
+
* program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
|
804
|
+
*
|
|
805
|
+
* @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.
|
|
806
|
+
* @return {Command} `this` command for chaining
|
|
807
|
+
*/
|
|
808
|
+
combineFlagAndOptionalValue(combine = true) {
|
|
809
|
+
this._combineFlagAndOptionalValue = !!combine;
|
|
810
|
+
return this;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Allow unknown options on the command line.
|
|
815
|
+
*
|
|
816
|
+
* @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.
|
|
817
|
+
* @return {Command} `this` command for chaining
|
|
818
|
+
*/
|
|
819
|
+
allowUnknownOption(allowUnknown = true) {
|
|
820
|
+
this._allowUnknownOption = !!allowUnknown;
|
|
821
|
+
return this;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
|
826
|
+
*
|
|
827
|
+
* @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.
|
|
828
|
+
* @return {Command} `this` command for chaining
|
|
829
|
+
*/
|
|
830
|
+
allowExcessArguments(allowExcess = true) {
|
|
831
|
+
this._allowExcessArguments = !!allowExcess;
|
|
832
|
+
return this;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Enable positional options. Positional means global options are specified before subcommands which lets
|
|
837
|
+
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
|
838
|
+
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
|
839
|
+
*
|
|
840
|
+
* @param {boolean} [positional]
|
|
841
|
+
* @return {Command} `this` command for chaining
|
|
842
|
+
*/
|
|
843
|
+
enablePositionalOptions(positional = true) {
|
|
844
|
+
this._enablePositionalOptions = !!positional;
|
|
845
|
+
return this;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Pass through options that come after command-arguments rather than treat them as command-options,
|
|
850
|
+
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
|
851
|
+
* positional options to have been enabled on the program (parent commands).
|
|
852
|
+
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
|
853
|
+
*
|
|
854
|
+
* @param {boolean} [passThrough] for unknown options.
|
|
855
|
+
* @return {Command} `this` command for chaining
|
|
856
|
+
*/
|
|
857
|
+
passThroughOptions(passThrough = true) {
|
|
858
|
+
this._passThroughOptions = !!passThrough;
|
|
859
|
+
this._checkForBrokenPassThrough();
|
|
860
|
+
return this;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* @private
|
|
865
|
+
*/
|
|
866
|
+
|
|
867
|
+
_checkForBrokenPassThrough() {
|
|
868
|
+
if (
|
|
869
|
+
this.parent &&
|
|
870
|
+
this._passThroughOptions &&
|
|
871
|
+
!this.parent._enablePositionalOptions
|
|
872
|
+
) {
|
|
873
|
+
throw new Error(
|
|
874
|
+
`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Whether to store option values as properties on command object,
|
|
881
|
+
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
|
882
|
+
*
|
|
883
|
+
* @param {boolean} [storeAsProperties=true]
|
|
884
|
+
* @return {Command} `this` command for chaining
|
|
885
|
+
*/
|
|
886
|
+
|
|
887
|
+
storeOptionsAsProperties(storeAsProperties = true) {
|
|
888
|
+
if (this.options.length) {
|
|
889
|
+
throw new Error('call .storeOptionsAsProperties() before adding options');
|
|
890
|
+
}
|
|
891
|
+
if (Object.keys(this._optionValues).length) {
|
|
892
|
+
throw new Error(
|
|
893
|
+
'call .storeOptionsAsProperties() before setting option values',
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
897
|
+
return this;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Retrieve option value.
|
|
902
|
+
*
|
|
903
|
+
* @param {string} key
|
|
904
|
+
* @return {object} value
|
|
905
|
+
*/
|
|
906
|
+
|
|
907
|
+
getOptionValue(key) {
|
|
908
|
+
if (this._storeOptionsAsProperties) {
|
|
909
|
+
return this[key];
|
|
910
|
+
}
|
|
911
|
+
return this._optionValues[key];
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Store option value.
|
|
916
|
+
*
|
|
917
|
+
* @param {string} key
|
|
918
|
+
* @param {object} value
|
|
919
|
+
* @return {Command} `this` command for chaining
|
|
920
|
+
*/
|
|
921
|
+
|
|
922
|
+
setOptionValue(key, value) {
|
|
923
|
+
return this.setOptionValueWithSource(key, value, undefined);
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Store option value and where the value came from.
|
|
928
|
+
*
|
|
929
|
+
* @param {string} key
|
|
930
|
+
* @param {object} value
|
|
931
|
+
* @param {string} source - expected values are default/config/env/cli/implied
|
|
932
|
+
* @return {Command} `this` command for chaining
|
|
933
|
+
*/
|
|
934
|
+
|
|
935
|
+
setOptionValueWithSource(key, value, source) {
|
|
936
|
+
if (this._storeOptionsAsProperties) {
|
|
937
|
+
this[key] = value;
|
|
938
|
+
} else {
|
|
939
|
+
this._optionValues[key] = value;
|
|
940
|
+
}
|
|
941
|
+
this._optionValueSources[key] = source;
|
|
942
|
+
return this;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Get source of option value.
|
|
947
|
+
* Expected values are default | config | env | cli | implied
|
|
948
|
+
*
|
|
949
|
+
* @param {string} key
|
|
950
|
+
* @return {string}
|
|
951
|
+
*/
|
|
952
|
+
|
|
953
|
+
getOptionValueSource(key) {
|
|
954
|
+
return this._optionValueSources[key];
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Get source of option value. See also .optsWithGlobals().
|
|
959
|
+
* Expected values are default | config | env | cli | implied
|
|
960
|
+
*
|
|
961
|
+
* @param {string} key
|
|
962
|
+
* @return {string}
|
|
963
|
+
*/
|
|
964
|
+
|
|
965
|
+
getOptionValueSourceWithGlobals(key) {
|
|
966
|
+
// global overwrites local, like optsWithGlobals
|
|
967
|
+
let source;
|
|
968
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
969
|
+
if (cmd.getOptionValueSource(key) !== undefined) {
|
|
970
|
+
source = cmd.getOptionValueSource(key);
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
return source;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Get user arguments from implied or explicit arguments.
|
|
978
|
+
* Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.
|
|
979
|
+
*
|
|
980
|
+
* @private
|
|
981
|
+
*/
|
|
982
|
+
|
|
983
|
+
_prepareUserArgs(argv, parseOptions) {
|
|
984
|
+
if (argv !== undefined && !Array.isArray(argv)) {
|
|
985
|
+
throw new Error('first parameter to parse must be array or undefined');
|
|
986
|
+
}
|
|
987
|
+
parseOptions = parseOptions || {};
|
|
988
|
+
|
|
989
|
+
// auto-detect argument conventions if nothing supplied
|
|
990
|
+
if (argv === undefined && parseOptions.from === undefined) {
|
|
991
|
+
if (process.versions?.electron) {
|
|
992
|
+
parseOptions.from = 'electron';
|
|
993
|
+
}
|
|
994
|
+
// check node specific options for scenarios where user CLI args follow executable without scriptname
|
|
995
|
+
const execArgv = process.execArgv ?? [];
|
|
996
|
+
if (
|
|
997
|
+
execArgv.includes('-e') ||
|
|
998
|
+
execArgv.includes('--eval') ||
|
|
999
|
+
execArgv.includes('-p') ||
|
|
1000
|
+
execArgv.includes('--print')
|
|
1001
|
+
) {
|
|
1002
|
+
parseOptions.from = 'eval'; // internal usage, not documented
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// default to using process.argv
|
|
1007
|
+
if (argv === undefined) {
|
|
1008
|
+
argv = process.argv;
|
|
1009
|
+
}
|
|
1010
|
+
this.rawArgs = argv.slice();
|
|
1011
|
+
|
|
1012
|
+
// extract the user args and scriptPath
|
|
1013
|
+
let userArgs;
|
|
1014
|
+
switch (parseOptions.from) {
|
|
1015
|
+
case undefined:
|
|
1016
|
+
case 'node':
|
|
1017
|
+
this._scriptPath = argv[1];
|
|
1018
|
+
userArgs = argv.slice(2);
|
|
1019
|
+
break;
|
|
1020
|
+
case 'electron':
|
|
1021
|
+
// @ts-ignore: because defaultApp is an unknown property
|
|
1022
|
+
if (process.defaultApp) {
|
|
1023
|
+
this._scriptPath = argv[1];
|
|
1024
|
+
userArgs = argv.slice(2);
|
|
1025
|
+
} else {
|
|
1026
|
+
userArgs = argv.slice(1);
|
|
1027
|
+
}
|
|
1028
|
+
break;
|
|
1029
|
+
case 'user':
|
|
1030
|
+
userArgs = argv.slice(0);
|
|
1031
|
+
break;
|
|
1032
|
+
case 'eval':
|
|
1033
|
+
userArgs = argv.slice(1);
|
|
1034
|
+
break;
|
|
1035
|
+
default:
|
|
1036
|
+
throw new Error(
|
|
1037
|
+
`unexpected parse option { from: '${parseOptions.from}' }`,
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// Find default name for program from arguments.
|
|
1042
|
+
if (!this._name && this._scriptPath)
|
|
1043
|
+
this.nameFromFilename(this._scriptPath);
|
|
1044
|
+
this._name = this._name || 'program';
|
|
1045
|
+
|
|
1046
|
+
return userArgs;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
1051
|
+
*
|
|
1052
|
+
* Use parseAsync instead of parse if any of your action handlers are async.
|
|
1053
|
+
*
|
|
1054
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
1055
|
+
*
|
|
1056
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
1057
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
1058
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
1059
|
+
* - `'user'`: just user arguments
|
|
1060
|
+
*
|
|
1061
|
+
* @example
|
|
1062
|
+
* program.parse(); // parse process.argv and auto-detect electron and special node flags
|
|
1063
|
+
* program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
|
1064
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
1065
|
+
*
|
|
1066
|
+
* @param {string[]} [argv] - optional, defaults to process.argv
|
|
1067
|
+
* @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron
|
|
1068
|
+
* @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
|
|
1069
|
+
* @return {Command} `this` command for chaining
|
|
1070
|
+
*/
|
|
1071
|
+
|
|
1072
|
+
parse(argv, parseOptions) {
|
|
1073
|
+
this._prepareForParse();
|
|
1074
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
1075
|
+
this._parseCommand([], userArgs);
|
|
1076
|
+
|
|
1077
|
+
return this;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
1082
|
+
*
|
|
1083
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
1084
|
+
*
|
|
1085
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
1086
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
1087
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
1088
|
+
* - `'user'`: just user arguments
|
|
1089
|
+
*
|
|
1090
|
+
* @example
|
|
1091
|
+
* await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
|
|
1092
|
+
* await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
|
|
1093
|
+
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
1094
|
+
*
|
|
1095
|
+
* @param {string[]} [argv]
|
|
1096
|
+
* @param {object} [parseOptions]
|
|
1097
|
+
* @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
|
|
1098
|
+
* @return {Promise}
|
|
1099
|
+
*/
|
|
1100
|
+
|
|
1101
|
+
async parseAsync(argv, parseOptions) {
|
|
1102
|
+
this._prepareForParse();
|
|
1103
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
1104
|
+
await this._parseCommand([], userArgs);
|
|
1105
|
+
|
|
1106
|
+
return this;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
_prepareForParse() {
|
|
1110
|
+
if (this._savedState === null) {
|
|
1111
|
+
this.saveStateBeforeParse();
|
|
1112
|
+
} else {
|
|
1113
|
+
this.restoreStateBeforeParse();
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
|
|
1119
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
1120
|
+
*
|
|
1121
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state saved.
|
|
1122
|
+
*/
|
|
1123
|
+
saveStateBeforeParse() {
|
|
1124
|
+
this._savedState = {
|
|
1125
|
+
// name is stable if supplied by author, but may be unspecified for root command and deduced during parsing
|
|
1126
|
+
_name: this._name,
|
|
1127
|
+
// option values before parse have default values (including false for negated options)
|
|
1128
|
+
// shallow clones
|
|
1129
|
+
_optionValues: { ...this._optionValues },
|
|
1130
|
+
_optionValueSources: { ...this._optionValueSources },
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Restore state before parse for calls after the first.
|
|
1136
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
1137
|
+
*
|
|
1138
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state restored.
|
|
1139
|
+
*/
|
|
1140
|
+
restoreStateBeforeParse() {
|
|
1141
|
+
if (this._storeOptionsAsProperties)
|
|
1142
|
+
throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
1143
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);
|
|
1144
|
+
|
|
1145
|
+
// clear state from _prepareUserArgs
|
|
1146
|
+
this._name = this._savedState._name;
|
|
1147
|
+
this._scriptPath = null;
|
|
1148
|
+
this.rawArgs = [];
|
|
1149
|
+
// clear state from setOptionValueWithSource
|
|
1150
|
+
this._optionValues = { ...this._savedState._optionValues };
|
|
1151
|
+
this._optionValueSources = { ...this._savedState._optionValueSources };
|
|
1152
|
+
// clear state from _parseCommand
|
|
1153
|
+
this.args = [];
|
|
1154
|
+
// clear state from _processArguments
|
|
1155
|
+
this.processedArgs = [];
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Throw if expected executable is missing. Add lots of help for author.
|
|
1160
|
+
*
|
|
1161
|
+
* @param {string} executableFile
|
|
1162
|
+
* @param {string} executableDir
|
|
1163
|
+
* @param {string} subcommandName
|
|
1164
|
+
*/
|
|
1165
|
+
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1166
|
+
if (fs.existsSync(executableFile)) return;
|
|
1167
|
+
|
|
1168
|
+
const executableDirMessage = executableDir
|
|
1169
|
+
? `searched for local subcommand relative to directory '${executableDir}'`
|
|
1170
|
+
: 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';
|
|
1171
|
+
const executableMissing = `'${executableFile}' does not exist
|
|
1172
|
+
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
1173
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1174
|
+
- ${executableDirMessage}`;
|
|
1175
|
+
throw new Error(executableMissing);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Execute a sub-command executable.
|
|
1180
|
+
*
|
|
1181
|
+
* @private
|
|
1182
|
+
*/
|
|
1183
|
+
|
|
1184
|
+
_executeSubCommand(subcommand, args) {
|
|
1185
|
+
args = args.slice();
|
|
1186
|
+
let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.
|
|
1187
|
+
const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];
|
|
1188
|
+
|
|
1189
|
+
function findFile(baseDir, baseName) {
|
|
1190
|
+
// Look for specified file
|
|
1191
|
+
const localBin = path.resolve(baseDir, baseName);
|
|
1192
|
+
if (fs.existsSync(localBin)) return localBin;
|
|
1193
|
+
|
|
1194
|
+
// Stop looking if candidate already has an expected extension.
|
|
1195
|
+
if (sourceExt.includes(path.extname(baseName))) return undefined;
|
|
1196
|
+
|
|
1197
|
+
// Try all the extensions.
|
|
1198
|
+
const foundExt = sourceExt.find((ext) =>
|
|
1199
|
+
fs.existsSync(`${localBin}${ext}`),
|
|
1200
|
+
);
|
|
1201
|
+
if (foundExt) return `${localBin}${foundExt}`;
|
|
1202
|
+
|
|
1203
|
+
return undefined;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
// Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.
|
|
1207
|
+
this._checkForMissingMandatoryOptions();
|
|
1208
|
+
this._checkForConflictingOptions();
|
|
1209
|
+
|
|
1210
|
+
// executableFile and executableDir might be full path, or just a name
|
|
1211
|
+
let executableFile =
|
|
1212
|
+
subcommand._executableFile || `${this._name}-${subcommand._name}`;
|
|
1213
|
+
let executableDir = this._executableDir || '';
|
|
1214
|
+
if (this._scriptPath) {
|
|
1215
|
+
let resolvedScriptPath; // resolve possible symlink for installed npm binary
|
|
1216
|
+
try {
|
|
1217
|
+
resolvedScriptPath = fs.realpathSync(this._scriptPath);
|
|
1218
|
+
} catch {
|
|
1219
|
+
resolvedScriptPath = this._scriptPath;
|
|
1220
|
+
}
|
|
1221
|
+
executableDir = path.resolve(
|
|
1222
|
+
path.dirname(resolvedScriptPath),
|
|
1223
|
+
executableDir,
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// Look for a local file in preference to a command in PATH.
|
|
1228
|
+
if (executableDir) {
|
|
1229
|
+
let localFile = findFile(executableDir, executableFile);
|
|
1230
|
+
|
|
1231
|
+
// Legacy search using prefix of script name instead of command name
|
|
1232
|
+
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1233
|
+
const legacyName = path.basename(
|
|
1234
|
+
this._scriptPath,
|
|
1235
|
+
path.extname(this._scriptPath),
|
|
1236
|
+
);
|
|
1237
|
+
if (legacyName !== this._name) {
|
|
1238
|
+
localFile = findFile(
|
|
1239
|
+
executableDir,
|
|
1240
|
+
`${legacyName}-${subcommand._name}`,
|
|
1241
|
+
);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
executableFile = localFile || executableFile;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
launchWithNode = sourceExt.includes(path.extname(executableFile));
|
|
1248
|
+
|
|
1249
|
+
let proc;
|
|
1250
|
+
if (process.platform !== 'win32') {
|
|
1251
|
+
if (launchWithNode) {
|
|
1252
|
+
args.unshift(executableFile);
|
|
1253
|
+
// add executable arguments to spawn
|
|
1254
|
+
args = incrementNodeInspectorPort(process.execArgv).concat(args);
|
|
1255
|
+
|
|
1256
|
+
proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });
|
|
1257
|
+
} else {
|
|
1258
|
+
proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });
|
|
1259
|
+
}
|
|
1260
|
+
} else {
|
|
1261
|
+
this._checkForMissingExecutable(
|
|
1262
|
+
executableFile,
|
|
1263
|
+
executableDir,
|
|
1264
|
+
subcommand._name,
|
|
1265
|
+
);
|
|
1266
|
+
args.unshift(executableFile);
|
|
1267
|
+
// add executable arguments to spawn
|
|
1268
|
+
args = incrementNodeInspectorPort(process.execArgv).concat(args);
|
|
1269
|
+
proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
if (!proc.killed) {
|
|
1273
|
+
// testing mainly to avoid leak warnings during unit tests with mocked spawn
|
|
1274
|
+
const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
|
|
1275
|
+
signals.forEach((signal) => {
|
|
1276
|
+
process.on(signal, () => {
|
|
1277
|
+
if (proc.killed === false && proc.exitCode === null) {
|
|
1278
|
+
// @ts-ignore because signals not typed to known strings
|
|
1279
|
+
proc.kill(signal);
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// By default terminate process when spawned process terminates.
|
|
1286
|
+
const exitCallback = this._exitCallback;
|
|
1287
|
+
proc.on('close', (code) => {
|
|
1288
|
+
code = code ?? 1; // code is null if spawned process terminated due to a signal
|
|
1289
|
+
if (!exitCallback) {
|
|
1290
|
+
process.exit(code);
|
|
1291
|
+
} else {
|
|
1292
|
+
exitCallback(
|
|
1293
|
+
new CommanderError(
|
|
1294
|
+
code,
|
|
1295
|
+
'commander.executeSubCommandAsync',
|
|
1296
|
+
'(close)',
|
|
1297
|
+
),
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
proc.on('error', (err) => {
|
|
1302
|
+
// @ts-ignore: because err.code is an unknown property
|
|
1303
|
+
if (err.code === 'ENOENT') {
|
|
1304
|
+
this._checkForMissingExecutable(
|
|
1305
|
+
executableFile,
|
|
1306
|
+
executableDir,
|
|
1307
|
+
subcommand._name,
|
|
1308
|
+
);
|
|
1309
|
+
// @ts-ignore: because err.code is an unknown property
|
|
1310
|
+
} else if (err.code === 'EACCES') {
|
|
1311
|
+
throw new Error(`'${executableFile}' not executable`);
|
|
1312
|
+
}
|
|
1313
|
+
if (!exitCallback) {
|
|
1314
|
+
process.exit(1);
|
|
1315
|
+
} else {
|
|
1316
|
+
const wrappedError = new CommanderError(
|
|
1317
|
+
1,
|
|
1318
|
+
'commander.executeSubCommandAsync',
|
|
1319
|
+
'(error)',
|
|
1320
|
+
);
|
|
1321
|
+
wrappedError.nestedError = err;
|
|
1322
|
+
exitCallback(wrappedError);
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
|
|
1326
|
+
// Store the reference to the child process
|
|
1327
|
+
this.runningCommand = proc;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* @private
|
|
1332
|
+
*/
|
|
1333
|
+
|
|
1334
|
+
_dispatchSubcommand(commandName, operands, unknown) {
|
|
1335
|
+
const subCommand = this._findCommand(commandName);
|
|
1336
|
+
if (!subCommand) this.help({ error: true });
|
|
1337
|
+
|
|
1338
|
+
subCommand._prepareForParse();
|
|
1339
|
+
let promiseChain;
|
|
1340
|
+
promiseChain = this._chainOrCallSubCommandHook(
|
|
1341
|
+
promiseChain,
|
|
1342
|
+
subCommand,
|
|
1343
|
+
'preSubcommand',
|
|
1344
|
+
);
|
|
1345
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
1346
|
+
if (subCommand._executableHandler) {
|
|
1347
|
+
this._executeSubCommand(subCommand, operands.concat(unknown));
|
|
1348
|
+
} else {
|
|
1349
|
+
return subCommand._parseCommand(operands, unknown);
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
return promiseChain;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Invoke help directly if possible, or dispatch if necessary.
|
|
1357
|
+
* e.g. help foo
|
|
1358
|
+
*
|
|
1359
|
+
* @private
|
|
1360
|
+
*/
|
|
1361
|
+
|
|
1362
|
+
_dispatchHelpCommand(subcommandName) {
|
|
1363
|
+
if (!subcommandName) {
|
|
1364
|
+
this.help();
|
|
1365
|
+
}
|
|
1366
|
+
const subCommand = this._findCommand(subcommandName);
|
|
1367
|
+
if (subCommand && !subCommand._executableHandler) {
|
|
1368
|
+
subCommand.help();
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// Fallback to parsing the help flag to invoke the help.
|
|
1372
|
+
return this._dispatchSubcommand(
|
|
1373
|
+
subcommandName,
|
|
1374
|
+
[],
|
|
1375
|
+
[this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Check this.args against expected this.registeredArguments.
|
|
1381
|
+
*
|
|
1382
|
+
* @private
|
|
1383
|
+
*/
|
|
1384
|
+
|
|
1385
|
+
_checkNumberOfArguments() {
|
|
1386
|
+
// too few
|
|
1387
|
+
this.registeredArguments.forEach((arg, i) => {
|
|
1388
|
+
if (arg.required && this.args[i] == null) {
|
|
1389
|
+
this.missingArgument(arg.name());
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
// too many
|
|
1393
|
+
if (
|
|
1394
|
+
this.registeredArguments.length > 0 &&
|
|
1395
|
+
this.registeredArguments[this.registeredArguments.length - 1].variadic
|
|
1396
|
+
) {
|
|
1397
|
+
return;
|
|
1398
|
+
}
|
|
1399
|
+
if (this.args.length > this.registeredArguments.length) {
|
|
1400
|
+
this._excessArguments(this.args);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* Process this.args using this.registeredArguments and save as this.processedArgs!
|
|
1406
|
+
*
|
|
1407
|
+
* @private
|
|
1408
|
+
*/
|
|
1409
|
+
|
|
1410
|
+
_processArguments() {
|
|
1411
|
+
const myParseArg = (argument, value, previous) => {
|
|
1412
|
+
// Extra processing for nice error message on parsing failure.
|
|
1413
|
+
let parsedValue = value;
|
|
1414
|
+
if (value !== null && argument.parseArg) {
|
|
1415
|
+
const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
|
|
1416
|
+
parsedValue = this._callParseArg(
|
|
1417
|
+
argument,
|
|
1418
|
+
value,
|
|
1419
|
+
previous,
|
|
1420
|
+
invalidValueMessage,
|
|
1421
|
+
);
|
|
1422
|
+
}
|
|
1423
|
+
return parsedValue;
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
this._checkNumberOfArguments();
|
|
1427
|
+
|
|
1428
|
+
const processedArgs = [];
|
|
1429
|
+
this.registeredArguments.forEach((declaredArg, index) => {
|
|
1430
|
+
let value = declaredArg.defaultValue;
|
|
1431
|
+
if (declaredArg.variadic) {
|
|
1432
|
+
// Collect together remaining arguments for passing together as an array.
|
|
1433
|
+
if (index < this.args.length) {
|
|
1434
|
+
value = this.args.slice(index);
|
|
1435
|
+
if (declaredArg.parseArg) {
|
|
1436
|
+
value = value.reduce((processed, v) => {
|
|
1437
|
+
return myParseArg(declaredArg, v, processed);
|
|
1438
|
+
}, declaredArg.defaultValue);
|
|
1439
|
+
}
|
|
1440
|
+
} else if (value === undefined) {
|
|
1441
|
+
value = [];
|
|
1442
|
+
}
|
|
1443
|
+
} else if (index < this.args.length) {
|
|
1444
|
+
value = this.args[index];
|
|
1445
|
+
if (declaredArg.parseArg) {
|
|
1446
|
+
value = myParseArg(declaredArg, value, declaredArg.defaultValue);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
processedArgs[index] = value;
|
|
1450
|
+
});
|
|
1451
|
+
this.processedArgs = processedArgs;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* Once we have a promise we chain, but call synchronously until then.
|
|
1456
|
+
*
|
|
1457
|
+
* @param {(Promise|undefined)} promise
|
|
1458
|
+
* @param {Function} fn
|
|
1459
|
+
* @return {(Promise|undefined)}
|
|
1460
|
+
* @private
|
|
1461
|
+
*/
|
|
1462
|
+
|
|
1463
|
+
_chainOrCall(promise, fn) {
|
|
1464
|
+
// thenable
|
|
1465
|
+
if (promise && promise.then && typeof promise.then === 'function') {
|
|
1466
|
+
// already have a promise, chain callback
|
|
1467
|
+
return promise.then(() => fn());
|
|
1468
|
+
}
|
|
1469
|
+
// callback might return a promise
|
|
1470
|
+
return fn();
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
*
|
|
1475
|
+
* @param {(Promise|undefined)} promise
|
|
1476
|
+
* @param {string} event
|
|
1477
|
+
* @return {(Promise|undefined)}
|
|
1478
|
+
* @private
|
|
1479
|
+
*/
|
|
1480
|
+
|
|
1481
|
+
_chainOrCallHooks(promise, event) {
|
|
1482
|
+
let result = promise;
|
|
1483
|
+
const hooks = [];
|
|
1484
|
+
this._getCommandAndAncestors()
|
|
1485
|
+
.reverse()
|
|
1486
|
+
.filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)
|
|
1487
|
+
.forEach((hookedCommand) => {
|
|
1488
|
+
hookedCommand._lifeCycleHooks[event].forEach((callback) => {
|
|
1489
|
+
hooks.push({ hookedCommand, callback });
|
|
1490
|
+
});
|
|
1491
|
+
});
|
|
1492
|
+
if (event === 'postAction') {
|
|
1493
|
+
hooks.reverse();
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
hooks.forEach((hookDetail) => {
|
|
1497
|
+
result = this._chainOrCall(result, () => {
|
|
1498
|
+
return hookDetail.callback(hookDetail.hookedCommand, this);
|
|
1499
|
+
});
|
|
1500
|
+
});
|
|
1501
|
+
return result;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
*
|
|
1506
|
+
* @param {(Promise|undefined)} promise
|
|
1507
|
+
* @param {Command} subCommand
|
|
1508
|
+
* @param {string} event
|
|
1509
|
+
* @return {(Promise|undefined)}
|
|
1510
|
+
* @private
|
|
1511
|
+
*/
|
|
1512
|
+
|
|
1513
|
+
_chainOrCallSubCommandHook(promise, subCommand, event) {
|
|
1514
|
+
let result = promise;
|
|
1515
|
+
if (this._lifeCycleHooks[event] !== undefined) {
|
|
1516
|
+
this._lifeCycleHooks[event].forEach((hook) => {
|
|
1517
|
+
result = this._chainOrCall(result, () => {
|
|
1518
|
+
return hook(this, subCommand);
|
|
1519
|
+
});
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
return result;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Process arguments in context of this command.
|
|
1527
|
+
* Returns action result, in case it is a promise.
|
|
1528
|
+
*
|
|
1529
|
+
* @private
|
|
1530
|
+
*/
|
|
1531
|
+
|
|
1532
|
+
_parseCommand(operands, unknown) {
|
|
1533
|
+
const parsed = this.parseOptions(unknown);
|
|
1534
|
+
this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env
|
|
1535
|
+
this._parseOptionsImplied();
|
|
1536
|
+
operands = operands.concat(parsed.operands);
|
|
1537
|
+
unknown = parsed.unknown;
|
|
1538
|
+
this.args = operands.concat(unknown);
|
|
1539
|
+
|
|
1540
|
+
if (operands && this._findCommand(operands[0])) {
|
|
1541
|
+
return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
|
|
1542
|
+
}
|
|
1543
|
+
if (
|
|
1544
|
+
this._getHelpCommand() &&
|
|
1545
|
+
operands[0] === this._getHelpCommand().name()
|
|
1546
|
+
) {
|
|
1547
|
+
return this._dispatchHelpCommand(operands[1]);
|
|
1548
|
+
}
|
|
1549
|
+
if (this._defaultCommandName) {
|
|
1550
|
+
this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command
|
|
1551
|
+
return this._dispatchSubcommand(
|
|
1552
|
+
this._defaultCommandName,
|
|
1553
|
+
operands,
|
|
1554
|
+
unknown,
|
|
1555
|
+
);
|
|
1556
|
+
}
|
|
1557
|
+
if (
|
|
1558
|
+
this.commands.length &&
|
|
1559
|
+
this.args.length === 0 &&
|
|
1560
|
+
!this._actionHandler &&
|
|
1561
|
+
!this._defaultCommandName
|
|
1562
|
+
) {
|
|
1563
|
+
// probably missing subcommand and no handler, user needs help (and exit)
|
|
1564
|
+
this.help({ error: true });
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
this._outputHelpIfRequested(parsed.unknown);
|
|
1568
|
+
this._checkForMissingMandatoryOptions();
|
|
1569
|
+
this._checkForConflictingOptions();
|
|
1570
|
+
|
|
1571
|
+
// We do not always call this check to avoid masking a "better" error, like unknown command.
|
|
1572
|
+
const checkForUnknownOptions = () => {
|
|
1573
|
+
if (parsed.unknown.length > 0) {
|
|
1574
|
+
this.unknownOption(parsed.unknown[0]);
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
const commandEvent = `command:${this.name()}`;
|
|
1579
|
+
if (this._actionHandler) {
|
|
1580
|
+
checkForUnknownOptions();
|
|
1581
|
+
this._processArguments();
|
|
1582
|
+
|
|
1583
|
+
let promiseChain;
|
|
1584
|
+
promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');
|
|
1585
|
+
promiseChain = this._chainOrCall(promiseChain, () =>
|
|
1586
|
+
this._actionHandler(this.processedArgs),
|
|
1587
|
+
);
|
|
1588
|
+
if (this.parent) {
|
|
1589
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
1590
|
+
this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');
|
|
1594
|
+
return promiseChain;
|
|
1595
|
+
}
|
|
1596
|
+
if (this.parent && this.parent.listenerCount(commandEvent)) {
|
|
1597
|
+
checkForUnknownOptions();
|
|
1598
|
+
this._processArguments();
|
|
1599
|
+
this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
1600
|
+
} else if (operands.length) {
|
|
1601
|
+
if (this._findCommand('*')) {
|
|
1602
|
+
// legacy default command
|
|
1603
|
+
return this._dispatchSubcommand('*', operands, unknown);
|
|
1604
|
+
}
|
|
1605
|
+
if (this.listenerCount('command:*')) {
|
|
1606
|
+
// skip option check, emit event for possible misspelling suggestion
|
|
1607
|
+
this.emit('command:*', operands, unknown);
|
|
1608
|
+
} else if (this.commands.length) {
|
|
1609
|
+
this.unknownCommand();
|
|
1610
|
+
} else {
|
|
1611
|
+
checkForUnknownOptions();
|
|
1612
|
+
this._processArguments();
|
|
1613
|
+
}
|
|
1614
|
+
} else if (this.commands.length) {
|
|
1615
|
+
checkForUnknownOptions();
|
|
1616
|
+
// This command has subcommands and nothing hooked up at this level, so display help (and exit).
|
|
1617
|
+
this.help({ error: true });
|
|
1618
|
+
} else {
|
|
1619
|
+
checkForUnknownOptions();
|
|
1620
|
+
this._processArguments();
|
|
1621
|
+
// fall through for caller to handle after calling .parse()
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* Find matching command.
|
|
1627
|
+
*
|
|
1628
|
+
* @private
|
|
1629
|
+
* @return {Command | undefined}
|
|
1630
|
+
*/
|
|
1631
|
+
_findCommand(name) {
|
|
1632
|
+
if (!name) return undefined;
|
|
1633
|
+
return this.commands.find(
|
|
1634
|
+
(cmd) => cmd._name === name || cmd._aliases.includes(name),
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Return an option matching `arg` if any.
|
|
1640
|
+
*
|
|
1641
|
+
* @param {string} arg
|
|
1642
|
+
* @return {Option}
|
|
1643
|
+
* @package
|
|
1644
|
+
*/
|
|
1645
|
+
|
|
1646
|
+
_findOption(arg) {
|
|
1647
|
+
return this.options.find((option) => option.is(arg));
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* Display an error message if a mandatory option does not have a value.
|
|
1652
|
+
* Called after checking for help flags in leaf subcommand.
|
|
1653
|
+
*
|
|
1654
|
+
* @private
|
|
1655
|
+
*/
|
|
1656
|
+
|
|
1657
|
+
_checkForMissingMandatoryOptions() {
|
|
1658
|
+
// Walk up hierarchy so can call in subcommand after checking for displaying help.
|
|
1659
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
1660
|
+
cmd.options.forEach((anOption) => {
|
|
1661
|
+
if (
|
|
1662
|
+
anOption.mandatory &&
|
|
1663
|
+
cmd.getOptionValue(anOption.attributeName()) === undefined
|
|
1664
|
+
) {
|
|
1665
|
+
cmd.missingMandatoryOptionValue(anOption);
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Display an error message if conflicting options are used together in this.
|
|
1673
|
+
*
|
|
1674
|
+
* @private
|
|
1675
|
+
*/
|
|
1676
|
+
_checkForConflictingLocalOptions() {
|
|
1677
|
+
const definedNonDefaultOptions = this.options.filter((option) => {
|
|
1678
|
+
const optionKey = option.attributeName();
|
|
1679
|
+
if (this.getOptionValue(optionKey) === undefined) {
|
|
1680
|
+
return false;
|
|
1681
|
+
}
|
|
1682
|
+
return this.getOptionValueSource(optionKey) !== 'default';
|
|
1683
|
+
});
|
|
1684
|
+
|
|
1685
|
+
const optionsWithConflicting = definedNonDefaultOptions.filter(
|
|
1686
|
+
(option) => option.conflictsWith.length > 0,
|
|
1687
|
+
);
|
|
1688
|
+
|
|
1689
|
+
optionsWithConflicting.forEach((option) => {
|
|
1690
|
+
const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>
|
|
1691
|
+
option.conflictsWith.includes(defined.attributeName()),
|
|
1692
|
+
);
|
|
1693
|
+
if (conflictingAndDefined) {
|
|
1694
|
+
this._conflictingOption(option, conflictingAndDefined);
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Display an error message if conflicting options are used together.
|
|
1701
|
+
* Called after checking for help flags in leaf subcommand.
|
|
1702
|
+
*
|
|
1703
|
+
* @private
|
|
1704
|
+
*/
|
|
1705
|
+
_checkForConflictingOptions() {
|
|
1706
|
+
// Walk up hierarchy so can call in subcommand after checking for displaying help.
|
|
1707
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
1708
|
+
cmd._checkForConflictingLocalOptions();
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Parse options from `argv` removing known options,
|
|
1714
|
+
* and return argv split into operands and unknown arguments.
|
|
1715
|
+
*
|
|
1716
|
+
* Side effects: modifies command by storing options. Does not reset state if called again.
|
|
1717
|
+
*
|
|
1718
|
+
* Examples:
|
|
1719
|
+
*
|
|
1720
|
+
* argv => operands, unknown
|
|
1721
|
+
* --known kkk op => [op], []
|
|
1722
|
+
* op --known kkk => [op], []
|
|
1723
|
+
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
1724
|
+
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
1725
|
+
*
|
|
1726
|
+
* @param {string[]} argv
|
|
1727
|
+
* @return {{operands: string[], unknown: string[]}}
|
|
1728
|
+
*/
|
|
1729
|
+
|
|
1730
|
+
parseOptions(argv) {
|
|
1731
|
+
const operands = []; // operands, not options or values
|
|
1732
|
+
const unknown = []; // first unknown option and remaining unknown args
|
|
1733
|
+
let dest = operands;
|
|
1734
|
+
const args = argv.slice();
|
|
1735
|
+
|
|
1736
|
+
function maybeOption(arg) {
|
|
1737
|
+
return arg.length > 1 && arg[0] === '-';
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
// parse options
|
|
1741
|
+
let activeVariadicOption = null;
|
|
1742
|
+
while (args.length) {
|
|
1743
|
+
const arg = args.shift();
|
|
1744
|
+
|
|
1745
|
+
// literal
|
|
1746
|
+
if (arg === '--') {
|
|
1747
|
+
if (dest === unknown) dest.push(arg);
|
|
1748
|
+
dest.push(...args);
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
if (activeVariadicOption && !maybeOption(arg)) {
|
|
1753
|
+
this.emit(`option:${activeVariadicOption.name()}`, arg);
|
|
1754
|
+
continue;
|
|
1755
|
+
}
|
|
1756
|
+
activeVariadicOption = null;
|
|
1757
|
+
|
|
1758
|
+
if (maybeOption(arg)) {
|
|
1759
|
+
const option = this._findOption(arg);
|
|
1760
|
+
// recognised option, call listener to assign value with possible custom processing
|
|
1761
|
+
if (option) {
|
|
1762
|
+
if (option.required) {
|
|
1763
|
+
const value = args.shift();
|
|
1764
|
+
if (value === undefined) this.optionMissingArgument(option);
|
|
1765
|
+
this.emit(`option:${option.name()}`, value);
|
|
1766
|
+
} else if (option.optional) {
|
|
1767
|
+
let value = null;
|
|
1768
|
+
// historical behaviour is optional value is following arg unless an option
|
|
1769
|
+
if (args.length > 0 && !maybeOption(args[0])) {
|
|
1770
|
+
value = args.shift();
|
|
1771
|
+
}
|
|
1772
|
+
this.emit(`option:${option.name()}`, value);
|
|
1773
|
+
} else {
|
|
1774
|
+
// boolean flag
|
|
1775
|
+
this.emit(`option:${option.name()}`);
|
|
1776
|
+
}
|
|
1777
|
+
activeVariadicOption = option.variadic ? option : null;
|
|
1778
|
+
continue;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
// Look for combo options following single dash, eat first one if known.
|
|
1783
|
+
if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {
|
|
1784
|
+
const option = this._findOption(`-${arg[1]}`);
|
|
1785
|
+
if (option) {
|
|
1786
|
+
if (
|
|
1787
|
+
option.required ||
|
|
1788
|
+
(option.optional && this._combineFlagAndOptionalValue)
|
|
1789
|
+
) {
|
|
1790
|
+
// option with value following in same argument
|
|
1791
|
+
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
1792
|
+
} else {
|
|
1793
|
+
// boolean option, emit and put back remainder of arg for further processing
|
|
1794
|
+
this.emit(`option:${option.name()}`);
|
|
1795
|
+
args.unshift(`-${arg.slice(2)}`);
|
|
1796
|
+
}
|
|
1797
|
+
continue;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
// Look for known long flag with value, like --foo=bar
|
|
1802
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
1803
|
+
const index = arg.indexOf('=');
|
|
1804
|
+
const option = this._findOption(arg.slice(0, index));
|
|
1805
|
+
if (option && (option.required || option.optional)) {
|
|
1806
|
+
this.emit(`option:${option.name()}`, arg.slice(index + 1));
|
|
1807
|
+
continue;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
// Not a recognised option by this command.
|
|
1812
|
+
// Might be a command-argument, or subcommand option, or unknown option, or help command or option.
|
|
1813
|
+
|
|
1814
|
+
// An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
|
|
1815
|
+
if (maybeOption(arg)) {
|
|
1816
|
+
dest = unknown;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
// If using positionalOptions, stop processing our options at subcommand.
|
|
1820
|
+
if (
|
|
1821
|
+
(this._enablePositionalOptions || this._passThroughOptions) &&
|
|
1822
|
+
operands.length === 0 &&
|
|
1823
|
+
unknown.length === 0
|
|
1824
|
+
) {
|
|
1825
|
+
if (this._findCommand(arg)) {
|
|
1826
|
+
operands.push(arg);
|
|
1827
|
+
if (args.length > 0) unknown.push(...args);
|
|
1828
|
+
break;
|
|
1829
|
+
} else if (
|
|
1830
|
+
this._getHelpCommand() &&
|
|
1831
|
+
arg === this._getHelpCommand().name()
|
|
1832
|
+
) {
|
|
1833
|
+
operands.push(arg);
|
|
1834
|
+
if (args.length > 0) operands.push(...args);
|
|
1835
|
+
break;
|
|
1836
|
+
} else if (this._defaultCommandName) {
|
|
1837
|
+
unknown.push(arg);
|
|
1838
|
+
if (args.length > 0) unknown.push(...args);
|
|
1839
|
+
break;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// If using passThroughOptions, stop processing options at first command-argument.
|
|
1844
|
+
if (this._passThroughOptions) {
|
|
1845
|
+
dest.push(arg);
|
|
1846
|
+
if (args.length > 0) dest.push(...args);
|
|
1847
|
+
break;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
// add arg
|
|
1851
|
+
dest.push(arg);
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
return { operands, unknown };
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* Return an object containing local option values as key-value pairs.
|
|
1859
|
+
*
|
|
1860
|
+
* @return {object}
|
|
1861
|
+
*/
|
|
1862
|
+
opts() {
|
|
1863
|
+
if (this._storeOptionsAsProperties) {
|
|
1864
|
+
// Preserve original behaviour so backwards compatible when still using properties
|
|
1865
|
+
const result = {};
|
|
1866
|
+
const len = this.options.length;
|
|
1867
|
+
|
|
1868
|
+
for (let i = 0; i < len; i++) {
|
|
1869
|
+
const key = this.options[i].attributeName();
|
|
1870
|
+
result[key] =
|
|
1871
|
+
key === this._versionOptionName ? this._version : this[key];
|
|
1872
|
+
}
|
|
1873
|
+
return result;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
return this._optionValues;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* Return an object containing merged local and global option values as key-value pairs.
|
|
1881
|
+
*
|
|
1882
|
+
* @return {object}
|
|
1883
|
+
*/
|
|
1884
|
+
optsWithGlobals() {
|
|
1885
|
+
// globals overwrite locals
|
|
1886
|
+
return this._getCommandAndAncestors().reduce(
|
|
1887
|
+
(combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),
|
|
1888
|
+
{},
|
|
1889
|
+
);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* Display error message and exit (or call exitOverride).
|
|
1894
|
+
*
|
|
1895
|
+
* @param {string} message
|
|
1896
|
+
* @param {object} [errorOptions]
|
|
1897
|
+
* @param {string} [errorOptions.code] - an id string representing the error
|
|
1898
|
+
* @param {number} [errorOptions.exitCode] - used with process.exit
|
|
1899
|
+
*/
|
|
1900
|
+
error(message, errorOptions) {
|
|
1901
|
+
// output handling
|
|
1902
|
+
this._outputConfiguration.outputError(
|
|
1903
|
+
`${message}\n`,
|
|
1904
|
+
this._outputConfiguration.writeErr,
|
|
1905
|
+
);
|
|
1906
|
+
if (typeof this._showHelpAfterError === 'string') {
|
|
1907
|
+
this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`);
|
|
1908
|
+
} else if (this._showHelpAfterError) {
|
|
1909
|
+
this._outputConfiguration.writeErr('\n');
|
|
1910
|
+
this.outputHelp({ error: true });
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
// exit handling
|
|
1914
|
+
const config = errorOptions || {};
|
|
1915
|
+
const exitCode = config.exitCode || 1;
|
|
1916
|
+
const code = config.code || 'commander.error';
|
|
1917
|
+
this._exit(exitCode, code, message);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* Apply any option related environment variables, if option does
|
|
1922
|
+
* not have a value from cli or client code.
|
|
1923
|
+
*
|
|
1924
|
+
* @private
|
|
1925
|
+
*/
|
|
1926
|
+
_parseOptionsEnv() {
|
|
1927
|
+
this.options.forEach((option) => {
|
|
1928
|
+
if (option.envVar && option.envVar in process.env) {
|
|
1929
|
+
const optionKey = option.attributeName();
|
|
1930
|
+
// Priority check. Do not overwrite cli or options from unknown source (client-code).
|
|
1931
|
+
if (
|
|
1932
|
+
this.getOptionValue(optionKey) === undefined ||
|
|
1933
|
+
['default', 'config', 'env'].includes(
|
|
1934
|
+
this.getOptionValueSource(optionKey),
|
|
1935
|
+
)
|
|
1936
|
+
) {
|
|
1937
|
+
if (option.required || option.optional) {
|
|
1938
|
+
// option can take a value
|
|
1939
|
+
// keep very simple, optional always takes value
|
|
1940
|
+
this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
|
|
1941
|
+
} else {
|
|
1942
|
+
// boolean
|
|
1943
|
+
// keep very simple, only care that envVar defined and not the value
|
|
1944
|
+
this.emit(`optionEnv:${option.name()}`);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* Apply any implied option values, if option is undefined or default value.
|
|
1953
|
+
*
|
|
1954
|
+
* @private
|
|
1955
|
+
*/
|
|
1956
|
+
_parseOptionsImplied() {
|
|
1957
|
+
const dualHelper = new DualOptions(this.options);
|
|
1958
|
+
const hasCustomOptionValue = (optionKey) => {
|
|
1959
|
+
return (
|
|
1960
|
+
this.getOptionValue(optionKey) !== undefined &&
|
|
1961
|
+
!['default', 'implied'].includes(this.getOptionValueSource(optionKey))
|
|
1962
|
+
);
|
|
1963
|
+
};
|
|
1964
|
+
this.options
|
|
1965
|
+
.filter(
|
|
1966
|
+
(option) =>
|
|
1967
|
+
option.implied !== undefined &&
|
|
1968
|
+
hasCustomOptionValue(option.attributeName()) &&
|
|
1969
|
+
dualHelper.valueFromOption(
|
|
1970
|
+
this.getOptionValue(option.attributeName()),
|
|
1971
|
+
option,
|
|
1972
|
+
),
|
|
1973
|
+
)
|
|
1974
|
+
.forEach((option) => {
|
|
1975
|
+
Object.keys(option.implied)
|
|
1976
|
+
.filter((impliedKey) => !hasCustomOptionValue(impliedKey))
|
|
1977
|
+
.forEach((impliedKey) => {
|
|
1978
|
+
this.setOptionValueWithSource(
|
|
1979
|
+
impliedKey,
|
|
1980
|
+
option.implied[impliedKey],
|
|
1981
|
+
'implied',
|
|
1982
|
+
);
|
|
1983
|
+
});
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Argument `name` is missing.
|
|
1989
|
+
*
|
|
1990
|
+
* @param {string} name
|
|
1991
|
+
* @private
|
|
1992
|
+
*/
|
|
1993
|
+
|
|
1994
|
+
missingArgument(name) {
|
|
1995
|
+
const message = `error: missing required argument '${name}'`;
|
|
1996
|
+
this.error(message, { code: 'commander.missingArgument' });
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* `Option` is missing an argument.
|
|
2001
|
+
*
|
|
2002
|
+
* @param {Option} option
|
|
2003
|
+
* @private
|
|
2004
|
+
*/
|
|
2005
|
+
|
|
2006
|
+
optionMissingArgument(option) {
|
|
2007
|
+
const message = `error: option '${option.flags}' argument missing`;
|
|
2008
|
+
this.error(message, { code: 'commander.optionMissingArgument' });
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* `Option` does not have a value, and is a mandatory option.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {Option} option
|
|
2015
|
+
* @private
|
|
2016
|
+
*/
|
|
2017
|
+
|
|
2018
|
+
missingMandatoryOptionValue(option) {
|
|
2019
|
+
const message = `error: required option '${option.flags}' not specified`;
|
|
2020
|
+
this.error(message, { code: 'commander.missingMandatoryOptionValue' });
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* `Option` conflicts with another option.
|
|
2025
|
+
*
|
|
2026
|
+
* @param {Option} option
|
|
2027
|
+
* @param {Option} conflictingOption
|
|
2028
|
+
* @private
|
|
2029
|
+
*/
|
|
2030
|
+
_conflictingOption(option, conflictingOption) {
|
|
2031
|
+
// The calling code does not know whether a negated option is the source of the
|
|
2032
|
+
// value, so do some work to take an educated guess.
|
|
2033
|
+
const findBestOptionFromValue = (option) => {
|
|
2034
|
+
const optionKey = option.attributeName();
|
|
2035
|
+
const optionValue = this.getOptionValue(optionKey);
|
|
2036
|
+
const negativeOption = this.options.find(
|
|
2037
|
+
(target) => target.negate && optionKey === target.attributeName(),
|
|
2038
|
+
);
|
|
2039
|
+
const positiveOption = this.options.find(
|
|
2040
|
+
(target) => !target.negate && optionKey === target.attributeName(),
|
|
2041
|
+
);
|
|
2042
|
+
if (
|
|
2043
|
+
negativeOption &&
|
|
2044
|
+
((negativeOption.presetArg === undefined && optionValue === false) ||
|
|
2045
|
+
(negativeOption.presetArg !== undefined &&
|
|
2046
|
+
optionValue === negativeOption.presetArg))
|
|
2047
|
+
) {
|
|
2048
|
+
return negativeOption;
|
|
2049
|
+
}
|
|
2050
|
+
return positiveOption || option;
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
const getErrorMessage = (option) => {
|
|
2054
|
+
const bestOption = findBestOptionFromValue(option);
|
|
2055
|
+
const optionKey = bestOption.attributeName();
|
|
2056
|
+
const source = this.getOptionValueSource(optionKey);
|
|
2057
|
+
if (source === 'env') {
|
|
2058
|
+
return `environment variable '${bestOption.envVar}'`;
|
|
2059
|
+
}
|
|
2060
|
+
return `option '${bestOption.flags}'`;
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
|
|
2064
|
+
this.error(message, { code: 'commander.conflictingOption' });
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Unknown option `flag`.
|
|
2069
|
+
*
|
|
2070
|
+
* @param {string} flag
|
|
2071
|
+
* @private
|
|
2072
|
+
*/
|
|
2073
|
+
|
|
2074
|
+
unknownOption(flag) {
|
|
2075
|
+
if (this._allowUnknownOption) return;
|
|
2076
|
+
let suggestion = '';
|
|
2077
|
+
|
|
2078
|
+
if (flag.startsWith('--') && this._showSuggestionAfterError) {
|
|
2079
|
+
// Looping to pick up the global options too
|
|
2080
|
+
let candidateFlags = [];
|
|
2081
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2082
|
+
let command = this;
|
|
2083
|
+
do {
|
|
2084
|
+
const moreFlags = command
|
|
2085
|
+
.createHelp()
|
|
2086
|
+
.visibleOptions(command)
|
|
2087
|
+
.filter((option) => option.long)
|
|
2088
|
+
.map((option) => option.long);
|
|
2089
|
+
candidateFlags = candidateFlags.concat(moreFlags);
|
|
2090
|
+
command = command.parent;
|
|
2091
|
+
} while (command && !command._enablePositionalOptions);
|
|
2092
|
+
suggestion = suggestSimilar(flag, candidateFlags);
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
const message = `error: unknown option '${flag}'${suggestion}`;
|
|
2096
|
+
this.error(message, { code: 'commander.unknownOption' });
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
/**
|
|
2100
|
+
* Excess arguments, more than expected.
|
|
2101
|
+
*
|
|
2102
|
+
* @param {string[]} receivedArgs
|
|
2103
|
+
* @private
|
|
2104
|
+
*/
|
|
2105
|
+
|
|
2106
|
+
_excessArguments(receivedArgs) {
|
|
2107
|
+
if (this._allowExcessArguments) return;
|
|
2108
|
+
|
|
2109
|
+
const expected = this.registeredArguments.length;
|
|
2110
|
+
const s = expected === 1 ? '' : 's';
|
|
2111
|
+
const forSubcommand = this.parent ? ` for '${this.name()}'` : '';
|
|
2112
|
+
const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
|
|
2113
|
+
this.error(message, { code: 'commander.excessArguments' });
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
/**
|
|
2117
|
+
* Unknown command.
|
|
2118
|
+
*
|
|
2119
|
+
* @private
|
|
2120
|
+
*/
|
|
2121
|
+
|
|
2122
|
+
unknownCommand() {
|
|
2123
|
+
const unknownName = this.args[0];
|
|
2124
|
+
let suggestion = '';
|
|
2125
|
+
|
|
2126
|
+
if (this._showSuggestionAfterError) {
|
|
2127
|
+
const candidateNames = [];
|
|
2128
|
+
this.createHelp()
|
|
2129
|
+
.visibleCommands(this)
|
|
2130
|
+
.forEach((command) => {
|
|
2131
|
+
candidateNames.push(command.name());
|
|
2132
|
+
// just visible alias
|
|
2133
|
+
if (command.alias()) candidateNames.push(command.alias());
|
|
2134
|
+
});
|
|
2135
|
+
suggestion = suggestSimilar(unknownName, candidateNames);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
const message = `error: unknown command '${unknownName}'${suggestion}`;
|
|
2139
|
+
this.error(message, { code: 'commander.unknownCommand' });
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* Get or set the program version.
|
|
2144
|
+
*
|
|
2145
|
+
* This method auto-registers the "-V, --version" option which will print the version number.
|
|
2146
|
+
*
|
|
2147
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
2148
|
+
*
|
|
2149
|
+
* @param {string} [str]
|
|
2150
|
+
* @param {string} [flags]
|
|
2151
|
+
* @param {string} [description]
|
|
2152
|
+
* @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
|
|
2153
|
+
*/
|
|
2154
|
+
|
|
2155
|
+
version(str, flags, description) {
|
|
2156
|
+
if (str === undefined) return this._version;
|
|
2157
|
+
this._version = str;
|
|
2158
|
+
flags = flags || '-V, --version';
|
|
2159
|
+
description = description || 'output the version number';
|
|
2160
|
+
const versionOption = this.createOption(flags, description);
|
|
2161
|
+
this._versionOptionName = versionOption.attributeName();
|
|
2162
|
+
this._registerOption(versionOption);
|
|
2163
|
+
|
|
2164
|
+
this.on('option:' + versionOption.name(), () => {
|
|
2165
|
+
this._outputConfiguration.writeOut(`${str}\n`);
|
|
2166
|
+
this._exit(0, 'commander.version', str);
|
|
2167
|
+
});
|
|
2168
|
+
return this;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* Set the description.
|
|
2173
|
+
*
|
|
2174
|
+
* @param {string} [str]
|
|
2175
|
+
* @param {object} [argsDescription]
|
|
2176
|
+
* @return {(string|Command)}
|
|
2177
|
+
*/
|
|
2178
|
+
description(str, argsDescription) {
|
|
2179
|
+
if (str === undefined && argsDescription === undefined)
|
|
2180
|
+
return this._description;
|
|
2181
|
+
this._description = str;
|
|
2182
|
+
if (argsDescription) {
|
|
2183
|
+
this._argsDescription = argsDescription;
|
|
2184
|
+
}
|
|
2185
|
+
return this;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* Set the summary. Used when listed as subcommand of parent.
|
|
2190
|
+
*
|
|
2191
|
+
* @param {string} [str]
|
|
2192
|
+
* @return {(string|Command)}
|
|
2193
|
+
*/
|
|
2194
|
+
summary(str) {
|
|
2195
|
+
if (str === undefined) return this._summary;
|
|
2196
|
+
this._summary = str;
|
|
2197
|
+
return this;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
/**
|
|
2201
|
+
* Set an alias for the command.
|
|
2202
|
+
*
|
|
2203
|
+
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
|
2204
|
+
*
|
|
2205
|
+
* @param {string} [alias]
|
|
2206
|
+
* @return {(string|Command)}
|
|
2207
|
+
*/
|
|
2208
|
+
|
|
2209
|
+
alias(alias) {
|
|
2210
|
+
if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility
|
|
2211
|
+
|
|
2212
|
+
/** @type {Command} */
|
|
2213
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2214
|
+
let command = this;
|
|
2215
|
+
if (
|
|
2216
|
+
this.commands.length !== 0 &&
|
|
2217
|
+
this.commands[this.commands.length - 1]._executableHandler
|
|
2218
|
+
) {
|
|
2219
|
+
// assume adding alias for last added executable subcommand, rather than this
|
|
2220
|
+
command = this.commands[this.commands.length - 1];
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
if (alias === command._name)
|
|
2224
|
+
throw new Error("Command alias can't be the same as its name");
|
|
2225
|
+
const matchingCommand = this.parent?._findCommand(alias);
|
|
2226
|
+
if (matchingCommand) {
|
|
2227
|
+
// c.f. _registerCommand
|
|
2228
|
+
const existingCmd = [matchingCommand.name()]
|
|
2229
|
+
.concat(matchingCommand.aliases())
|
|
2230
|
+
.join('|');
|
|
2231
|
+
throw new Error(
|
|
2232
|
+
`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,
|
|
2233
|
+
);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
command._aliases.push(alias);
|
|
2237
|
+
return this;
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
/**
|
|
2241
|
+
* Set aliases for the command.
|
|
2242
|
+
*
|
|
2243
|
+
* Only the first alias is shown in the auto-generated help.
|
|
2244
|
+
*
|
|
2245
|
+
* @param {string[]} [aliases]
|
|
2246
|
+
* @return {(string[]|Command)}
|
|
2247
|
+
*/
|
|
2248
|
+
|
|
2249
|
+
aliases(aliases) {
|
|
2250
|
+
// Getter for the array of aliases is the main reason for having aliases() in addition to alias().
|
|
2251
|
+
if (aliases === undefined) return this._aliases;
|
|
2252
|
+
|
|
2253
|
+
aliases.forEach((alias) => this.alias(alias));
|
|
2254
|
+
return this;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* Set / get the command usage `str`.
|
|
2259
|
+
*
|
|
2260
|
+
* @param {string} [str]
|
|
2261
|
+
* @return {(string|Command)}
|
|
2262
|
+
*/
|
|
2263
|
+
|
|
2264
|
+
usage(str) {
|
|
2265
|
+
if (str === undefined) {
|
|
2266
|
+
if (this._usage) return this._usage;
|
|
2267
|
+
|
|
2268
|
+
const args = this.registeredArguments.map((arg) => {
|
|
2269
|
+
return humanReadableArgName(arg);
|
|
2270
|
+
});
|
|
2271
|
+
return []
|
|
2272
|
+
.concat(
|
|
2273
|
+
this.options.length || this._helpOption !== null ? '[options]' : [],
|
|
2274
|
+
this.commands.length ? '[command]' : [],
|
|
2275
|
+
this.registeredArguments.length ? args : [],
|
|
2276
|
+
)
|
|
2277
|
+
.join(' ');
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
this._usage = str;
|
|
2281
|
+
return this;
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* Get or set the name of the command.
|
|
2286
|
+
*
|
|
2287
|
+
* @param {string} [str]
|
|
2288
|
+
* @return {(string|Command)}
|
|
2289
|
+
*/
|
|
2290
|
+
|
|
2291
|
+
name(str) {
|
|
2292
|
+
if (str === undefined) return this._name;
|
|
2293
|
+
this._name = str;
|
|
2294
|
+
return this;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* Set the name of the command from script filename, such as process.argv[1],
|
|
2299
|
+
* or require.main.filename, or __filename.
|
|
2300
|
+
*
|
|
2301
|
+
* (Used internally and public although not documented in README.)
|
|
2302
|
+
*
|
|
2303
|
+
* @example
|
|
2304
|
+
* program.nameFromFilename(require.main.filename);
|
|
2305
|
+
*
|
|
2306
|
+
* @param {string} filename
|
|
2307
|
+
* @return {Command}
|
|
2308
|
+
*/
|
|
2309
|
+
|
|
2310
|
+
nameFromFilename(filename) {
|
|
2311
|
+
this._name = path.basename(filename, path.extname(filename));
|
|
2312
|
+
|
|
2313
|
+
return this;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* Get or set the directory for searching for executable subcommands of this command.
|
|
2318
|
+
*
|
|
2319
|
+
* @example
|
|
2320
|
+
* program.executableDir(__dirname);
|
|
2321
|
+
* // or
|
|
2322
|
+
* program.executableDir('subcommands');
|
|
2323
|
+
*
|
|
2324
|
+
* @param {string} [path]
|
|
2325
|
+
* @return {(string|null|Command)}
|
|
2326
|
+
*/
|
|
2327
|
+
|
|
2328
|
+
executableDir(path) {
|
|
2329
|
+
if (path === undefined) return this._executableDir;
|
|
2330
|
+
this._executableDir = path;
|
|
2331
|
+
return this;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
/**
|
|
2335
|
+
* Return program help documentation.
|
|
2336
|
+
*
|
|
2337
|
+
* @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
|
|
2338
|
+
* @return {string}
|
|
2339
|
+
*/
|
|
2340
|
+
|
|
2341
|
+
helpInformation(contextOptions) {
|
|
2342
|
+
const helper = this.createHelp();
|
|
2343
|
+
const context = this._getOutputContext(contextOptions);
|
|
2344
|
+
helper.prepareContext({
|
|
2345
|
+
error: context.error,
|
|
2346
|
+
helpWidth: context.helpWidth,
|
|
2347
|
+
outputHasColors: context.hasColors,
|
|
2348
|
+
});
|
|
2349
|
+
const text = helper.formatHelp(this, helper);
|
|
2350
|
+
if (context.hasColors) return text;
|
|
2351
|
+
return this._outputConfiguration.stripColor(text);
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* @typedef HelpContext
|
|
2356
|
+
* @type {object}
|
|
2357
|
+
* @property {boolean} error
|
|
2358
|
+
* @property {number} helpWidth
|
|
2359
|
+
* @property {boolean} hasColors
|
|
2360
|
+
* @property {function} write - includes stripColor if needed
|
|
2361
|
+
*
|
|
2362
|
+
* @returns {HelpContext}
|
|
2363
|
+
* @private
|
|
2364
|
+
*/
|
|
2365
|
+
|
|
2366
|
+
_getOutputContext(contextOptions) {
|
|
2367
|
+
contextOptions = contextOptions || {};
|
|
2368
|
+
const error = !!contextOptions.error;
|
|
2369
|
+
let baseWrite;
|
|
2370
|
+
let hasColors;
|
|
2371
|
+
let helpWidth;
|
|
2372
|
+
if (error) {
|
|
2373
|
+
baseWrite = (str) => this._outputConfiguration.writeErr(str);
|
|
2374
|
+
hasColors = this._outputConfiguration.getErrHasColors();
|
|
2375
|
+
helpWidth = this._outputConfiguration.getErrHelpWidth();
|
|
2376
|
+
} else {
|
|
2377
|
+
baseWrite = (str) => this._outputConfiguration.writeOut(str);
|
|
2378
|
+
hasColors = this._outputConfiguration.getOutHasColors();
|
|
2379
|
+
helpWidth = this._outputConfiguration.getOutHelpWidth();
|
|
2380
|
+
}
|
|
2381
|
+
const write = (str) => {
|
|
2382
|
+
if (!hasColors) str = this._outputConfiguration.stripColor(str);
|
|
2383
|
+
return baseWrite(str);
|
|
2384
|
+
};
|
|
2385
|
+
return { error, write, hasColors, helpWidth };
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* Output help information for this command.
|
|
2390
|
+
*
|
|
2391
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
2392
|
+
*
|
|
2393
|
+
* @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
|
|
2394
|
+
*/
|
|
2395
|
+
|
|
2396
|
+
outputHelp(contextOptions) {
|
|
2397
|
+
let deprecatedCallback;
|
|
2398
|
+
if (typeof contextOptions === 'function') {
|
|
2399
|
+
deprecatedCallback = contextOptions;
|
|
2400
|
+
contextOptions = undefined;
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
const outputContext = this._getOutputContext(contextOptions);
|
|
2404
|
+
/** @type {HelpTextEventContext} */
|
|
2405
|
+
const eventContext = {
|
|
2406
|
+
error: outputContext.error,
|
|
2407
|
+
write: outputContext.write,
|
|
2408
|
+
command: this,
|
|
2409
|
+
};
|
|
2410
|
+
|
|
2411
|
+
this._getCommandAndAncestors()
|
|
2412
|
+
.reverse()
|
|
2413
|
+
.forEach((command) => command.emit('beforeAllHelp', eventContext));
|
|
2414
|
+
this.emit('beforeHelp', eventContext);
|
|
2415
|
+
|
|
2416
|
+
let helpInformation = this.helpInformation({ error: outputContext.error });
|
|
2417
|
+
if (deprecatedCallback) {
|
|
2418
|
+
helpInformation = deprecatedCallback(helpInformation);
|
|
2419
|
+
if (
|
|
2420
|
+
typeof helpInformation !== 'string' &&
|
|
2421
|
+
!Buffer.isBuffer(helpInformation)
|
|
2422
|
+
) {
|
|
2423
|
+
throw new Error('outputHelp callback must return a string or a Buffer');
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
outputContext.write(helpInformation);
|
|
2427
|
+
|
|
2428
|
+
if (this._getHelpOption()?.long) {
|
|
2429
|
+
this.emit(this._getHelpOption().long); // deprecated
|
|
2430
|
+
}
|
|
2431
|
+
this.emit('afterHelp', eventContext);
|
|
2432
|
+
this._getCommandAndAncestors().forEach((command) =>
|
|
2433
|
+
command.emit('afterAllHelp', eventContext),
|
|
2434
|
+
);
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
/**
|
|
2438
|
+
* You can pass in flags and a description to customise the built-in help option.
|
|
2439
|
+
* Pass in false to disable the built-in help option.
|
|
2440
|
+
*
|
|
2441
|
+
* @example
|
|
2442
|
+
* program.helpOption('-?, --help' 'show help'); // customise
|
|
2443
|
+
* program.helpOption(false); // disable
|
|
2444
|
+
*
|
|
2445
|
+
* @param {(string | boolean)} flags
|
|
2446
|
+
* @param {string} [description]
|
|
2447
|
+
* @return {Command} `this` command for chaining
|
|
2448
|
+
*/
|
|
2449
|
+
|
|
2450
|
+
helpOption(flags, description) {
|
|
2451
|
+
// Support disabling built-in help option.
|
|
2452
|
+
if (typeof flags === 'boolean') {
|
|
2453
|
+
// true is not an expected value. Do something sensible but no unit-test.
|
|
2454
|
+
// istanbul ignore if
|
|
2455
|
+
if (flags) {
|
|
2456
|
+
this._helpOption = this._helpOption ?? undefined; // preserve existing option
|
|
2457
|
+
} else {
|
|
2458
|
+
this._helpOption = null; // disable
|
|
2459
|
+
}
|
|
2460
|
+
return this;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
// Customise flags and description.
|
|
2464
|
+
flags = flags ?? '-h, --help';
|
|
2465
|
+
description = description ?? 'display help for command';
|
|
2466
|
+
this._helpOption = this.createOption(flags, description);
|
|
2467
|
+
|
|
2468
|
+
return this;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2472
|
+
* Lazy create help option.
|
|
2473
|
+
* Returns null if has been disabled with .helpOption(false).
|
|
2474
|
+
*
|
|
2475
|
+
* @returns {(Option | null)} the help option
|
|
2476
|
+
* @package
|
|
2477
|
+
*/
|
|
2478
|
+
_getHelpOption() {
|
|
2479
|
+
// Lazy create help option on demand.
|
|
2480
|
+
if (this._helpOption === undefined) {
|
|
2481
|
+
this.helpOption(undefined, undefined);
|
|
2482
|
+
}
|
|
2483
|
+
return this._helpOption;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* Supply your own option to use for the built-in help option.
|
|
2488
|
+
* This is an alternative to using helpOption() to customise the flags and description etc.
|
|
2489
|
+
*
|
|
2490
|
+
* @param {Option} option
|
|
2491
|
+
* @return {Command} `this` command for chaining
|
|
2492
|
+
*/
|
|
2493
|
+
addHelpOption(option) {
|
|
2494
|
+
this._helpOption = option;
|
|
2495
|
+
return this;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* Output help information and exit.
|
|
2500
|
+
*
|
|
2501
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
2502
|
+
*
|
|
2503
|
+
* @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
|
|
2504
|
+
*/
|
|
2505
|
+
|
|
2506
|
+
help(contextOptions) {
|
|
2507
|
+
this.outputHelp(contextOptions);
|
|
2508
|
+
let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number
|
|
2509
|
+
if (
|
|
2510
|
+
exitCode === 0 &&
|
|
2511
|
+
contextOptions &&
|
|
2512
|
+
typeof contextOptions !== 'function' &&
|
|
2513
|
+
contextOptions.error
|
|
2514
|
+
) {
|
|
2515
|
+
exitCode = 1;
|
|
2516
|
+
}
|
|
2517
|
+
// message: do not have all displayed text available so only passing placeholder.
|
|
2518
|
+
this._exit(exitCode, 'commander.help', '(outputHelp)');
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* // Do a little typing to coordinate emit and listener for the help text events.
|
|
2523
|
+
* @typedef HelpTextEventContext
|
|
2524
|
+
* @type {object}
|
|
2525
|
+
* @property {boolean} error
|
|
2526
|
+
* @property {Command} command
|
|
2527
|
+
* @property {function} write
|
|
2528
|
+
*/
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* Add additional text to be displayed with the built-in help.
|
|
2532
|
+
*
|
|
2533
|
+
* Position is 'before' or 'after' to affect just this command,
|
|
2534
|
+
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
|
2535
|
+
*
|
|
2536
|
+
* @param {string} position - before or after built-in help
|
|
2537
|
+
* @param {(string | Function)} text - string to add, or a function returning a string
|
|
2538
|
+
* @return {Command} `this` command for chaining
|
|
2539
|
+
*/
|
|
2540
|
+
|
|
2541
|
+
addHelpText(position, text) {
|
|
2542
|
+
const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];
|
|
2543
|
+
if (!allowedValues.includes(position)) {
|
|
2544
|
+
throw new Error(`Unexpected value for position to addHelpText.
|
|
2545
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
const helpEvent = `${position}Help`;
|
|
2549
|
+
this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {
|
|
2550
|
+
let helpStr;
|
|
2551
|
+
if (typeof text === 'function') {
|
|
2552
|
+
helpStr = text({ error: context.error, command: context.command });
|
|
2553
|
+
} else {
|
|
2554
|
+
helpStr = text;
|
|
2555
|
+
}
|
|
2556
|
+
// Ignore falsy value when nothing to output.
|
|
2557
|
+
if (helpStr) {
|
|
2558
|
+
context.write(`${helpStr}\n`);
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
return this;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* Output help information if help flags specified
|
|
2566
|
+
*
|
|
2567
|
+
* @param {Array} args - array of options to search for help flags
|
|
2568
|
+
* @private
|
|
2569
|
+
*/
|
|
2570
|
+
|
|
2571
|
+
_outputHelpIfRequested(args) {
|
|
2572
|
+
const helpOption = this._getHelpOption();
|
|
2573
|
+
const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));
|
|
2574
|
+
if (helpRequested) {
|
|
2575
|
+
this.outputHelp();
|
|
2576
|
+
// (Do not have all displayed text available so only passing placeholder.)
|
|
2577
|
+
this._exit(0, 'commander.helpDisplayed', '(outputHelp)');
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).
|
|
2584
|
+
*
|
|
2585
|
+
* @param {string[]} args - array of arguments from node.execArgv
|
|
2586
|
+
* @returns {string[]}
|
|
2587
|
+
* @private
|
|
2588
|
+
*/
|
|
2589
|
+
|
|
2590
|
+
function incrementNodeInspectorPort(args) {
|
|
2591
|
+
// Testing for these options:
|
|
2592
|
+
// --inspect[=[host:]port]
|
|
2593
|
+
// --inspect-brk[=[host:]port]
|
|
2594
|
+
// --inspect-port=[host:]port
|
|
2595
|
+
return args.map((arg) => {
|
|
2596
|
+
if (!arg.startsWith('--inspect')) {
|
|
2597
|
+
return arg;
|
|
2598
|
+
}
|
|
2599
|
+
let debugOption;
|
|
2600
|
+
let debugHost = '127.0.0.1';
|
|
2601
|
+
let debugPort = '9229';
|
|
2602
|
+
let match;
|
|
2603
|
+
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
2604
|
+
// e.g. --inspect
|
|
2605
|
+
debugOption = match[1];
|
|
2606
|
+
} else if (
|
|
2607
|
+
(match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null
|
|
2608
|
+
) {
|
|
2609
|
+
debugOption = match[1];
|
|
2610
|
+
if (/^\d+$/.test(match[3])) {
|
|
2611
|
+
// e.g. --inspect=1234
|
|
2612
|
+
debugPort = match[3];
|
|
2613
|
+
} else {
|
|
2614
|
+
// e.g. --inspect=localhost
|
|
2615
|
+
debugHost = match[3];
|
|
2616
|
+
}
|
|
2617
|
+
} else if (
|
|
2618
|
+
(match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null
|
|
2619
|
+
) {
|
|
2620
|
+
// e.g. --inspect=localhost:1234
|
|
2621
|
+
debugOption = match[1];
|
|
2622
|
+
debugHost = match[3];
|
|
2623
|
+
debugPort = match[4];
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
if (debugOption && debugPort !== '0') {
|
|
2627
|
+
return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
|
|
2628
|
+
}
|
|
2629
|
+
return arg;
|
|
2630
|
+
});
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
/**
|
|
2634
|
+
* @returns {boolean | undefined}
|
|
2635
|
+
* @package
|
|
2636
|
+
*/
|
|
2637
|
+
function useColor() {
|
|
2638
|
+
// Test for common conventions.
|
|
2639
|
+
// NB: the observed behaviour is in combination with how author adds color! For example:
|
|
2640
|
+
// - we do not test NODE_DISABLE_COLORS, but util:styletext does
|
|
2641
|
+
// - we do test NO_COLOR, but Chalk does not
|
|
2642
|
+
//
|
|
2643
|
+
// References:
|
|
2644
|
+
// https://no-color.org
|
|
2645
|
+
// https://bixense.com/clicolors/
|
|
2646
|
+
// https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109
|
|
2647
|
+
// https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33
|
|
2648
|
+
// (https://force-color.org recent web page from 2023, does not match major javascript implementations)
|
|
2649
|
+
|
|
2650
|
+
if (
|
|
2651
|
+
process.env.NO_COLOR ||
|
|
2652
|
+
process.env.FORCE_COLOR === '0' ||
|
|
2653
|
+
process.env.FORCE_COLOR === 'false'
|
|
2654
|
+
)
|
|
2655
|
+
return false;
|
|
2656
|
+
if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)
|
|
2657
|
+
return true;
|
|
2658
|
+
return undefined;
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
exports.Command = Command;
|
|
2662
|
+
exports.useColor = useColor; // exporting for tests
|