@adviser/cement 0.3.4 → 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-B-PcaG0B.d.ts → base-sys-abstraction-CKI4xiRR.d.ts} +4 -4
- package/{base-sys-abstraction-CLlfCI2Q.d.cts → base-sys-abstraction-DLnSeH4s.d.cts} +4 -4
- package/cf/index.cjs +200 -6
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +3 -3
- package/cf/index.d.ts +3 -3
- package/cf/index.js +3 -3
- package/{chunk-OQ4NGEJR.js → chunk-4QRZPFED.js} +67 -10
- 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-5GJADB3C.js → chunk-6AG3MRNY.js} +17 -167
- 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-MFC4AD5O.js → chunk-OIIUVSUX.js} +3 -3
- package/chunk-OIIUVSUX.js.map +1 -0
- package/chunk-QDDO6NOK.js +194 -0
- package/chunk-QDDO6NOK.js.map +1 -0
- package/deno/index.cjs +200 -6
- package/deno/index.cjs.map +1 -1
- package/deno/index.d.cts +3 -3
- package/deno/index.d.ts +3 -3
- package/deno/index.js +2 -2
- 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-ChpAZoUE.d.ts → index-1R-hTV11.d.ts} +5 -50
- package/{index-CI2cJ0-W.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 +237 -170
- package/index.cjs.map +1 -1
- package/index.d.cts +13 -11
- package/index.d.ts +13 -11
- package/index.js +16 -11
- package/index.js.map +1 -1
- package/node/index.cjs +204 -10
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +3 -3
- package/node/index.d.ts +3 -3
- package/node/index.js +6 -6
- package/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/base-sys-abstraction.ts +8 -6
- package/src/cf-test-main.ts +5 -0
- package/src/deno/deno-file-service.ts +1 -1
- 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/resolve-once.ts +6 -5
- package/src/runtime.ts +3 -3
- package/src/sys-env.ts +60 -0
- 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-sys-abstraction.ts +1 -1
- package/{sys-abstraction-Coxu8BjZ.d.cts → sys-abstraction-BRDT_TIU.d.cts} +8 -1
- package/{sys-abstraction-Coxu8BjZ.d.ts → sys-abstraction-Bd0EzwO6.d.ts} +8 -1
- package/test/index.cjs +407 -355
- 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 -5
- 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.map +1 -0
- package/ts/src/cf/cf-env-actions.js.map +1 -0
- package/ts/src/cf/cf-sys-abstraction.d.ts.map +1 -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/src/crypto.test.js.map +1 -0
- package/ts/src/deno/deno-env-actions.d.ts.map +1 -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/src/deno/deno-sys-abstraction.d.ts.map +1 -0
- 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.map +1 -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/src/node/node-sys-abstraction.d.ts.map +1 -0
- 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} +53 -0
- 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} +68 -0
- 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.map +1 -0
- package/ts/src/web/web-env-actions.js.map +1 -0
- package/ts/{web → src/web}/web-sys-abstraction.d.ts +1 -1
- package/ts/src/web/web-sys-abstraction.d.ts.map +1 -0
- 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 +200 -6
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +4 -4
- package/web/index.d.ts +4 -4
- package/web/index.js +3 -3
- package/chunk-5GJADB3C.js.map +0 -1
- package/chunk-A7OPSHUV.js.map +0 -1
- package/chunk-HFP74WLI.js.map +0 -1
- package/chunk-MFC4AD5O.js.map +0 -1
- package/chunk-OQ4NGEJR.js.map +0 -1
- package/chunk-PPS4L4VW.js +0 -38
- package/chunk-PPS4L4VW.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-env-actions.d.ts.map +0 -1
- package/ts/cf/cf-env-actions.js.map +0 -1
- 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-env-actions.d.ts.map +0 -1
- package/ts/deno/deno-env-actions.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-env-actions.d.ts.map +0 -1
- package/ts/node/node-env-actions.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-env-actions.d.ts.map +0 -1
- package/ts/web/web-env-actions.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}/cf-env-actions.d.ts +0 -0
- /package/ts/{cf → src/cf}/cf-env-actions.js +0 -0
- /package/ts/{cf → src/cf}/cf-sys-abstraction.d.ts +0 -0
- /package/ts/{cf → src/cf}/cf-sys-abstraction.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/{crypto.test.js → src/crypto.test.js} +0 -0
- /package/ts/{deno → src/deno}/deno-env-actions.d.ts +0 -0
- /package/ts/{deno → src/deno}/deno-env-actions.js +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}/deno-sys-abstraction.d.ts +0 -0
- /package/ts/{deno → src/deno}/deno-sys-abstraction.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-env-actions.d.ts +0 -0
- /package/ts/{node → src/node}/node-env-actions.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.d.ts +0 -0
- /package/ts/{node → src/node}/node-sys-abstraction.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/ts/{web → src/web}/web-env-actions.d.ts +0 -0
- /package/ts/{web → src/web}/web-env-actions.js +0 -0
- /package/ts/{web → src/web}/web-sys-abstraction.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
|
};
|
@@ -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
|
}
|
@@ -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;
|
@@ -857,8 +859,8 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
857
859
|
return __privateGet(this, _deno).Deno.env;
|
858
860
|
}
|
859
861
|
register(env) {
|
860
|
-
for (const
|
861
|
-
this._env.set(
|
862
|
+
for (const key of env.keys()) {
|
863
|
+
this._env.set(key, env.get(key) || "");
|
862
864
|
}
|
863
865
|
return env;
|
864
866
|
}
|
@@ -868,16 +870,16 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
868
870
|
keys() {
|
869
871
|
return Object.keys(this._env.toObject());
|
870
872
|
}
|
871
|
-
get(
|
872
|
-
return this._env.get(
|
873
|
+
get(key) {
|
874
|
+
return this._env.get(key);
|
873
875
|
}
|
874
|
-
set(
|
876
|
+
set(key, value) {
|
875
877
|
if (value) {
|
876
|
-
this._env.set(
|
878
|
+
this._env.set(key, value);
|
877
879
|
}
|
878
880
|
}
|
879
|
-
delete(
|
880
|
-
this._env.delete(
|
881
|
+
delete(key) {
|
882
|
+
this._env.delete(key);
|
881
883
|
}
|
882
884
|
};
|
883
885
|
_deno = new WeakMap();
|
@@ -896,8 +898,8 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
896
898
|
return once2.once(() => new _NodeEnvActions(opts));
|
897
899
|
}
|
898
900
|
register(env) {
|
899
|
-
for (const
|
900
|
-
this._env[
|
901
|
+
for (const key of env.keys()) {
|
902
|
+
this._env[key] = env.get(key) || "";
|
901
903
|
}
|
902
904
|
return env;
|
903
905
|
}
|
@@ -907,16 +909,16 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
907
909
|
keys() {
|
908
910
|
return Object.keys(this._env);
|
909
911
|
}
|
910
|
-
get(
|
911
|
-
return this._env[
|
912
|
+
get(key) {
|
913
|
+
return this._env[key];
|
912
914
|
}
|
913
|
-
set(
|
915
|
+
set(key, value) {
|
914
916
|
if (value) {
|
915
|
-
this._env[
|
917
|
+
this._env[key] = value;
|
916
918
|
}
|
917
919
|
}
|
918
|
-
delete(
|
919
|
-
delete this._env[
|
920
|
+
delete(key) {
|
921
|
+
delete this._env[key];
|
920
922
|
}
|
921
923
|
};
|
922
924
|
_node = new WeakMap();
|
@@ -932,16 +934,16 @@ var BrowserEnvActions = class _BrowserEnvActions {
|
|
932
934
|
static new(opts) {
|
933
935
|
return once3.once(() => new _BrowserEnvActions(opts));
|
934
936
|
}
|
935
|
-
get(
|
936
|
-
return this.env.get(
|
937
|
+
get(key) {
|
938
|
+
return this.env.get(key);
|
937
939
|
}
|
938
|
-
set(
|
940
|
+
set(key, value) {
|
939
941
|
if (value) {
|
940
|
-
this.env.set(
|
942
|
+
this.env.set(key, value);
|
941
943
|
}
|
942
944
|
}
|
943
|
-
delete(
|
944
|
-
this.env.delete(
|
945
|
+
delete(key) {
|
946
|
+
this.env.delete(key);
|
945
947
|
}
|
946
948
|
keys() {
|
947
949
|
return Array.from(this.env.keys());
|
@@ -969,13 +971,13 @@ var CFEnvActions = class _CFEnvActions {
|
|
969
971
|
}
|
970
972
|
static inject(o) {
|
971
973
|
const env = _CFEnvActions.new({});
|
972
|
-
for (const
|
973
|
-
const value = o[
|
974
|
+
for (const key in o) {
|
975
|
+
const value = o[key];
|
974
976
|
if (typeof value === "string") {
|
975
977
|
if (env.env) {
|
976
|
-
env.env.set(
|
978
|
+
env.env.set(key, value);
|
977
979
|
} else {
|
978
|
-
env.injectOnRegister[
|
980
|
+
env.injectOnRegister[key] = value;
|
979
981
|
}
|
980
982
|
}
|
981
983
|
}
|
@@ -985,27 +987,177 @@ var CFEnvActions = class _CFEnvActions {
|
|
985
987
|
}
|
986
988
|
register(env) {
|
987
989
|
this.env = env;
|
988
|
-
for (const
|
989
|
-
env.set(
|
990
|
+
for (const key in this.injectOnRegister) {
|
991
|
+
env.set(key, this.injectOnRegister[key]);
|
990
992
|
}
|
991
993
|
return env;
|
992
994
|
}
|
993
|
-
get(
|
994
|
-
return this.cfEnv.get(
|
995
|
+
get(key) {
|
996
|
+
return this.cfEnv.get(key);
|
995
997
|
}
|
996
|
-
set(
|
998
|
+
set(key, value) {
|
997
999
|
if (value) {
|
998
|
-
this.cfEnv.set(
|
1000
|
+
this.cfEnv.set(key, value);
|
999
1001
|
}
|
1000
1002
|
}
|
1001
|
-
delete(
|
1002
|
-
this.cfEnv.delete(
|
1003
|
+
delete(key) {
|
1004
|
+
this.cfEnv.delete(key);
|
1003
1005
|
}
|
1004
1006
|
keys() {
|
1005
1007
|
return Array.from(this.cfEnv.keys());
|
1006
1008
|
}
|
1007
1009
|
};
|
1008
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
|
+
|
1009
1161
|
// src/sys-env.ts
|
1010
1162
|
var envActions = [
|
1011
1163
|
{ id: "cf", fn: (opts) => CFEnvActions.new(opts) },
|
@@ -1026,25 +1178,75 @@ function envFactory(opts = {}) {
|
|
1026
1178
|
return ret;
|
1027
1179
|
});
|
1028
1180
|
}
|
1181
|
+
function isIterable(obj) {
|
1182
|
+
if (obj == null) {
|
1183
|
+
return false;
|
1184
|
+
}
|
1185
|
+
return typeof obj[Symbol.iterator] === "function";
|
1186
|
+
}
|
1029
1187
|
var EnvImpl = class {
|
1030
1188
|
constructor(map, opts = {}) {
|
1031
1189
|
this._onSet = [];
|
1032
1190
|
this._map = map;
|
1033
1191
|
this._updatePresets(opts.presetEnv);
|
1034
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
|
+
}
|
1035
1237
|
_updatePresets(presetEnv) {
|
1036
1238
|
if (!presetEnv) {
|
1037
1239
|
return;
|
1038
1240
|
}
|
1039
|
-
for (const [
|
1040
|
-
this._map.set(
|
1241
|
+
for (const [key, value] of presetEnv) {
|
1242
|
+
this._map.set(key, value);
|
1041
1243
|
}
|
1042
1244
|
}
|
1043
|
-
_applyOnSet(onSet,
|
1245
|
+
_applyOnSet(onSet, key, value) {
|
1044
1246
|
onSet.forEach((item) => {
|
1045
1247
|
let keys = [];
|
1046
|
-
if (
|
1047
|
-
keys = [
|
1248
|
+
if (key) {
|
1249
|
+
keys = [key];
|
1048
1250
|
} else {
|
1049
1251
|
keys = this._map.keys();
|
1050
1252
|
}
|
@@ -1058,9 +1260,9 @@ var EnvImpl = class {
|
|
1058
1260
|
return false;
|
1059
1261
|
}).forEach((k) => {
|
1060
1262
|
let v;
|
1061
|
-
if (!
|
1263
|
+
if (!key && !value) {
|
1062
1264
|
v = this._map.get(k);
|
1063
|
-
} else if (
|
1265
|
+
} else if (key && !value) {
|
1064
1266
|
v = void 0;
|
1065
1267
|
} else {
|
1066
1268
|
v = value;
|
@@ -1078,19 +1280,19 @@ var EnvImpl = class {
|
|
1078
1280
|
this._onSet.push(item);
|
1079
1281
|
this._applyOnSet([item]);
|
1080
1282
|
}
|
1081
|
-
get(
|
1082
|
-
return this._map.get(
|
1283
|
+
get(key) {
|
1284
|
+
return this._map.get(key);
|
1083
1285
|
}
|
1084
|
-
set(
|
1286
|
+
set(key, value) {
|
1085
1287
|
if (!value) {
|
1086
1288
|
return;
|
1087
1289
|
}
|
1088
|
-
this._map.set(
|
1089
|
-
this._applyOnSet(this._onSet,
|
1290
|
+
this._map.set(key, value);
|
1291
|
+
this._applyOnSet(this._onSet, key, value);
|
1090
1292
|
}
|
1091
|
-
delete(
|
1092
|
-
this._map.delete(
|
1093
|
-
this._applyOnSet(this._onSet,
|
1293
|
+
delete(key) {
|
1294
|
+
this._map.delete(key);
|
1295
|
+
this._applyOnSet(this._onSet, key);
|
1094
1296
|
}
|
1095
1297
|
};
|
1096
1298
|
|
@@ -1157,106 +1359,15 @@ var WebSystemService = class {
|
|
1157
1359
|
}
|
1158
1360
|
};
|
1159
1361
|
var my = void 0;
|
1160
|
-
function WebSysAbstraction(
|
1362
|
+
function WebSysAbstraction(param2) {
|
1161
1363
|
if (!my) {
|
1162
1364
|
my = new BaseSysAbstraction({
|
1163
|
-
TxtEnDecoder: (
|
1365
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || Utf8EnDecoderSingleton(),
|
1164
1366
|
FileSystem: new WebFileService(),
|
1165
1367
|
SystemService: new WebSystemService()
|
1166
1368
|
});
|
1167
1369
|
}
|
1168
|
-
return new WrapperSysAbstraction(my,
|
1169
|
-
}
|
1170
|
-
|
1171
|
-
// src/result.ts
|
1172
|
-
var Result = class _Result {
|
1173
|
-
static Ok(t) {
|
1174
|
-
return new ResultOK(t);
|
1175
|
-
}
|
1176
|
-
static Err(t) {
|
1177
|
-
if (typeof t === "string") {
|
1178
|
-
return new ResultError(new Error(t));
|
1179
|
-
}
|
1180
|
-
if (_Result.Is(t)) {
|
1181
|
-
if (t.is_ok()) {
|
1182
|
-
return new ResultError(new Error("Result Error is Ok"));
|
1183
|
-
}
|
1184
|
-
return t;
|
1185
|
-
}
|
1186
|
-
return new ResultError(t);
|
1187
|
-
}
|
1188
|
-
static Is(t) {
|
1189
|
-
if (!t) {
|
1190
|
-
return false;
|
1191
|
-
}
|
1192
|
-
if (t instanceof _Result) {
|
1193
|
-
return true;
|
1194
|
-
}
|
1195
|
-
const rt = t;
|
1196
|
-
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
1197
|
-
return true;
|
1198
|
-
}
|
1199
|
-
return false;
|
1200
|
-
}
|
1201
|
-
isOk() {
|
1202
|
-
return this.is_ok();
|
1203
|
-
}
|
1204
|
-
isErr() {
|
1205
|
-
return this.is_err();
|
1206
|
-
}
|
1207
|
-
Ok() {
|
1208
|
-
return this.unwrap();
|
1209
|
-
}
|
1210
|
-
Err() {
|
1211
|
-
return this.unwrap_err();
|
1212
|
-
}
|
1213
|
-
};
|
1214
|
-
var ResultOK = class extends Result {
|
1215
|
-
constructor(t) {
|
1216
|
-
super();
|
1217
|
-
this._t = t;
|
1218
|
-
}
|
1219
|
-
is_ok() {
|
1220
|
-
return true;
|
1221
|
-
}
|
1222
|
-
is_err() {
|
1223
|
-
return false;
|
1224
|
-
}
|
1225
|
-
unwrap_err() {
|
1226
|
-
throw new Error("Result is Ok");
|
1227
|
-
}
|
1228
|
-
unwrap() {
|
1229
|
-
return this._t;
|
1230
|
-
}
|
1231
|
-
};
|
1232
|
-
var ResultError = class extends Result {
|
1233
|
-
constructor(t) {
|
1234
|
-
super();
|
1235
|
-
this._error = t;
|
1236
|
-
}
|
1237
|
-
is_ok() {
|
1238
|
-
return false;
|
1239
|
-
}
|
1240
|
-
is_err() {
|
1241
|
-
return true;
|
1242
|
-
}
|
1243
|
-
unwrap() {
|
1244
|
-
throw new Error(`Result is Err: ${this._error}`);
|
1245
|
-
}
|
1246
|
-
unwrap_err() {
|
1247
|
-
return this._error;
|
1248
|
-
}
|
1249
|
-
};
|
1250
|
-
function exception2Result(fn) {
|
1251
|
-
try {
|
1252
|
-
const res = fn();
|
1253
|
-
if (res instanceof Promise) {
|
1254
|
-
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
1255
|
-
}
|
1256
|
-
return Result.Ok(res);
|
1257
|
-
} catch (e) {
|
1258
|
-
return Result.Err(e);
|
1259
|
-
}
|
1370
|
+
return new WrapperSysAbstraction(my, param2);
|
1260
1371
|
}
|
1261
1372
|
|
1262
1373
|
// src/utils/relative-path.ts
|
@@ -1412,37 +1523,37 @@ function localStripper(path, restrips, obj) {
|
|
1412
1523
|
return obj.map((i) => localStripper(path, restrips, i));
|
1413
1524
|
}
|
1414
1525
|
const ret = { ...obj };
|
1415
|
-
const matcher = (
|
1526
|
+
const matcher = (key, nextPath) => {
|
1416
1527
|
for (const re of restrips) {
|
1417
|
-
if (re.test(
|
1528
|
+
if (re.test(key) || re.test(nextPath)) {
|
1418
1529
|
return true;
|
1419
1530
|
}
|
1420
1531
|
}
|
1421
1532
|
return false;
|
1422
1533
|
};
|
1423
|
-
for (const
|
1424
|
-
if (Object.prototype.hasOwnProperty.call(ret,
|
1534
|
+
for (const key in ret) {
|
1535
|
+
if (Object.prototype.hasOwnProperty.call(ret, key)) {
|
1425
1536
|
let nextPath;
|
1426
1537
|
if (path) {
|
1427
|
-
nextPath = [path,
|
1538
|
+
nextPath = [path, key].join(".");
|
1428
1539
|
} else {
|
1429
|
-
nextPath =
|
1540
|
+
nextPath = key;
|
1430
1541
|
}
|
1431
|
-
if (matcher(
|
1432
|
-
delete ret[
|
1542
|
+
if (matcher(key, nextPath)) {
|
1543
|
+
delete ret[key];
|
1433
1544
|
continue;
|
1434
1545
|
}
|
1435
|
-
if (typeof ret[
|
1436
|
-
if (Array.isArray(ret[
|
1437
|
-
ret[
|
1438
|
-
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}]`);
|
1439
1550
|
if (!toDelete) {
|
1440
1551
|
acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
|
1441
1552
|
}
|
1442
1553
|
return acc;
|
1443
1554
|
}, []);
|
1444
1555
|
} else {
|
1445
|
-
ret[
|
1556
|
+
ret[key] = localStripper(nextPath, restrips, ret[key]);
|
1446
1557
|
}
|
1447
1558
|
}
|
1448
1559
|
}
|
@@ -1451,29 +1562,15 @@ function localStripper(path, restrips, obj) {
|
|
1451
1562
|
}
|
1452
1563
|
|
1453
1564
|
// src/uri.ts
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
}
|
1458
|
-
};
|
1459
|
-
var _OPTIONAL = class {
|
1460
|
-
constructor() {
|
1461
|
-
this.val = "OPTIONAL";
|
1462
|
-
}
|
1463
|
-
};
|
1464
|
-
var key = {
|
1465
|
-
REQUIRED: new _REQUIRED(),
|
1466
|
-
OPTIONAL: new _OPTIONAL()
|
1467
|
-
};
|
1468
|
-
function coerceKey(key2, def) {
|
1469
|
-
if (typeof key2 === "object") {
|
1470
|
-
const keys = Object.keys(key2);
|
1565
|
+
function coerceKey(key, def) {
|
1566
|
+
if (typeof key === "object") {
|
1567
|
+
const keys = Object.keys(key);
|
1471
1568
|
if (keys.length !== 1) {
|
1472
|
-
throw new Error(`Invalid key: ${JSON.stringify(
|
1569
|
+
throw new Error(`Invalid key: ${JSON.stringify(key)}`);
|
1473
1570
|
}
|
1474
|
-
return { key: keys[0], def:
|
1571
|
+
return { key: keys[0], def: key[keys[0]] };
|
1475
1572
|
}
|
1476
|
-
return { key
|
1573
|
+
return { key, def };
|
1477
1574
|
}
|
1478
1575
|
function falsy2undef(value) {
|
1479
1576
|
return value === void 0 || value === null ? void 0 : value;
|
@@ -1576,8 +1673,8 @@ var MutableURL = class _MutableURL extends URL {
|
|
1576
1673
|
toString() {
|
1577
1674
|
let search = "";
|
1578
1675
|
if (this._sysURL.searchParams.size) {
|
1579
|
-
for (const [
|
1580
|
-
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)}`;
|
1581
1678
|
}
|
1582
1679
|
}
|
1583
1680
|
let hostpart = "";
|
@@ -1612,57 +1709,14 @@ function from(fac, strURLUri, defaultProtocol) {
|
|
1612
1709
|
throw new Error(`Invalid argument: ${typeof strURLUri}`);
|
1613
1710
|
}
|
1614
1711
|
}
|
1615
|
-
function getParamResult(
|
1616
|
-
return `missing parameter: ${
|
1712
|
+
function getParamResult(key, val, msgFn = (key2) => {
|
1713
|
+
return `missing parameter: ${key2}`;
|
1617
1714
|
}) {
|
1618
1715
|
if (val === void 0) {
|
1619
|
-
return Result.Err(msgFn(
|
1716
|
+
return Result.Err(msgFn(key));
|
1620
1717
|
}
|
1621
1718
|
return Result.Ok(val);
|
1622
1719
|
}
|
1623
|
-
function getParamsResult(keys, getParam) {
|
1624
|
-
const keyDef = keys.flat().reduce(
|
1625
|
-
(acc, i) => {
|
1626
|
-
if (typeof i === "string") {
|
1627
|
-
acc.push({ key: i, def: void 0, isOptional: false });
|
1628
|
-
} else if (typeof i === "object") {
|
1629
|
-
acc.push(
|
1630
|
-
...Object.keys(i).map((k) => ({
|
1631
|
-
key: k,
|
1632
|
-
def: typeof i[k] === "string" ? i[k] : void 0,
|
1633
|
-
isOptional: i[k] instanceof _OPTIONAL
|
1634
|
-
}))
|
1635
|
-
);
|
1636
|
-
}
|
1637
|
-
return acc;
|
1638
|
-
},
|
1639
|
-
[]
|
1640
|
-
);
|
1641
|
-
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1642
|
-
const msg = keys2.join(",");
|
1643
|
-
return `missing parameters: ${msg}`;
|
1644
|
-
});
|
1645
|
-
const errors = [];
|
1646
|
-
const result = {};
|
1647
|
-
for (const kd of keyDef) {
|
1648
|
-
const val = getParam.getParam(kd.key);
|
1649
|
-
if (val === void 0) {
|
1650
|
-
if (typeof kd.def === "string") {
|
1651
|
-
result[kd.key] = kd.def;
|
1652
|
-
} else {
|
1653
|
-
if (!kd.isOptional) {
|
1654
|
-
errors.push(kd.key);
|
1655
|
-
}
|
1656
|
-
}
|
1657
|
-
} else {
|
1658
|
-
result[kd.key] = val;
|
1659
|
-
}
|
1660
|
-
}
|
1661
|
-
if (errors.length) {
|
1662
|
-
return Result.Err(msgFn(...errors));
|
1663
|
-
}
|
1664
|
-
return Result.Ok(result);
|
1665
|
-
}
|
1666
1720
|
var BuildURI = class _BuildURI {
|
1667
1721
|
// pathname needs this
|
1668
1722
|
constructor(url) {
|
@@ -1716,47 +1770,47 @@ var BuildURI = class _BuildURI {
|
|
1716
1770
|
const pathname = "./" + appendUrl.pathname;
|
1717
1771
|
const basePath = this._url.pathname;
|
1718
1772
|
this.pathname(relativePath(basePath, pathname));
|
1719
|
-
for (const [
|
1720
|
-
this.setParam(
|
1773
|
+
for (const [key, value] of appendUrl.getParams) {
|
1774
|
+
this.setParam(key, value);
|
1721
1775
|
}
|
1722
1776
|
return this;
|
1723
1777
|
}
|
1724
1778
|
cleanParams() {
|
1725
|
-
for (const
|
1726
|
-
this._url.searchParams.delete(
|
1779
|
+
for (const key of Array.from(this._url.searchParams.keys())) {
|
1780
|
+
this._url.searchParams.delete(key);
|
1727
1781
|
}
|
1728
1782
|
return this;
|
1729
1783
|
}
|
1730
|
-
delParam(
|
1731
|
-
this._url.searchParams.delete(
|
1784
|
+
delParam(key) {
|
1785
|
+
this._url.searchParams.delete(key);
|
1732
1786
|
return this;
|
1733
1787
|
}
|
1734
|
-
defParam(
|
1735
|
-
if (!this._url.searchParams.has(
|
1736
|
-
this._url.searchParams.set(
|
1788
|
+
defParam(key, str) {
|
1789
|
+
if (!this._url.searchParams.has(key)) {
|
1790
|
+
this._url.searchParams.set(key, str);
|
1737
1791
|
}
|
1738
1792
|
return this;
|
1739
1793
|
}
|
1740
|
-
setParam(
|
1741
|
-
this._url.searchParams.set(
|
1794
|
+
setParam(key, str) {
|
1795
|
+
this._url.searchParams.set(key, str);
|
1742
1796
|
return this;
|
1743
1797
|
}
|
1744
|
-
hasParam(
|
1745
|
-
return this._url.searchParams.has(
|
1798
|
+
hasParam(key) {
|
1799
|
+
return this._url.searchParams.has(key);
|
1746
1800
|
}
|
1747
1801
|
get getParams() {
|
1748
1802
|
return this._url.searchParams.entries();
|
1749
1803
|
}
|
1750
|
-
getParam(
|
1751
|
-
const { key: k, def: d } = coerceKey(
|
1804
|
+
getParam(key, def) {
|
1805
|
+
const { key: k, def: d } = coerceKey(key, def);
|
1752
1806
|
let val = this._url.searchParams.get(k);
|
1753
1807
|
if (!falsy2undef(val) && d) {
|
1754
1808
|
val = d;
|
1755
1809
|
}
|
1756
1810
|
return falsy2undef(val);
|
1757
1811
|
}
|
1758
|
-
getParamResult(
|
1759
|
-
return getParamResult(
|
1812
|
+
getParamResult(key, msgFn) {
|
1813
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
1760
1814
|
}
|
1761
1815
|
getParamsResult(...keys) {
|
1762
1816
|
return getParamsResult(keys, this);
|
@@ -1799,8 +1853,8 @@ var URI = class _URI {
|
|
1799
1853
|
if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
|
1800
1854
|
intoUrl.pathname(fromUrl.pathname);
|
1801
1855
|
}
|
1802
|
-
for (const [
|
1803
|
-
intoUrl.setParam(
|
1856
|
+
for (const [key, value] of fromUrl.getParams) {
|
1857
|
+
intoUrl.setParam(key, value);
|
1804
1858
|
}
|
1805
1859
|
return intoUrl.URI();
|
1806
1860
|
}
|
@@ -1853,19 +1907,19 @@ var URI = class _URI {
|
|
1853
1907
|
get getParams() {
|
1854
1908
|
return this._url.searchParams.entries();
|
1855
1909
|
}
|
1856
|
-
hasParam(
|
1857
|
-
return this._url.searchParams.has(
|
1910
|
+
hasParam(key) {
|
1911
|
+
return this._url.searchParams.has(key);
|
1858
1912
|
}
|
1859
|
-
getParam(
|
1860
|
-
const { key: k, def: d } = coerceKey(
|
1913
|
+
getParam(key, def) {
|
1914
|
+
const { key: k, def: d } = coerceKey(key, def);
|
1861
1915
|
let val = this._url.searchParams.get(k);
|
1862
1916
|
if (!falsy2undef(val) && d) {
|
1863
1917
|
val = d;
|
1864
1918
|
}
|
1865
1919
|
return falsy2undef(val);
|
1866
1920
|
}
|
1867
|
-
getParamResult(
|
1868
|
-
return getParamResult(
|
1921
|
+
getParamResult(key, msgFn) {
|
1922
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
1869
1923
|
}
|
1870
1924
|
getParamsResult(...keys) {
|
1871
1925
|
return getParamsResult(keys, this);
|
@@ -1922,7 +1976,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
1922
1976
|
this.ready = Promise.resolve(void 0);
|
1923
1977
|
this.closed = Promise.resolve(void 0);
|
1924
1978
|
}
|
1925
|
-
|
1979
|
+
write(chunk) {
|
1926
1980
|
let strObj = this.decoder.decode(chunk).trimEnd();
|
1927
1981
|
let output = "log";
|
1928
1982
|
try {
|
@@ -1940,6 +1994,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
1940
1994
|
default:
|
1941
1995
|
console.log(strObj);
|
1942
1996
|
}
|
1997
|
+
return Promise.resolve();
|
1943
1998
|
}
|
1944
1999
|
};
|
1945
2000
|
var ConsoleWriterStream = class {
|
@@ -1950,8 +2005,8 @@ var ConsoleWriterStream = class {
|
|
1950
2005
|
abort(reason) {
|
1951
2006
|
throw new Error("Method not implemented.");
|
1952
2007
|
}
|
1953
|
-
|
1954
|
-
return;
|
2008
|
+
close() {
|
2009
|
+
return Promise.resolve();
|
1955
2010
|
}
|
1956
2011
|
getWriter() {
|
1957
2012
|
if (this.locked) {
|
@@ -1979,7 +2034,7 @@ var LogWriterStream = class {
|
|
1979
2034
|
const writer = this._out.getWriter();
|
1980
2035
|
await writer.ready;
|
1981
2036
|
await writer.write(encoded);
|
1982
|
-
|
2037
|
+
writer.releaseLock();
|
1983
2038
|
} catch (err) {
|
1984
2039
|
console.error("Chunk error:", err);
|
1985
2040
|
}
|
@@ -2003,7 +2058,9 @@ var LogWriterStream = class {
|
|
2003
2058
|
return;
|
2004
2059
|
}
|
2005
2060
|
const my2 = this._toFlush.shift();
|
2006
|
-
my2 == null ? void 0 : my2().
|
2061
|
+
my2 == null ? void 0 : my2().catch((e) => {
|
2062
|
+
console.error("Flush error:", e);
|
2063
|
+
}).finally(() => {
|
2007
2064
|
this._flush(this._toFlush);
|
2008
2065
|
});
|
2009
2066
|
}
|
@@ -2025,9 +2082,6 @@ function getLen(value, lvs) {
|
|
2025
2082
|
}
|
2026
2083
|
return logValue(() => -1, lvs);
|
2027
2084
|
}
|
2028
|
-
function hash(value) {
|
2029
|
-
return "not implemented";
|
2030
|
-
}
|
2031
2085
|
function toLogValue(lop) {
|
2032
2086
|
if (lop && typeof lop.then === "function") {
|
2033
2087
|
throw new Error("async logValue Not implemented");
|
@@ -2126,9 +2180,9 @@ var LoggerImpl = class _LoggerImpl {
|
|
2126
2180
|
this.levelHandler.disableLevel(level, ...modules);
|
2127
2181
|
return this;
|
2128
2182
|
}
|
2129
|
-
Module(
|
2130
|
-
this._attributes["module"] = logValue(
|
2131
|
-
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));
|
2132
2186
|
return this;
|
2133
2187
|
}
|
2134
2188
|
// if the string is "*" it will enable for all modules
|
@@ -2169,10 +2223,10 @@ var LoggerImpl = class _LoggerImpl {
|
|
2169
2223
|
}
|
2170
2224
|
Err(err) {
|
2171
2225
|
var _a;
|
2172
|
-
let
|
2226
|
+
let key = "error";
|
2173
2227
|
if (Result.Is(err)) {
|
2174
2228
|
if (err.isOk()) {
|
2175
|
-
|
2229
|
+
key = "noerror";
|
2176
2230
|
err = err.Ok();
|
2177
2231
|
} else {
|
2178
2232
|
err = err.Err();
|
@@ -2180,12 +2234,12 @@ var LoggerImpl = class _LoggerImpl {
|
|
2180
2234
|
}
|
2181
2235
|
if (err instanceof Error) {
|
2182
2236
|
if (err.cause) {
|
2183
|
-
this.coerceKey(
|
2237
|
+
this.coerceKey(key, {
|
2184
2238
|
message: err.message,
|
2185
2239
|
cause: err.cause
|
2186
2240
|
});
|
2187
2241
|
} else {
|
2188
|
-
this._attributes[
|
2242
|
+
this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
|
2189
2243
|
}
|
2190
2244
|
if (this.levelHandler.isStackExposed) {
|
2191
2245
|
this._attributes["stack"] = logValue(
|
@@ -2194,7 +2248,7 @@ var LoggerImpl = class _LoggerImpl {
|
|
2194
2248
|
);
|
2195
2249
|
}
|
2196
2250
|
} else {
|
2197
|
-
this.Any(
|
2251
|
+
this.Any(key, err);
|
2198
2252
|
}
|
2199
2253
|
return this;
|
2200
2254
|
}
|
@@ -2202,22 +2256,22 @@ var LoggerImpl = class _LoggerImpl {
|
|
2202
2256
|
this._attributes["level"] = logValue(l, toLogValueCtx(this.levelHandler));
|
2203
2257
|
return this;
|
2204
2258
|
}
|
2205
|
-
Ref(
|
2259
|
+
Ref(key, action) {
|
2206
2260
|
if (typeof action === "function") {
|
2207
|
-
this._attributes[
|
2261
|
+
this._attributes[key] = logValue(action, toLogValueCtx(this.levelHandler));
|
2208
2262
|
} else if (typeof action.toString === "function") {
|
2209
|
-
this._attributes[
|
2263
|
+
this._attributes[key] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
|
2210
2264
|
} else {
|
2211
|
-
this._attributes[
|
2265
|
+
this._attributes[key] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
|
2212
2266
|
}
|
2213
2267
|
return this;
|
2214
2268
|
}
|
2215
|
-
Bool(
|
2216
|
-
this.coerceKey(
|
2269
|
+
Bool(key, value) {
|
2270
|
+
this.coerceKey(key, !!value);
|
2217
2271
|
return this;
|
2218
2272
|
}
|
2219
2273
|
Http(...mix) {
|
2220
|
-
const
|
2274
|
+
const key = mix.find((x) => typeof x === "string");
|
2221
2275
|
mix = mix.filter((x) => typeof x !== "string");
|
2222
2276
|
const resErrors = mix.filter((x) => Result.Is(x) && x.isErr());
|
2223
2277
|
if (resErrors.length) {
|
@@ -2237,72 +2291,70 @@ var LoggerImpl = class _LoggerImpl {
|
|
2237
2291
|
reqAndOrres = req;
|
2238
2292
|
}
|
2239
2293
|
if (reqAndOrres) {
|
2240
|
-
this.Any(
|
2294
|
+
this.Any(key || "Http", reqAndOrres);
|
2241
2295
|
}
|
2242
2296
|
return this;
|
2243
2297
|
}
|
2244
2298
|
Pair(x) {
|
2245
|
-
for (const
|
2246
|
-
const value = x[
|
2299
|
+
for (const key of Object.keys(x)) {
|
2300
|
+
const value = x[key];
|
2247
2301
|
if (value instanceof LogValue) {
|
2248
|
-
this._attributes[
|
2302
|
+
this._attributes[key] = value;
|
2249
2303
|
continue;
|
2250
2304
|
}
|
2251
2305
|
if (Result.Is(value)) {
|
2252
|
-
this.Result(
|
2306
|
+
this.Result(key, value);
|
2253
2307
|
continue;
|
2254
2308
|
}
|
2255
|
-
this.Any(
|
2309
|
+
this.Any(key, value);
|
2256
2310
|
}
|
2257
2311
|
return this;
|
2258
2312
|
}
|
2259
|
-
Result(
|
2313
|
+
Result(key, res) {
|
2260
2314
|
if (res.isOk()) {
|
2261
|
-
this._attributes[
|
2315
|
+
this._attributes[key] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
|
2262
2316
|
} else {
|
2263
2317
|
this.Err(res.Err());
|
2264
2318
|
}
|
2265
2319
|
return this;
|
2266
2320
|
}
|
2267
|
-
Len(value,
|
2268
|
-
this._attributes[
|
2321
|
+
Len(value, key = "len") {
|
2322
|
+
this._attributes[key] = getLen(value, toLogValueCtx(this.levelHandler));
|
2269
2323
|
return this;
|
2270
2324
|
}
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
);
|
2275
|
-
return this;
|
2325
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2326
|
+
Hash(value, key = "hash") {
|
2327
|
+
throw new Error("Not implemented");
|
2276
2328
|
}
|
2277
|
-
Url(url,
|
2278
|
-
this.Ref(
|
2329
|
+
Url(url, key = "url") {
|
2330
|
+
this.Ref(key, () => URI.from(url).toString());
|
2279
2331
|
return this;
|
2280
2332
|
}
|
2281
|
-
coerceKey(
|
2282
|
-
if (typeof
|
2283
|
-
this._attributes[
|
2333
|
+
coerceKey(key, value) {
|
2334
|
+
if (typeof key === "string") {
|
2335
|
+
this._attributes[key] = logValue(value, toLogValueCtx(this.levelHandler));
|
2284
2336
|
} else {
|
2285
|
-
this.Pair(
|
2337
|
+
this.Pair(key);
|
2286
2338
|
}
|
2287
2339
|
}
|
2288
|
-
Str(
|
2289
|
-
this.coerceKey(
|
2340
|
+
Str(key, value) {
|
2341
|
+
this.coerceKey(key, value);
|
2290
2342
|
return this;
|
2291
2343
|
}
|
2292
|
-
Any(
|
2293
|
-
this.coerceKey(
|
2344
|
+
Any(key, value) {
|
2345
|
+
this.coerceKey(key, value);
|
2294
2346
|
return this;
|
2295
2347
|
}
|
2296
|
-
Dur(
|
2297
|
-
this._attributes[
|
2348
|
+
Dur(key, nsec) {
|
2349
|
+
this._attributes[key] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
|
2298
2350
|
return this;
|
2299
2351
|
}
|
2300
|
-
Uint64(
|
2301
|
-
this.coerceKey(
|
2352
|
+
Uint64(key, value) {
|
2353
|
+
this.coerceKey(key, value);
|
2302
2354
|
return this;
|
2303
2355
|
}
|
2304
|
-
Int(
|
2305
|
-
return this.Uint64(
|
2356
|
+
Int(key, value) {
|
2357
|
+
return this.Uint64(key, value);
|
2306
2358
|
}
|
2307
2359
|
async Flush() {
|
2308
2360
|
return new Promise((resolve) => {
|
@@ -2325,8 +2377,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2325
2377
|
}
|
2326
2378
|
_resetAttributes(fn) {
|
2327
2379
|
const ret = fn();
|
2328
|
-
Object.keys(this._attributes).forEach((
|
2329
|
-
delete this._attributes[
|
2380
|
+
Object.keys(this._attributes).forEach((key) => {
|
2381
|
+
delete this._attributes[key];
|
2330
2382
|
});
|
2331
2383
|
Object.assign(this._attributes, this._withAttributes);
|
2332
2384
|
return ret;
|
@@ -2393,8 +2445,8 @@ var WithLoggerBuilder = class {
|
|
2393
2445
|
this._li.levelHandler.enableLevel(level, ...modules);
|
2394
2446
|
return this;
|
2395
2447
|
}
|
2396
|
-
Module(
|
2397
|
-
this._li.Module(
|
2448
|
+
Module(key) {
|
2449
|
+
this._li.Module(key);
|
2398
2450
|
return this;
|
2399
2451
|
}
|
2400
2452
|
SetDebug(...modules) {
|
@@ -2409,36 +2461,36 @@ var WithLoggerBuilder = class {
|
|
2409
2461
|
this._li.Pair(x);
|
2410
2462
|
return this;
|
2411
2463
|
}
|
2412
|
-
Str(
|
2413
|
-
this._li.Str(
|
2464
|
+
Str(key, value) {
|
2465
|
+
this._li.Str(key, value);
|
2414
2466
|
return this;
|
2415
2467
|
}
|
2416
|
-
Len(value,
|
2417
|
-
this._li.Len(value,
|
2468
|
+
Len(value, key) {
|
2469
|
+
this._li.Len(value, key);
|
2418
2470
|
return this;
|
2419
2471
|
}
|
2420
|
-
Hash(value,
|
2421
|
-
this._li.Hash(value,
|
2472
|
+
Hash(value, key) {
|
2473
|
+
this._li.Hash(value, key);
|
2422
2474
|
return this;
|
2423
2475
|
}
|
2424
|
-
Ref(
|
2425
|
-
this._li.Ref(
|
2476
|
+
Ref(key, action) {
|
2477
|
+
this._li.Ref(key, action);
|
2426
2478
|
return this;
|
2427
2479
|
}
|
2428
|
-
Bool(
|
2429
|
-
this._li.Bool(
|
2480
|
+
Bool(key, value) {
|
2481
|
+
this._li.Bool(key, value);
|
2430
2482
|
return this;
|
2431
2483
|
}
|
2432
|
-
Result(
|
2433
|
-
this._li.Result(
|
2484
|
+
Result(key, res) {
|
2485
|
+
this._li.Result(key, res);
|
2434
2486
|
return this;
|
2435
2487
|
}
|
2436
|
-
Url(url,
|
2437
|
-
this._li.Url(url,
|
2488
|
+
Url(url, key) {
|
2489
|
+
this._li.Url(url, key);
|
2438
2490
|
return this;
|
2439
2491
|
}
|
2440
|
-
Int(
|
2441
|
-
this._li.Int(
|
2492
|
+
Int(key, value) {
|
2493
|
+
this._li.Int(key, value);
|
2442
2494
|
return this;
|
2443
2495
|
}
|
2444
2496
|
Log() {
|
@@ -2473,16 +2525,16 @@ var WithLoggerBuilder = class {
|
|
2473
2525
|
this._li.Timestamp();
|
2474
2526
|
return this;
|
2475
2527
|
}
|
2476
|
-
Any(
|
2477
|
-
this._li.Any(
|
2528
|
+
Any(key, value) {
|
2529
|
+
this._li.Any(key, value);
|
2478
2530
|
return this;
|
2479
2531
|
}
|
2480
|
-
Dur(
|
2481
|
-
this._li.Dur(
|
2532
|
+
Dur(key, nsec) {
|
2533
|
+
this._li.Dur(key, nsec);
|
2482
2534
|
return this;
|
2483
2535
|
}
|
2484
|
-
Uint64(
|
2485
|
-
this._li.Uint64(
|
2536
|
+
Uint64(key, value) {
|
2537
|
+
this._li.Uint64(key, value);
|
2486
2538
|
return this;
|
2487
2539
|
}
|
2488
2540
|
};
|