@zuplo/cli 7.0.2 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/delete/handler.js +2 -2
- package/dist/delete/handler.js.map +1 -1
- package/dist/deploy/handler.js +1 -1
- package/dist/deploy/handler.js.map +1 -1
- package/dist/deploy/poll-deployment.js +1 -1
- package/dist/deploy/poll-deployment.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- 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/{event-target-shim → @pinojs/redact}/LICENSE +2 -3
- 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/@zuplo/core/customer.cli.minified.js +240 -240
- package/node_modules/@zuplo/core/index.minified.js +258 -258
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/{abort-controller → @zuplo/editor/node_modules/fast-copy}/LICENSE +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-copy/README.md +395 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/cjs/index.cjs +406 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/umd/index.js +412 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/umd/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/index.d.ts +55 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/package.json +103 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/.github/workflows/ci.yml +97 -0
- package/node_modules/{fast-redact → @zuplo/editor/node_modules/pino-abstract-transport}/LICENSE +3 -3
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/README.md +172 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/index.d.ts +122 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/index.js +128 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/package.json +40 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/base.test.js +445 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-async-iteration.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-on-data.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-transform.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/worker-pipeline.js +15 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/types/index.test-d.ts +31 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/worker.test.js +357 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.airtap.yml +7 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/dependabot.yml +13 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/stale.yml +21 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/workflows/ci.yml +137 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/README.md +126 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/ignore.js +35 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/no__proto__.js +40 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/package.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/remove.js +39 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/throw.js +49 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/valid.js +49 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/index.js +126 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/package.json +41 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/test/index.test.js +505 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/types/index.d.ts +57 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/types/index.test-d.ts +31 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/index.d.ts +36 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/index.js +77 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/license +9 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/package.json +47 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/readme.md +78 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.claude/settings.local.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.github/dependabot.yml +13 -0
- package/node_modules/{pino → @zuplo/editor/node_modules/thread-stream}/.github/workflows/ci.yml +25 -19
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.husky/pre-commit +4 -0
- package/node_modules/@zuplo/editor/node_modules/{process-warning → thread-stream}/LICENSE +1 -1
- package/node_modules/@zuplo/editor/node_modules/thread-stream/README.md +136 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/bench.js +85 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/index.d.ts +92 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/index.js +565 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/indexes.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/wait.js +61 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/worker.js +186 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/package.json +57 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/base.test.js +258 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/bench.test.js +38 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/bundlers.test.js +60 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/close-on-gc.js +37 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/commonjs-fallback.test.js +80 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/context.test.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/create-and-exit.js +16 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/custom-worker.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/dir with spaces/test-package.zip +0 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/emit-event.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/end.test.js +61 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/error.js +14 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/esm.test.mjs +47 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/event.test.js +23 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/exit.js +14 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/get-context.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/helper.d.ts +1 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/helper.js +35 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/indexes.test.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/message-without-code.js +19 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/multibyte-chars.test.mjs +74 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/on-message.js +18 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/index.js +37 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/pkg.config.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/pkg.test.js +46 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/port.js +16 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/post-message.test.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/string-limit-2.test.js +41 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/string-limit.test.js +42 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/syntax-error.mjs +2 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/thread-management.test.js +121 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file-on-destroy.js +23 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file-on-final.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file.js +12 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file.mjs +8 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-next.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/transpiled.test.js +30 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts/to-file.ts +10 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts/transpile.sh +19 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts-commonjs-default-export.zip +0 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/uncaughtException.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/unhandledRejection.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/watch-mode.test.js +28 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/yarnrc.yml +7 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/tsconfig.json +8 -0
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-XLNOQPTE.js → chunk-RS7HF7BL.js} +63 -63
- package/node_modules/@zuplo/runtime/out/esm/chunk-RS7HF7BL.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +16 -19
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mcp/messages/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mocks/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/sdks/aws/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/fast-copy/LICENSE +1 -1
- package/node_modules/fast-copy/README.md +186 -154
- package/node_modules/fast-copy/dist/cjs/index.cjs +143 -214
- package/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -1
- package/node_modules/fast-copy/dist/cjs/index.d.cts +54 -0
- package/node_modules/fast-copy/dist/es/index.d.mts +54 -0
- package/node_modules/fast-copy/dist/es/index.mjs +331 -0
- package/node_modules/fast-copy/dist/es/index.mjs.map +1 -0
- package/node_modules/fast-copy/dist/umd/index.d.ts +54 -0
- package/node_modules/fast-copy/dist/umd/index.js +143 -214
- package/node_modules/fast-copy/dist/umd/index.js.map +1 -1
- package/node_modules/fast-copy/index.d.ts +37 -38
- package/node_modules/fast-copy/package.json +68 -61
- package/node_modules/pino/CONTRIBUTING.md +4 -4
- package/node_modules/pino/LICENSE +1 -1
- package/node_modules/pino/README.md +18 -2
- package/node_modules/pino/SECURITY.md +19 -0
- package/node_modules/pino/browser.js +76 -13
- package/node_modules/pino/build/sync-version.js +16 -1
- package/node_modules/pino/docs/api.md +128 -5
- package/node_modules/pino/docs/browser.md +51 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +15 -12
- package/node_modules/pino/docs/help.md +28 -2
- package/node_modules/pino/docs/transports.md +188 -20
- package/node_modules/pino/docs/web.md +40 -0
- package/node_modules/pino/eslint.config.js +28 -0
- package/node_modules/pino/lib/meta.js +1 -1
- package/node_modules/pino/lib/multistream.js +17 -2
- package/node_modules/pino/lib/proto.js +34 -10
- package/node_modules/pino/lib/redaction.js +9 -13
- package/node_modules/pino/lib/time.js +29 -1
- package/node_modules/pino/lib/tools.js +42 -9
- package/node_modules/pino/lib/transport.js +125 -3
- package/node_modules/pino/package.json +25 -25
- package/node_modules/pino/pino.d.ts +228 -203
- package/node_modules/pino/pino.js +2 -1
- package/node_modules/pino/test/basic.test.js +179 -167
- package/node_modules/pino/test/broken-pipe.test.js +16 -14
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser.test.js +39 -0
- package/node_modules/pino/test/complex-objects.test.js +8 -6
- package/node_modules/pino/test/crlf.test.js +7 -5
- package/node_modules/pino/test/custom-levels.test.js +80 -66
- 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 +47 -42
- package/node_modules/pino/test/escaping.test.js +7 -5
- package/node_modules/pino/test/esm/esm.mjs +5 -3
- package/node_modules/pino/test/esm/index.test.js +14 -27
- package/node_modules/pino/test/esm/named-exports.mjs +8 -6
- package/node_modules/pino/test/exit.test.js +17 -15
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -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-worker-name.js +24 -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 +1 -1
- package/node_modules/pino/test/formatters.test.js +43 -34
- package/node_modules/pino/test/helper.d.ts +3 -3
- package/node_modules/pino/test/helper.js +36 -9
- package/node_modules/pino/test/hooks.test.js +45 -28
- package/node_modules/pino/test/http.test.js +38 -66
- package/node_modules/pino/test/internals/version.test.js +9 -7
- package/node_modules/pino/test/is-level-enabled.test.js +66 -72
- package/node_modules/pino/test/levels.test.js +191 -153
- package/node_modules/pino/test/metadata.test.js +44 -30
- package/node_modules/pino/test/mixin-merge-strategy.test.js +9 -7
- package/node_modules/pino/test/mixin.test.js +62 -39
- package/node_modules/pino/test/multistream.test.js +173 -117
- package/node_modules/pino/test/redact.test.js +172 -126
- package/node_modules/pino/test/serializers.test.js +61 -57
- package/node_modules/pino/test/stdout-protection.test.js +12 -10
- package/node_modules/pino/test/syncfalse.test.js +24 -26
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +37 -34
- package/node_modules/pino/test/transport/big.test.js +8 -9
- package/node_modules/pino/test/transport/bundlers-support.test.js +12 -10
- package/node_modules/pino/test/transport/caller.test.js +8 -7
- package/node_modules/pino/test/transport/core.test.js +232 -143
- package/node_modules/pino/test/transport/core.transpiled.test.ts +15 -13
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +17 -15
- 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 +14 -12
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +4 -3
- package/node_modules/pino/test/transport/{syncfalse.test.js → sync-false.test.js} +15 -16
- package/node_modules/pino/test/transport/{syncTrue.test.js → sync-true.test.js} +6 -4
- package/node_modules/pino/test/transport/targets.test.js +13 -9
- package/node_modules/pino/test/transport/uses-pino-config.test.js +13 -14
- package/node_modules/pino/test/transport-stream.test.js +22 -8
- package/node_modules/pino/test/types/{pino-import.test-d.ts → pino-import.test-d.cts} +4 -3
- package/node_modules/pino/test/types/pino-multistream.test-d.ts +4 -4
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +26 -27
- package/node_modules/pino/test/types/pino-transport.test-d.ts +99 -88
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +55 -44
- package/node_modules/pino/test/types/pino.test-d.ts +500 -281
- package/node_modules/pino/test/types/pino.ts +50 -37
- package/node_modules/pino/tsconfig.json +1 -1
- package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +5 -22
- package/node_modules/pino-abstract-transport/README.md +0 -1
- package/node_modules/pino-abstract-transport/package.json +6 -5
- package/node_modules/pino-abstract-transport/test/base.test.js +108 -80
- package/node_modules/pino-abstract-transport/test/match.js +24 -0
- package/node_modules/pino-abstract-transport/test/worker.test.js +46 -31
- package/node_modules/pino-pretty/.borp.yaml +6 -0
- package/node_modules/pino-pretty/.github/dependabot.yml +1 -1
- package/node_modules/pino-pretty/.github/workflows/ci.yml +5 -12
- package/node_modules/pino-pretty/Readme.md +24 -3
- package/node_modules/pino-pretty/bin.js +5 -4
- package/node_modules/pino-pretty/eslint.config.js +3 -0
- package/node_modules/pino-pretty/index.d.ts +7 -7
- package/node_modules/pino-pretty/index.js +1 -1
- package/node_modules/pino-pretty/lib/colors.js +9 -4
- package/node_modules/pino-pretty/lib/colors.test.js +36 -36
- package/node_modules/pino-pretty/lib/pretty.js +7 -5
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +2 -4
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +17 -19
- package/node_modules/pino-pretty/lib/utils/create-date.test.js +7 -7
- package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +7 -7
- package/node_modules/pino-pretty/lib/utils/filter-log.test.js +33 -40
- package/node_modules/pino-pretty/lib/utils/format-time.js +1 -1
- package/node_modules/pino-pretty/lib/utils/format-time.test.js +25 -25
- package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +11 -11
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +15 -14
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +11 -11
- package/node_modules/pino-pretty/lib/utils/index.test.js +8 -8
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +23 -23
- package/node_modules/pino-pretty/lib/utils/is-object.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +6 -6
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/noop.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +26 -26
- package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +3 -4
- package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +9 -9
- package/node_modules/pino-pretty/lib/utils/prettify-message.js +2 -1
- package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +73 -41
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +37 -37
- package/node_modules/pino-pretty/lib/utils/prettify-object.js +1 -1
- package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +71 -32
- package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +29 -29
- package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +11 -11
- package/node_modules/pino-pretty/package.json +22 -24
- package/node_modules/pino-pretty/test/basic.test.js +190 -181
- package/node_modules/pino-pretty/test/cli-rc.test.js +93 -73
- package/node_modules/pino-pretty/test/cli.test.js +169 -144
- package/node_modules/pino-pretty/test/crlf.test.js +6 -8
- package/node_modules/pino-pretty/test/error-objects.test.js +85 -90
- package/node_modules/pino-pretty/test/example/example.js +3 -1
- package/node_modules/pino-pretty/test/helper.js +19 -0
- package/node_modules/pino-pretty/test/types/pino-pretty.test-d.ts +4 -1
- package/node_modules/process-warning/.github/dependabot.yml +41 -1
- package/node_modules/process-warning/.github/workflows/ci.yml +12 -3
- package/node_modules/process-warning/LICENSE +1 -1
- package/node_modules/process-warning/README.md +42 -3
- package/node_modules/process-warning/index.js +85 -17
- package/node_modules/process-warning/package.json +7 -8
- package/node_modules/process-warning/test/emit-interpolated-string.test.js +11 -6
- package/node_modules/process-warning/test/emit-once-only.test.js +14 -9
- package/node_modules/process-warning/test/emit-reset.test.js +14 -10
- package/node_modules/process-warning/test/emit-set.test.js +10 -5
- package/node_modules/process-warning/test/emit-unlimited.test.js +14 -9
- package/node_modules/process-warning/test/index.test.js +20 -20
- package/node_modules/process-warning/test/issue-88.test.js +8 -3
- package/node_modules/process-warning/test/jest.test.js +17 -15
- package/node_modules/process-warning/test/no-warnings.test.js +7 -7
- package/node_modules/process-warning/types/index.d.ts +15 -1
- package/node_modules/secure-json-parse/.github/dependabot.yml +1 -1
- package/node_modules/secure-json-parse/.github/workflows/ci.yml +31 -19
- package/node_modules/{ieee754 → secure-json-parse}/LICENSE +9 -1
- package/node_modules/secure-json-parse/README.md +14 -8
- package/node_modules/secure-json-parse/benchmarks/ignore.js +1 -1
- package/node_modules/secure-json-parse/benchmarks/throw.js +3 -3
- package/node_modules/secure-json-parse/index.js +39 -4
- package/node_modules/secure-json-parse/package.json +41 -8
- package/node_modules/secure-json-parse/test/index.test.js +150 -6
- package/node_modules/secure-json-parse/types/index.d.ts +9 -6
- package/node_modules/secure-json-parse/types/index.test-d.ts +13 -1
- package/node_modules/strip-json-comments/index.d.ts +18 -13
- package/node_modules/strip-json-comments/index.js +75 -39
- package/node_modules/strip-json-comments/package.json +14 -5
- package/node_modules/strip-json-comments/readme.md +15 -18
- package/node_modules/thread-stream/.github/workflows/ci.yml +4 -24
- package/node_modules/thread-stream/README.md +2 -0
- package/node_modules/thread-stream/eslint.config.js +10 -0
- package/node_modules/thread-stream/index.d.ts +7 -0
- package/node_modules/thread-stream/index.js +189 -109
- package/node_modules/thread-stream/lib/wait.js +58 -42
- package/node_modules/thread-stream/lib/worker.js +126 -14
- package/node_modules/thread-stream/node_modules/real-require/LICENSE.md +21 -0
- package/node_modules/thread-stream/node_modules/real-require/README.md +51 -0
- package/node_modules/thread-stream/node_modules/real-require/package.json +38 -0
- package/node_modules/thread-stream/node_modules/real-require/src/index.js +14 -0
- package/node_modules/thread-stream/package.json +18 -25
- package/node_modules/thread-stream/test/base.test.js +97 -96
- package/node_modules/thread-stream/test/bench.test.js +3 -3
- package/node_modules/thread-stream/test/bundlers.test.js +8 -9
- package/node_modules/thread-stream/test/commonjs-fallback.test.js +17 -22
- package/node_modules/thread-stream/test/context.test.js +6 -6
- package/node_modules/thread-stream/test/end.test.js +22 -27
- package/node_modules/thread-stream/test/esm.test.mjs +8 -9
- package/node_modules/thread-stream/test/event.test.js +10 -9
- package/node_modules/thread-stream/test/flush-worker.js +68 -0
- package/node_modules/thread-stream/test/flush.test.js +112 -0
- package/node_modules/thread-stream/test/helper.js +1 -10
- package/node_modules/thread-stream/test/indexes.test.js +4 -4
- package/node_modules/thread-stream/test/multibyte-chars.test.mjs +14 -13
- package/node_modules/thread-stream/test/multibyte-overrun.test.mjs +33 -0
- package/node_modules/thread-stream/test/pkg/index.js +23 -23
- package/node_modules/thread-stream/test/pkg/pkg.config.json +3 -4
- package/node_modules/thread-stream/test/pkg/pkg.test.js +5 -6
- package/node_modules/thread-stream/test/post-message.test.js +4 -5
- package/node_modules/thread-stream/test/report-thread-name.js +16 -0
- package/node_modules/thread-stream/test/string-limit-2.test.js +24 -30
- package/node_modules/thread-stream/test/string-limit.test.js +24 -29
- package/node_modules/thread-stream/test/thread-management.test.js +46 -17
- package/node_modules/thread-stream/test/transpiled.test.js +5 -6
- 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/watch-mode.test.js +13 -11
- package/node_modules/thread-stream/test/worker-name.test.js +43 -0
- package/package.json +8 -8
- package/node_modules/@zuplo/editor/node_modules/process-warning/.github/dependabot.yml +0 -53
- package/node_modules/@zuplo/editor/node_modules/process-warning/.github/workflows/ci.yml +0 -33
- package/node_modules/@zuplo/editor/node_modules/process-warning/README.md +0 -157
- package/node_modules/@zuplo/editor/node_modules/process-warning/benchmarks/warn.js +0 -25
- package/node_modules/@zuplo/editor/node_modules/process-warning/examples/example.js +0 -11
- package/node_modules/@zuplo/editor/node_modules/process-warning/index.js +0 -192
- package/node_modules/@zuplo/editor/node_modules/process-warning/package.json +0 -72
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-interpolated-string.test.js +0 -34
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-once-only.test.js +0 -33
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-reset.test.js +0 -40
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-set.test.js +0 -35
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-unlimited.test.js +0 -42
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/index.test.js +0 -99
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/issue-88.test.js +0 -38
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/jest.test.js +0 -24
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/no-warnings.test.js +0 -80
- package/node_modules/@zuplo/editor/node_modules/process-warning/types/index.d.ts +0 -51
- package/node_modules/@zuplo/runtime/out/esm/chunk-XLNOQPTE.js.map +0 -1
- package/node_modules/abort-controller/README.md +0 -98
- package/node_modules/abort-controller/browser.js +0 -13
- package/node_modules/abort-controller/browser.mjs +0 -11
- package/node_modules/abort-controller/dist/abort-controller.d.ts +0 -43
- package/node_modules/abort-controller/dist/abort-controller.js +0 -127
- package/node_modules/abort-controller/dist/abort-controller.js.map +0 -1
- package/node_modules/abort-controller/dist/abort-controller.mjs +0 -118
- package/node_modules/abort-controller/dist/abort-controller.mjs.map +0 -1
- package/node_modules/abort-controller/dist/abort-controller.umd.js +0 -5
- package/node_modules/abort-controller/dist/abort-controller.umd.js.map +0 -1
- package/node_modules/abort-controller/package.json +0 -97
- package/node_modules/abort-controller/polyfill.js +0 -21
- package/node_modules/abort-controller/polyfill.mjs +0 -19
- package/node_modules/base64-js/LICENSE +0 -21
- package/node_modules/base64-js/README.md +0 -34
- package/node_modules/base64-js/base64js.min.js +0 -1
- package/node_modules/base64-js/index.d.ts +0 -3
- package/node_modules/base64-js/index.js +0 -150
- package/node_modules/base64-js/package.json +0 -47
- package/node_modules/buffer/AUTHORS.md +0 -73
- package/node_modules/buffer/LICENSE +0 -21
- package/node_modules/buffer/README.md +0 -410
- package/node_modules/buffer/index.d.ts +0 -194
- package/node_modules/buffer/index.js +0 -2106
- package/node_modules/buffer/package.json +0 -93
- package/node_modules/event-target-shim/README.md +0 -293
- package/node_modules/event-target-shim/dist/event-target-shim.js +0 -871
- package/node_modules/event-target-shim/dist/event-target-shim.js.map +0 -1
- package/node_modules/event-target-shim/dist/event-target-shim.mjs +0 -862
- package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +0 -1
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js +0 -6
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +0 -1
- package/node_modules/event-target-shim/index.d.ts +0 -399
- package/node_modules/event-target-shim/package.json +0 -82
- package/node_modules/events/.airtap.yml +0 -15
- package/node_modules/events/.github/FUNDING.yml +0 -12
- package/node_modules/events/.travis.yml +0 -18
- package/node_modules/events/History.md +0 -118
- package/node_modules/events/LICENSE +0 -22
- package/node_modules/events/Readme.md +0 -50
- package/node_modules/events/events.js +0 -497
- package/node_modules/events/package.json +0 -37
- package/node_modules/events/security.md +0 -10
- package/node_modules/events/tests/add-listeners.js +0 -111
- package/node_modules/events/tests/check-listener-leaks.js +0 -101
- package/node_modules/events/tests/common.js +0 -104
- package/node_modules/events/tests/errors.js +0 -13
- package/node_modules/events/tests/events-list.js +0 -28
- package/node_modules/events/tests/events-once.js +0 -234
- package/node_modules/events/tests/index.js +0 -64
- package/node_modules/events/tests/legacy-compat.js +0 -16
- package/node_modules/events/tests/listener-count.js +0 -37
- package/node_modules/events/tests/listeners-side-effects.js +0 -56
- package/node_modules/events/tests/listeners.js +0 -168
- package/node_modules/events/tests/max-listeners.js +0 -47
- package/node_modules/events/tests/method-names.js +0 -35
- package/node_modules/events/tests/modify-in-emit.js +0 -90
- package/node_modules/events/tests/num-args.js +0 -60
- package/node_modules/events/tests/once.js +0 -83
- package/node_modules/events/tests/prepend.js +0 -31
- package/node_modules/events/tests/remove-all-listeners.js +0 -133
- package/node_modules/events/tests/remove-listeners.js +0 -212
- package/node_modules/events/tests/set-max-listeners-side-effects.js +0 -31
- package/node_modules/events/tests/special-event-names.js +0 -45
- package/node_modules/events/tests/subclass.js +0 -66
- package/node_modules/events/tests/symbols.js +0 -25
- package/node_modules/fast-redact/.github/workflows/ci.yml +0 -37
- package/node_modules/fast-redact/benchmark/index.js +0 -223
- package/node_modules/fast-redact/example/default-usage.js +0 -14
- package/node_modules/fast-redact/example/intermediate-wildcard-array.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array-depth.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array-end.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array.js +0 -11
- package/node_modules/fast-redact/example/serialize-false.js +0 -11
- package/node_modules/fast-redact/example/serialize-function.js +0 -4
- package/node_modules/fast-redact/example/top-wildcard-object.js +0 -9
- package/node_modules/fast-redact/index.js +0 -56
- package/node_modules/fast-redact/lib/modifiers.js +0 -291
- package/node_modules/fast-redact/lib/parse.js +0 -44
- package/node_modules/fast-redact/lib/redactor.js +0 -108
- package/node_modules/fast-redact/lib/restorer.js +0 -92
- package/node_modules/fast-redact/lib/rx.js +0 -16
- package/node_modules/fast-redact/lib/state.js +0 -20
- package/node_modules/fast-redact/lib/validator.js +0 -33
- package/node_modules/fast-redact/package.json +0 -50
- package/node_modules/fast-redact/readme.md +0 -282
- package/node_modules/fast-redact/test/index.js +0 -1502
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -52
- package/node_modules/pino/.eslintignore +0 -2
- package/node_modules/pino/.eslintrc +0 -8
- package/node_modules/pino/.github/workflows/bench.yml +0 -61
- package/node_modules/pino/.github/workflows/lock-threads.yml +0 -30
- package/node_modules/pino/.github/workflows/target-main.yml +0 -23
- package/node_modules/pino/.taprc.yaml +0 -8
- package/node_modules/pino/docsify/sidebar.md +0 -26
- package/node_modules/pino/favicon-16x16.png +0 -0
- package/node_modules/pino/favicon-32x32.png +0 -0
- package/node_modules/pino/pino-banner.png +0 -0
- package/node_modules/pino/pino-logo-hire.png +0 -0
- package/node_modules/pino/pino-tree.png +0 -0
- package/node_modules/pino/pretty-demo.png +0 -0
- package/node_modules/pino/test/errorKey.test.js +0 -34
- package/node_modules/pino/test/pkg/index.js +0 -46
- package/node_modules/pino/test/pkg/pkg.config.json +0 -17
- package/node_modules/pino/test/pkg/pkg.test.js +0 -56
- package/node_modules/pino/test/transport/core.test.ts +0 -236
- package/node_modules/process/.eslintrc +0 -21
- package/node_modules/process/LICENSE +0 -22
- package/node_modules/process/README.md +0 -26
- package/node_modules/process/browser.js +0 -184
- package/node_modules/process/index.js +0 -2
- package/node_modules/process/package.json +0 -27
- package/node_modules/process/test.js +0 -199
- package/node_modules/process-warning/.taprc +0 -2
- package/node_modules/process-warning/types/index.test-d.ts +0 -36
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -116
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -4
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -4
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -4
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -4
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -4
- package/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +0 -52
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -157
- package/node_modules/readable-stream/lib/internal/streams/compose.js +0 -194
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -290
- package/node_modules/readable-stream/lib/internal/streams/duplex.js +0 -143
- package/node_modules/readable-stream/lib/internal/streams/duplexify.js +0 -378
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -286
- package/node_modules/readable-stream/lib/internal/streams/from.js +0 -98
- package/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +0 -51
- package/node_modules/readable-stream/lib/internal/streams/legacy.js +0 -89
- package/node_modules/readable-stream/lib/internal/streams/operators.js +0 -457
- package/node_modules/readable-stream/lib/internal/streams/passthrough.js +0 -39
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -471
- package/node_modules/readable-stream/lib/internal/streams/readable.js +0 -1290
- package/node_modules/readable-stream/lib/internal/streams/state.js +0 -39
- package/node_modules/readable-stream/lib/internal/streams/transform.js +0 -180
- package/node_modules/readable-stream/lib/internal/streams/utils.js +0 -327
- package/node_modules/readable-stream/lib/internal/streams/writable.js +0 -819
- package/node_modules/readable-stream/lib/internal/validators.js +0 -530
- package/node_modules/readable-stream/lib/ours/browser.js +0 -35
- package/node_modules/readable-stream/lib/ours/errors.js +0 -343
- package/node_modules/readable-stream/lib/ours/index.js +0 -65
- package/node_modules/readable-stream/lib/ours/primordials.js +0 -124
- package/node_modules/readable-stream/lib/ours/util/inspect.js +0 -55
- package/node_modules/readable-stream/lib/ours/util.js +0 -148
- package/node_modules/readable-stream/lib/stream/promises.js +0 -43
- package/node_modules/readable-stream/lib/stream.js +0 -143
- package/node_modules/readable-stream/package.json +0 -88
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -65
- package/node_modules/safe-buffer/package.json +0 -51
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -34
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/.release-it.beta.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/.release-it.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/CHANGELOG.md +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/index.mjs +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/index.mjs.map +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/index.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/index.js.map +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/flow-typed/fast-copy.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.base.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.cjs.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.esm.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.min.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.umd.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/packageJson.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/base.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/cjs.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/declarations.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/esm.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/min.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/umd.json +0 -0
- /package/node_modules/{pino → @zuplo/editor/node_modules/pino-abstract-transport}/.github/dependabot.yml +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/pino-abstract-transport}/.husky/pre-commit +0 -0
- /package/node_modules/{secure-json-parse → @zuplo/editor/node_modules/secure-json-parse}/LICENSE.md +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/.taprc +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/CLAUDE.md +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/test/never-drain.test.js +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/test/ts.test.ts +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-XLNOQPTE.js.LEGAL.txt → chunk-RS7HF7BL.js.LEGAL.txt} +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/.github/workflows/lock-threads.yml +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/test/promise.js +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/test/spy-warning.test.js +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/types/index.tst.ts +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → secure-json-parse}/.gitattributes +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → secure-json-parse}/eslint.config.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface Cache {
|
|
2
|
+
has: (value: any) => boolean;
|
|
3
|
+
set: (key: any, value: any) => void;
|
|
4
|
+
get: (key: any) => any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type InternalCopier<Value> = (value: Value, state: State) => Value;
|
|
8
|
+
interface State {
|
|
9
|
+
Constructor: any;
|
|
10
|
+
cache: Cache;
|
|
11
|
+
copier: InternalCopier<any>;
|
|
12
|
+
prototype: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface CopierMethods {
|
|
16
|
+
array?: InternalCopier<any[]>;
|
|
17
|
+
arrayBuffer?: InternalCopier<ArrayBuffer>;
|
|
18
|
+
asyncGenerator?: InternalCopier<AsyncGenerator>;
|
|
19
|
+
blob?: InternalCopier<Blob>;
|
|
20
|
+
dataView?: InternalCopier<DataView>;
|
|
21
|
+
date?: InternalCopier<Date>;
|
|
22
|
+
error?: InternalCopier<Error>;
|
|
23
|
+
generator?: InternalCopier<Generator>;
|
|
24
|
+
map?: InternalCopier<Map<any, any>>;
|
|
25
|
+
object?: InternalCopier<Record<string, any>>;
|
|
26
|
+
regExp?: InternalCopier<RegExp>;
|
|
27
|
+
set?: InternalCopier<Set<any>>;
|
|
28
|
+
}
|
|
29
|
+
interface CreateCopierOptions {
|
|
30
|
+
createCache?: () => Cache;
|
|
31
|
+
methods?: CopierMethods;
|
|
32
|
+
strict?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a custom copier based on custom options for any of the following:
|
|
37
|
+
* - `createCache` method to create a cache for copied objects
|
|
38
|
+
* - custom copier `methods` for specific object types
|
|
39
|
+
* - `strict` mode to copy all properties with their descriptors
|
|
40
|
+
*/
|
|
41
|
+
declare function createCopier(options?: CreateCopierOptions): <Value>(value: Value) => Value;
|
|
42
|
+
/**
|
|
43
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
44
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
45
|
+
* original property descriptors on both objects and arrays.
|
|
46
|
+
*/
|
|
47
|
+
declare const copyStrict: <Value>(value: Value) => Value;
|
|
48
|
+
/**
|
|
49
|
+
* Copy an value deeply as much as possible.
|
|
50
|
+
*/
|
|
51
|
+
declare const copy: <Value>(value: Value) => Value;
|
|
52
|
+
|
|
53
|
+
export { copy, copyStrict, createCopier };
|
|
54
|
+
export type { CreateCopierOptions, State };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface Cache {
|
|
2
|
+
has: (value: any) => boolean;
|
|
3
|
+
set: (key: any, value: any) => void;
|
|
4
|
+
get: (key: any) => any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type InternalCopier<Value> = (value: Value, state: State) => Value;
|
|
8
|
+
interface State {
|
|
9
|
+
Constructor: any;
|
|
10
|
+
cache: Cache;
|
|
11
|
+
copier: InternalCopier<any>;
|
|
12
|
+
prototype: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface CopierMethods {
|
|
16
|
+
array?: InternalCopier<any[]>;
|
|
17
|
+
arrayBuffer?: InternalCopier<ArrayBuffer>;
|
|
18
|
+
asyncGenerator?: InternalCopier<AsyncGenerator>;
|
|
19
|
+
blob?: InternalCopier<Blob>;
|
|
20
|
+
dataView?: InternalCopier<DataView>;
|
|
21
|
+
date?: InternalCopier<Date>;
|
|
22
|
+
error?: InternalCopier<Error>;
|
|
23
|
+
generator?: InternalCopier<Generator>;
|
|
24
|
+
map?: InternalCopier<Map<any, any>>;
|
|
25
|
+
object?: InternalCopier<Record<string, any>>;
|
|
26
|
+
regExp?: InternalCopier<RegExp>;
|
|
27
|
+
set?: InternalCopier<Set<any>>;
|
|
28
|
+
}
|
|
29
|
+
interface CreateCopierOptions {
|
|
30
|
+
createCache?: () => Cache;
|
|
31
|
+
methods?: CopierMethods;
|
|
32
|
+
strict?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a custom copier based on custom options for any of the following:
|
|
37
|
+
* - `createCache` method to create a cache for copied objects
|
|
38
|
+
* - custom copier `methods` for specific object types
|
|
39
|
+
* - `strict` mode to copy all properties with their descriptors
|
|
40
|
+
*/
|
|
41
|
+
declare function createCopier(options?: CreateCopierOptions): <Value>(value: Value) => Value;
|
|
42
|
+
/**
|
|
43
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
44
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
45
|
+
* original property descriptors on both objects and arrays.
|
|
46
|
+
*/
|
|
47
|
+
declare const copyStrict: <Value>(value: Value) => Value;
|
|
48
|
+
/**
|
|
49
|
+
* Copy an value deeply as much as possible.
|
|
50
|
+
*/
|
|
51
|
+
declare const copy: <Value>(value: Value) => Value;
|
|
52
|
+
|
|
53
|
+
export { copy, copyStrict, createCopier };
|
|
54
|
+
export type { CreateCopierOptions, State };
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
2
|
+
const toStringFunction = Function.prototype.toString;
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
4
|
+
const toStringObject = Object.prototype.toString;
|
|
5
|
+
/**
|
|
6
|
+
* Get an empty version of the object with the same prototype it has.
|
|
7
|
+
*/
|
|
8
|
+
function getCleanClone(prototype) {
|
|
9
|
+
if (!prototype) {
|
|
10
|
+
return Object.create(null);
|
|
11
|
+
}
|
|
12
|
+
const Constructor = prototype.constructor;
|
|
13
|
+
if (Constructor === Object) {
|
|
14
|
+
return prototype === Object.prototype ? {} : Object.create(prototype);
|
|
15
|
+
}
|
|
16
|
+
if (Constructor && ~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
17
|
+
try {
|
|
18
|
+
return new Constructor();
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
// Ignore
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return Object.create(prototype);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the tag of the value passed, so that the correct copier can be used.
|
|
28
|
+
*/
|
|
29
|
+
function getTag(value) {
|
|
30
|
+
const stringTag = value[Symbol.toStringTag];
|
|
31
|
+
if (stringTag) {
|
|
32
|
+
return stringTag;
|
|
33
|
+
}
|
|
34
|
+
const type = toStringObject.call(value);
|
|
35
|
+
return type.substring(8, type.length - 1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
39
|
+
const { propertyIsEnumerable } = Object.prototype;
|
|
40
|
+
function copyOwnDescriptor(original, clone, property, state) {
|
|
41
|
+
const ownDescriptor = Object.getOwnPropertyDescriptor(original, property) || {
|
|
42
|
+
configurable: true,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
value: original[property],
|
|
45
|
+
writable: true,
|
|
46
|
+
};
|
|
47
|
+
const descriptor = ownDescriptor.get || ownDescriptor.set
|
|
48
|
+
? ownDescriptor
|
|
49
|
+
: {
|
|
50
|
+
configurable: ownDescriptor.configurable,
|
|
51
|
+
enumerable: ownDescriptor.enumerable,
|
|
52
|
+
value: state.copier(ownDescriptor.value, state),
|
|
53
|
+
writable: ownDescriptor.writable,
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
Object.defineProperty(clone, property, descriptor);
|
|
57
|
+
}
|
|
58
|
+
catch (_a) {
|
|
59
|
+
// The above can fail on node in extreme edge cases, so fall back to the loose assignment.
|
|
60
|
+
clone[property] = descriptor.get ? descriptor.get() : descriptor.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Strictly copy all properties contained on the object.
|
|
65
|
+
*/
|
|
66
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
67
|
+
for (const name of Object.getOwnPropertyNames(value)) {
|
|
68
|
+
copyOwnDescriptor(value, clone, name, state);
|
|
69
|
+
}
|
|
70
|
+
for (const symbol of Object.getOwnPropertySymbols(value)) {
|
|
71
|
+
copyOwnDescriptor(value, clone, symbol, state);
|
|
72
|
+
}
|
|
73
|
+
return clone;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Deeply copy the indexed values in the array.
|
|
77
|
+
*/
|
|
78
|
+
function copyArrayLoose(array, state) {
|
|
79
|
+
const clone = new state.Constructor();
|
|
80
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
81
|
+
state.cache.set(array, clone);
|
|
82
|
+
for (let index = 0; index < array.length; ++index) {
|
|
83
|
+
clone[index] = state.copier(array[index], state);
|
|
84
|
+
}
|
|
85
|
+
return clone;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Deeply copy the indexed values in the array, as well as any custom properties.
|
|
89
|
+
*/
|
|
90
|
+
function copyArrayStrict(array, state) {
|
|
91
|
+
const clone = new state.Constructor();
|
|
92
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
93
|
+
state.cache.set(array, clone);
|
|
94
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Copy the contents of the ArrayBuffer.
|
|
98
|
+
*/
|
|
99
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
100
|
+
return arrayBuffer.slice(0);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Create a new Blob with the contents of the original.
|
|
104
|
+
*/
|
|
105
|
+
function copyBlob(blob, _state) {
|
|
106
|
+
return blob.slice(0, blob.size, blob.type);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Create a new DataView with the contents of the original.
|
|
110
|
+
*/
|
|
111
|
+
function copyDataView(dataView, state) {
|
|
112
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a new Date based on the time of the original.
|
|
116
|
+
*/
|
|
117
|
+
function copyDate(date, state) {
|
|
118
|
+
return new state.Constructor(date.getTime());
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Deeply copy the keys and values of the original.
|
|
122
|
+
*/
|
|
123
|
+
function copyMapLoose(map, state) {
|
|
124
|
+
const clone = new state.Constructor();
|
|
125
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
126
|
+
state.cache.set(map, clone);
|
|
127
|
+
for (const [key, value] of map) {
|
|
128
|
+
clone.set(key, state.copier(value, state));
|
|
129
|
+
}
|
|
130
|
+
return clone;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Deeply copy the keys and values of the original, as well as any custom properties.
|
|
134
|
+
*/
|
|
135
|
+
function copyMapStrict(map, state) {
|
|
136
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Deeply copy the properties (keys and symbols) and values of the original.
|
|
140
|
+
*/
|
|
141
|
+
function copyObjectLoose(object, state) {
|
|
142
|
+
const clone = getCleanClone(state.prototype);
|
|
143
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
144
|
+
state.cache.set(object, clone);
|
|
145
|
+
for (const key of Object.keys(object)) {
|
|
146
|
+
clone[key] = state.copier(object[key], state);
|
|
147
|
+
}
|
|
148
|
+
for (const symbol of Object.getOwnPropertySymbols(object)) {
|
|
149
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
150
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return clone;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Deeply copy the properties (keys and symbols) and values of the original, as well
|
|
157
|
+
* as any hidden or non-enumerable properties.
|
|
158
|
+
*/
|
|
159
|
+
function copyObjectStrict(object, state) {
|
|
160
|
+
const clone = getCleanClone(state.prototype);
|
|
161
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
162
|
+
state.cache.set(object, clone);
|
|
163
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Create a new primitive wrapper from the value of the original.
|
|
167
|
+
*/
|
|
168
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
169
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create a new RegExp based on the value and flags of the original.
|
|
173
|
+
*/
|
|
174
|
+
function copyRegExp(regExp, state) {
|
|
175
|
+
const clone = new state.Constructor(regExp.source, regExp.flags);
|
|
176
|
+
clone.lastIndex = regExp.lastIndex;
|
|
177
|
+
return clone;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Return the original value (an identity function).
|
|
181
|
+
*
|
|
182
|
+
* @note
|
|
183
|
+
* THis is used for objects that cannot be copied, such as WeakMap.
|
|
184
|
+
*/
|
|
185
|
+
function copySelf(value, _state) {
|
|
186
|
+
return value;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Deeply copy the values of the original.
|
|
190
|
+
*/
|
|
191
|
+
function copySetLoose(set, state) {
|
|
192
|
+
const clone = new state.Constructor();
|
|
193
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
194
|
+
state.cache.set(set, clone);
|
|
195
|
+
for (const value of set) {
|
|
196
|
+
clone.add(state.copier(value, state));
|
|
197
|
+
}
|
|
198
|
+
return clone;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Deeply copy the values of the original, as well as any custom properties.
|
|
202
|
+
*/
|
|
203
|
+
function copySetStrict(set, state) {
|
|
204
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function createDefaultCache() {
|
|
208
|
+
return new WeakMap();
|
|
209
|
+
}
|
|
210
|
+
function getOptions({ createCache: createCacheOverride, methods: methodsOverride, strict, }) {
|
|
211
|
+
const defaultMethods = {
|
|
212
|
+
array: strict ? copyArrayStrict : copyArrayLoose,
|
|
213
|
+
arrayBuffer: copyArrayBuffer,
|
|
214
|
+
asyncGenerator: copySelf,
|
|
215
|
+
blob: copyBlob,
|
|
216
|
+
dataView: copyDataView,
|
|
217
|
+
date: copyDate,
|
|
218
|
+
error: copySelf,
|
|
219
|
+
generator: copySelf,
|
|
220
|
+
map: strict ? copyMapStrict : copyMapLoose,
|
|
221
|
+
object: strict ? copyObjectStrict : copyObjectLoose,
|
|
222
|
+
regExp: copyRegExp,
|
|
223
|
+
set: strict ? copySetStrict : copySetLoose,
|
|
224
|
+
};
|
|
225
|
+
const methods = methodsOverride ? Object.assign(defaultMethods, methodsOverride) : defaultMethods;
|
|
226
|
+
const copiers = getTagSpecificCopiers(methods);
|
|
227
|
+
const createCache = createCacheOverride || createDefaultCache;
|
|
228
|
+
// Extra safety check to ensure that object and array copiers are always provided,
|
|
229
|
+
// avoiding runtime errors.
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
231
|
+
if (!copiers.Object || !copiers.Array) {
|
|
232
|
+
throw new Error('An object and array copier must be provided.');
|
|
233
|
+
}
|
|
234
|
+
return { createCache, copiers, methods, strict: Boolean(strict) };
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get the copiers used for each specific object tag.
|
|
238
|
+
*/
|
|
239
|
+
function getTagSpecificCopiers(methods) {
|
|
240
|
+
return {
|
|
241
|
+
Arguments: methods.object,
|
|
242
|
+
Array: methods.array,
|
|
243
|
+
ArrayBuffer: methods.arrayBuffer,
|
|
244
|
+
AsyncGenerator: methods.asyncGenerator,
|
|
245
|
+
BigInt64Array: methods.arrayBuffer,
|
|
246
|
+
BigUint64Array: methods.arrayBuffer,
|
|
247
|
+
Blob: methods.blob,
|
|
248
|
+
Boolean: copyPrimitiveWrapper,
|
|
249
|
+
DataView: methods.dataView,
|
|
250
|
+
Date: methods.date,
|
|
251
|
+
Error: methods.error,
|
|
252
|
+
Float32Array: methods.arrayBuffer,
|
|
253
|
+
Float64Array: methods.arrayBuffer,
|
|
254
|
+
Generator: methods.generator,
|
|
255
|
+
Int8Array: methods.arrayBuffer,
|
|
256
|
+
Int16Array: methods.arrayBuffer,
|
|
257
|
+
Int32Array: methods.arrayBuffer,
|
|
258
|
+
Map: methods.map,
|
|
259
|
+
Number: copyPrimitiveWrapper,
|
|
260
|
+
Object: methods.object,
|
|
261
|
+
Promise: copySelf,
|
|
262
|
+
RegExp: methods.regExp,
|
|
263
|
+
Set: methods.set,
|
|
264
|
+
String: copyPrimitiveWrapper,
|
|
265
|
+
WeakMap: copySelf,
|
|
266
|
+
WeakSet: copySelf,
|
|
267
|
+
Uint8Array: methods.arrayBuffer,
|
|
268
|
+
Uint8ClampedArray: methods.arrayBuffer,
|
|
269
|
+
Uint16Array: methods.arrayBuffer,
|
|
270
|
+
Uint32Array: methods.arrayBuffer,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Create a custom copier based on custom options for any of the following:
|
|
276
|
+
* - `createCache` method to create a cache for copied objects
|
|
277
|
+
* - custom copier `methods` for specific object types
|
|
278
|
+
* - `strict` mode to copy all properties with their descriptors
|
|
279
|
+
*/
|
|
280
|
+
function createCopier(options = {}) {
|
|
281
|
+
const { createCache, copiers } = getOptions(options);
|
|
282
|
+
const { Array: copyArray, Object: copyObject } = copiers;
|
|
283
|
+
function copier(value, state) {
|
|
284
|
+
state.prototype = state.Constructor = undefined;
|
|
285
|
+
if (!value || typeof value !== 'object') {
|
|
286
|
+
return value;
|
|
287
|
+
}
|
|
288
|
+
if (state.cache.has(value)) {
|
|
289
|
+
return state.cache.get(value);
|
|
290
|
+
}
|
|
291
|
+
state.prototype = Object.getPrototypeOf(value);
|
|
292
|
+
// Using logical AND for speed, since optional chaining transforms to
|
|
293
|
+
// a local variable usage.
|
|
294
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
295
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
296
|
+
// plain objects
|
|
297
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
298
|
+
return copyObject(value, state);
|
|
299
|
+
}
|
|
300
|
+
// arrays
|
|
301
|
+
if (Array.isArray(value)) {
|
|
302
|
+
return copyArray(value, state);
|
|
303
|
+
}
|
|
304
|
+
const tagSpecificCopier = copiers[getTag(value)];
|
|
305
|
+
if (tagSpecificCopier) {
|
|
306
|
+
return tagSpecificCopier(value, state);
|
|
307
|
+
}
|
|
308
|
+
return typeof value.then === 'function' ? value : copyObject(value, state);
|
|
309
|
+
}
|
|
310
|
+
return function copy(value) {
|
|
311
|
+
return copier(value, {
|
|
312
|
+
Constructor: undefined,
|
|
313
|
+
cache: createCache(),
|
|
314
|
+
copier,
|
|
315
|
+
prototype: undefined,
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
321
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
322
|
+
* original property descriptors on both objects and arrays.
|
|
323
|
+
*/
|
|
324
|
+
const copyStrict = createCopier({ strict: true });
|
|
325
|
+
/**
|
|
326
|
+
* Copy an value deeply as much as possible.
|
|
327
|
+
*/
|
|
328
|
+
const copy = createCopier();
|
|
329
|
+
|
|
330
|
+
export { copy, copyStrict, createCopier };
|
|
331
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/utils.ts","../../../src/copier.ts","../../../src/options.ts","../../../src/index.ts"],"sourcesContent":["export interface Cache {\n has: (value: any) => boolean;\n set: (key: any, value: any) => void;\n get: (key: any) => any;\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toStringFunction = Function.prototype.toString;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toStringObject = Object.prototype.toString;\n\n/**\n * Get an empty version of the object with the same prototype it has.\n */\nexport function getCleanClone(prototype: any): any {\n if (!prototype) {\n return Object.create(null);\n }\n\n const Constructor = prototype.constructor;\n\n if (Constructor === Object) {\n return prototype === Object.prototype ? {} : Object.create(prototype as object | null);\n }\n\n if (Constructor && ~toStringFunction.call(Constructor).indexOf('[native code]')) {\n try {\n return new Constructor();\n } catch {\n // Ignore\n }\n }\n\n return Object.create(prototype as object | null);\n}\n\n/**\n * Get the tag of the value passed, so that the correct copier can be used.\n */\nexport function getTag(value: any): string {\n const stringTag = value[Symbol.toStringTag];\n\n if (stringTag) {\n return stringTag;\n }\n\n const type = toStringObject.call(value);\n\n return type.substring(8, type.length - 1);\n}\n","import { getCleanClone } from './utils.js';\nimport type { Cache } from './utils.ts';\n\nexport type InternalCopier<Value> = (value: Value, state: State) => Value;\n\nexport interface State {\n Constructor: any;\n cache: Cache;\n copier: InternalCopier<any>;\n prototype: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { propertyIsEnumerable } = Object.prototype;\n\nfunction copyOwnDescriptor<Value extends object>(\n original: Value,\n clone: Value,\n property: string | symbol,\n state: State,\n): void {\n const ownDescriptor = Object.getOwnPropertyDescriptor(original, property) || {\n configurable: true,\n enumerable: true,\n value: original[property as keyof Value],\n writable: true,\n };\n const descriptor =\n ownDescriptor.get || ownDescriptor.set\n ? ownDescriptor\n : {\n configurable: ownDescriptor.configurable,\n enumerable: ownDescriptor.enumerable,\n value: state.copier(ownDescriptor.value, state),\n writable: ownDescriptor.writable,\n };\n\n try {\n Object.defineProperty(clone, property, descriptor);\n } catch {\n // The above can fail on node in extreme edge cases, so fall back to the loose assignment.\n clone[property as keyof Value] = descriptor.get ? descriptor.get() : descriptor.value;\n }\n}\n\n/**\n * Strictly copy all properties contained on the object.\n */\nfunction copyOwnPropertiesStrict<Value extends object>(value: Value, clone: Value, state: State): Value {\n for (const name of Object.getOwnPropertyNames(value)) {\n copyOwnDescriptor(value, clone, name, state);\n }\n\n for (const symbol of Object.getOwnPropertySymbols(value)) {\n copyOwnDescriptor(value, clone, symbol, state);\n }\n\n return clone;\n}\n\n/**\n * Deeply copy the indexed values in the array.\n */\nexport function copyArrayLoose(array: any[], state: State) {\n const clone = new state.Constructor();\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(array, clone);\n\n for (let index = 0; index < array.length; ++index) {\n clone[index] = state.copier(array[index], state);\n }\n\n return clone;\n}\n\n/**\n * Deeply copy the indexed values in the array, as well as any custom properties.\n */\nexport function copyArrayStrict<Value extends any[]>(array: Value, state: State) {\n const clone = new state.Constructor() as Value;\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(array, clone);\n\n return copyOwnPropertiesStrict(array, clone, state);\n}\n\n/**\n * Copy the contents of the ArrayBuffer.\n */\nexport function copyArrayBuffer<Value extends ArrayBufferLike>(arrayBuffer: Value, _state: State): Value {\n return arrayBuffer.slice(0) as Value;\n}\n\n/**\n * Create a new Blob with the contents of the original.\n */\nexport function copyBlob<Value extends Blob>(blob: Value, _state: State): Value {\n return blob.slice(0, blob.size, blob.type) as Value;\n}\n\n/**\n * Create a new DataView with the contents of the original.\n */\nexport function copyDataView<Value extends DataView>(dataView: Value, state: State): Value {\n return new state.Constructor(copyArrayBuffer(dataView.buffer, state));\n}\n\n/**\n * Create a new Date based on the time of the original.\n */\nexport function copyDate<Value extends Date>(date: Value, state: State): Value {\n return new state.Constructor(date.getTime());\n}\n\n/**\n * Deeply copy the keys and values of the original.\n */\nexport function copyMapLoose<Value extends Map<any, any>>(map: Value, state: State): Value {\n const clone = new state.Constructor() as Value;\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(map, clone);\n\n for (const [key, value] of map) {\n clone.set(key, state.copier(value, state));\n }\n\n return clone;\n}\n\n/**\n * Deeply copy the keys and values of the original, as well as any custom properties.\n */\nexport function copyMapStrict<Value extends Map<any, any>>(map: Value, state: State) {\n return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);\n}\n\n/**\n * Deeply copy the properties (keys and symbols) and values of the original.\n */\nexport function copyObjectLoose<Value extends Record<string, any>>(object: Value, state: State): Value {\n const clone = getCleanClone(state.prototype);\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(object, clone);\n\n for (const key of Object.keys(object)) {\n clone[key] = state.copier(object[key], state);\n }\n\n for (const symbol of Object.getOwnPropertySymbols(object)) {\n if (propertyIsEnumerable.call(object, symbol)) {\n clone[symbol] = state.copier((object as any)[symbol], state);\n }\n }\n\n return clone;\n}\n\n/**\n * Deeply copy the properties (keys and symbols) and values of the original, as well\n * as any hidden or non-enumerable properties.\n */\nexport function copyObjectStrict<Value extends Record<string, any>>(object: Value, state: State): Value {\n const clone = getCleanClone(state.prototype);\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(object, clone);\n\n return copyOwnPropertiesStrict(object, clone, state);\n}\n\n/**\n * Create a new primitive wrapper from the value of the original.\n */\nexport function copyPrimitiveWrapper<\n // Specifically use the object constructor types\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\n Value extends Boolean | Number | String,\n>(primitiveObject: Value, state: State): Value {\n return new state.Constructor(primitiveObject.valueOf());\n}\n\n/**\n * Create a new RegExp based on the value and flags of the original.\n */\nexport function copyRegExp<Value extends RegExp>(regExp: Value, state: State): Value {\n const clone = new state.Constructor(regExp.source, regExp.flags) as Value;\n\n clone.lastIndex = regExp.lastIndex;\n\n return clone;\n}\n\n/**\n * Return the original value (an identity function).\n *\n * @note\n * THis is used for objects that cannot be copied, such as WeakMap.\n */\nexport function copySelf<Value>(value: Value, _state: State): Value {\n return value;\n}\n\n/**\n * Deeply copy the values of the original.\n */\nexport function copySetLoose<Value extends Set<any>>(set: Value, state: State): Value {\n const clone = new state.Constructor() as Value;\n\n // set in the cache immediately to be able to reuse the object recursively\n state.cache.set(set, clone);\n\n for (const value of set) {\n clone.add(state.copier(value, state));\n }\n\n return clone;\n}\n\n/**\n * Deeply copy the values of the original, as well as any custom properties.\n */\nexport function copySetStrict<Value extends Set<any>>(set: Value, state: State): Value {\n return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);\n}\n","import {\n copyArrayBuffer,\n copyArrayLoose,\n copyArrayStrict,\n copyBlob,\n copyDataView,\n copyDate,\n copyMapLoose,\n copyMapStrict,\n copyObjectLoose,\n copyObjectStrict,\n copyPrimitiveWrapper,\n copyRegExp,\n copySelf,\n copySetLoose,\n copySetStrict,\n} from './copier.js';\nimport type { InternalCopier } from './copier.ts';\nimport type { Cache } from './utils.ts';\n\nexport interface CopierMethods {\n array?: InternalCopier<any[]>;\n arrayBuffer?: InternalCopier<ArrayBuffer>;\n asyncGenerator?: InternalCopier<AsyncGenerator>;\n blob?: InternalCopier<Blob>;\n dataView?: InternalCopier<DataView>;\n date?: InternalCopier<Date>;\n error?: InternalCopier<Error>;\n generator?: InternalCopier<Generator>;\n map?: InternalCopier<Map<any, any>>;\n object?: InternalCopier<Record<string, any>>;\n regExp?: InternalCopier<RegExp>;\n set?: InternalCopier<Set<any>>;\n}\n\ninterface Copiers {\n [key: string]: InternalCopier<any> | undefined;\n\n Arguments: InternalCopier<Record<string, any>>;\n Array: InternalCopier<any[]>;\n ArrayBuffer: InternalCopier<ArrayBuffer>;\n AsyncGenerator: InternalCopier<AsyncGenerator>;\n BigInt64Array: InternalCopier<ArrayBuffer>;\n BigUint64Array: InternalCopier<ArrayBuffer>;\n Blob: InternalCopier<Blob>;\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\n Boolean: InternalCopier<Boolean>;\n DataView: InternalCopier<DataView>;\n Date: InternalCopier<Date>;\n Error: InternalCopier<Error>;\n Float32Array: InternalCopier<ArrayBuffer>;\n Float64Array: InternalCopier<ArrayBuffer>;\n Generator: InternalCopier<Generator>;\n Int8Array: InternalCopier<ArrayBuffer>;\n Int16Array: InternalCopier<ArrayBuffer>;\n Int32Array: InternalCopier<ArrayBuffer>;\n Map: InternalCopier<Map<any, any>>;\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\n Number: InternalCopier<Number>;\n Object: InternalCopier<Record<string, any>>;\n Promise: InternalCopier<Promise<any>>;\n RegExp: InternalCopier<RegExp>;\n Set: InternalCopier<Set<any>>;\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\n String: InternalCopier<String>;\n WeakMap: InternalCopier<WeakMap<any, any>>;\n WeakSet: InternalCopier<WeakSet<any>>;\n Uint8Array: InternalCopier<ArrayBuffer>;\n Uint8ClampedArray: InternalCopier<ArrayBuffer>;\n Uint16Array: InternalCopier<ArrayBuffer>;\n Uint32Array: InternalCopier<ArrayBuffer>;\n}\n\nexport interface CreateCopierOptions {\n createCache?: () => Cache;\n methods?: CopierMethods;\n strict?: boolean;\n}\n\nexport interface RequiredCreateCopierOptions extends Omit<Required<CreateCopierOptions>, 'methods'> {\n copiers: Copiers;\n methods: Required<CopierMethods>;\n}\n\nexport function createDefaultCache(): Cache {\n return new WeakMap();\n}\n\nexport function getOptions({\n createCache: createCacheOverride,\n methods: methodsOverride,\n strict,\n}: CreateCopierOptions): RequiredCreateCopierOptions {\n const defaultMethods = {\n array: strict ? copyArrayStrict : copyArrayLoose,\n arrayBuffer: copyArrayBuffer,\n asyncGenerator: copySelf,\n blob: copyBlob,\n dataView: copyDataView,\n date: copyDate,\n error: copySelf,\n generator: copySelf,\n map: strict ? copyMapStrict : copyMapLoose,\n object: strict ? copyObjectStrict : copyObjectLoose,\n regExp: copyRegExp,\n set: strict ? copySetStrict : copySetLoose,\n };\n\n const methods = methodsOverride ? Object.assign(defaultMethods, methodsOverride) : defaultMethods;\n const copiers = getTagSpecificCopiers(methods);\n const createCache = createCacheOverride || createDefaultCache;\n\n // Extra safety check to ensure that object and array copiers are always provided,\n // avoiding runtime errors.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!copiers.Object || !copiers.Array) {\n throw new Error('An object and array copier must be provided.');\n }\n\n return { createCache, copiers, methods, strict: Boolean(strict) };\n}\n\n/**\n * Get the copiers used for each specific object tag.\n */\nexport function getTagSpecificCopiers(methods: Required<CopierMethods>): Copiers {\n return {\n Arguments: methods.object,\n Array: methods.array,\n ArrayBuffer: methods.arrayBuffer,\n AsyncGenerator: methods.asyncGenerator,\n BigInt64Array: methods.arrayBuffer,\n BigUint64Array: methods.arrayBuffer,\n Blob: methods.blob,\n Boolean: copyPrimitiveWrapper,\n DataView: methods.dataView,\n Date: methods.date,\n Error: methods.error,\n Float32Array: methods.arrayBuffer,\n Float64Array: methods.arrayBuffer,\n Generator: methods.generator,\n Int8Array: methods.arrayBuffer,\n Int16Array: methods.arrayBuffer,\n Int32Array: methods.arrayBuffer,\n Map: methods.map,\n Number: copyPrimitiveWrapper,\n Object: methods.object,\n Promise: copySelf,\n RegExp: methods.regExp,\n Set: methods.set,\n String: copyPrimitiveWrapper,\n WeakMap: copySelf,\n WeakSet: copySelf,\n Uint8Array: methods.arrayBuffer,\n Uint8ClampedArray: methods.arrayBuffer,\n Uint16Array: methods.arrayBuffer,\n Uint32Array: methods.arrayBuffer,\n };\n}\n","import type { State } from './copier.ts';\nimport { getOptions } from './options.js';\nimport type { CreateCopierOptions } from './options.ts';\nimport { getTag } from './utils.js';\n\nexport type { State } from './copier.ts';\nexport type { CreateCopierOptions } from './options.ts';\n\n/**\n * Create a custom copier based on custom options for any of the following:\n * - `createCache` method to create a cache for copied objects\n * - custom copier `methods` for specific object types\n * - `strict` mode to copy all properties with their descriptors\n */\nexport function createCopier(options: CreateCopierOptions = {}) {\n const { createCache, copiers } = getOptions(options);\n const { Array: copyArray, Object: copyObject } = copiers;\n\n function copier(value: any, state: State): any {\n state.prototype = state.Constructor = undefined;\n\n if (!value || typeof value !== 'object') {\n return value;\n }\n\n if (state.cache.has(value)) {\n return state.cache.get(value);\n }\n\n state.prototype = Object.getPrototypeOf(value);\n // Using logical AND for speed, since optional chaining transforms to\n // a local variable usage.\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n state.Constructor = state.prototype && state.prototype.constructor;\n\n // plain objects\n if (!state.Constructor || state.Constructor === Object) {\n return copyObject(value as Record<string, any>, state);\n }\n\n // arrays\n if (Array.isArray(value)) {\n return copyArray(value, state);\n }\n\n const tagSpecificCopier = copiers[getTag(value)];\n\n if (tagSpecificCopier) {\n return tagSpecificCopier(value, state);\n }\n\n return typeof value.then === 'function' ? value : copyObject(value as Record<string, any>, state);\n }\n\n return function copy<Value>(value: Value): Value {\n return copier(value, {\n Constructor: undefined,\n cache: createCache(),\n copier,\n prototype: undefined,\n });\n };\n}\n\n/**\n * Copy an value deeply as much as possible, where strict recreation of object properties\n * are maintained. All properties (including non-enumerable ones) are copied with their\n * original property descriptors on both objects and arrays.\n */\nexport const copyStrict = createCopier({ strict: true });\n\n/**\n * Copy an value deeply as much as possible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;AACN,YAAA,SAAS,EAAE,SAAS;AACrB,SAAA,CAAC;AACJ,IAAA,CAAC;AACH;AAEA;;;;AAIG;AACI,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;AAEvD;;AAEG;AACI,MAAM,IAAI,GAAG,YAAY;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface Cache {
|
|
2
|
+
has: (value: any) => boolean;
|
|
3
|
+
set: (key: any, value: any) => void;
|
|
4
|
+
get: (key: any) => any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type InternalCopier<Value> = (value: Value, state: State) => Value;
|
|
8
|
+
interface State {
|
|
9
|
+
Constructor: any;
|
|
10
|
+
cache: Cache;
|
|
11
|
+
copier: InternalCopier<any>;
|
|
12
|
+
prototype: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface CopierMethods {
|
|
16
|
+
array?: InternalCopier<any[]>;
|
|
17
|
+
arrayBuffer?: InternalCopier<ArrayBuffer>;
|
|
18
|
+
asyncGenerator?: InternalCopier<AsyncGenerator>;
|
|
19
|
+
blob?: InternalCopier<Blob>;
|
|
20
|
+
dataView?: InternalCopier<DataView>;
|
|
21
|
+
date?: InternalCopier<Date>;
|
|
22
|
+
error?: InternalCopier<Error>;
|
|
23
|
+
generator?: InternalCopier<Generator>;
|
|
24
|
+
map?: InternalCopier<Map<any, any>>;
|
|
25
|
+
object?: InternalCopier<Record<string, any>>;
|
|
26
|
+
regExp?: InternalCopier<RegExp>;
|
|
27
|
+
set?: InternalCopier<Set<any>>;
|
|
28
|
+
}
|
|
29
|
+
interface CreateCopierOptions {
|
|
30
|
+
createCache?: () => Cache;
|
|
31
|
+
methods?: CopierMethods;
|
|
32
|
+
strict?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a custom copier based on custom options for any of the following:
|
|
37
|
+
* - `createCache` method to create a cache for copied objects
|
|
38
|
+
* - custom copier `methods` for specific object types
|
|
39
|
+
* - `strict` mode to copy all properties with their descriptors
|
|
40
|
+
*/
|
|
41
|
+
declare function createCopier(options?: CreateCopierOptions): <Value>(value: Value) => Value;
|
|
42
|
+
/**
|
|
43
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
44
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
45
|
+
* original property descriptors on both objects and arrays.
|
|
46
|
+
*/
|
|
47
|
+
declare const copyStrict: <Value>(value: Value) => Value;
|
|
48
|
+
/**
|
|
49
|
+
* Copy an value deeply as much as possible.
|
|
50
|
+
*/
|
|
51
|
+
declare const copy: <Value>(value: Value) => Value;
|
|
52
|
+
|
|
53
|
+
export { copy, copyStrict, createCopier };
|
|
54
|
+
export type { CreateCopierOptions, State };
|