@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,412 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["fast-copy"] = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var toStringFunction = Function.prototype.toString;
|
|
8
|
+
var create = Object.create;
|
|
9
|
+
var toStringObject = Object.prototype.toString;
|
|
10
|
+
/**
|
|
11
|
+
* @classdesc Fallback cache for when WeakMap is not natively supported
|
|
12
|
+
*/
|
|
13
|
+
var LegacyCache = /** @class */ (function () {
|
|
14
|
+
function LegacyCache() {
|
|
15
|
+
this._keys = [];
|
|
16
|
+
this._values = [];
|
|
17
|
+
}
|
|
18
|
+
LegacyCache.prototype.has = function (key) {
|
|
19
|
+
return !!~this._keys.indexOf(key);
|
|
20
|
+
};
|
|
21
|
+
LegacyCache.prototype.get = function (key) {
|
|
22
|
+
return this._values[this._keys.indexOf(key)];
|
|
23
|
+
};
|
|
24
|
+
LegacyCache.prototype.set = function (key, value) {
|
|
25
|
+
this._keys.push(key);
|
|
26
|
+
this._values.push(value);
|
|
27
|
+
};
|
|
28
|
+
return LegacyCache;
|
|
29
|
+
}());
|
|
30
|
+
function createCacheLegacy() {
|
|
31
|
+
return new LegacyCache();
|
|
32
|
+
}
|
|
33
|
+
function createCacheModern() {
|
|
34
|
+
return new WeakMap();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get a new cache object to prevent circular references.
|
|
38
|
+
*/
|
|
39
|
+
var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
|
|
40
|
+
/**
|
|
41
|
+
* Get an empty version of the object with the same prototype it has.
|
|
42
|
+
*/
|
|
43
|
+
function getCleanClone(prototype) {
|
|
44
|
+
if (!prototype) {
|
|
45
|
+
return create(null);
|
|
46
|
+
}
|
|
47
|
+
var Constructor = prototype.constructor;
|
|
48
|
+
if (Constructor === Object) {
|
|
49
|
+
return prototype === Object.prototype ? {} : create(prototype);
|
|
50
|
+
}
|
|
51
|
+
if (Constructor &&
|
|
52
|
+
~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
53
|
+
try {
|
|
54
|
+
return new Constructor();
|
|
55
|
+
}
|
|
56
|
+
catch (_a) { }
|
|
57
|
+
}
|
|
58
|
+
return create(prototype);
|
|
59
|
+
}
|
|
60
|
+
function getRegExpFlagsLegacy(regExp) {
|
|
61
|
+
var flags = '';
|
|
62
|
+
if (regExp.global) {
|
|
63
|
+
flags += 'g';
|
|
64
|
+
}
|
|
65
|
+
if (regExp.ignoreCase) {
|
|
66
|
+
flags += 'i';
|
|
67
|
+
}
|
|
68
|
+
if (regExp.multiline) {
|
|
69
|
+
flags += 'm';
|
|
70
|
+
}
|
|
71
|
+
if (regExp.unicode) {
|
|
72
|
+
flags += 'u';
|
|
73
|
+
}
|
|
74
|
+
if (regExp.sticky) {
|
|
75
|
+
flags += 'y';
|
|
76
|
+
}
|
|
77
|
+
return flags;
|
|
78
|
+
}
|
|
79
|
+
function getRegExpFlagsModern(regExp) {
|
|
80
|
+
return regExp.flags;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the flags to apply to the copied regexp.
|
|
84
|
+
*/
|
|
85
|
+
var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
|
|
86
|
+
function getTagLegacy(value) {
|
|
87
|
+
var type = toStringObject.call(value);
|
|
88
|
+
return type.substring(8, type.length - 1);
|
|
89
|
+
}
|
|
90
|
+
function getTagModern(value) {
|
|
91
|
+
return value[Symbol.toStringTag] || getTagLegacy(value);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the tag of the value passed, so that the correct copier can be used.
|
|
95
|
+
*/
|
|
96
|
+
var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
|
|
97
|
+
|
|
98
|
+
var defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
99
|
+
var _a = Object.prototype, hasOwnProperty = _a.hasOwnProperty, propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
100
|
+
var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
|
|
101
|
+
function getStrictPropertiesModern(object) {
|
|
102
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the properites used when copying objects strictly. This includes both keys and symbols.
|
|
106
|
+
*/
|
|
107
|
+
var getStrictProperties = SUPPORTS_SYMBOL
|
|
108
|
+
? getStrictPropertiesModern
|
|
109
|
+
: getOwnPropertyNames;
|
|
110
|
+
/**
|
|
111
|
+
* Striclty copy all properties contained on the object.
|
|
112
|
+
*/
|
|
113
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
114
|
+
var properties = getStrictProperties(value);
|
|
115
|
+
for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
|
|
116
|
+
property = properties[index];
|
|
117
|
+
if (property === 'callee' || property === 'caller') {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
descriptor = getOwnPropertyDescriptor(value, property);
|
|
121
|
+
if (!descriptor) {
|
|
122
|
+
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
123
|
+
// the loose assignment.
|
|
124
|
+
clone[property] = state.copier(value[property], state);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
// Only clone the value if actually a value, not a getter / setter.
|
|
128
|
+
if (!descriptor.get && !descriptor.set) {
|
|
129
|
+
descriptor.value = state.copier(descriptor.value, state);
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
defineProperty(clone, property, descriptor);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
136
|
+
clone[property] = descriptor.value;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return clone;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Deeply copy the indexed values in the array.
|
|
143
|
+
*/
|
|
144
|
+
function copyArrayLoose(array, state) {
|
|
145
|
+
var clone = new state.Constructor();
|
|
146
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
147
|
+
state.cache.set(array, clone);
|
|
148
|
+
for (var index = 0, length_2 = array.length; index < length_2; ++index) {
|
|
149
|
+
clone[index] = state.copier(array[index], state);
|
|
150
|
+
}
|
|
151
|
+
return clone;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Deeply copy the indexed values in the array, as well as any custom properties.
|
|
155
|
+
*/
|
|
156
|
+
function copyArrayStrict(array, state) {
|
|
157
|
+
var clone = new state.Constructor();
|
|
158
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
159
|
+
state.cache.set(array, clone);
|
|
160
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Copy the contents of the ArrayBuffer.
|
|
164
|
+
*/
|
|
165
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
166
|
+
return arrayBuffer.slice(0);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Create a new Blob with the contents of the original.
|
|
170
|
+
*/
|
|
171
|
+
function copyBlob(blob, _state) {
|
|
172
|
+
return blob.slice(0, blob.size, blob.type);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Create a new DataView with the contents of the original.
|
|
176
|
+
*/
|
|
177
|
+
function copyDataView(dataView, state) {
|
|
178
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Create a new Date based on the time of the original.
|
|
182
|
+
*/
|
|
183
|
+
function copyDate(date, state) {
|
|
184
|
+
return new state.Constructor(date.getTime());
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Deeply copy the keys and values of the original.
|
|
188
|
+
*/
|
|
189
|
+
function copyMapLoose(map, state) {
|
|
190
|
+
var clone = new state.Constructor();
|
|
191
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
192
|
+
state.cache.set(map, clone);
|
|
193
|
+
map.forEach(function (value, key) {
|
|
194
|
+
clone.set(key, state.copier(value, state));
|
|
195
|
+
});
|
|
196
|
+
return clone;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Deeply copy the keys and values of the original, as well as any custom properties.
|
|
200
|
+
*/
|
|
201
|
+
function copyMapStrict(map, state) {
|
|
202
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
203
|
+
}
|
|
204
|
+
function copyObjectLooseLegacy(object, state) {
|
|
205
|
+
var clone = getCleanClone(state.prototype);
|
|
206
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
207
|
+
state.cache.set(object, clone);
|
|
208
|
+
for (var key in object) {
|
|
209
|
+
if (hasOwnProperty.call(object, key)) {
|
|
210
|
+
clone[key] = state.copier(object[key], state);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return clone;
|
|
214
|
+
}
|
|
215
|
+
function copyObjectLooseModern(object, state) {
|
|
216
|
+
var clone = getCleanClone(state.prototype);
|
|
217
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
218
|
+
state.cache.set(object, clone);
|
|
219
|
+
for (var key in object) {
|
|
220
|
+
if (hasOwnProperty.call(object, key)) {
|
|
221
|
+
clone[key] = state.copier(object[key], state);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
var symbols = getOwnPropertySymbols(object);
|
|
225
|
+
for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
|
|
226
|
+
symbol = symbols[index];
|
|
227
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
228
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return clone;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Deeply copy the properties (keys and symbols) and values of the original.
|
|
235
|
+
*/
|
|
236
|
+
var copyObjectLoose = SUPPORTS_SYMBOL
|
|
237
|
+
? copyObjectLooseModern
|
|
238
|
+
: copyObjectLooseLegacy;
|
|
239
|
+
/**
|
|
240
|
+
* Deeply copy the properties (keys and symbols) and values of the original, as well
|
|
241
|
+
* as any hidden or non-enumerable properties.
|
|
242
|
+
*/
|
|
243
|
+
function copyObjectStrict(object, state) {
|
|
244
|
+
var clone = getCleanClone(state.prototype);
|
|
245
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
246
|
+
state.cache.set(object, clone);
|
|
247
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Create a new primitive wrapper from the value of the original.
|
|
251
|
+
*/
|
|
252
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
253
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Create a new RegExp based on the value and flags of the original.
|
|
257
|
+
*/
|
|
258
|
+
function copyRegExp(regExp, state) {
|
|
259
|
+
var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
|
|
260
|
+
clone.lastIndex = regExp.lastIndex;
|
|
261
|
+
return clone;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Return the original value (an identity function).
|
|
265
|
+
*
|
|
266
|
+
* @note
|
|
267
|
+
* THis is used for objects that cannot be copied, such as WeakMap.
|
|
268
|
+
*/
|
|
269
|
+
function copySelf(value, _state) {
|
|
270
|
+
return value;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Deeply copy the values of the original.
|
|
274
|
+
*/
|
|
275
|
+
function copySetLoose(set, state) {
|
|
276
|
+
var clone = new state.Constructor();
|
|
277
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
278
|
+
state.cache.set(set, clone);
|
|
279
|
+
set.forEach(function (value) {
|
|
280
|
+
clone.add(state.copier(value, state));
|
|
281
|
+
});
|
|
282
|
+
return clone;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Deeply copy the values of the original, as well as any custom properties.
|
|
286
|
+
*/
|
|
287
|
+
function copySetStrict(set, state) {
|
|
288
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
var isArray = Array.isArray;
|
|
292
|
+
var assign = Object.assign;
|
|
293
|
+
var getPrototypeOf = Object.getPrototypeOf || (function (obj) { return obj.__proto__; });
|
|
294
|
+
var DEFAULT_LOOSE_OPTIONS = {
|
|
295
|
+
array: copyArrayLoose,
|
|
296
|
+
arrayBuffer: copyArrayBuffer,
|
|
297
|
+
blob: copyBlob,
|
|
298
|
+
dataView: copyDataView,
|
|
299
|
+
date: copyDate,
|
|
300
|
+
error: copySelf,
|
|
301
|
+
map: copyMapLoose,
|
|
302
|
+
object: copyObjectLoose,
|
|
303
|
+
regExp: copyRegExp,
|
|
304
|
+
set: copySetLoose,
|
|
305
|
+
};
|
|
306
|
+
var DEFAULT_STRICT_OPTIONS = assign({}, DEFAULT_LOOSE_OPTIONS, {
|
|
307
|
+
array: copyArrayStrict,
|
|
308
|
+
map: copyMapStrict,
|
|
309
|
+
object: copyObjectStrict,
|
|
310
|
+
set: copySetStrict,
|
|
311
|
+
});
|
|
312
|
+
/**
|
|
313
|
+
* Get the copiers used for each specific object tag.
|
|
314
|
+
*/
|
|
315
|
+
function getTagSpecificCopiers(options) {
|
|
316
|
+
return {
|
|
317
|
+
Arguments: options.object,
|
|
318
|
+
Array: options.array,
|
|
319
|
+
ArrayBuffer: options.arrayBuffer,
|
|
320
|
+
Blob: options.blob,
|
|
321
|
+
Boolean: copyPrimitiveWrapper,
|
|
322
|
+
DataView: options.dataView,
|
|
323
|
+
Date: options.date,
|
|
324
|
+
Error: options.error,
|
|
325
|
+
Float32Array: options.arrayBuffer,
|
|
326
|
+
Float64Array: options.arrayBuffer,
|
|
327
|
+
Int8Array: options.arrayBuffer,
|
|
328
|
+
Int16Array: options.arrayBuffer,
|
|
329
|
+
Int32Array: options.arrayBuffer,
|
|
330
|
+
Map: options.map,
|
|
331
|
+
Number: copyPrimitiveWrapper,
|
|
332
|
+
Object: options.object,
|
|
333
|
+
Promise: copySelf,
|
|
334
|
+
RegExp: options.regExp,
|
|
335
|
+
Set: options.set,
|
|
336
|
+
String: copyPrimitiveWrapper,
|
|
337
|
+
WeakMap: copySelf,
|
|
338
|
+
WeakSet: copySelf,
|
|
339
|
+
Uint8Array: options.arrayBuffer,
|
|
340
|
+
Uint8ClampedArray: options.arrayBuffer,
|
|
341
|
+
Uint16Array: options.arrayBuffer,
|
|
342
|
+
Uint32Array: options.arrayBuffer,
|
|
343
|
+
Uint64Array: options.arrayBuffer,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Create a custom copier based on the object-specific copy methods passed.
|
|
348
|
+
*/
|
|
349
|
+
function createCopier(options) {
|
|
350
|
+
var normalizedOptions = assign({}, DEFAULT_LOOSE_OPTIONS, options);
|
|
351
|
+
var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
|
|
352
|
+
var array = tagSpecificCopiers.Array, object = tagSpecificCopiers.Object;
|
|
353
|
+
function copier(value, state) {
|
|
354
|
+
state.prototype = state.Constructor = undefined;
|
|
355
|
+
if (!value || typeof value !== 'object') {
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
358
|
+
if (state.cache.has(value)) {
|
|
359
|
+
return state.cache.get(value);
|
|
360
|
+
}
|
|
361
|
+
state.prototype = getPrototypeOf(value);
|
|
362
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
363
|
+
// plain objects
|
|
364
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
365
|
+
return object(value, state);
|
|
366
|
+
}
|
|
367
|
+
// arrays
|
|
368
|
+
if (isArray(value)) {
|
|
369
|
+
return array(value, state);
|
|
370
|
+
}
|
|
371
|
+
var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
|
|
372
|
+
if (tagSpecificCopier) {
|
|
373
|
+
return tagSpecificCopier(value, state);
|
|
374
|
+
}
|
|
375
|
+
return typeof value.then === 'function' ? value : object(value, state);
|
|
376
|
+
}
|
|
377
|
+
return function copy(value) {
|
|
378
|
+
return copier(value, {
|
|
379
|
+
Constructor: undefined,
|
|
380
|
+
cache: createCache(),
|
|
381
|
+
copier: copier,
|
|
382
|
+
prototype: undefined,
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Create a custom copier based on the object-specific copy methods passed, defaulting to the
|
|
388
|
+
* same internals as `copyStrict`.
|
|
389
|
+
*/
|
|
390
|
+
function createStrictCopier(options) {
|
|
391
|
+
return createCopier(assign({}, DEFAULT_STRICT_OPTIONS, options));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
395
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
396
|
+
* original property descriptors on both objects and arrays.
|
|
397
|
+
*/
|
|
398
|
+
var copyStrict = createStrictCopier({});
|
|
399
|
+
/**
|
|
400
|
+
* Copy an value deeply as much as possible.
|
|
401
|
+
*/
|
|
402
|
+
var index = createCopier({});
|
|
403
|
+
|
|
404
|
+
exports.copyStrict = copyStrict;
|
|
405
|
+
exports.createCopier = createCopier;
|
|
406
|
+
exports.createStrictCopier = createStrictCopier;
|
|
407
|
+
exports.default = index;
|
|
408
|
+
|
|
409
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
410
|
+
|
|
411
|
+
}));
|
|
412
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/utils.ts","../../../../src/copier.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\nconst { toString: toStringFunction } = Function.prototype;\nconst { create } = Object;\nconst { toString: toStringObject } = Object.prototype;\n\n/**\n * @classdesc Fallback cache for when WeakMap is not natively supported\n */\nclass LegacyCache {\n private _keys: any[] = [];\n private _values: any[] = [];\n\n has(key: any) {\n return !!~this._keys.indexOf(key);\n }\n\n get(key: any) {\n return this._values[this._keys.indexOf(key)];\n }\n\n set(key: any, value: any) {\n this._keys.push(key);\n this._values.push(value);\n }\n}\n\nfunction createCacheLegacy(): Cache {\n return new LegacyCache();\n}\n\nfunction createCacheModern(): Cache {\n return new WeakMap();\n}\n\n/**\n * Get a new cache object to prevent circular references.\n */\nexport const createCache =\n typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;\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 create(null);\n }\n\n const Constructor = prototype.constructor;\n\n if (Constructor === Object) {\n return prototype === Object.prototype ? {} : create(prototype);\n }\n\n if (\n Constructor &&\n ~toStringFunction.call(Constructor).indexOf('[native code]')\n ) {\n try {\n return new Constructor();\n } catch {}\n }\n\n return create(prototype);\n}\n\nfunction getRegExpFlagsLegacy(regExp: RegExp): string {\n let flags = '';\n\n if (regExp.global) {\n flags += 'g';\n }\n\n if (regExp.ignoreCase) {\n flags += 'i';\n }\n\n if (regExp.multiline) {\n flags += 'm';\n }\n\n if (regExp.unicode) {\n flags += 'u';\n }\n\n if (regExp.sticky) {\n flags += 'y';\n }\n\n return flags;\n}\n\nfunction getRegExpFlagsModern(regExp: RegExp): string {\n return regExp.flags;\n}\n\n/**\n * Get the flags to apply to the copied regexp.\n */\nexport const getRegExpFlags =\n /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;\n\nfunction getTagLegacy(value: any): string {\n const type = toStringObject.call(value);\n\n return type.substring(8, type.length - 1);\n}\n\nfunction getTagModern(value: any): string {\n return value[Symbol.toStringTag] || getTagLegacy(value);\n}\n\n/**\n * Get the tag of the value passed, so that the correct copier can be used.\n */\nexport const getTag =\n typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;\n","import { getCleanClone, getRegExpFlags } from './utils';\n\nimport type { Cache } from './utils';\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\nconst {\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n} = Object;\nconst { hasOwnProperty, propertyIsEnumerable } = Object.prototype;\n\nconst SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';\n\nfunction getStrictPropertiesModern(object: any): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(\n getOwnPropertySymbols(object)\n );\n}\n\n/**\n * Get the properites used when copying objects strictly. This includes both keys and symbols.\n */\nconst getStrictProperties = SUPPORTS_SYMBOL\n ? getStrictPropertiesModern\n : getOwnPropertyNames;\n\n/**\n * Striclty copy all properties contained on the object.\n */\nfunction copyOwnPropertiesStrict<Value>(\n value: Value,\n clone: Value,\n state: State\n): Value {\n const properties = getStrictProperties(value);\n\n for (\n let index = 0, length = properties.length, property, descriptor;\n index < length;\n ++index\n ) {\n property = properties[index];\n\n if (property === 'callee' || property === 'caller') {\n continue;\n }\n\n descriptor = getOwnPropertyDescriptor(value, property);\n\n if (!descriptor) {\n // In extra edge cases where the property descriptor cannot be retrived, fall back to\n // the loose assignment.\n (clone as any)[property] = state.copier((value as any)[property], state);\n continue;\n }\n\n // Only clone the value if actually a value, not a getter / setter.\n if (!descriptor.get && !descriptor.set) {\n descriptor.value = state.copier(descriptor.value, state);\n }\n\n try {\n defineProperty(clone, property, descriptor);\n } catch (error) {\n // Tee above can fail on node in edge cases, so fall back to the loose assignment.\n (clone as any)[property] = descriptor.value;\n }\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, length = array.length; index < 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[]>(\n array: Value,\n state: State\n) {\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 ArrayBuffer>(\n arrayBuffer: Value,\n _state: State\n): 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>(\n blob: Value,\n _state: State\n): 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>(\n dataView: Value,\n state: State\n): 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>>(\n map: Value,\n state: State\n): 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 map.forEach((value, key) => {\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>>(\n map: Value,\n state: State\n) {\n return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);\n}\n\nfunction copyObjectLooseLegacy<Value extends Record<string, any>>(\n object: Value,\n state: State\n): Value {\n const clone: any = 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 in object) {\n if (hasOwnProperty.call(object, key)) {\n clone[key] = state.copier(object[key], state);\n }\n }\n\n return clone;\n}\n\nfunction copyObjectLooseModern<Value extends Record<string, any>>(\n object: Value,\n state: State\n): 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 in object) {\n if (hasOwnProperty.call(object, key)) {\n clone[key] = state.copier(object[key], state);\n }\n }\n\n const symbols = getOwnPropertySymbols(object);\n\n for (\n let index = 0, length = symbols.length, symbol;\n index < length;\n ++index\n ) {\n symbol = symbols[index];\n\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.\n */\nexport const copyObjectLoose = SUPPORTS_SYMBOL\n ? copyObjectLooseModern\n : copyObjectLooseLegacy;\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>>(\n object: Value,\n state: State\n): 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/ban-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>(\n regExp: Value,\n state: State\n): Value {\n const clone = new state.Constructor(\n regExp.source,\n getRegExpFlags(regExp)\n ) 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>>(\n set: Value,\n state: State\n): 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 set.forEach((value) => {\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>>(\n set: Value,\n state: State\n): 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';\nimport { createCache, getTag } from './utils';\n\nimport type { InternalCopier, State } from './copier';\n\nexport type { State } from './copier';\n\nconst { isArray } = Array;\nconst { assign } = Object;\nconst getPrototypeOf = Object.getPrototypeOf || ((obj) => obj.__proto__)\n\nexport interface CreateCopierOptions {\n array?: InternalCopier<any[]>;\n arrayBuffer?: InternalCopier<ArrayBuffer>;\n blob?: InternalCopier<Blob>;\n dataView?: InternalCopier<DataView>;\n date?: InternalCopier<Date>;\n error?: InternalCopier<any>;\n map?: InternalCopier<Map<any, any>>;\n object?: InternalCopier<Record<string, any>>;\n regExp?: InternalCopier<RegExp>;\n set?: InternalCopier<Set<any>>;\n}\n\nconst DEFAULT_LOOSE_OPTIONS: Required<CreateCopierOptions> = {\n array: copyArrayLoose,\n arrayBuffer: copyArrayBuffer,\n blob: copyBlob,\n dataView: copyDataView,\n date: copyDate,\n error: copySelf,\n map: copyMapLoose,\n object: copyObjectLoose,\n regExp: copyRegExp,\n set: copySetLoose,\n};\nconst DEFAULT_STRICT_OPTIONS: Required<CreateCopierOptions> = assign(\n {},\n DEFAULT_LOOSE_OPTIONS,\n {\n array: copyArrayStrict,\n map: copyMapStrict,\n object: copyObjectStrict,\n set: copySetStrict,\n }\n);\n\n/**\n * Get the copiers used for each specific object tag.\n */\nfunction getTagSpecificCopiers(\n options: Required<CreateCopierOptions>\n): Record<string, InternalCopier<any>> {\n return {\n Arguments: options.object,\n Array: options.array,\n ArrayBuffer: options.arrayBuffer,\n Blob: options.blob,\n Boolean: copyPrimitiveWrapper,\n DataView: options.dataView,\n Date: options.date,\n Error: options.error,\n Float32Array: options.arrayBuffer,\n Float64Array: options.arrayBuffer,\n Int8Array: options.arrayBuffer,\n Int16Array: options.arrayBuffer,\n Int32Array: options.arrayBuffer,\n Map: options.map,\n Number: copyPrimitiveWrapper,\n Object: options.object,\n Promise: copySelf,\n RegExp: options.regExp,\n Set: options.set,\n String: copyPrimitiveWrapper,\n WeakMap: copySelf,\n WeakSet: copySelf,\n Uint8Array: options.arrayBuffer,\n Uint8ClampedArray: options.arrayBuffer,\n Uint16Array: options.arrayBuffer,\n Uint32Array: options.arrayBuffer,\n Uint64Array: options.arrayBuffer,\n };\n}\n\n/**\n * Create a custom copier based on the object-specific copy methods passed.\n */\nexport function createCopier(options: CreateCopierOptions) {\n const normalizedOptions = assign({}, DEFAULT_LOOSE_OPTIONS, options);\n const tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);\n const { Array: array, Object: object } = tagSpecificCopiers;\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 = getPrototypeOf(value);\n state.Constructor = state.prototype && state.prototype.constructor;\n\n // plain objects\n if (!state.Constructor || state.Constructor === Object) {\n return object(value, state);\n }\n\n // arrays\n if (isArray(value)) {\n return array(value, state);\n }\n\n const tagSpecificCopier = tagSpecificCopiers[getTag(value)];\n\n if (tagSpecificCopier) {\n return tagSpecificCopier(value, state);\n }\n\n return typeof value.then === 'function' ? value : object(value, 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 * Create a custom copier based on the object-specific copy methods passed, defaulting to the\n * same internals as `copyStrict`.\n */\nexport function createStrictCopier(options: CreateCopierOptions) {\n return createCopier(assign({}, DEFAULT_STRICT_OPTIONS, options));\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 = createStrictCopier({});\n\n/**\n * Copy an value deeply as much as possible.\n */\nexport default createCopier({});\n"],"names":[],"mappings":";;;;;;IAMQ,IAAU,gBAAgB,GAAK,QAAQ,CAAC,SAAS,SAAvB,CAAwB;IAClD,IAAA,MAAM,GAAK,MAAM,CAAA,MAAX,CAAY;IAClB,IAAU,cAAc,GAAK,MAAM,CAAC,SAAS,SAArB,CAAsB;IAEtD;;IAEG;IACH,IAAA,WAAA,kBAAA,YAAA;IAAA,IAAA,SAAA,WAAA,GAAA;YACU,IAAK,CAAA,KAAA,GAAU,EAAE,CAAC;YAClB,IAAO,CAAA,OAAA,GAAU,EAAE,CAAC;SAc7B;QAZC,WAAG,CAAA,SAAA,CAAA,GAAA,GAAH,UAAI,GAAQ,EAAA;YACV,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SACnC,CAAA;QAED,WAAG,CAAA,SAAA,CAAA,GAAA,GAAH,UAAI,GAAQ,EAAA;IACV,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;SAC9C,CAAA;IAED,IAAA,WAAA,CAAA,SAAA,CAAA,GAAG,GAAH,UAAI,GAAQ,EAAE,KAAU,EAAA;IACtB,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1B,CAAA;QACH,OAAC,WAAA,CAAA;IAAD,CAAC,EAAA,CAAA,CAAA;IAED,SAAS,iBAAiB,GAAA;QACxB,OA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AG,kBAAkB,CAAC,EAAE,EAAE;IAEjD;;IAEG;AACH,gBAAe,YAAY,CAAC,EAAE,CAAC;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
interface Cache {
|
|
2
|
+
_keys?: any[];
|
|
3
|
+
_values?: any[];
|
|
4
|
+
has: (value: any) => boolean;
|
|
5
|
+
set: (key: any, value: any) => void;
|
|
6
|
+
get: (key: any) => any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface CreateCopierOptions {
|
|
10
|
+
array?: InternalCopier<any[]>;
|
|
11
|
+
arrayBuffer?: InternalCopier<ArrayBuffer>;
|
|
12
|
+
blob?: InternalCopier<Blob>;
|
|
13
|
+
dataView?: InternalCopier<DataView>;
|
|
14
|
+
date?: InternalCopier<Date>;
|
|
15
|
+
map?: InternalCopier<Map<any, any>>;
|
|
16
|
+
object?: InternalCopier<Record<string, any>>;
|
|
17
|
+
regExp?: InternalCopier<RegExp>;
|
|
18
|
+
set?: InternalCopier<Set<any>>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type InternalCopier<Value> = (value: Value, state: State) => Value;
|
|
22
|
+
|
|
23
|
+
export interface State {
|
|
24
|
+
Constructor: any;
|
|
25
|
+
cache: Cache;
|
|
26
|
+
copier: InternalCopier<any>;
|
|
27
|
+
prototype: any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Copy an value deeply as much as possible.
|
|
32
|
+
*/
|
|
33
|
+
export default function copy<Value>(value: Value): Value;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
37
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
38
|
+
* original property descriptors on both objects and arrays.
|
|
39
|
+
*/
|
|
40
|
+
export function copyStrict<Value>(value: Value): Value;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a custom copier based on the object-specific copy methods passed.
|
|
44
|
+
*/
|
|
45
|
+
export function createCopier(
|
|
46
|
+
options: CreateCopierOptions
|
|
47
|
+
): <Value>(value: Value) => Value;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create a custom copier based on the object-specific copy methods passed, defaulting to the
|
|
51
|
+
* same internals as `copyStrict`.
|
|
52
|
+
*/
|
|
53
|
+
export function createStrictCopier(
|
|
54
|
+
options: CreateCopierOptions
|
|
55
|
+
): <Value>(value: Value) => Value;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "tony_quetano@planttheidea.com",
|
|
3
|
+
"contributors": [
|
|
4
|
+
"Dariusz Rzepka <rzepkadarek@gmail.com>"
|
|
5
|
+
],
|
|
6
|
+
"browser": "dist/umd/index.js",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/planttheidea/fast-copy/issues"
|
|
9
|
+
},
|
|
10
|
+
"description": "A blazing fast deep object copier",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
13
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
14
|
+
"@types/eslint": "^8.21.1",
|
|
15
|
+
"@types/jest": "^29.4.0",
|
|
16
|
+
"@types/lodash": "^4.14.191",
|
|
17
|
+
"@types/node": "^18.14.0",
|
|
18
|
+
"@types/ramda": "^0.28.23",
|
|
19
|
+
"@types/react": "^18.0.28",
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "^5.52.0",
|
|
21
|
+
"@typescript-eslint/parser": "^5.52.0",
|
|
22
|
+
"benchee": "^1.0.3",
|
|
23
|
+
"cli-table3": "^0.6.3",
|
|
24
|
+
"clone": "^2.1.2",
|
|
25
|
+
"deepclone": "^1.0.2",
|
|
26
|
+
"eslint": "^8.34.0",
|
|
27
|
+
"eslint-webpack-plugin": "^4.0.0",
|
|
28
|
+
"fast-clone": "^1.5.3",
|
|
29
|
+
"html-webpack-plugin": "^5.5.0",
|
|
30
|
+
"in-publish": "^2.0.1",
|
|
31
|
+
"jest": "^29.4.3",
|
|
32
|
+
"lodash": "^4.17.11",
|
|
33
|
+
"nyc": "^15.1.0",
|
|
34
|
+
"ramda": "^0.28.0",
|
|
35
|
+
"react": "^18.2.0",
|
|
36
|
+
"react-dom": "^18.2.0",
|
|
37
|
+
"release-it": "15.6.0",
|
|
38
|
+
"rollup": "^3.16.0",
|
|
39
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
40
|
+
"ts-jest": "^29.0.5",
|
|
41
|
+
"ts-loader": "^9.4.2",
|
|
42
|
+
"typescript": "^4.9.5",
|
|
43
|
+
"webpack": "^5.75.0",
|
|
44
|
+
"webpack-cli": "^5.0.1",
|
|
45
|
+
"webpack-dev-server": "^4.11.1"
|
|
46
|
+
},
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/esm/types/index.d.ts",
|
|
51
|
+
"default": "./dist/esm/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"require": {
|
|
54
|
+
"types": "./dist/cjs/types/index.d.ts",
|
|
55
|
+
"default": "./dist/cjs/index.cjs"
|
|
56
|
+
},
|
|
57
|
+
"default": {
|
|
58
|
+
"types": "./dist/umd/types/index.d.ts",
|
|
59
|
+
"default": "./dist/umd/index.js"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://github.com/planttheidea/fast-copy#readme",
|
|
64
|
+
"keywords": [
|
|
65
|
+
"clone",
|
|
66
|
+
"deep",
|
|
67
|
+
"copy",
|
|
68
|
+
"fast"
|
|
69
|
+
],
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"main": "dist/cjs/index.cjs",
|
|
72
|
+
"module": "dist/esm/index.mjs",
|
|
73
|
+
"name": "fast-copy",
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "git+https://github.com/planttheidea/fast-copy.git"
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"benchmark": "npm run clean && npm run build:cjs && node benchmark/index.cjs",
|
|
80
|
+
"build": "npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:min",
|
|
81
|
+
"build:cjs": "NODE_ENV=production rollup -c rollup/config.cjs.js && tsc -p ./tsconfig/cjs.json",
|
|
82
|
+
"build:esm": "NODE_ENV=production rollup -c rollup/config.esm.js && tsc -p ./tsconfig/esm.json",
|
|
83
|
+
"build:min": "NODE_ENV=production rollup -c rollup/config.min.js && tsc -p ./tsconfig/min.json",
|
|
84
|
+
"build:umd": "NODE_ENV=production rollup -c rollup/config.umd.js && tsc -p ./tsconfig/umd.json",
|
|
85
|
+
"clean": "rimraf dist",
|
|
86
|
+
"dev": "NODE_ENV=development webpack-dev-server --config=webpack/webpack.config.js",
|
|
87
|
+
"dist": "npm run clean && npm run build",
|
|
88
|
+
"lint": "eslint 'src/*.ts' '__tests__/*.ts' 'DEV_ONLY/*.ts'",
|
|
89
|
+
"lint:fix": "npm run lint -- --fix",
|
|
90
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run dist",
|
|
91
|
+
"release": "release-it",
|
|
92
|
+
"release:beta": "release-it --config=.release-it.beta.json",
|
|
93
|
+
"release:dry": "release-it --dry-run",
|
|
94
|
+
"start": "npm run dev",
|
|
95
|
+
"test": "NODE_PATH=. jest",
|
|
96
|
+
"test:coverage": "npm run test -- --coverage",
|
|
97
|
+
"test:watch": "npm run test -- --watch",
|
|
98
|
+
"typecheck": "tsc --noEmit"
|
|
99
|
+
},
|
|
100
|
+
"type": "module",
|
|
101
|
+
"types": "index.d.ts",
|
|
102
|
+
"version": "3.0.2"
|
|
103
|
+
}
|