@adviser/cement 0.3.3 → 0.3.5
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/{base-sys-abstraction-CR_Z-Ceg.d.ts → base-sys-abstraction-CKI4xiRR.d.ts} +4 -4
- package/{base-sys-abstraction-DWtPI7Kg.d.cts → base-sys-abstraction-DLnSeH4s.d.cts} +4 -4
- package/cf/index.cjs +298 -284
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +4 -18
- package/cf/index.d.ts +4 -18
- package/cf/index.js +39 -6
- package/cf/index.js.map +1 -1
- package/{chunk-P6LDM7PY.js → chunk-4QRZPFED.js} +112 -506
- package/chunk-4QRZPFED.js.map +1 -0
- package/{chunk-HFP74WLI.js → chunk-4U6TAOIU.js} +5 -4
- package/chunk-4U6TAOIU.js.map +1 -0
- package/{chunk-PRCFKZR7.js → chunk-6AG3MRNY.js} +22 -170
- package/chunk-6AG3MRNY.js.map +1 -0
- package/{chunk-A7OPSHUV.js → chunk-LRJXXDF5.js} +11 -4
- package/chunk-LRJXXDF5.js.map +1 -0
- package/chunk-OIIUVSUX.js +88 -0
- package/chunk-OIIUVSUX.js.map +1 -0
- package/chunk-QDDO6NOK.js +194 -0
- package/chunk-QDDO6NOK.js.map +1 -0
- package/deno/index.cjs +274 -166
- package/deno/index.cjs.map +1 -1
- package/deno/index.d.cts +4 -24
- package/deno/index.d.ts +4 -24
- package/deno/index.js +174 -8
- package/deno/index.js.map +1 -1
- package/get-params-result-Bhy5997x.d.cts +61 -0
- package/get-params-result-Bhy5997x.d.ts +61 -0
- package/{index-CfSl8Gmj.d.ts → index-1R-hTV11.d.ts} +5 -50
- package/{index-BfZxTAe_.d.cts → index-98HXQB3i.d.cts} +5 -50
- package/{index-Q3phXzYr.d.cts → index-BMCdndbY.d.cts} +28 -23
- package/{index-tIGZMHTc.d.ts → index-IrV5jK1W.d.ts} +28 -23
- package/index.cjs +327 -430
- package/index.cjs.map +1 -1
- package/index.d.cts +13 -11
- package/index.d.ts +13 -11
- package/index.js +18 -12
- package/index.js.map +1 -1
- package/node/index.cjs +247 -139
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +4 -17
- package/node/index.d.ts +4 -17
- package/node/index.js +183 -12
- package/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/base-sys-abstraction.ts +8 -6
- package/src/cf/cf-env-actions.ts +53 -0
- package/src/cf/cf-sys-abstraction.ts +1 -53
- package/src/cf-test-main.ts +5 -0
- package/src/deno/deno-env-actions.ts +57 -0
- package/src/deno/deno-file-service.ts +1 -1
- package/src/deno/deno-sys-abstraction.ts +1 -57
- package/src/http_header.ts +1 -1
- package/src/index.ts +3 -0
- package/src/jsr.json +1 -1
- package/src/log-writer-impl.ts +10 -5
- package/src/logger-impl.ts +9 -8
- package/src/logger.ts +4 -5
- package/src/node/mock-file-service.ts +4 -4
- package/src/node/node-env-actions.ts +45 -0
- package/src/node/node-sys-abstraction.ts +1 -45
- package/src/resolve-once.ts +6 -5
- package/src/runtime.ts +3 -3
- package/src/sys-env.ts +64 -4
- package/src/test/log-write-stream.ts +2 -1
- package/src/tracer.ts +4 -6
- package/src/uri.ts +4 -69
- package/src/utils/console-write-stream.ts +4 -3
- package/src/utils/fanout-write-stream.ts +1 -1
- package/src/utils/get-params-result.ts +71 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/rebuffer.ts +27 -21
- package/src/utils/relative-path.ts +1 -1
- package/src/utils/stream2string.ts +2 -2
- package/src/utils/stripper.ts +2 -2
- package/src/version.ts +2 -2
- package/src/web/web-env-actions.ts +41 -0
- package/src/web/web-sys-abstraction.ts +2 -42
- package/{sys-abstraction-GNnBj2sz.d.cts → sys-abstraction-BRDT_TIU.d.cts} +8 -1
- package/{sys-abstraction-GNnBj2sz.d.ts → sys-abstraction-Bd0EzwO6.d.ts} +8 -1
- package/test/index.cjs +460 -578
- package/test/index.cjs.map +1 -1
- package/test/index.d.cts +3 -3
- package/test/index.d.ts +3 -3
- package/test/index.js +5 -4
- package/ts/smoke/smoke.d.ts +2 -0
- package/ts/smoke/smoke.d.ts.map +1 -0
- package/ts/smoke/smoke.js +33 -0
- package/ts/smoke/smoke.js.map +1 -0
- package/ts/{base-sys-abstraction.d.ts → src/base-sys-abstraction.d.ts} +2 -2
- package/ts/src/base-sys-abstraction.d.ts.map +1 -0
- package/ts/{base-sys-abstraction.js → src/base-sys-abstraction.js} +4 -2
- package/ts/src/base-sys-abstraction.js.map +1 -0
- package/ts/src/base-sys-abstraction.test.d.ts.map +1 -0
- package/ts/src/base-sys-abstraction.test.js.map +1 -0
- package/ts/src/bin2text.d.ts.map +1 -0
- package/ts/src/bin2text.js.map +1 -0
- package/ts/{bin2text.test.d.ts.map → src/bin2text.test.d.ts.map} +1 -1
- package/ts/src/bin2text.test.js.map +1 -0
- package/ts/src/cf/cf-env-actions.d.ts +16 -0
- package/ts/src/cf/cf-env-actions.d.ts.map +1 -0
- package/ts/{cf/cf-sys-abstraction.js → src/cf/cf-env-actions.js} +1 -30
- package/ts/src/cf/cf-env-actions.js.map +1 -0
- package/ts/src/cf/cf-sys-abstraction.d.ts +11 -0
- package/ts/src/cf/cf-sys-abstraction.d.ts.map +1 -0
- package/ts/src/cf/cf-sys-abstraction.js +30 -0
- package/ts/src/cf/cf-sys-abstraction.js.map +1 -0
- package/ts/src/cf/index.d.ts.map +1 -0
- package/ts/src/cf/index.js.map +1 -0
- package/ts/src/cf-test-main.d.ts +5 -0
- package/ts/src/cf-test-main.d.ts.map +1 -0
- package/ts/src/cf-test-main.js +6 -0
- package/ts/src/cf-test-main.js.map +1 -0
- package/ts/src/crypto.d.ts.map +1 -0
- package/ts/src/crypto.js.map +1 -0
- package/ts/{crypto.test.d.ts.map → src/crypto.test.d.ts.map} +1 -1
- package/ts/{crypto.test.js → src/crypto.test.js} +8 -1
- package/ts/src/crypto.test.js.map +1 -0
- package/ts/src/deno/deno-env-actions.d.ts +23 -0
- package/ts/src/deno/deno-env-actions.d.ts.map +1 -0
- package/ts/src/deno/deno-env-actions.js +46 -0
- package/ts/src/deno/deno-env-actions.js.map +1 -0
- package/ts/src/deno/deno-file-service.d.ts.map +1 -0
- package/ts/src/deno/deno-file-service.js.map +1 -0
- package/ts/{deno → src/deno}/deno-sys-abstraction.d.ts +1 -22
- package/ts/src/deno/deno-sys-abstraction.d.ts.map +1 -0
- package/ts/{deno → src/deno}/deno-sys-abstraction.js +0 -45
- package/ts/src/deno/deno-sys-abstraction.js.map +1 -0
- package/ts/src/deno/index.d.ts.map +1 -0
- package/ts/src/deno/index.js.map +1 -0
- package/ts/src/file-service.d.ts.map +1 -0
- package/ts/{file-service.js.map → src/file-service.js.map} +1 -1
- package/ts/src/future.d.ts.map +1 -0
- package/ts/src/future.js.map +1 -0
- package/ts/{future.test.d.ts.map → src/future.test.d.ts.map} +1 -1
- package/ts/src/future.test.js.map +1 -0
- package/ts/src/http_header.d.ts.map +1 -0
- package/ts/src/http_header.js.map +1 -0
- package/ts/src/http_header.test.d.ts.map +1 -0
- package/ts/src/http_header.test.js.map +1 -0
- package/ts/{index.d.ts → src/index.d.ts} +2 -0
- package/ts/src/index.d.ts.map +1 -0
- package/ts/{index.js → src/index.js} +2 -0
- package/ts/src/index.js.map +1 -0
- package/ts/src/log-level-impl.d.ts.map +1 -0
- package/ts/src/log-level-impl.js.map +1 -0
- package/ts/src/log-writer-impl.d.ts.map +1 -0
- package/ts/{log-writer-impl.js → src/log-writer-impl.js} +4 -2
- package/ts/src/log-writer-impl.js.map +1 -0
- package/ts/{logger-impl.d.ts → src/logger-impl.d.ts} +1 -1
- package/ts/src/logger-impl.d.ts.map +1 -0
- package/ts/{logger-impl.js → src/logger-impl.js} +2 -3
- package/ts/src/logger-impl.js.map +1 -0
- package/ts/{logger.d.ts → src/logger.d.ts} +1 -1
- package/ts/src/logger.d.ts.map +1 -0
- package/ts/src/logger.js.map +1 -0
- package/ts/{logger.test.d.ts.map → src/logger.test.d.ts.map} +1 -1
- package/ts/{logger.test.js → src/logger.test.js} +4 -4
- package/ts/src/logger.test.js.map +1 -0
- package/ts/src/node/index.d.ts.map +1 -0
- package/ts/src/node/index.js.map +1 -0
- package/ts/src/node/mock-file-service.d.ts.map +1 -0
- package/ts/{node → src/node}/mock-file-service.js +4 -4
- package/ts/src/node/mock-file-service.js.map +1 -0
- package/ts/src/node/mock-file-service.test.d.ts.map +1 -0
- package/ts/src/node/mock-file-service.test.js.map +1 -0
- package/ts/src/node/node-env-actions.d.ts +15 -0
- package/ts/src/node/node-env-actions.d.ts.map +1 -0
- package/ts/src/node/node-env-actions.js +44 -0
- package/ts/src/node/node-env-actions.js.map +1 -0
- package/ts/src/node/node-file-service.d.ts.map +1 -0
- package/ts/src/node/node-file-service.js.map +1 -0
- package/ts/{node → src/node}/node-sys-abstraction.d.ts +1 -14
- package/ts/src/node/node-sys-abstraction.d.ts.map +1 -0
- package/ts/{node → src/node}/node-sys-abstraction.js +0 -43
- package/ts/src/node/node-sys-abstraction.js.map +1 -0
- package/ts/src/node/node-sys-abstraction.test.d.ts.map +1 -0
- package/ts/src/node/node-sys-abstraction.test.js.map +1 -0
- package/ts/src/option.d.ts.map +1 -0
- package/ts/src/option.js.map +1 -0
- package/ts/{resolve-once.d.ts → src/resolve-once.d.ts} +1 -1
- package/ts/src/resolve-once.d.ts.map +1 -0
- package/ts/{resolve-once.js → src/resolve-once.js} +5 -4
- package/ts/src/resolve-once.js.map +1 -0
- package/ts/src/resolve-once.test.d.ts.map +1 -0
- package/ts/{resolve-once.test.js → src/resolve-once.test.js} +20 -24
- package/ts/src/resolve-once.test.js.map +1 -0
- package/ts/src/result.d.ts.map +1 -0
- package/ts/src/result.js.map +1 -0
- package/ts/{result.test.d.ts.map → src/result.test.d.ts.map} +1 -1
- package/ts/{result.test.js → src/result.test.js} +2 -4
- package/ts/src/result.test.js.map +1 -0
- package/ts/src/runtime.d.ts.map +1 -0
- package/ts/src/runtime.js.map +1 -0
- package/ts/src/sys-abstraction.d.ts.map +1 -0
- package/ts/src/sys-abstraction.js.map +1 -0
- package/ts/{sys-env.d.ts → src/sys-env.d.ts} +7 -0
- package/ts/src/sys-env.d.ts.map +1 -0
- package/ts/{sys-env.js → src/sys-env.js} +57 -4
- package/ts/src/sys-env.js.map +1 -0
- package/ts/{sys-env.test.d.ts.map → src/sys-env.test.d.ts.map} +1 -1
- package/ts/{sys-env.test.js → src/sys-env.test.js} +70 -2
- package/ts/src/sys-env.test.js.map +1 -0
- package/ts/src/test/index.d.ts.map +1 -0
- package/ts/src/test/index.js.map +1 -0
- package/ts/src/test/log-write-stream.d.ts.map +1 -0
- package/ts/src/test/log-write-stream.js.map +1 -0
- package/ts/src/test/mock-logger.d.ts.map +1 -0
- package/ts/src/test/mock-logger.js.map +1 -0
- package/ts/src/test/mock-logger.test.d.ts.map +1 -0
- package/ts/src/test/mock-logger.test.js.map +1 -0
- package/ts/src/test/test-exit-handler.d.ts.map +1 -0
- package/ts/{test → src/test}/test-exit-handler.js +8 -3
- package/ts/src/test/test-exit-handler.js.map +1 -0
- package/ts/src/time.d.ts.map +1 -0
- package/ts/src/time.js.map +1 -0
- package/ts/src/tracer.d.ts.map +1 -0
- package/ts/src/tracer.js.map +1 -0
- package/ts/{tracer.test.d.ts.map → src/tracer.test.d.ts.map} +1 -1
- package/ts/{tracer.test.js → src/tracer.test.js} +5 -5
- package/ts/src/tracer.test.js.map +1 -0
- package/ts/src/txt-en-decoder.d.ts.map +1 -0
- package/ts/src/txt-en-decoder.js.map +1 -0
- package/ts/{uri.d.ts → src/uri.d.ts} +2 -13
- package/ts/src/uri.d.ts.map +1 -0
- package/ts/{uri.js → src/uri.js} +2 -56
- package/ts/src/uri.js.map +1 -0
- package/ts/{uri.test.d.ts.map → src/uri.test.d.ts.map} +1 -1
- package/ts/{uri.test.js → src/uri.test.js} +7 -7
- package/ts/src/uri.test.js.map +1 -0
- package/ts/{utils → src/utils}/console-write-stream.d.ts +1 -1
- package/ts/src/utils/console-write-stream.d.ts.map +1 -0
- package/ts/{utils → src/utils}/console-write-stream.js +4 -3
- package/ts/src/utils/console-write-stream.js.map +1 -0
- package/ts/{utils → src/utils}/fanout-write-stream.d.ts +1 -1
- package/ts/src/utils/fanout-write-stream.d.ts.map +1 -0
- package/ts/src/utils/fanout-write-stream.js.map +1 -0
- package/ts/src/utils/get-params-result.d.ts +19 -0
- package/ts/src/utils/get-params-result.d.ts.map +1 -0
- package/ts/src/utils/get-params-result.js +58 -0
- package/ts/src/utils/get-params-result.js.map +1 -0
- package/ts/{utils → src/utils}/index.d.ts +1 -0
- package/ts/src/utils/index.d.ts.map +1 -0
- package/ts/{utils → src/utils}/index.js +1 -0
- package/ts/src/utils/index.js.map +1 -0
- package/ts/src/utils/rebuffer.d.ts.map +1 -0
- package/ts/{utils → src/utils}/rebuffer.js +7 -1
- package/ts/src/utils/rebuffer.js.map +1 -0
- package/ts/src/utils/rebuffer.test.d.ts.map +1 -0
- package/ts/src/utils/rebuffer.test.js.map +1 -0
- package/ts/src/utils/relative-path.d.ts.map +1 -0
- package/ts/src/utils/relative-path.js.map +1 -0
- package/ts/src/utils/relative-path.test.d.ts.map +1 -0
- package/ts/src/utils/relative-path.test.js.map +1 -0
- package/ts/src/utils/stream-map.d.ts.map +1 -0
- package/ts/src/utils/stream-map.js.map +1 -0
- package/ts/src/utils/stream-map.test.d.ts.map +1 -0
- package/ts/src/utils/stream-map.test.js.map +1 -0
- package/ts/src/utils/stream-test-helper.d.ts.map +1 -0
- package/ts/{utils → src/utils}/stream-test-helper.js +18 -10
- package/ts/src/utils/stream-test-helper.js.map +1 -0
- package/ts/src/utils/stream2string.d.ts.map +1 -0
- package/ts/src/utils/stream2string.js.map +1 -0
- package/ts/src/utils/stream2string.test.d.ts.map +1 -0
- package/ts/src/utils/stream2string.test.js.map +1 -0
- package/ts/src/utils/string2stream.d.ts.map +1 -0
- package/ts/src/utils/string2stream.js.map +1 -0
- package/ts/src/utils/string2stream.test.d.ts.map +1 -0
- package/ts/src/utils/string2stream.test.js.map +1 -0
- package/ts/src/utils/stripper.d.ts +3 -0
- package/ts/src/utils/stripper.d.ts.map +1 -0
- package/ts/src/utils/stripper.js.map +1 -0
- package/ts/src/utils/stripper.test.d.ts.map +1 -0
- package/ts/src/utils/stripper.test.js.map +1 -0
- package/ts/src/version.d.ts.map +1 -0
- package/ts/src/version.js.map +1 -0
- package/ts/src/web/index.d.ts.map +1 -0
- package/ts/src/web/index.js.map +1 -0
- package/ts/src/web/web-env-actions.d.ts +14 -0
- package/ts/src/web/web-env-actions.d.ts.map +1 -0
- package/ts/src/web/web-env-actions.js +35 -0
- package/ts/src/web/web-env-actions.js.map +1 -0
- package/ts/{web → src/web}/web-sys-abstraction.d.ts +1 -14
- package/ts/src/web/web-sys-abstraction.d.ts.map +1 -0
- package/ts/{web → src/web}/web-sys-abstraction.js +0 -34
- package/ts/src/web/web-sys-abstraction.js.map +1 -0
- package/ts/vitest.browser.config.d.ts +3 -0
- package/ts/vitest.browser.config.d.ts.map +1 -0
- package/ts/vitest.browser.config.js +17 -0
- package/ts/vitest.browser.config.js.map +1 -0
- package/ts/vitest.cf-runtime.config.d.ts +3 -0
- package/ts/vitest.cf-runtime.config.d.ts.map +1 -0
- package/ts/vitest.cf-runtime.config.js +16 -0
- package/ts/vitest.cf-runtime.config.js.map +1 -0
- package/ts/vitest.config.d.ts +3 -0
- package/ts/vitest.config.d.ts.map +1 -0
- package/ts/vitest.config.js +8 -0
- package/ts/vitest.config.js.map +1 -0
- package/ts/vitest.node.config.d.ts +3 -0
- package/ts/vitest.node.config.d.ts.map +1 -0
- package/ts/vitest.node.config.js +11 -0
- package/ts/vitest.node.config.js.map +1 -0
- package/ts/vitest.workspace.d.ts +3 -0
- package/ts/vitest.workspace.d.ts.map +1 -0
- package/ts/vitest.workspace.js +6 -0
- package/ts/vitest.workspace.js.map +1 -0
- package/utils/index.cjs +150 -3
- package/utils/index.cjs.map +1 -1
- package/utils/index.d.cts +2 -2
- package/utils/index.d.ts +2 -2
- package/utils/index.js +8 -3
- package/web/index.cjs +251 -239
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +5 -17
- package/web/index.d.ts +5 -17
- package/web/index.js +3 -4
- package/chunk-A7OPSHUV.js.map +0 -1
- package/chunk-HFP74WLI.js.map +0 -1
- package/chunk-P6LDM7PY.js.map +0 -1
- package/chunk-PPS4L4VW.js +0 -38
- package/chunk-PPS4L4VW.js.map +0 -1
- package/chunk-PRCFKZR7.js.map +0 -1
- package/ts/base-sys-abstraction.d.ts.map +0 -1
- package/ts/base-sys-abstraction.js.map +0 -1
- package/ts/base-sys-abstraction.test.d.ts.map +0 -1
- package/ts/base-sys-abstraction.test.js.map +0 -1
- package/ts/bin2text.d.ts.map +0 -1
- package/ts/bin2text.js.map +0 -1
- package/ts/bin2text.test.js.map +0 -1
- package/ts/cf/cf-sys-abstraction.d.ts +0 -25
- package/ts/cf/cf-sys-abstraction.d.ts.map +0 -1
- package/ts/cf/cf-sys-abstraction.js.map +0 -1
- package/ts/cf/index.d.ts.map +0 -1
- package/ts/cf/index.js.map +0 -1
- package/ts/crypto.d.ts.map +0 -1
- package/ts/crypto.js.map +0 -1
- package/ts/crypto.test.js.map +0 -1
- package/ts/deno/deno-file-service.d.ts.map +0 -1
- package/ts/deno/deno-file-service.js.map +0 -1
- package/ts/deno/deno-sys-abstraction.d.ts.map +0 -1
- package/ts/deno/deno-sys-abstraction.js.map +0 -1
- package/ts/deno/index.d.ts.map +0 -1
- package/ts/deno/index.js.map +0 -1
- package/ts/file-service.d.ts.map +0 -1
- package/ts/future.d.ts.map +0 -1
- package/ts/future.js.map +0 -1
- package/ts/future.test.js.map +0 -1
- package/ts/http_header.d.ts.map +0 -1
- package/ts/http_header.js.map +0 -1
- package/ts/http_header.test.d.ts.map +0 -1
- package/ts/http_header.test.js.map +0 -1
- package/ts/index.d.ts.map +0 -1
- package/ts/index.js.map +0 -1
- package/ts/log-level-impl.d.ts.map +0 -1
- package/ts/log-level-impl.js.map +0 -1
- package/ts/log-writer-impl.d.ts.map +0 -1
- package/ts/log-writer-impl.js.map +0 -1
- package/ts/logger-impl.d.ts.map +0 -1
- package/ts/logger-impl.js.map +0 -1
- package/ts/logger.d.ts.map +0 -1
- package/ts/logger.js.map +0 -1
- package/ts/logger.test.js.map +0 -1
- package/ts/node/index.d.ts.map +0 -1
- package/ts/node/index.js.map +0 -1
- package/ts/node/mock-file-service.d.ts.map +0 -1
- package/ts/node/mock-file-service.js.map +0 -1
- package/ts/node/mock-file-service.test.d.ts.map +0 -1
- package/ts/node/mock-file-service.test.js.map +0 -1
- package/ts/node/node-file-service.d.ts.map +0 -1
- package/ts/node/node-file-service.js.map +0 -1
- package/ts/node/node-sys-abstraction.d.ts.map +0 -1
- package/ts/node/node-sys-abstraction.js.map +0 -1
- package/ts/node/node-sys-abstraction.test.d.ts.map +0 -1
- package/ts/node/node-sys-abstraction.test.js.map +0 -1
- package/ts/option.d.ts.map +0 -1
- package/ts/option.js.map +0 -1
- package/ts/resolve-once.d.ts.map +0 -1
- package/ts/resolve-once.js.map +0 -1
- package/ts/resolve-once.test.d.ts.map +0 -1
- package/ts/resolve-once.test.js.map +0 -1
- package/ts/result.d.ts.map +0 -1
- package/ts/result.js.map +0 -1
- package/ts/result.test.js.map +0 -1
- package/ts/runtime.d.ts.map +0 -1
- package/ts/runtime.js.map +0 -1
- package/ts/sys-abstraction.d.ts.map +0 -1
- package/ts/sys-abstraction.js.map +0 -1
- package/ts/sys-env.d.ts.map +0 -1
- package/ts/sys-env.js.map +0 -1
- package/ts/sys-env.test.js.map +0 -1
- package/ts/test/index.d.ts.map +0 -1
- package/ts/test/index.js.map +0 -1
- package/ts/test/log-write-stream.d.ts.map +0 -1
- package/ts/test/log-write-stream.js.map +0 -1
- package/ts/test/mock-logger.d.ts.map +0 -1
- package/ts/test/mock-logger.js.map +0 -1
- package/ts/test/mock-logger.test.d.ts.map +0 -1
- package/ts/test/mock-logger.test.js.map +0 -1
- package/ts/test/test-exit-handler.d.ts.map +0 -1
- package/ts/test/test-exit-handler.js.map +0 -1
- package/ts/time.d.ts.map +0 -1
- package/ts/time.js.map +0 -1
- package/ts/tracer.d.ts.map +0 -1
- package/ts/tracer.js.map +0 -1
- package/ts/tracer.test.js.map +0 -1
- package/ts/txt-en-decoder.d.ts.map +0 -1
- package/ts/txt-en-decoder.js.map +0 -1
- package/ts/uri.d.ts.map +0 -1
- package/ts/uri.js.map +0 -1
- package/ts/uri.test.js.map +0 -1
- package/ts/utils/console-write-stream.d.ts.map +0 -1
- package/ts/utils/console-write-stream.js.map +0 -1
- package/ts/utils/fanout-write-stream.d.ts.map +0 -1
- package/ts/utils/fanout-write-stream.js.map +0 -1
- package/ts/utils/index.d.ts.map +0 -1
- package/ts/utils/index.js.map +0 -1
- package/ts/utils/rebuffer.d.ts.map +0 -1
- package/ts/utils/rebuffer.js.map +0 -1
- package/ts/utils/rebuffer.test.d.ts.map +0 -1
- package/ts/utils/rebuffer.test.js.map +0 -1
- package/ts/utils/relative-path.d.ts.map +0 -1
- package/ts/utils/relative-path.js.map +0 -1
- package/ts/utils/relative-path.test.d.ts.map +0 -1
- package/ts/utils/relative-path.test.js.map +0 -1
- package/ts/utils/stream-map.d.ts.map +0 -1
- package/ts/utils/stream-map.js.map +0 -1
- package/ts/utils/stream-map.test.d.ts.map +0 -1
- package/ts/utils/stream-map.test.js.map +0 -1
- package/ts/utils/stream-test-helper.d.ts.map +0 -1
- package/ts/utils/stream-test-helper.js.map +0 -1
- package/ts/utils/stream2string.d.ts.map +0 -1
- package/ts/utils/stream2string.js.map +0 -1
- package/ts/utils/stream2string.test.d.ts.map +0 -1
- package/ts/utils/stream2string.test.js.map +0 -1
- package/ts/utils/string2stream.d.ts.map +0 -1
- package/ts/utils/string2stream.js.map +0 -1
- package/ts/utils/string2stream.test.d.ts.map +0 -1
- package/ts/utils/string2stream.test.js.map +0 -1
- package/ts/utils/stripper.d.ts +0 -3
- package/ts/utils/stripper.d.ts.map +0 -1
- package/ts/utils/stripper.js.map +0 -1
- package/ts/utils/stripper.test.d.ts.map +0 -1
- package/ts/utils/stripper.test.js.map +0 -1
- package/ts/version.d.ts.map +0 -1
- package/ts/version.js.map +0 -1
- package/ts/web/index.d.ts.map +0 -1
- package/ts/web/index.js.map +0 -1
- package/ts/web/web-sys-abstraction.d.ts.map +0 -1
- package/ts/web/web-sys-abstraction.js.map +0 -1
- package/txt-en-decoder-CZYJUju2.d.cts +0 -11
- package/txt-en-decoder-CZYJUju2.d.ts +0 -11
- /package/ts/{base-sys-abstraction.test.d.ts → src/base-sys-abstraction.test.d.ts} +0 -0
- /package/ts/{base-sys-abstraction.test.js → src/base-sys-abstraction.test.js} +0 -0
- /package/ts/{bin2text.d.ts → src/bin2text.d.ts} +0 -0
- /package/ts/{bin2text.js → src/bin2text.js} +0 -0
- /package/ts/{bin2text.test.d.ts → src/bin2text.test.d.ts} +0 -0
- /package/ts/{bin2text.test.js → src/bin2text.test.js} +0 -0
- /package/ts/{cf → src/cf}/index.d.ts +0 -0
- /package/ts/{cf → src/cf}/index.js +0 -0
- /package/ts/{crypto.d.ts → src/crypto.d.ts} +0 -0
- /package/ts/{crypto.js → src/crypto.js} +0 -0
- /package/ts/{crypto.test.d.ts → src/crypto.test.d.ts} +0 -0
- /package/ts/{deno → src/deno}/deno-file-service.d.ts +0 -0
- /package/ts/{deno → src/deno}/deno-file-service.js +0 -0
- /package/ts/{deno → src/deno}/index.d.ts +0 -0
- /package/ts/{deno → src/deno}/index.js +0 -0
- /package/ts/{file-service.d.ts → src/file-service.d.ts} +0 -0
- /package/ts/{file-service.js → src/file-service.js} +0 -0
- /package/ts/{future.d.ts → src/future.d.ts} +0 -0
- /package/ts/{future.js → src/future.js} +0 -0
- /package/ts/{future.test.d.ts → src/future.test.d.ts} +0 -0
- /package/ts/{future.test.js → src/future.test.js} +0 -0
- /package/ts/{http_header.d.ts → src/http_header.d.ts} +0 -0
- /package/ts/{http_header.js → src/http_header.js} +0 -0
- /package/ts/{http_header.test.d.ts → src/http_header.test.d.ts} +0 -0
- /package/ts/{http_header.test.js → src/http_header.test.js} +0 -0
- /package/ts/{log-level-impl.d.ts → src/log-level-impl.d.ts} +0 -0
- /package/ts/{log-level-impl.js → src/log-level-impl.js} +0 -0
- /package/ts/{log-writer-impl.d.ts → src/log-writer-impl.d.ts} +0 -0
- /package/ts/{logger.js → src/logger.js} +0 -0
- /package/ts/{logger.test.d.ts → src/logger.test.d.ts} +0 -0
- /package/ts/{node → src/node}/index.d.ts +0 -0
- /package/ts/{node → src/node}/index.js +0 -0
- /package/ts/{node → src/node}/mock-file-service.d.ts +0 -0
- /package/ts/{node → src/node}/mock-file-service.test.d.ts +0 -0
- /package/ts/{node → src/node}/mock-file-service.test.js +0 -0
- /package/ts/{node → src/node}/node-file-service.d.ts +0 -0
- /package/ts/{node → src/node}/node-file-service.js +0 -0
- /package/ts/{node → src/node}/node-sys-abstraction.test.d.ts +0 -0
- /package/ts/{node → src/node}/node-sys-abstraction.test.js +0 -0
- /package/ts/{option.d.ts → src/option.d.ts} +0 -0
- /package/ts/{option.js → src/option.js} +0 -0
- /package/ts/{resolve-once.test.d.ts → src/resolve-once.test.d.ts} +0 -0
- /package/ts/{result.d.ts → src/result.d.ts} +0 -0
- /package/ts/{result.js → src/result.js} +0 -0
- /package/ts/{result.test.d.ts → src/result.test.d.ts} +0 -0
- /package/ts/{runtime.d.ts → src/runtime.d.ts} +0 -0
- /package/ts/{runtime.js → src/runtime.js} +0 -0
- /package/ts/{sys-abstraction.d.ts → src/sys-abstraction.d.ts} +0 -0
- /package/ts/{sys-abstraction.js → src/sys-abstraction.js} +0 -0
- /package/ts/{sys-env.test.d.ts → src/sys-env.test.d.ts} +0 -0
- /package/ts/{test → src/test}/index.d.ts +0 -0
- /package/ts/{test → src/test}/index.js +0 -0
- /package/ts/{test → src/test}/log-write-stream.d.ts +0 -0
- /package/ts/{test → src/test}/log-write-stream.js +0 -0
- /package/ts/{test → src/test}/mock-logger.d.ts +0 -0
- /package/ts/{test → src/test}/mock-logger.js +0 -0
- /package/ts/{test → src/test}/mock-logger.test.d.ts +0 -0
- /package/ts/{test → src/test}/mock-logger.test.js +0 -0
- /package/ts/{test → src/test}/test-exit-handler.d.ts +0 -0
- /package/ts/{time.d.ts → src/time.d.ts} +0 -0
- /package/ts/{time.js → src/time.js} +0 -0
- /package/ts/{tracer.d.ts → src/tracer.d.ts} +0 -0
- /package/ts/{tracer.js → src/tracer.js} +0 -0
- /package/ts/{tracer.test.d.ts → src/tracer.test.d.ts} +0 -0
- /package/ts/{txt-en-decoder.d.ts → src/txt-en-decoder.d.ts} +0 -0
- /package/ts/{txt-en-decoder.js → src/txt-en-decoder.js} +0 -0
- /package/ts/{uri.test.d.ts → src/uri.test.d.ts} +0 -0
- /package/ts/{utils → src/utils}/fanout-write-stream.js +0 -0
- /package/ts/{utils → src/utils}/rebuffer.d.ts +0 -0
- /package/ts/{utils → src/utils}/rebuffer.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/rebuffer.test.js +0 -0
- /package/ts/{utils → src/utils}/relative-path.d.ts +0 -0
- /package/ts/{utils → src/utils}/relative-path.js +0 -0
- /package/ts/{utils → src/utils}/relative-path.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/relative-path.test.js +0 -0
- /package/ts/{utils → src/utils}/stream-map.d.ts +0 -0
- /package/ts/{utils → src/utils}/stream-map.js +0 -0
- /package/ts/{utils → src/utils}/stream-map.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/stream-map.test.js +0 -0
- /package/ts/{utils → src/utils}/stream-test-helper.d.ts +0 -0
- /package/ts/{utils → src/utils}/stream2string.d.ts +0 -0
- /package/ts/{utils → src/utils}/stream2string.js +0 -0
- /package/ts/{utils → src/utils}/stream2string.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/stream2string.test.js +0 -0
- /package/ts/{utils → src/utils}/string2stream.d.ts +0 -0
- /package/ts/{utils → src/utils}/string2stream.js +0 -0
- /package/ts/{utils → src/utils}/string2stream.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/string2stream.test.js +0 -0
- /package/ts/{utils → src/utils}/stripper.js +0 -0
- /package/ts/{utils → src/utils}/stripper.test.d.ts +0 -0
- /package/ts/{utils → src/utils}/stripper.test.js +0 -0
- /package/ts/{version.d.ts → src/version.d.ts} +0 -0
- /package/ts/{version.js → src/version.js} +0 -0
- /package/ts/{web → src/web}/index.d.ts +0 -0
- /package/ts/{web → src/web}/index.js +0 -0
package/test/index.cjs
CHANGED
@@ -14,9 +14,9 @@ var __export = (target, all) => {
|
|
14
14
|
};
|
15
15
|
var __copyProps = (to, from2, except, desc) => {
|
16
16
|
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
17
|
-
for (let
|
18
|
-
if (!__hasOwnProp.call(to,
|
19
|
-
__defProp(to,
|
17
|
+
for (let key of __getOwnPropNames(from2))
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
19
|
+
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
20
20
|
}
|
21
21
|
return to;
|
22
22
|
};
|
@@ -80,8 +80,8 @@ var Future = class {
|
|
80
80
|
__privateAdd(this, _rejectFn, () => {
|
81
81
|
throw new Error("This Promise is not working as expected.");
|
82
82
|
});
|
83
|
-
__privateSet(this, _promise, new Promise((
|
84
|
-
__privateSet(this, _resolveFn,
|
83
|
+
__privateSet(this, _promise, new Promise((resolve, reject) => {
|
84
|
+
__privateSet(this, _resolveFn, resolve);
|
85
85
|
__privateSet(this, _rejectFn, reject);
|
86
86
|
}));
|
87
87
|
}
|
@@ -256,9 +256,6 @@ var LogValue = class {
|
|
256
256
|
return this.value();
|
257
257
|
}
|
258
258
|
};
|
259
|
-
function asyncLogValue(val) {
|
260
|
-
throw new Error("Not implemented");
|
261
|
-
}
|
262
259
|
function logValue(val, ctx) {
|
263
260
|
return logValueInternal(val, {
|
264
261
|
...ctx,
|
@@ -334,16 +331,16 @@ function logValueInternal(val, ctx) {
|
|
334
331
|
}
|
335
332
|
const res = {};
|
336
333
|
const typedVal = val;
|
337
|
-
for (const
|
338
|
-
if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(
|
334
|
+
for (const key in typedVal) {
|
335
|
+
if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(key)) {
|
339
336
|
continue;
|
340
337
|
}
|
341
|
-
const element = typedVal[
|
338
|
+
const element = typedVal[key];
|
342
339
|
if (element instanceof LogValue) {
|
343
|
-
res[
|
340
|
+
res[key] = element;
|
344
341
|
} else {
|
345
342
|
if (typeof element !== "function") {
|
346
|
-
res[
|
343
|
+
res[key] = logValueInternal(element, ctx);
|
347
344
|
}
|
348
345
|
}
|
349
346
|
}
|
@@ -513,9 +510,9 @@ var SysTime = class extends Time {
|
|
513
510
|
return /* @__PURE__ */ new Date();
|
514
511
|
}
|
515
512
|
Sleep(duration) {
|
516
|
-
return new Promise((
|
513
|
+
return new Promise((resolve) => {
|
517
514
|
setTimeout(() => {
|
518
|
-
|
515
|
+
resolve();
|
519
516
|
}, duration);
|
520
517
|
});
|
521
518
|
}
|
@@ -628,13 +625,15 @@ var BaseSysAbstraction = class {
|
|
628
625
|
this._systemService = params.SystemService;
|
629
626
|
this._txtEnDe = params.TxtEnDecoder;
|
630
627
|
const decoder2 = this._txtEnDe;
|
631
|
-
this._stdout = CFWriteableStream(
|
628
|
+
this._stdout = CFWriteableStream((chunk) => {
|
632
629
|
const decoded = decoder2.decode(chunk);
|
633
630
|
console.log(decoded.trimEnd());
|
631
|
+
return Promise.resolve();
|
634
632
|
});
|
635
|
-
this._stderr = CFWriteableStream(
|
633
|
+
this._stderr = CFWriteableStream((chunk) => {
|
636
634
|
const decoded = decoder2.decode(chunk);
|
637
635
|
console.error(decoded.trimEnd());
|
636
|
+
return Promise.resolve();
|
638
637
|
});
|
639
638
|
}
|
640
639
|
};
|
@@ -778,24 +777,24 @@ var Keyed = class {
|
|
778
777
|
this._map = /* @__PURE__ */ new Map();
|
779
778
|
this.factory = factory;
|
780
779
|
}
|
781
|
-
async asyncGet(
|
782
|
-
return this.get(await
|
780
|
+
async asyncGet(key) {
|
781
|
+
return this.get(await key());
|
783
782
|
}
|
784
|
-
get(
|
785
|
-
if (typeof
|
786
|
-
|
783
|
+
get(key) {
|
784
|
+
if (typeof key === "function") {
|
785
|
+
key = key();
|
787
786
|
}
|
788
|
-
let keyed = this._map.get(
|
787
|
+
let keyed = this._map.get(key);
|
789
788
|
if (!keyed) {
|
790
|
-
keyed = this.factory(
|
791
|
-
this._map.set(
|
789
|
+
keyed = this.factory(key);
|
790
|
+
this._map.set(key, keyed);
|
792
791
|
}
|
793
792
|
return keyed;
|
794
793
|
}
|
795
|
-
unget(
|
796
|
-
const keyed = this._map.get(
|
794
|
+
unget(key) {
|
795
|
+
const keyed = this._map.get(key);
|
797
796
|
keyed == null ? void 0 : keyed.reset();
|
798
|
-
this._map.delete(
|
797
|
+
this._map.delete(key);
|
799
798
|
}
|
800
799
|
reset() {
|
801
800
|
this._map.forEach((keyed) => keyed.reset());
|
@@ -804,7 +803,7 @@ var Keyed = class {
|
|
804
803
|
};
|
805
804
|
var KeyedResolvOnce = class extends Keyed {
|
806
805
|
constructor() {
|
807
|
-
super((
|
806
|
+
super((key) => new ResolveOnce(key));
|
808
807
|
}
|
809
808
|
};
|
810
809
|
|
@@ -821,7 +820,10 @@ function isSet(value, ref = globalThis) {
|
|
821
820
|
}
|
822
821
|
function runtimeFn() {
|
823
822
|
const gt = globalThis;
|
824
|
-
let isReactNative =
|
823
|
+
let isReactNative = (
|
824
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
825
|
+
isSet("navigator.product") && typeof gt["navigator"] === "object" && gt["navigator"]["product"] === "ReactNative"
|
826
|
+
);
|
825
827
|
let isNodeIsh = false;
|
826
828
|
if (!isSet("Deno")) {
|
827
829
|
isNodeIsh = isSet("process.versions.node") && !isReactNative;
|
@@ -842,12 +844,7 @@ function runtimeFn() {
|
|
842
844
|
};
|
843
845
|
}
|
844
846
|
|
845
|
-
// src/deno/deno-
|
846
|
-
var path = __toESM(require("path"), 1);
|
847
|
-
var Deno = globalThis.Deno;
|
848
|
-
|
849
|
-
// src/deno/deno-sys-abstraction.ts
|
850
|
-
var Deno2 = globalThis.Deno;
|
847
|
+
// src/deno/deno-env-actions.ts
|
851
848
|
var once = new ResolveOnce();
|
852
849
|
var _deno;
|
853
850
|
var _DenoEnvActions = class _DenoEnvActions {
|
@@ -862,8 +859,8 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
862
859
|
return __privateGet(this, _deno).Deno.env;
|
863
860
|
}
|
864
861
|
register(env) {
|
865
|
-
for (const
|
866
|
-
this._env.set(
|
862
|
+
for (const key of env.keys()) {
|
863
|
+
this._env.set(key, env.get(key) || "");
|
867
864
|
}
|
868
865
|
return env;
|
869
866
|
}
|
@@ -873,109 +870,22 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
873
870
|
keys() {
|
874
871
|
return Object.keys(this._env.toObject());
|
875
872
|
}
|
876
|
-
get(
|
877
|
-
return this._env.get(
|
873
|
+
get(key) {
|
874
|
+
return this._env.get(key);
|
878
875
|
}
|
879
|
-
set(
|
876
|
+
set(key, value) {
|
880
877
|
if (value) {
|
881
|
-
this._env.set(
|
878
|
+
this._env.set(key, value);
|
882
879
|
}
|
883
880
|
}
|
884
|
-
delete(
|
885
|
-
this._env.delete(
|
881
|
+
delete(key) {
|
882
|
+
this._env.delete(key);
|
886
883
|
}
|
887
884
|
};
|
888
885
|
_deno = new WeakMap();
|
889
886
|
var DenoEnvActions = _DenoEnvActions;
|
890
|
-
var DenoExitServiceImpl = class {
|
891
|
-
constructor() {
|
892
|
-
this._exitHandlers = [];
|
893
|
-
this.invoked = false;
|
894
|
-
this._handleExit = async () => {
|
895
|
-
if (this.invoked) {
|
896
|
-
return;
|
897
|
-
}
|
898
|
-
this.invoked = true;
|
899
|
-
for (const h of this._exitHandlers) {
|
900
|
-
try {
|
901
|
-
const ret = h.hdl();
|
902
|
-
if (typeof ret.then === "function") {
|
903
|
-
await ret;
|
904
|
-
}
|
905
|
-
} finally {
|
906
|
-
}
|
907
|
-
}
|
908
|
-
};
|
909
|
-
globalThis.addEventListener("unhandledrejection", (e) => {
|
910
|
-
e.preventDefault();
|
911
|
-
this.exit(19);
|
912
|
-
});
|
913
|
-
globalThis.addEventListener("error", () => {
|
914
|
-
this.exit(19);
|
915
|
-
});
|
916
|
-
globalThis.addEventListener("uncaughtException", () => {
|
917
|
-
this.exit(19);
|
918
|
-
});
|
919
|
-
globalThis.addEventListener("unload", () => {
|
920
|
-
this.exit(0);
|
921
|
-
});
|
922
|
-
Deno2.addSignalListener("SIGQUIT", () => {
|
923
|
-
this.exit(3);
|
924
|
-
});
|
925
|
-
Deno2.addSignalListener("SIGINT", () => {
|
926
|
-
this.exit(2);
|
927
|
-
});
|
928
|
-
Deno2.addSignalListener("SIGTERM", () => {
|
929
|
-
this.exit(9);
|
930
|
-
});
|
931
|
-
}
|
932
|
-
injectExitHandlers(hdls) {
|
933
|
-
this._exitHandlers = hdls;
|
934
|
-
}
|
935
|
-
exit(code) {
|
936
|
-
this._handleExit().then(() => {
|
937
|
-
Deno2.exit(code);
|
938
|
-
}).catch((err) => {
|
939
|
-
console.error("ExitService: failed to handle exit", err);
|
940
|
-
Deno2.exit(code);
|
941
|
-
});
|
942
|
-
}
|
943
|
-
};
|
944
|
-
var _DenoSystemService = class _DenoSystemService {
|
945
|
-
constructor() {
|
946
|
-
this._exitService = new DenoExitServiceImpl();
|
947
|
-
this._exitService.injectExitHandlers(_DenoSystemService._exitHandlers);
|
948
|
-
}
|
949
|
-
Env() {
|
950
|
-
return envFactory();
|
951
|
-
}
|
952
|
-
Args() {
|
953
|
-
return Deno2.args;
|
954
|
-
}
|
955
|
-
OnExit(hdl) {
|
956
|
-
const id = crypto.randomUUID();
|
957
|
-
_DenoSystemService._exitHandlers.push({ hdl, id });
|
958
|
-
return () => {
|
959
|
-
const idx = _DenoSystemService._exitHandlers.findIndex((h) => h.id === id);
|
960
|
-
if (idx >= 0) {
|
961
|
-
_DenoSystemService._exitHandlers.splice(idx, 1);
|
962
|
-
}
|
963
|
-
};
|
964
|
-
}
|
965
|
-
Exit(code) {
|
966
|
-
this._exitService.exit(code);
|
967
|
-
}
|
968
|
-
};
|
969
|
-
_DenoSystemService._exitHandlers = [];
|
970
|
-
var DenoSystemService = _DenoSystemService;
|
971
|
-
|
972
|
-
// src/node/node-file-service.ts
|
973
|
-
var import_node_path = __toESM(require("path"), 1);
|
974
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
975
|
-
var import_node_process = __toESM(require("process"), 1);
|
976
887
|
|
977
|
-
// src/node/node-
|
978
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
888
|
+
// src/node/node-env-actions.ts
|
979
889
|
var once2 = new ResolveOnce();
|
980
890
|
var _node;
|
981
891
|
var _NodeEnvActions = class _NodeEnvActions {
|
@@ -988,8 +898,8 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
988
898
|
return once2.once(() => new _NodeEnvActions(opts));
|
989
899
|
}
|
990
900
|
register(env) {
|
991
|
-
for (const
|
992
|
-
this._env[
|
901
|
+
for (const key of env.keys()) {
|
902
|
+
this._env[key] = env.get(key) || "";
|
993
903
|
}
|
994
904
|
return env;
|
995
905
|
}
|
@@ -999,120 +909,75 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
999
909
|
keys() {
|
1000
910
|
return Object.keys(this._env);
|
1001
911
|
}
|
1002
|
-
get(
|
1003
|
-
return this._env[
|
912
|
+
get(key) {
|
913
|
+
return this._env[key];
|
1004
914
|
}
|
1005
|
-
set(
|
915
|
+
set(key, value) {
|
1006
916
|
if (value) {
|
1007
|
-
this._env[
|
917
|
+
this._env[key] = value;
|
1008
918
|
}
|
1009
919
|
}
|
1010
|
-
delete(
|
1011
|
-
delete this._env[
|
920
|
+
delete(key) {
|
921
|
+
delete this._env[key];
|
1012
922
|
}
|
1013
923
|
};
|
1014
924
|
_node = new WeakMap();
|
1015
925
|
var NodeEnvActions = _NodeEnvActions;
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
}
|
1024
|
-
this.invoked = true;
|
1025
|
-
for (const h of this._exitHandlers) {
|
1026
|
-
try {
|
1027
|
-
const ret = h.hdl();
|
1028
|
-
if (typeof ret.then === "function") {
|
1029
|
-
await ret;
|
1030
|
-
}
|
1031
|
-
} finally {
|
1032
|
-
}
|
1033
|
-
}
|
1034
|
-
};
|
1035
|
-
import_node_process2.default.on("unhandledRejection", (reason, p) => {
|
1036
|
-
this.exit(19);
|
1037
|
-
});
|
1038
|
-
import_node_process2.default.on("uncaughtException", (error) => {
|
1039
|
-
this.exit(18);
|
1040
|
-
});
|
1041
|
-
import_node_process2.default.on("close", () => {
|
1042
|
-
this.exit(0);
|
1043
|
-
});
|
1044
|
-
import_node_process2.default.on("exit", () => {
|
1045
|
-
this.exit(0);
|
1046
|
-
});
|
1047
|
-
import_node_process2.default.on("SIGQUIT", () => {
|
1048
|
-
this.exit(3);
|
1049
|
-
});
|
1050
|
-
import_node_process2.default.on("SIGINT", () => {
|
1051
|
-
this.exit(2);
|
1052
|
-
});
|
1053
|
-
import_node_process2.default.on("SIGTERM", () => {
|
1054
|
-
this.exit(9);
|
1055
|
-
});
|
926
|
+
|
927
|
+
// src/web/web-env-actions.ts
|
928
|
+
var once3 = new ResolveOnce();
|
929
|
+
var BrowserEnvActions = class _BrowserEnvActions {
|
930
|
+
constructor(opts) {
|
931
|
+
this.env = /* @__PURE__ */ new Map();
|
932
|
+
this.opts = opts;
|
1056
933
|
}
|
1057
|
-
|
1058
|
-
|
934
|
+
static new(opts) {
|
935
|
+
return once3.once(() => new _BrowserEnvActions(opts));
|
1059
936
|
}
|
1060
|
-
|
1061
|
-
this.
|
1062
|
-
import_node_process2.default.exit(code);
|
1063
|
-
}).catch((err) => {
|
1064
|
-
console.error("ExitService: failed to handle exit", err);
|
1065
|
-
import_node_process2.default.exit(code);
|
1066
|
-
});
|
937
|
+
get(key) {
|
938
|
+
return this.env.get(key);
|
1067
939
|
}
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
this._exitService.injectExitHandlers(_NodeSystemService._exitHandlers);
|
940
|
+
set(key, value) {
|
941
|
+
if (value) {
|
942
|
+
this.env.set(key, value);
|
943
|
+
}
|
1073
944
|
}
|
1074
|
-
|
1075
|
-
|
945
|
+
delete(key) {
|
946
|
+
this.env.delete(key);
|
1076
947
|
}
|
1077
|
-
|
1078
|
-
return
|
948
|
+
keys() {
|
949
|
+
return Array.from(this.env.keys());
|
1079
950
|
}
|
1080
|
-
|
1081
|
-
|
1082
|
-
_NodeSystemService._exitHandlers.push({ hdl, id });
|
1083
|
-
return () => {
|
1084
|
-
const idx = _NodeSystemService._exitHandlers.findIndex((h) => h.id === id);
|
1085
|
-
if (idx >= 0) {
|
1086
|
-
_NodeSystemService._exitHandlers.splice(idx, 1);
|
1087
|
-
}
|
1088
|
-
};
|
951
|
+
active() {
|
952
|
+
return true;
|
1089
953
|
}
|
1090
|
-
|
1091
|
-
this.
|
954
|
+
register(env) {
|
955
|
+
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
956
|
+
const browser = globalThis;
|
957
|
+
browser[sym] = env;
|
958
|
+
return env;
|
1092
959
|
}
|
1093
960
|
};
|
1094
|
-
_NodeSystemService._exitHandlers = [];
|
1095
|
-
var NodeSystemService = _NodeSystemService;
|
1096
961
|
|
1097
|
-
// src/cf/cf-
|
1098
|
-
var
|
962
|
+
// src/cf/cf-env-actions.ts
|
963
|
+
var once4 = new ResolveOnce();
|
1099
964
|
var CFEnvActions = class _CFEnvActions {
|
1100
965
|
constructor(env) {
|
1101
966
|
this.injectOnRegister = {};
|
1102
967
|
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1103
968
|
}
|
1104
969
|
static new(opts) {
|
1105
|
-
return
|
970
|
+
return once4.once(() => new _CFEnvActions(opts));
|
1106
971
|
}
|
1107
972
|
static inject(o) {
|
1108
973
|
const env = _CFEnvActions.new({});
|
1109
|
-
for (const
|
1110
|
-
const value = o[
|
974
|
+
for (const key in o) {
|
975
|
+
const value = o[key];
|
1111
976
|
if (typeof value === "string") {
|
1112
977
|
if (env.env) {
|
1113
|
-
env.env.set(
|
978
|
+
env.env.set(key, value);
|
1114
979
|
} else {
|
1115
|
-
env.injectOnRegister[
|
980
|
+
env.injectOnRegister[key] = value;
|
1116
981
|
}
|
1117
982
|
}
|
1118
983
|
}
|
@@ -1122,27 +987,177 @@ var CFEnvActions = class _CFEnvActions {
|
|
1122
987
|
}
|
1123
988
|
register(env) {
|
1124
989
|
this.env = env;
|
1125
|
-
for (const
|
1126
|
-
env.set(
|
990
|
+
for (const key in this.injectOnRegister) {
|
991
|
+
env.set(key, this.injectOnRegister[key]);
|
1127
992
|
}
|
1128
993
|
return env;
|
1129
994
|
}
|
1130
|
-
get(
|
1131
|
-
return this.cfEnv.get(
|
995
|
+
get(key) {
|
996
|
+
return this.cfEnv.get(key);
|
1132
997
|
}
|
1133
|
-
set(
|
998
|
+
set(key, value) {
|
1134
999
|
if (value) {
|
1135
|
-
this.cfEnv.set(
|
1000
|
+
this.cfEnv.set(key, value);
|
1136
1001
|
}
|
1137
1002
|
}
|
1138
|
-
delete(
|
1139
|
-
this.cfEnv.delete(
|
1003
|
+
delete(key) {
|
1004
|
+
this.cfEnv.delete(key);
|
1140
1005
|
}
|
1141
1006
|
keys() {
|
1142
1007
|
return Array.from(this.cfEnv.keys());
|
1143
1008
|
}
|
1144
1009
|
};
|
1145
1010
|
|
1011
|
+
// src/result.ts
|
1012
|
+
var Result = class _Result {
|
1013
|
+
static Ok(t) {
|
1014
|
+
return new ResultOK(t);
|
1015
|
+
}
|
1016
|
+
static Err(t) {
|
1017
|
+
if (typeof t === "string") {
|
1018
|
+
return new ResultError(new Error(t));
|
1019
|
+
}
|
1020
|
+
if (_Result.Is(t)) {
|
1021
|
+
if (t.is_ok()) {
|
1022
|
+
return new ResultError(new Error("Result Error is Ok"));
|
1023
|
+
}
|
1024
|
+
return t;
|
1025
|
+
}
|
1026
|
+
return new ResultError(t);
|
1027
|
+
}
|
1028
|
+
static Is(t) {
|
1029
|
+
if (!t) {
|
1030
|
+
return false;
|
1031
|
+
}
|
1032
|
+
if (t instanceof _Result) {
|
1033
|
+
return true;
|
1034
|
+
}
|
1035
|
+
const rt = t;
|
1036
|
+
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
1037
|
+
return true;
|
1038
|
+
}
|
1039
|
+
return false;
|
1040
|
+
}
|
1041
|
+
isOk() {
|
1042
|
+
return this.is_ok();
|
1043
|
+
}
|
1044
|
+
isErr() {
|
1045
|
+
return this.is_err();
|
1046
|
+
}
|
1047
|
+
Ok() {
|
1048
|
+
return this.unwrap();
|
1049
|
+
}
|
1050
|
+
Err() {
|
1051
|
+
return this.unwrap_err();
|
1052
|
+
}
|
1053
|
+
};
|
1054
|
+
var ResultOK = class extends Result {
|
1055
|
+
constructor(t) {
|
1056
|
+
super();
|
1057
|
+
this._t = t;
|
1058
|
+
}
|
1059
|
+
is_ok() {
|
1060
|
+
return true;
|
1061
|
+
}
|
1062
|
+
is_err() {
|
1063
|
+
return false;
|
1064
|
+
}
|
1065
|
+
unwrap_err() {
|
1066
|
+
throw new Error("Result is Ok");
|
1067
|
+
}
|
1068
|
+
unwrap() {
|
1069
|
+
return this._t;
|
1070
|
+
}
|
1071
|
+
};
|
1072
|
+
var ResultError = class extends Result {
|
1073
|
+
constructor(t) {
|
1074
|
+
super();
|
1075
|
+
this._error = t;
|
1076
|
+
}
|
1077
|
+
is_ok() {
|
1078
|
+
return false;
|
1079
|
+
}
|
1080
|
+
is_err() {
|
1081
|
+
return true;
|
1082
|
+
}
|
1083
|
+
unwrap() {
|
1084
|
+
throw new Error(`Result is Err: ${this._error}`);
|
1085
|
+
}
|
1086
|
+
unwrap_err() {
|
1087
|
+
return this._error;
|
1088
|
+
}
|
1089
|
+
};
|
1090
|
+
function exception2Result(fn) {
|
1091
|
+
try {
|
1092
|
+
const res = fn();
|
1093
|
+
if (res instanceof Promise) {
|
1094
|
+
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
1095
|
+
}
|
1096
|
+
return Result.Ok(res);
|
1097
|
+
} catch (e) {
|
1098
|
+
return Result.Err(e);
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
|
1102
|
+
// src/utils/get-params-result.ts
|
1103
|
+
var _REQUIRED = class {
|
1104
|
+
constructor() {
|
1105
|
+
this.val = "REQUIRED";
|
1106
|
+
}
|
1107
|
+
};
|
1108
|
+
var _OPTIONAL = class {
|
1109
|
+
constructor() {
|
1110
|
+
this.val = "OPTIONAL";
|
1111
|
+
}
|
1112
|
+
};
|
1113
|
+
var param = {
|
1114
|
+
REQUIRED: new _REQUIRED(),
|
1115
|
+
OPTIONAL: new _OPTIONAL()
|
1116
|
+
};
|
1117
|
+
function getParamsResult(keys, getParam) {
|
1118
|
+
const keyDef = keys.flat().reduce(
|
1119
|
+
(acc, i) => {
|
1120
|
+
if (typeof i === "string") {
|
1121
|
+
acc.push({ key: i, def: void 0, isOptional: false });
|
1122
|
+
} else if (typeof i === "object") {
|
1123
|
+
acc.push(
|
1124
|
+
...Object.keys(i).map((k) => ({
|
1125
|
+
key: k,
|
1126
|
+
def: typeof i[k] === "string" ? i[k] : void 0,
|
1127
|
+
isOptional: i[k] === param.OPTIONAL
|
1128
|
+
}))
|
1129
|
+
);
|
1130
|
+
}
|
1131
|
+
return acc;
|
1132
|
+
},
|
1133
|
+
[]
|
1134
|
+
);
|
1135
|
+
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1136
|
+
const msg = keys2.join(",");
|
1137
|
+
return `missing parameters: ${msg}`;
|
1138
|
+
});
|
1139
|
+
const errors = [];
|
1140
|
+
const result = {};
|
1141
|
+
for (const kd of keyDef) {
|
1142
|
+
const val = getParam.getParam(kd.key);
|
1143
|
+
if (val === void 0) {
|
1144
|
+
if (typeof kd.def === "string") {
|
1145
|
+
result[kd.key] = kd.def;
|
1146
|
+
} else {
|
1147
|
+
if (!kd.isOptional) {
|
1148
|
+
errors.push(kd.key);
|
1149
|
+
}
|
1150
|
+
}
|
1151
|
+
} else {
|
1152
|
+
result[kd.key] = val;
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
if (errors.length) {
|
1156
|
+
return Result.Err(msgFn(...errors));
|
1157
|
+
}
|
1158
|
+
return Result.Ok(result);
|
1159
|
+
}
|
1160
|
+
|
1146
1161
|
// src/sys-env.ts
|
1147
1162
|
var envActions = [
|
1148
1163
|
{ id: "cf", fn: (opts) => CFEnvActions.new(opts) },
|
@@ -1158,30 +1173,80 @@ function envFactory(opts = {}) {
|
|
1158
1173
|
}
|
1159
1174
|
return _envFactories.get(found.id).once(() => {
|
1160
1175
|
const action = found.fn(opts);
|
1161
|
-
const ret = new
|
1176
|
+
const ret = new EnvImpl(action, opts);
|
1162
1177
|
action.register(ret);
|
1163
1178
|
return ret;
|
1164
1179
|
});
|
1165
1180
|
}
|
1166
|
-
|
1181
|
+
function isIterable(obj) {
|
1182
|
+
if (obj == null) {
|
1183
|
+
return false;
|
1184
|
+
}
|
1185
|
+
return typeof obj[Symbol.iterator] === "function";
|
1186
|
+
}
|
1187
|
+
var EnvImpl = class {
|
1167
1188
|
constructor(map, opts = {}) {
|
1168
1189
|
this._onSet = [];
|
1169
1190
|
this._map = map;
|
1170
1191
|
this._updatePresets(opts.presetEnv);
|
1171
1192
|
}
|
1193
|
+
gets(...kparams) {
|
1194
|
+
return getParamsResult(kparams, {
|
1195
|
+
getParam: (k) => this.get(k)
|
1196
|
+
});
|
1197
|
+
}
|
1198
|
+
sets(...keys) {
|
1199
|
+
keys.forEach((key) => {
|
1200
|
+
if (Array.isArray(key)) {
|
1201
|
+
if (key.length === 2) {
|
1202
|
+
const [k, v] = key;
|
1203
|
+
if (typeof k === "string" && typeof v === "string") {
|
1204
|
+
this.set(k, v);
|
1205
|
+
return;
|
1206
|
+
}
|
1207
|
+
}
|
1208
|
+
for (const item of key) {
|
1209
|
+
if (Array.isArray(item)) {
|
1210
|
+
if (item.length === 2) {
|
1211
|
+
const [k, v] = item;
|
1212
|
+
if (typeof k === "string" && typeof v === "string") {
|
1213
|
+
this.set(k, v);
|
1214
|
+
}
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
}
|
1218
|
+
} else {
|
1219
|
+
if (isIterable(key)) {
|
1220
|
+
for (const [k, v] of key) {
|
1221
|
+
if (typeof k === "string" && typeof v === "string") {
|
1222
|
+
this.set(k, v);
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
} else {
|
1226
|
+
const rKey = key;
|
1227
|
+
for (const k in rKey) {
|
1228
|
+
const v = rKey[k];
|
1229
|
+
if (typeof k === "string" && typeof v === "string") {
|
1230
|
+
this.set(k, v);
|
1231
|
+
}
|
1232
|
+
}
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
});
|
1236
|
+
}
|
1172
1237
|
_updatePresets(presetEnv) {
|
1173
1238
|
if (!presetEnv) {
|
1174
1239
|
return;
|
1175
1240
|
}
|
1176
|
-
for (const [
|
1177
|
-
this._map.set(
|
1241
|
+
for (const [key, value] of presetEnv) {
|
1242
|
+
this._map.set(key, value);
|
1178
1243
|
}
|
1179
1244
|
}
|
1180
|
-
_applyOnSet(onSet,
|
1245
|
+
_applyOnSet(onSet, key, value) {
|
1181
1246
|
onSet.forEach((item) => {
|
1182
1247
|
let keys = [];
|
1183
|
-
if (
|
1184
|
-
keys = [
|
1248
|
+
if (key) {
|
1249
|
+
keys = [key];
|
1185
1250
|
} else {
|
1186
1251
|
keys = this._map.keys();
|
1187
1252
|
}
|
@@ -1195,9 +1260,9 @@ var EnvImpl2 = class {
|
|
1195
1260
|
return false;
|
1196
1261
|
}).forEach((k) => {
|
1197
1262
|
let v;
|
1198
|
-
if (!
|
1263
|
+
if (!key && !value) {
|
1199
1264
|
v = this._map.get(k);
|
1200
|
-
} else if (
|
1265
|
+
} else if (key && !value) {
|
1201
1266
|
v = void 0;
|
1202
1267
|
} else {
|
1203
1268
|
v = value;
|
@@ -1215,56 +1280,23 @@ var EnvImpl2 = class {
|
|
1215
1280
|
this._onSet.push(item);
|
1216
1281
|
this._applyOnSet([item]);
|
1217
1282
|
}
|
1218
|
-
get(
|
1219
|
-
return this._map.get(
|
1283
|
+
get(key) {
|
1284
|
+
return this._map.get(key);
|
1220
1285
|
}
|
1221
|
-
set(
|
1286
|
+
set(key, value) {
|
1222
1287
|
if (!value) {
|
1223
1288
|
return;
|
1224
1289
|
}
|
1225
|
-
this._map.set(
|
1226
|
-
this._applyOnSet(this._onSet,
|
1290
|
+
this._map.set(key, value);
|
1291
|
+
this._applyOnSet(this._onSet, key, value);
|
1227
1292
|
}
|
1228
|
-
delete(
|
1229
|
-
this._map.delete(
|
1230
|
-
this._applyOnSet(this._onSet,
|
1293
|
+
delete(key) {
|
1294
|
+
this._map.delete(key);
|
1295
|
+
this._applyOnSet(this._onSet, key);
|
1231
1296
|
}
|
1232
1297
|
};
|
1233
1298
|
|
1234
1299
|
// src/web/web-sys-abstraction.ts
|
1235
|
-
var once4 = new ResolveOnce();
|
1236
|
-
var BrowserEnvActions = class _BrowserEnvActions {
|
1237
|
-
constructor(opts) {
|
1238
|
-
this.env = /* @__PURE__ */ new Map();
|
1239
|
-
this.opts = opts;
|
1240
|
-
}
|
1241
|
-
static new(opts) {
|
1242
|
-
return once4.once(() => new _BrowserEnvActions(opts));
|
1243
|
-
}
|
1244
|
-
get(key2) {
|
1245
|
-
return this.env.get(key2);
|
1246
|
-
}
|
1247
|
-
set(key2, value) {
|
1248
|
-
if (value) {
|
1249
|
-
this.env.set(key2, value);
|
1250
|
-
}
|
1251
|
-
}
|
1252
|
-
delete(key2) {
|
1253
|
-
this.env.delete(key2);
|
1254
|
-
}
|
1255
|
-
keys() {
|
1256
|
-
return Array.from(this.env.keys());
|
1257
|
-
}
|
1258
|
-
active() {
|
1259
|
-
return true;
|
1260
|
-
}
|
1261
|
-
register(env) {
|
1262
|
-
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
1263
|
-
const browser = globalThis;
|
1264
|
-
browser[sym] = env;
|
1265
|
-
return env;
|
1266
|
-
}
|
1267
|
-
};
|
1268
1300
|
var WebFileService = class {
|
1269
1301
|
get baseDir() {
|
1270
1302
|
throw new Error("basedir-Method not implemented.");
|
@@ -1327,106 +1359,15 @@ var WebSystemService = class {
|
|
1327
1359
|
}
|
1328
1360
|
};
|
1329
1361
|
var my = void 0;
|
1330
|
-
function WebSysAbstraction(
|
1362
|
+
function WebSysAbstraction(param2) {
|
1331
1363
|
if (!my) {
|
1332
1364
|
my = new BaseSysAbstraction({
|
1333
|
-
TxtEnDecoder: (
|
1365
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || Utf8EnDecoderSingleton(),
|
1334
1366
|
FileSystem: new WebFileService(),
|
1335
1367
|
SystemService: new WebSystemService()
|
1336
1368
|
});
|
1337
1369
|
}
|
1338
|
-
return new WrapperSysAbstraction(my,
|
1339
|
-
}
|
1340
|
-
|
1341
|
-
// src/result.ts
|
1342
|
-
var Result = class _Result {
|
1343
|
-
static Ok(t) {
|
1344
|
-
return new ResultOK(t);
|
1345
|
-
}
|
1346
|
-
static Err(t) {
|
1347
|
-
if (typeof t === "string") {
|
1348
|
-
return new ResultError(new Error(t));
|
1349
|
-
}
|
1350
|
-
if (_Result.Is(t)) {
|
1351
|
-
if (t.is_ok()) {
|
1352
|
-
return new ResultError(new Error("Result Error is Ok"));
|
1353
|
-
}
|
1354
|
-
return t;
|
1355
|
-
}
|
1356
|
-
return new ResultError(t);
|
1357
|
-
}
|
1358
|
-
static Is(t) {
|
1359
|
-
if (!t) {
|
1360
|
-
return false;
|
1361
|
-
}
|
1362
|
-
if (t instanceof _Result) {
|
1363
|
-
return true;
|
1364
|
-
}
|
1365
|
-
const rt = t;
|
1366
|
-
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
1367
|
-
return true;
|
1368
|
-
}
|
1369
|
-
return false;
|
1370
|
-
}
|
1371
|
-
isOk() {
|
1372
|
-
return this.is_ok();
|
1373
|
-
}
|
1374
|
-
isErr() {
|
1375
|
-
return this.is_err();
|
1376
|
-
}
|
1377
|
-
Ok() {
|
1378
|
-
return this.unwrap();
|
1379
|
-
}
|
1380
|
-
Err() {
|
1381
|
-
return this.unwrap_err();
|
1382
|
-
}
|
1383
|
-
};
|
1384
|
-
var ResultOK = class extends Result {
|
1385
|
-
constructor(t) {
|
1386
|
-
super();
|
1387
|
-
this._t = t;
|
1388
|
-
}
|
1389
|
-
is_ok() {
|
1390
|
-
return true;
|
1391
|
-
}
|
1392
|
-
is_err() {
|
1393
|
-
return false;
|
1394
|
-
}
|
1395
|
-
unwrap_err() {
|
1396
|
-
throw new Error("Result is Ok");
|
1397
|
-
}
|
1398
|
-
unwrap() {
|
1399
|
-
return this._t;
|
1400
|
-
}
|
1401
|
-
};
|
1402
|
-
var ResultError = class extends Result {
|
1403
|
-
constructor(t) {
|
1404
|
-
super();
|
1405
|
-
this._error = t;
|
1406
|
-
}
|
1407
|
-
is_ok() {
|
1408
|
-
return false;
|
1409
|
-
}
|
1410
|
-
is_err() {
|
1411
|
-
return true;
|
1412
|
-
}
|
1413
|
-
unwrap() {
|
1414
|
-
throw new Error(`Result is Err: ${this._error}`);
|
1415
|
-
}
|
1416
|
-
unwrap_err() {
|
1417
|
-
return this._error;
|
1418
|
-
}
|
1419
|
-
};
|
1420
|
-
function exception2Result(fn) {
|
1421
|
-
try {
|
1422
|
-
const res = fn();
|
1423
|
-
if (res instanceof Promise) {
|
1424
|
-
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
1425
|
-
}
|
1426
|
-
return Result.Ok(res);
|
1427
|
-
} catch (e) {
|
1428
|
-
return Result.Err(e);
|
1429
|
-
}
|
1370
|
+
return new WrapperSysAbstraction(my, param2);
|
1430
1371
|
}
|
1431
1372
|
|
1432
1373
|
// src/utils/relative-path.ts
|
@@ -1475,23 +1416,23 @@ var Path = class {
|
|
1475
1416
|
this.parts.push(part);
|
1476
1417
|
}
|
1477
1418
|
};
|
1478
|
-
function splitPath(
|
1419
|
+
function splitPath(path) {
|
1479
1420
|
const p = new Path();
|
1480
|
-
if (
|
1421
|
+
if (path === "") {
|
1481
1422
|
return p;
|
1482
1423
|
}
|
1483
|
-
for (let count = 0;
|
1484
|
-
if (
|
1424
|
+
for (let count = 0; path.length; count++) {
|
1425
|
+
if (path.match(/^\/+/)) {
|
1485
1426
|
if (count === 0) {
|
1486
1427
|
p.add(3 /* Root */);
|
1487
1428
|
} else {
|
1488
1429
|
p.add(1 /* Slash */);
|
1489
1430
|
}
|
1490
|
-
|
1431
|
+
path = path.replace(/^\/+/, "");
|
1491
1432
|
} else {
|
1492
|
-
const part =
|
1433
|
+
const part = path.replace(/\/.*$/, "");
|
1493
1434
|
p.add(part);
|
1494
|
-
|
1435
|
+
path = path.replace(/^[^/]+/, "");
|
1495
1436
|
}
|
1496
1437
|
}
|
1497
1438
|
return p;
|
@@ -1500,29 +1441,29 @@ function pathJoin(...paths) {
|
|
1500
1441
|
let prev = "";
|
1501
1442
|
const res = [];
|
1502
1443
|
for (let i = 0; i < paths.length; i++) {
|
1503
|
-
const
|
1504
|
-
if (
|
1444
|
+
const path = paths[i];
|
1445
|
+
if (path === "") {
|
1505
1446
|
continue;
|
1506
1447
|
}
|
1507
|
-
if (!(prev.endsWith("/") ||
|
1448
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1508
1449
|
if (prev !== "") {
|
1509
1450
|
res.push("/");
|
1510
1451
|
}
|
1511
|
-
res.push(
|
1452
|
+
res.push(path);
|
1512
1453
|
} else {
|
1513
|
-
res.push(
|
1454
|
+
res.push(path);
|
1514
1455
|
}
|
1515
|
-
prev =
|
1456
|
+
prev = path;
|
1516
1457
|
}
|
1517
1458
|
return res.join("");
|
1518
1459
|
}
|
1519
|
-
function relativePath(
|
1520
|
-
const relativeParts = splitPath(
|
1460
|
+
function relativePath(path, relative) {
|
1461
|
+
const relativeParts = splitPath(relative);
|
1521
1462
|
let result;
|
1522
1463
|
if (relativeParts.parts[0] === 3 /* Root */) {
|
1523
|
-
result =
|
1464
|
+
result = relative;
|
1524
1465
|
} else {
|
1525
|
-
result = pathJoin(
|
1466
|
+
result = pathJoin(path, relative);
|
1526
1467
|
}
|
1527
1468
|
const unoptPath = splitPath(result);
|
1528
1469
|
const out = [];
|
@@ -1574,45 +1515,45 @@ function stripper(strip, obj) {
|
|
1574
1515
|
});
|
1575
1516
|
return localStripper(void 0, restrips, obj);
|
1576
1517
|
}
|
1577
|
-
function localStripper(
|
1518
|
+
function localStripper(path, restrips, obj) {
|
1578
1519
|
if (typeof obj !== "object" || obj === null) {
|
1579
1520
|
return obj;
|
1580
1521
|
}
|
1581
1522
|
if (Array.isArray(obj)) {
|
1582
|
-
return obj.map((i) => localStripper(
|
1523
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
1583
1524
|
}
|
1584
1525
|
const ret = { ...obj };
|
1585
|
-
const matcher = (
|
1526
|
+
const matcher = (key, nextPath) => {
|
1586
1527
|
for (const re of restrips) {
|
1587
|
-
if (re.test(
|
1528
|
+
if (re.test(key) || re.test(nextPath)) {
|
1588
1529
|
return true;
|
1589
1530
|
}
|
1590
1531
|
}
|
1591
1532
|
return false;
|
1592
1533
|
};
|
1593
|
-
for (const
|
1594
|
-
if (Object.prototype.hasOwnProperty.call(ret,
|
1534
|
+
for (const key in ret) {
|
1535
|
+
if (Object.prototype.hasOwnProperty.call(ret, key)) {
|
1595
1536
|
let nextPath;
|
1596
|
-
if (
|
1597
|
-
nextPath = [
|
1537
|
+
if (path) {
|
1538
|
+
nextPath = [path, key].join(".");
|
1598
1539
|
} else {
|
1599
|
-
nextPath =
|
1540
|
+
nextPath = key;
|
1600
1541
|
}
|
1601
|
-
if (matcher(
|
1602
|
-
delete ret[
|
1542
|
+
if (matcher(key, nextPath)) {
|
1543
|
+
delete ret[key];
|
1603
1544
|
continue;
|
1604
1545
|
}
|
1605
|
-
if (typeof ret[
|
1606
|
-
if (Array.isArray(ret[
|
1607
|
-
ret[
|
1608
|
-
const toDelete = matcher(
|
1546
|
+
if (typeof ret[key] === "object") {
|
1547
|
+
if (Array.isArray(ret[key])) {
|
1548
|
+
ret[key] = ret[key].reduce((acc, v, i) => {
|
1549
|
+
const toDelete = matcher(key, `${nextPath}[${i}]`);
|
1609
1550
|
if (!toDelete) {
|
1610
1551
|
acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
|
1611
1552
|
}
|
1612
1553
|
return acc;
|
1613
1554
|
}, []);
|
1614
1555
|
} else {
|
1615
|
-
ret[
|
1556
|
+
ret[key] = localStripper(nextPath, restrips, ret[key]);
|
1616
1557
|
}
|
1617
1558
|
}
|
1618
1559
|
}
|
@@ -1621,29 +1562,15 @@ function localStripper(path3, restrips, obj) {
|
|
1621
1562
|
}
|
1622
1563
|
|
1623
1564
|
// src/uri.ts
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
}
|
1628
|
-
};
|
1629
|
-
var _OPTIONAL = class {
|
1630
|
-
constructor() {
|
1631
|
-
this.val = "OPTIONAL";
|
1632
|
-
}
|
1633
|
-
};
|
1634
|
-
var key = {
|
1635
|
-
REQUIRED: new _REQUIRED(),
|
1636
|
-
OPTIONAL: new _OPTIONAL()
|
1637
|
-
};
|
1638
|
-
function coerceKey(key2, def) {
|
1639
|
-
if (typeof key2 === "object") {
|
1640
|
-
const keys = Object.keys(key2);
|
1565
|
+
function coerceKey(key, def) {
|
1566
|
+
if (typeof key === "object") {
|
1567
|
+
const keys = Object.keys(key);
|
1641
1568
|
if (keys.length !== 1) {
|
1642
|
-
throw new Error(`Invalid key: ${JSON.stringify(
|
1569
|
+
throw new Error(`Invalid key: ${JSON.stringify(key)}`);
|
1643
1570
|
}
|
1644
|
-
return { key: keys[0], def:
|
1571
|
+
return { key: keys[0], def: key[keys[0]] };
|
1645
1572
|
}
|
1646
|
-
return { key
|
1573
|
+
return { key, def };
|
1647
1574
|
}
|
1648
1575
|
function falsy2undef(value) {
|
1649
1576
|
return value === void 0 || value === null ? void 0 : value;
|
@@ -1746,8 +1673,8 @@ var MutableURL = class _MutableURL extends URL {
|
|
1746
1673
|
toString() {
|
1747
1674
|
let search = "";
|
1748
1675
|
if (this._sysURL.searchParams.size) {
|
1749
|
-
for (const [
|
1750
|
-
search += `${!search.length ? "?" : "&"}${
|
1676
|
+
for (const [key, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
|
1677
|
+
search += `${!search.length ? "?" : "&"}${key}=${encodeURIComponent(value)}`;
|
1751
1678
|
}
|
1752
1679
|
}
|
1753
1680
|
let hostpart = "";
|
@@ -1782,57 +1709,14 @@ function from(fac, strURLUri, defaultProtocol) {
|
|
1782
1709
|
throw new Error(`Invalid argument: ${typeof strURLUri}`);
|
1783
1710
|
}
|
1784
1711
|
}
|
1785
|
-
function getParamResult(
|
1786
|
-
return `missing parameter: ${
|
1712
|
+
function getParamResult(key, val, msgFn = (key2) => {
|
1713
|
+
return `missing parameter: ${key2}`;
|
1787
1714
|
}) {
|
1788
1715
|
if (val === void 0) {
|
1789
|
-
return Result.Err(msgFn(
|
1716
|
+
return Result.Err(msgFn(key));
|
1790
1717
|
}
|
1791
1718
|
return Result.Ok(val);
|
1792
1719
|
}
|
1793
|
-
function getParamsResult(keys, getParam) {
|
1794
|
-
const keyDef = keys.flat().reduce(
|
1795
|
-
(acc, i) => {
|
1796
|
-
if (typeof i === "string") {
|
1797
|
-
acc.push({ key: i, def: void 0, isOptional: false });
|
1798
|
-
} else if (typeof i === "object") {
|
1799
|
-
acc.push(
|
1800
|
-
...Object.keys(i).map((k) => ({
|
1801
|
-
key: k,
|
1802
|
-
def: typeof i[k] === "string" ? i[k] : void 0,
|
1803
|
-
isOptional: i[k] instanceof _OPTIONAL
|
1804
|
-
}))
|
1805
|
-
);
|
1806
|
-
}
|
1807
|
-
return acc;
|
1808
|
-
},
|
1809
|
-
[]
|
1810
|
-
);
|
1811
|
-
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1812
|
-
const msg = keys2.join(",");
|
1813
|
-
return `missing parameters: ${msg}`;
|
1814
|
-
});
|
1815
|
-
const errors = [];
|
1816
|
-
const result = {};
|
1817
|
-
for (const kd of keyDef) {
|
1818
|
-
const val = getParam.getParam(kd.key);
|
1819
|
-
if (val === void 0) {
|
1820
|
-
if (typeof kd.def === "string") {
|
1821
|
-
result[kd.key] = kd.def;
|
1822
|
-
} else {
|
1823
|
-
if (!kd.isOptional) {
|
1824
|
-
errors.push(kd.key);
|
1825
|
-
}
|
1826
|
-
}
|
1827
|
-
} else {
|
1828
|
-
result[kd.key] = val;
|
1829
|
-
}
|
1830
|
-
}
|
1831
|
-
if (errors.length) {
|
1832
|
-
return Result.Err(msgFn(...errors));
|
1833
|
-
}
|
1834
|
-
return Result.Ok(result);
|
1835
|
-
}
|
1836
1720
|
var BuildURI = class _BuildURI {
|
1837
1721
|
// pathname needs this
|
1838
1722
|
constructor(url) {
|
@@ -1886,47 +1770,47 @@ var BuildURI = class _BuildURI {
|
|
1886
1770
|
const pathname = "./" + appendUrl.pathname;
|
1887
1771
|
const basePath = this._url.pathname;
|
1888
1772
|
this.pathname(relativePath(basePath, pathname));
|
1889
|
-
for (const [
|
1890
|
-
this.setParam(
|
1773
|
+
for (const [key, value] of appendUrl.getParams) {
|
1774
|
+
this.setParam(key, value);
|
1891
1775
|
}
|
1892
1776
|
return this;
|
1893
1777
|
}
|
1894
1778
|
cleanParams() {
|
1895
|
-
for (const
|
1896
|
-
this._url.searchParams.delete(
|
1779
|
+
for (const key of Array.from(this._url.searchParams.keys())) {
|
1780
|
+
this._url.searchParams.delete(key);
|
1897
1781
|
}
|
1898
1782
|
return this;
|
1899
1783
|
}
|
1900
|
-
delParam(
|
1901
|
-
this._url.searchParams.delete(
|
1784
|
+
delParam(key) {
|
1785
|
+
this._url.searchParams.delete(key);
|
1902
1786
|
return this;
|
1903
1787
|
}
|
1904
|
-
defParam(
|
1905
|
-
if (!this._url.searchParams.has(
|
1906
|
-
this._url.searchParams.set(
|
1788
|
+
defParam(key, str) {
|
1789
|
+
if (!this._url.searchParams.has(key)) {
|
1790
|
+
this._url.searchParams.set(key, str);
|
1907
1791
|
}
|
1908
1792
|
return this;
|
1909
1793
|
}
|
1910
|
-
setParam(
|
1911
|
-
this._url.searchParams.set(
|
1794
|
+
setParam(key, str) {
|
1795
|
+
this._url.searchParams.set(key, str);
|
1912
1796
|
return this;
|
1913
1797
|
}
|
1914
|
-
hasParam(
|
1915
|
-
return this._url.searchParams.has(
|
1798
|
+
hasParam(key) {
|
1799
|
+
return this._url.searchParams.has(key);
|
1916
1800
|
}
|
1917
1801
|
get getParams() {
|
1918
1802
|
return this._url.searchParams.entries();
|
1919
1803
|
}
|
1920
|
-
getParam(
|
1921
|
-
const { key: k, def: d } = coerceKey(
|
1804
|
+
getParam(key, def) {
|
1805
|
+
const { key: k, def: d } = coerceKey(key, def);
|
1922
1806
|
let val = this._url.searchParams.get(k);
|
1923
1807
|
if (!falsy2undef(val) && d) {
|
1924
1808
|
val = d;
|
1925
1809
|
}
|
1926
1810
|
return falsy2undef(val);
|
1927
1811
|
}
|
1928
|
-
getParamResult(
|
1929
|
-
return getParamResult(
|
1812
|
+
getParamResult(key, msgFn) {
|
1813
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
1930
1814
|
}
|
1931
1815
|
getParamsResult(...keys) {
|
1932
1816
|
return getParamsResult(keys, this);
|
@@ -1969,8 +1853,8 @@ var URI = class _URI {
|
|
1969
1853
|
if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
|
1970
1854
|
intoUrl.pathname(fromUrl.pathname);
|
1971
1855
|
}
|
1972
|
-
for (const [
|
1973
|
-
intoUrl.setParam(
|
1856
|
+
for (const [key, value] of fromUrl.getParams) {
|
1857
|
+
intoUrl.setParam(key, value);
|
1974
1858
|
}
|
1975
1859
|
return intoUrl.URI();
|
1976
1860
|
}
|
@@ -2023,19 +1907,19 @@ var URI = class _URI {
|
|
2023
1907
|
get getParams() {
|
2024
1908
|
return this._url.searchParams.entries();
|
2025
1909
|
}
|
2026
|
-
hasParam(
|
2027
|
-
return this._url.searchParams.has(
|
1910
|
+
hasParam(key) {
|
1911
|
+
return this._url.searchParams.has(key);
|
2028
1912
|
}
|
2029
|
-
getParam(
|
2030
|
-
const { key: k, def: d } = coerceKey(
|
1913
|
+
getParam(key, def) {
|
1914
|
+
const { key: k, def: d } = coerceKey(key, def);
|
2031
1915
|
let val = this._url.searchParams.get(k);
|
2032
1916
|
if (!falsy2undef(val) && d) {
|
2033
1917
|
val = d;
|
2034
1918
|
}
|
2035
1919
|
return falsy2undef(val);
|
2036
1920
|
}
|
2037
|
-
getParamResult(
|
2038
|
-
return getParamResult(
|
1921
|
+
getParamResult(key, msgFn) {
|
1922
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
2039
1923
|
}
|
2040
1924
|
getParamsResult(...keys) {
|
2041
1925
|
return getParamsResult(keys, this);
|
@@ -2092,7 +1976,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
2092
1976
|
this.ready = Promise.resolve(void 0);
|
2093
1977
|
this.closed = Promise.resolve(void 0);
|
2094
1978
|
}
|
2095
|
-
|
1979
|
+
write(chunk) {
|
2096
1980
|
let strObj = this.decoder.decode(chunk).trimEnd();
|
2097
1981
|
let output = "log";
|
2098
1982
|
try {
|
@@ -2110,6 +1994,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
2110
1994
|
default:
|
2111
1995
|
console.log(strObj);
|
2112
1996
|
}
|
1997
|
+
return Promise.resolve();
|
2113
1998
|
}
|
2114
1999
|
};
|
2115
2000
|
var ConsoleWriterStream = class {
|
@@ -2120,8 +2005,8 @@ var ConsoleWriterStream = class {
|
|
2120
2005
|
abort(reason) {
|
2121
2006
|
throw new Error("Method not implemented.");
|
2122
2007
|
}
|
2123
|
-
|
2124
|
-
return;
|
2008
|
+
close() {
|
2009
|
+
return Promise.resolve();
|
2125
2010
|
}
|
2126
2011
|
getWriter() {
|
2127
2012
|
if (this.locked) {
|
@@ -2149,7 +2034,7 @@ var LogWriterStream = class {
|
|
2149
2034
|
const writer = this._out.getWriter();
|
2150
2035
|
await writer.ready;
|
2151
2036
|
await writer.write(encoded);
|
2152
|
-
|
2037
|
+
writer.releaseLock();
|
2153
2038
|
} catch (err) {
|
2154
2039
|
console.error("Chunk error:", err);
|
2155
2040
|
}
|
@@ -2173,7 +2058,9 @@ var LogWriterStream = class {
|
|
2173
2058
|
return;
|
2174
2059
|
}
|
2175
2060
|
const my2 = this._toFlush.shift();
|
2176
|
-
my2 == null ? void 0 : my2().
|
2061
|
+
my2 == null ? void 0 : my2().catch((e) => {
|
2062
|
+
console.error("Flush error:", e);
|
2063
|
+
}).finally(() => {
|
2177
2064
|
this._flush(this._toFlush);
|
2178
2065
|
});
|
2179
2066
|
}
|
@@ -2195,9 +2082,6 @@ function getLen(value, lvs) {
|
|
2195
2082
|
}
|
2196
2083
|
return logValue(() => -1, lvs);
|
2197
2084
|
}
|
2198
|
-
function hash(value) {
|
2199
|
-
return "not implemented";
|
2200
|
-
}
|
2201
2085
|
function toLogValue(lop) {
|
2202
2086
|
if (lop && typeof lop.then === "function") {
|
2203
2087
|
throw new Error("async logValue Not implemented");
|
@@ -2296,9 +2180,9 @@ var LoggerImpl = class _LoggerImpl {
|
|
2296
2180
|
this.levelHandler.disableLevel(level, ...modules);
|
2297
2181
|
return this;
|
2298
2182
|
}
|
2299
|
-
Module(
|
2300
|
-
this._attributes["module"] = logValue(
|
2301
|
-
this._withAttributes["module"] = logValue(
|
2183
|
+
Module(key) {
|
2184
|
+
this._attributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
|
2185
|
+
this._withAttributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
|
2302
2186
|
return this;
|
2303
2187
|
}
|
2304
2188
|
// if the string is "*" it will enable for all modules
|
@@ -2339,10 +2223,10 @@ var LoggerImpl = class _LoggerImpl {
|
|
2339
2223
|
}
|
2340
2224
|
Err(err) {
|
2341
2225
|
var _a;
|
2342
|
-
let
|
2226
|
+
let key = "error";
|
2343
2227
|
if (Result.Is(err)) {
|
2344
2228
|
if (err.isOk()) {
|
2345
|
-
|
2229
|
+
key = "noerror";
|
2346
2230
|
err = err.Ok();
|
2347
2231
|
} else {
|
2348
2232
|
err = err.Err();
|
@@ -2350,12 +2234,12 @@ var LoggerImpl = class _LoggerImpl {
|
|
2350
2234
|
}
|
2351
2235
|
if (err instanceof Error) {
|
2352
2236
|
if (err.cause) {
|
2353
|
-
this.coerceKey(
|
2237
|
+
this.coerceKey(key, {
|
2354
2238
|
message: err.message,
|
2355
2239
|
cause: err.cause
|
2356
2240
|
});
|
2357
2241
|
} else {
|
2358
|
-
this._attributes[
|
2242
|
+
this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
|
2359
2243
|
}
|
2360
2244
|
if (this.levelHandler.isStackExposed) {
|
2361
2245
|
this._attributes["stack"] = logValue(
|
@@ -2364,7 +2248,7 @@ var LoggerImpl = class _LoggerImpl {
|
|
2364
2248
|
);
|
2365
2249
|
}
|
2366
2250
|
} else {
|
2367
|
-
this.Any(
|
2251
|
+
this.Any(key, err);
|
2368
2252
|
}
|
2369
2253
|
return this;
|
2370
2254
|
}
|
@@ -2372,22 +2256,22 @@ var LoggerImpl = class _LoggerImpl {
|
|
2372
2256
|
this._attributes["level"] = logValue(l, toLogValueCtx(this.levelHandler));
|
2373
2257
|
return this;
|
2374
2258
|
}
|
2375
|
-
Ref(
|
2259
|
+
Ref(key, action) {
|
2376
2260
|
if (typeof action === "function") {
|
2377
|
-
this._attributes[
|
2261
|
+
this._attributes[key] = logValue(action, toLogValueCtx(this.levelHandler));
|
2378
2262
|
} else if (typeof action.toString === "function") {
|
2379
|
-
this._attributes[
|
2263
|
+
this._attributes[key] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
|
2380
2264
|
} else {
|
2381
|
-
this._attributes[
|
2265
|
+
this._attributes[key] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
|
2382
2266
|
}
|
2383
2267
|
return this;
|
2384
2268
|
}
|
2385
|
-
Bool(
|
2386
|
-
this.coerceKey(
|
2269
|
+
Bool(key, value) {
|
2270
|
+
this.coerceKey(key, !!value);
|
2387
2271
|
return this;
|
2388
2272
|
}
|
2389
2273
|
Http(...mix) {
|
2390
|
-
const
|
2274
|
+
const key = mix.find((x) => typeof x === "string");
|
2391
2275
|
mix = mix.filter((x) => typeof x !== "string");
|
2392
2276
|
const resErrors = mix.filter((x) => Result.Is(x) && x.isErr());
|
2393
2277
|
if (resErrors.length) {
|
@@ -2407,76 +2291,74 @@ var LoggerImpl = class _LoggerImpl {
|
|
2407
2291
|
reqAndOrres = req;
|
2408
2292
|
}
|
2409
2293
|
if (reqAndOrres) {
|
2410
|
-
this.Any(
|
2294
|
+
this.Any(key || "Http", reqAndOrres);
|
2411
2295
|
}
|
2412
2296
|
return this;
|
2413
2297
|
}
|
2414
2298
|
Pair(x) {
|
2415
|
-
for (const
|
2416
|
-
const value = x[
|
2299
|
+
for (const key of Object.keys(x)) {
|
2300
|
+
const value = x[key];
|
2417
2301
|
if (value instanceof LogValue) {
|
2418
|
-
this._attributes[
|
2302
|
+
this._attributes[key] = value;
|
2419
2303
|
continue;
|
2420
2304
|
}
|
2421
2305
|
if (Result.Is(value)) {
|
2422
|
-
this.Result(
|
2306
|
+
this.Result(key, value);
|
2423
2307
|
continue;
|
2424
2308
|
}
|
2425
|
-
this.Any(
|
2309
|
+
this.Any(key, value);
|
2426
2310
|
}
|
2427
2311
|
return this;
|
2428
2312
|
}
|
2429
|
-
Result(
|
2313
|
+
Result(key, res) {
|
2430
2314
|
if (res.isOk()) {
|
2431
|
-
this._attributes[
|
2315
|
+
this._attributes[key] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
|
2432
2316
|
} else {
|
2433
2317
|
this.Err(res.Err());
|
2434
2318
|
}
|
2435
2319
|
return this;
|
2436
2320
|
}
|
2437
|
-
Len(value,
|
2438
|
-
this._attributes[
|
2321
|
+
Len(value, key = "len") {
|
2322
|
+
this._attributes[key] = getLen(value, toLogValueCtx(this.levelHandler));
|
2439
2323
|
return this;
|
2440
2324
|
}
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
);
|
2445
|
-
return this;
|
2325
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2326
|
+
Hash(value, key = "hash") {
|
2327
|
+
throw new Error("Not implemented");
|
2446
2328
|
}
|
2447
|
-
Url(url,
|
2448
|
-
this.Ref(
|
2329
|
+
Url(url, key = "url") {
|
2330
|
+
this.Ref(key, () => URI.from(url).toString());
|
2449
2331
|
return this;
|
2450
2332
|
}
|
2451
|
-
coerceKey(
|
2452
|
-
if (typeof
|
2453
|
-
this._attributes[
|
2333
|
+
coerceKey(key, value) {
|
2334
|
+
if (typeof key === "string") {
|
2335
|
+
this._attributes[key] = logValue(value, toLogValueCtx(this.levelHandler));
|
2454
2336
|
} else {
|
2455
|
-
this.Pair(
|
2337
|
+
this.Pair(key);
|
2456
2338
|
}
|
2457
2339
|
}
|
2458
|
-
Str(
|
2459
|
-
this.coerceKey(
|
2340
|
+
Str(key, value) {
|
2341
|
+
this.coerceKey(key, value);
|
2460
2342
|
return this;
|
2461
2343
|
}
|
2462
|
-
Any(
|
2463
|
-
this.coerceKey(
|
2344
|
+
Any(key, value) {
|
2345
|
+
this.coerceKey(key, value);
|
2464
2346
|
return this;
|
2465
2347
|
}
|
2466
|
-
Dur(
|
2467
|
-
this._attributes[
|
2348
|
+
Dur(key, nsec) {
|
2349
|
+
this._attributes[key] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
|
2468
2350
|
return this;
|
2469
2351
|
}
|
2470
|
-
Uint64(
|
2471
|
-
this.coerceKey(
|
2352
|
+
Uint64(key, value) {
|
2353
|
+
this.coerceKey(key, value);
|
2472
2354
|
return this;
|
2473
2355
|
}
|
2474
|
-
Int(
|
2475
|
-
return this.Uint64(
|
2356
|
+
Int(key, value) {
|
2357
|
+
return this.Uint64(key, value);
|
2476
2358
|
}
|
2477
2359
|
async Flush() {
|
2478
|
-
return new Promise((
|
2479
|
-
this._logWriter._flush(void 0,
|
2360
|
+
return new Promise((resolve) => {
|
2361
|
+
this._logWriter._flush(void 0, resolve);
|
2480
2362
|
});
|
2481
2363
|
}
|
2482
2364
|
With() {
|
@@ -2495,8 +2377,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2495
2377
|
}
|
2496
2378
|
_resetAttributes(fn) {
|
2497
2379
|
const ret = fn();
|
2498
|
-
Object.keys(this._attributes).forEach((
|
2499
|
-
delete this._attributes[
|
2380
|
+
Object.keys(this._attributes).forEach((key) => {
|
2381
|
+
delete this._attributes[key];
|
2500
2382
|
});
|
2501
2383
|
Object.assign(this._attributes, this._withAttributes);
|
2502
2384
|
return ret;
|
@@ -2563,8 +2445,8 @@ var WithLoggerBuilder = class {
|
|
2563
2445
|
this._li.levelHandler.enableLevel(level, ...modules);
|
2564
2446
|
return this;
|
2565
2447
|
}
|
2566
|
-
Module(
|
2567
|
-
this._li.Module(
|
2448
|
+
Module(key) {
|
2449
|
+
this._li.Module(key);
|
2568
2450
|
return this;
|
2569
2451
|
}
|
2570
2452
|
SetDebug(...modules) {
|
@@ -2579,36 +2461,36 @@ var WithLoggerBuilder = class {
|
|
2579
2461
|
this._li.Pair(x);
|
2580
2462
|
return this;
|
2581
2463
|
}
|
2582
|
-
Str(
|
2583
|
-
this._li.Str(
|
2464
|
+
Str(key, value) {
|
2465
|
+
this._li.Str(key, value);
|
2584
2466
|
return this;
|
2585
2467
|
}
|
2586
|
-
Len(value,
|
2587
|
-
this._li.Len(value,
|
2468
|
+
Len(value, key) {
|
2469
|
+
this._li.Len(value, key);
|
2588
2470
|
return this;
|
2589
2471
|
}
|
2590
|
-
Hash(value,
|
2591
|
-
this._li.Hash(value,
|
2472
|
+
Hash(value, key) {
|
2473
|
+
this._li.Hash(value, key);
|
2592
2474
|
return this;
|
2593
2475
|
}
|
2594
|
-
Ref(
|
2595
|
-
this._li.Ref(
|
2476
|
+
Ref(key, action) {
|
2477
|
+
this._li.Ref(key, action);
|
2596
2478
|
return this;
|
2597
2479
|
}
|
2598
|
-
Bool(
|
2599
|
-
this._li.Bool(
|
2480
|
+
Bool(key, value) {
|
2481
|
+
this._li.Bool(key, value);
|
2600
2482
|
return this;
|
2601
2483
|
}
|
2602
|
-
Result(
|
2603
|
-
this._li.Result(
|
2484
|
+
Result(key, res) {
|
2485
|
+
this._li.Result(key, res);
|
2604
2486
|
return this;
|
2605
2487
|
}
|
2606
|
-
Url(url,
|
2607
|
-
this._li.Url(url,
|
2488
|
+
Url(url, key) {
|
2489
|
+
this._li.Url(url, key);
|
2608
2490
|
return this;
|
2609
2491
|
}
|
2610
|
-
Int(
|
2611
|
-
this._li.Int(
|
2492
|
+
Int(key, value) {
|
2493
|
+
this._li.Int(key, value);
|
2612
2494
|
return this;
|
2613
2495
|
}
|
2614
2496
|
Log() {
|
@@ -2643,16 +2525,16 @@ var WithLoggerBuilder = class {
|
|
2643
2525
|
this._li.Timestamp();
|
2644
2526
|
return this;
|
2645
2527
|
}
|
2646
|
-
Any(
|
2647
|
-
this._li.Any(
|
2528
|
+
Any(key, value) {
|
2529
|
+
this._li.Any(key, value);
|
2648
2530
|
return this;
|
2649
2531
|
}
|
2650
|
-
Dur(
|
2651
|
-
this._li.Dur(
|
2532
|
+
Dur(key, nsec) {
|
2533
|
+
this._li.Dur(key, nsec);
|
2652
2534
|
return this;
|
2653
2535
|
}
|
2654
|
-
Uint64(
|
2655
|
-
this._li.Uint64(
|
2536
|
+
Uint64(key, value) {
|
2537
|
+
this._li.Uint64(key, value);
|
2656
2538
|
return this;
|
2657
2539
|
}
|
2658
2540
|
};
|