@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/index.cjs
CHANGED
@@ -40,7 +40,7 @@ __export(src_exports, {
|
|
40
40
|
BaseSysAbstraction: () => BaseSysAbstraction,
|
41
41
|
BuildURI: () => BuildURI,
|
42
42
|
ConstTime: () => ConstTime,
|
43
|
-
EnvImpl: () =>
|
43
|
+
EnvImpl: () => EnvImpl,
|
44
44
|
Future: () => Future,
|
45
45
|
HeadersImpl: () => HeadersImpl,
|
46
46
|
HttpHeader: () => HttpHeader,
|
@@ -95,6 +95,7 @@ __export(src_exports, {
|
|
95
95
|
isURL: () => isURL,
|
96
96
|
key: () => key,
|
97
97
|
logValue: () => logValue,
|
98
|
+
param: () => param2,
|
98
99
|
registerEnvAction: () => registerEnvAction,
|
99
100
|
runtimeFn: () => runtimeFn,
|
100
101
|
toCryptoRuntime: () => toCryptoRuntime,
|
@@ -348,9 +349,9 @@ var SysTime = class extends Time {
|
|
348
349
|
return /* @__PURE__ */ new Date();
|
349
350
|
}
|
350
351
|
Sleep(duration) {
|
351
|
-
return new Promise((
|
352
|
+
return new Promise((resolve) => {
|
352
353
|
setTimeout(() => {
|
353
|
-
|
354
|
+
resolve();
|
354
355
|
}, duration);
|
355
356
|
});
|
356
357
|
}
|
@@ -463,13 +464,15 @@ var BaseSysAbstraction = class {
|
|
463
464
|
this._systemService = params.SystemService;
|
464
465
|
this._txtEnDe = params.TxtEnDecoder;
|
465
466
|
const decoder2 = this._txtEnDe;
|
466
|
-
this._stdout = CFWriteableStream(
|
467
|
+
this._stdout = CFWriteableStream((chunk) => {
|
467
468
|
const decoded = decoder2.decode(chunk);
|
468
469
|
console.log(decoded.trimEnd());
|
470
|
+
return Promise.resolve();
|
469
471
|
});
|
470
|
-
this._stderr = CFWriteableStream(
|
472
|
+
this._stderr = CFWriteableStream((chunk) => {
|
471
473
|
const decoded = decoder2.decode(chunk);
|
472
474
|
console.error(decoded.trimEnd());
|
475
|
+
return Promise.resolve();
|
473
476
|
});
|
474
477
|
}
|
475
478
|
};
|
@@ -540,8 +543,8 @@ var Future = class {
|
|
540
543
|
__privateAdd(this, _rejectFn, () => {
|
541
544
|
throw new Error("This Promise is not working as expected.");
|
542
545
|
});
|
543
|
-
__privateSet(this, _promise, new Promise((
|
544
|
-
__privateSet(this, _resolveFn,
|
546
|
+
__privateSet(this, _promise, new Promise((resolve, reject) => {
|
547
|
+
__privateSet(this, _resolveFn, resolve);
|
545
548
|
__privateSet(this, _rejectFn, reject);
|
546
549
|
}));
|
547
550
|
}
|
@@ -567,20 +570,21 @@ var ResolveSeq = class {
|
|
567
570
|
}
|
568
571
|
reset() {
|
569
572
|
}
|
570
|
-
|
573
|
+
_step(item) {
|
571
574
|
if (!item) {
|
572
|
-
return;
|
575
|
+
return Promise.resolve();
|
573
576
|
}
|
574
577
|
item.fn(this.ctx).then((value) => item.future.resolve(value)).catch((e) => item.future.reject(e)).finally(() => {
|
575
578
|
this._seqFutures.shift();
|
576
|
-
this._step(this._seqFutures[0]);
|
579
|
+
void this._step(this._seqFutures[0]);
|
577
580
|
});
|
581
|
+
return Promise.resolve();
|
578
582
|
}
|
579
583
|
async add(fn, id) {
|
580
584
|
const future = new Future();
|
581
585
|
this._seqFutures.push({ future, fn, id });
|
582
586
|
if (this._seqFutures.length === 1) {
|
583
|
-
this._step(this._seqFutures[0]);
|
587
|
+
void this._step(this._seqFutures[0]);
|
584
588
|
}
|
585
589
|
return future.asPromise();
|
586
590
|
}
|
@@ -716,7 +720,10 @@ function isSet(value, ref = globalThis) {
|
|
716
720
|
}
|
717
721
|
function runtimeFn() {
|
718
722
|
const gt = globalThis;
|
719
|
-
let isReactNative =
|
723
|
+
let isReactNative = (
|
724
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
725
|
+
isSet("navigator.product") && typeof gt["navigator"] === "object" && gt["navigator"]["product"] === "ReactNative"
|
726
|
+
);
|
720
727
|
let isNodeIsh = false;
|
721
728
|
if (!isSet("Deno")) {
|
722
729
|
isNodeIsh = isSet("process.versions.node") && !isReactNative;
|
@@ -737,28 +744,7 @@ function runtimeFn() {
|
|
737
744
|
};
|
738
745
|
}
|
739
746
|
|
740
|
-
// src/
|
741
|
-
var encoder = new TextEncoder();
|
742
|
-
var decoder = new TextDecoder();
|
743
|
-
var Utf8EnDecoder = class {
|
744
|
-
encode(str) {
|
745
|
-
return encoder.encode(str);
|
746
|
-
}
|
747
|
-
decode(data) {
|
748
|
-
return decoder.decode(data);
|
749
|
-
}
|
750
|
-
};
|
751
|
-
var utf8EnDecoder = new Utf8EnDecoder();
|
752
|
-
function Utf8EnDecoderSingleton() {
|
753
|
-
return utf8EnDecoder;
|
754
|
-
}
|
755
|
-
|
756
|
-
// src/deno/deno-file-service.ts
|
757
|
-
var path = __toESM(require("path"), 1);
|
758
|
-
var Deno = globalThis.Deno;
|
759
|
-
|
760
|
-
// src/deno/deno-sys-abstraction.ts
|
761
|
-
var Deno2 = globalThis.Deno;
|
747
|
+
// src/deno/deno-env-actions.ts
|
762
748
|
var once = new ResolveOnce();
|
763
749
|
var _deno;
|
764
750
|
var _DenoEnvActions = class _DenoEnvActions {
|
@@ -798,95 +784,8 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
798
784
|
};
|
799
785
|
_deno = new WeakMap();
|
800
786
|
var DenoEnvActions = _DenoEnvActions;
|
801
|
-
var DenoExitServiceImpl = class {
|
802
|
-
constructor() {
|
803
|
-
this._exitHandlers = [];
|
804
|
-
this.invoked = false;
|
805
|
-
this._handleExit = async () => {
|
806
|
-
if (this.invoked) {
|
807
|
-
return;
|
808
|
-
}
|
809
|
-
this.invoked = true;
|
810
|
-
for (const h of this._exitHandlers) {
|
811
|
-
try {
|
812
|
-
const ret = h.hdl();
|
813
|
-
if (typeof ret.then === "function") {
|
814
|
-
await ret;
|
815
|
-
}
|
816
|
-
} finally {
|
817
|
-
}
|
818
|
-
}
|
819
|
-
};
|
820
|
-
globalThis.addEventListener("unhandledrejection", (e) => {
|
821
|
-
e.preventDefault();
|
822
|
-
this.exit(19);
|
823
|
-
});
|
824
|
-
globalThis.addEventListener("error", () => {
|
825
|
-
this.exit(19);
|
826
|
-
});
|
827
|
-
globalThis.addEventListener("uncaughtException", () => {
|
828
|
-
this.exit(19);
|
829
|
-
});
|
830
|
-
globalThis.addEventListener("unload", () => {
|
831
|
-
this.exit(0);
|
832
|
-
});
|
833
|
-
Deno2.addSignalListener("SIGQUIT", () => {
|
834
|
-
this.exit(3);
|
835
|
-
});
|
836
|
-
Deno2.addSignalListener("SIGINT", () => {
|
837
|
-
this.exit(2);
|
838
|
-
});
|
839
|
-
Deno2.addSignalListener("SIGTERM", () => {
|
840
|
-
this.exit(9);
|
841
|
-
});
|
842
|
-
}
|
843
|
-
injectExitHandlers(hdls) {
|
844
|
-
this._exitHandlers = hdls;
|
845
|
-
}
|
846
|
-
exit(code) {
|
847
|
-
this._handleExit().then(() => {
|
848
|
-
Deno2.exit(code);
|
849
|
-
}).catch((err) => {
|
850
|
-
console.error("ExitService: failed to handle exit", err);
|
851
|
-
Deno2.exit(code);
|
852
|
-
});
|
853
|
-
}
|
854
|
-
};
|
855
|
-
var _DenoSystemService = class _DenoSystemService {
|
856
|
-
constructor() {
|
857
|
-
this._exitService = new DenoExitServiceImpl();
|
858
|
-
this._exitService.injectExitHandlers(_DenoSystemService._exitHandlers);
|
859
|
-
}
|
860
|
-
Env() {
|
861
|
-
return envFactory();
|
862
|
-
}
|
863
|
-
Args() {
|
864
|
-
return Deno2.args;
|
865
|
-
}
|
866
|
-
OnExit(hdl) {
|
867
|
-
const id = crypto.randomUUID();
|
868
|
-
_DenoSystemService._exitHandlers.push({ hdl, id });
|
869
|
-
return () => {
|
870
|
-
const idx = _DenoSystemService._exitHandlers.findIndex((h) => h.id === id);
|
871
|
-
if (idx >= 0) {
|
872
|
-
_DenoSystemService._exitHandlers.splice(idx, 1);
|
873
|
-
}
|
874
|
-
};
|
875
|
-
}
|
876
|
-
Exit(code) {
|
877
|
-
this._exitService.exit(code);
|
878
|
-
}
|
879
|
-
};
|
880
|
-
_DenoSystemService._exitHandlers = [];
|
881
|
-
var DenoSystemService = _DenoSystemService;
|
882
787
|
|
883
|
-
// src/node/node-
|
884
|
-
var import_node_path = __toESM(require("path"), 1);
|
885
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
886
|
-
var import_node_process = __toESM(require("process"), 1);
|
887
|
-
|
888
|
-
// src/node/node-sys-abstraction.ts
|
889
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
788
|
+
// src/node/node-env-actions.ts
|
890
789
|
var once2 = new ResolveOnce();
|
891
790
|
var _node;
|
892
791
|
var _NodeEnvActions = class _NodeEnvActions {
|
@@ -924,96 +823,51 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
924
823
|
};
|
925
824
|
_node = new WeakMap();
|
926
825
|
var NodeEnvActions = _NodeEnvActions;
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
}
|
935
|
-
this.invoked = true;
|
936
|
-
for (const h of this._exitHandlers) {
|
937
|
-
try {
|
938
|
-
const ret = h.hdl();
|
939
|
-
if (typeof ret.then === "function") {
|
940
|
-
await ret;
|
941
|
-
}
|
942
|
-
} finally {
|
943
|
-
}
|
944
|
-
}
|
945
|
-
};
|
946
|
-
import_node_process2.default.on("unhandledRejection", (reason, p) => {
|
947
|
-
this.exit(19);
|
948
|
-
});
|
949
|
-
import_node_process2.default.on("uncaughtException", (error) => {
|
950
|
-
this.exit(18);
|
951
|
-
});
|
952
|
-
import_node_process2.default.on("close", () => {
|
953
|
-
this.exit(0);
|
954
|
-
});
|
955
|
-
import_node_process2.default.on("exit", () => {
|
956
|
-
this.exit(0);
|
957
|
-
});
|
958
|
-
import_node_process2.default.on("SIGQUIT", () => {
|
959
|
-
this.exit(3);
|
960
|
-
});
|
961
|
-
import_node_process2.default.on("SIGINT", () => {
|
962
|
-
this.exit(2);
|
963
|
-
});
|
964
|
-
import_node_process2.default.on("SIGTERM", () => {
|
965
|
-
this.exit(9);
|
966
|
-
});
|
826
|
+
|
827
|
+
// src/web/web-env-actions.ts
|
828
|
+
var once3 = new ResolveOnce();
|
829
|
+
var BrowserEnvActions = class _BrowserEnvActions {
|
830
|
+
constructor(opts) {
|
831
|
+
this.env = /* @__PURE__ */ new Map();
|
832
|
+
this.opts = opts;
|
967
833
|
}
|
968
|
-
|
969
|
-
|
834
|
+
static new(opts) {
|
835
|
+
return once3.once(() => new _BrowserEnvActions(opts));
|
970
836
|
}
|
971
|
-
|
972
|
-
this.
|
973
|
-
import_node_process2.default.exit(code);
|
974
|
-
}).catch((err) => {
|
975
|
-
console.error("ExitService: failed to handle exit", err);
|
976
|
-
import_node_process2.default.exit(code);
|
977
|
-
});
|
837
|
+
get(key2) {
|
838
|
+
return this.env.get(key2);
|
978
839
|
}
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
this._exitService.injectExitHandlers(_NodeSystemService._exitHandlers);
|
840
|
+
set(key2, value) {
|
841
|
+
if (value) {
|
842
|
+
this.env.set(key2, value);
|
843
|
+
}
|
984
844
|
}
|
985
|
-
|
986
|
-
|
845
|
+
delete(key2) {
|
846
|
+
this.env.delete(key2);
|
987
847
|
}
|
988
|
-
|
989
|
-
return
|
848
|
+
keys() {
|
849
|
+
return Array.from(this.env.keys());
|
990
850
|
}
|
991
|
-
|
992
|
-
|
993
|
-
_NodeSystemService._exitHandlers.push({ hdl, id });
|
994
|
-
return () => {
|
995
|
-
const idx = _NodeSystemService._exitHandlers.findIndex((h) => h.id === id);
|
996
|
-
if (idx >= 0) {
|
997
|
-
_NodeSystemService._exitHandlers.splice(idx, 1);
|
998
|
-
}
|
999
|
-
};
|
851
|
+
active() {
|
852
|
+
return true;
|
1000
853
|
}
|
1001
|
-
|
1002
|
-
this.
|
854
|
+
register(env) {
|
855
|
+
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
856
|
+
const browser = globalThis;
|
857
|
+
browser[sym] = env;
|
858
|
+
return env;
|
1003
859
|
}
|
1004
860
|
};
|
1005
|
-
_NodeSystemService._exitHandlers = [];
|
1006
|
-
var NodeSystemService = _NodeSystemService;
|
1007
861
|
|
1008
|
-
// src/cf/cf-
|
1009
|
-
var
|
862
|
+
// src/cf/cf-env-actions.ts
|
863
|
+
var once4 = new ResolveOnce();
|
1010
864
|
var CFEnvActions = class _CFEnvActions {
|
1011
865
|
constructor(env) {
|
1012
866
|
this.injectOnRegister = {};
|
1013
867
|
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1014
868
|
}
|
1015
869
|
static new(opts) {
|
1016
|
-
return
|
870
|
+
return once4.once(() => new _CFEnvActions(opts));
|
1017
871
|
}
|
1018
872
|
static inject(o) {
|
1019
873
|
const env = _CFEnvActions.new({});
|
@@ -1054,6 +908,156 @@ var CFEnvActions = class _CFEnvActions {
|
|
1054
908
|
}
|
1055
909
|
};
|
1056
910
|
|
911
|
+
// src/result.ts
|
912
|
+
var Result = class _Result {
|
913
|
+
static Ok(t) {
|
914
|
+
return new ResultOK(t);
|
915
|
+
}
|
916
|
+
static Err(t) {
|
917
|
+
if (typeof t === "string") {
|
918
|
+
return new ResultError(new Error(t));
|
919
|
+
}
|
920
|
+
if (_Result.Is(t)) {
|
921
|
+
if (t.is_ok()) {
|
922
|
+
return new ResultError(new Error("Result Error is Ok"));
|
923
|
+
}
|
924
|
+
return t;
|
925
|
+
}
|
926
|
+
return new ResultError(t);
|
927
|
+
}
|
928
|
+
static Is(t) {
|
929
|
+
if (!t) {
|
930
|
+
return false;
|
931
|
+
}
|
932
|
+
if (t instanceof _Result) {
|
933
|
+
return true;
|
934
|
+
}
|
935
|
+
const rt = t;
|
936
|
+
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
937
|
+
return true;
|
938
|
+
}
|
939
|
+
return false;
|
940
|
+
}
|
941
|
+
isOk() {
|
942
|
+
return this.is_ok();
|
943
|
+
}
|
944
|
+
isErr() {
|
945
|
+
return this.is_err();
|
946
|
+
}
|
947
|
+
Ok() {
|
948
|
+
return this.unwrap();
|
949
|
+
}
|
950
|
+
Err() {
|
951
|
+
return this.unwrap_err();
|
952
|
+
}
|
953
|
+
};
|
954
|
+
var ResultOK = class extends Result {
|
955
|
+
constructor(t) {
|
956
|
+
super();
|
957
|
+
this._t = t;
|
958
|
+
}
|
959
|
+
is_ok() {
|
960
|
+
return true;
|
961
|
+
}
|
962
|
+
is_err() {
|
963
|
+
return false;
|
964
|
+
}
|
965
|
+
unwrap_err() {
|
966
|
+
throw new Error("Result is Ok");
|
967
|
+
}
|
968
|
+
unwrap() {
|
969
|
+
return this._t;
|
970
|
+
}
|
971
|
+
};
|
972
|
+
var ResultError = class extends Result {
|
973
|
+
constructor(t) {
|
974
|
+
super();
|
975
|
+
this._error = t;
|
976
|
+
}
|
977
|
+
is_ok() {
|
978
|
+
return false;
|
979
|
+
}
|
980
|
+
is_err() {
|
981
|
+
return true;
|
982
|
+
}
|
983
|
+
unwrap() {
|
984
|
+
throw new Error(`Result is Err: ${this._error}`);
|
985
|
+
}
|
986
|
+
unwrap_err() {
|
987
|
+
return this._error;
|
988
|
+
}
|
989
|
+
};
|
990
|
+
function exception2Result(fn) {
|
991
|
+
try {
|
992
|
+
const res = fn();
|
993
|
+
if (res instanceof Promise) {
|
994
|
+
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
995
|
+
}
|
996
|
+
return Result.Ok(res);
|
997
|
+
} catch (e) {
|
998
|
+
return Result.Err(e);
|
999
|
+
}
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
// src/utils/get-params-result.ts
|
1003
|
+
var _REQUIRED = class {
|
1004
|
+
constructor() {
|
1005
|
+
this.val = "REQUIRED";
|
1006
|
+
}
|
1007
|
+
};
|
1008
|
+
var _OPTIONAL = class {
|
1009
|
+
constructor() {
|
1010
|
+
this.val = "OPTIONAL";
|
1011
|
+
}
|
1012
|
+
};
|
1013
|
+
var param = {
|
1014
|
+
REQUIRED: new _REQUIRED(),
|
1015
|
+
OPTIONAL: new _OPTIONAL()
|
1016
|
+
};
|
1017
|
+
function getParamsResult(keys, getParam) {
|
1018
|
+
const keyDef = keys.flat().reduce(
|
1019
|
+
(acc, i) => {
|
1020
|
+
if (typeof i === "string") {
|
1021
|
+
acc.push({ key: i, def: void 0, isOptional: false });
|
1022
|
+
} else if (typeof i === "object") {
|
1023
|
+
acc.push(
|
1024
|
+
...Object.keys(i).map((k) => ({
|
1025
|
+
key: k,
|
1026
|
+
def: typeof i[k] === "string" ? i[k] : void 0,
|
1027
|
+
isOptional: i[k] === param.OPTIONAL
|
1028
|
+
}))
|
1029
|
+
);
|
1030
|
+
}
|
1031
|
+
return acc;
|
1032
|
+
},
|
1033
|
+
[]
|
1034
|
+
);
|
1035
|
+
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1036
|
+
const msg = keys2.join(",");
|
1037
|
+
return `missing parameters: ${msg}`;
|
1038
|
+
});
|
1039
|
+
const errors = [];
|
1040
|
+
const result = {};
|
1041
|
+
for (const kd of keyDef) {
|
1042
|
+
const val = getParam.getParam(kd.key);
|
1043
|
+
if (val === void 0) {
|
1044
|
+
if (typeof kd.def === "string") {
|
1045
|
+
result[kd.key] = kd.def;
|
1046
|
+
} else {
|
1047
|
+
if (!kd.isOptional) {
|
1048
|
+
errors.push(kd.key);
|
1049
|
+
}
|
1050
|
+
}
|
1051
|
+
} else {
|
1052
|
+
result[kd.key] = val;
|
1053
|
+
}
|
1054
|
+
}
|
1055
|
+
if (errors.length) {
|
1056
|
+
return Result.Err(msgFn(...errors));
|
1057
|
+
}
|
1058
|
+
return Result.Ok(result);
|
1059
|
+
}
|
1060
|
+
|
1057
1061
|
// src/sys-env.ts
|
1058
1062
|
var envActions = [
|
1059
1063
|
{ id: "cf", fn: (opts) => CFEnvActions.new(opts) },
|
@@ -1080,17 +1084,67 @@ function envFactory(opts = {}) {
|
|
1080
1084
|
}
|
1081
1085
|
return _envFactories.get(found.id).once(() => {
|
1082
1086
|
const action = found.fn(opts);
|
1083
|
-
const ret = new
|
1087
|
+
const ret = new EnvImpl(action, opts);
|
1084
1088
|
action.register(ret);
|
1085
1089
|
return ret;
|
1086
1090
|
});
|
1087
1091
|
}
|
1088
|
-
|
1092
|
+
function isIterable(obj) {
|
1093
|
+
if (obj == null) {
|
1094
|
+
return false;
|
1095
|
+
}
|
1096
|
+
return typeof obj[Symbol.iterator] === "function";
|
1097
|
+
}
|
1098
|
+
var EnvImpl = class {
|
1089
1099
|
constructor(map, opts = {}) {
|
1090
1100
|
this._onSet = [];
|
1091
1101
|
this._map = map;
|
1092
1102
|
this._updatePresets(opts.presetEnv);
|
1093
1103
|
}
|
1104
|
+
gets(...kparams) {
|
1105
|
+
return getParamsResult(kparams, {
|
1106
|
+
getParam: (k) => this.get(k)
|
1107
|
+
});
|
1108
|
+
}
|
1109
|
+
sets(...keys) {
|
1110
|
+
keys.forEach((key2) => {
|
1111
|
+
if (Array.isArray(key2)) {
|
1112
|
+
if (key2.length === 2) {
|
1113
|
+
const [k, v] = key2;
|
1114
|
+
if (typeof k === "string" && typeof v === "string") {
|
1115
|
+
this.set(k, v);
|
1116
|
+
return;
|
1117
|
+
}
|
1118
|
+
}
|
1119
|
+
for (const item of key2) {
|
1120
|
+
if (Array.isArray(item)) {
|
1121
|
+
if (item.length === 2) {
|
1122
|
+
const [k, v] = item;
|
1123
|
+
if (typeof k === "string" && typeof v === "string") {
|
1124
|
+
this.set(k, v);
|
1125
|
+
}
|
1126
|
+
}
|
1127
|
+
}
|
1128
|
+
}
|
1129
|
+
} else {
|
1130
|
+
if (isIterable(key2)) {
|
1131
|
+
for (const [k, v] of key2) {
|
1132
|
+
if (typeof k === "string" && typeof v === "string") {
|
1133
|
+
this.set(k, v);
|
1134
|
+
}
|
1135
|
+
}
|
1136
|
+
} else {
|
1137
|
+
const rKey = key2;
|
1138
|
+
for (const k in rKey) {
|
1139
|
+
const v = rKey[k];
|
1140
|
+
if (typeof k === "string" && typeof v === "string") {
|
1141
|
+
this.set(k, v);
|
1142
|
+
}
|
1143
|
+
}
|
1144
|
+
}
|
1145
|
+
}
|
1146
|
+
});
|
1147
|
+
}
|
1094
1148
|
_updatePresets(presetEnv) {
|
1095
1149
|
if (!presetEnv) {
|
1096
1150
|
return;
|
@@ -1153,40 +1207,23 @@ var EnvImpl2 = class {
|
|
1153
1207
|
}
|
1154
1208
|
};
|
1155
1209
|
|
1156
|
-
// src/
|
1157
|
-
var
|
1158
|
-
var
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
}
|
1163
|
-
static new(opts) {
|
1164
|
-
return once4.once(() => new _BrowserEnvActions(opts));
|
1165
|
-
}
|
1166
|
-
get(key2) {
|
1167
|
-
return this.env.get(key2);
|
1168
|
-
}
|
1169
|
-
set(key2, value) {
|
1170
|
-
if (value) {
|
1171
|
-
this.env.set(key2, value);
|
1172
|
-
}
|
1173
|
-
}
|
1174
|
-
delete(key2) {
|
1175
|
-
this.env.delete(key2);
|
1176
|
-
}
|
1177
|
-
keys() {
|
1178
|
-
return Array.from(this.env.keys());
|
1179
|
-
}
|
1180
|
-
active() {
|
1181
|
-
return true;
|
1210
|
+
// src/txt-en-decoder.ts
|
1211
|
+
var encoder = new TextEncoder();
|
1212
|
+
var decoder = new TextDecoder();
|
1213
|
+
var Utf8EnDecoder = class {
|
1214
|
+
encode(str) {
|
1215
|
+
return encoder.encode(str);
|
1182
1216
|
}
|
1183
|
-
|
1184
|
-
|
1185
|
-
const browser = globalThis;
|
1186
|
-
browser[sym] = env;
|
1187
|
-
return env;
|
1217
|
+
decode(data) {
|
1218
|
+
return decoder.decode(data);
|
1188
1219
|
}
|
1189
1220
|
};
|
1221
|
+
var utf8EnDecoder = new Utf8EnDecoder();
|
1222
|
+
function Utf8EnDecoderSingleton() {
|
1223
|
+
return utf8EnDecoder;
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
// src/web/web-sys-abstraction.ts
|
1190
1227
|
var WebFileService = class {
|
1191
1228
|
get baseDir() {
|
1192
1229
|
throw new Error("basedir-Method not implemented.");
|
@@ -1249,106 +1286,15 @@ var WebSystemService = class {
|
|
1249
1286
|
}
|
1250
1287
|
};
|
1251
1288
|
var my = void 0;
|
1252
|
-
function WebSysAbstraction(
|
1289
|
+
function WebSysAbstraction(param3) {
|
1253
1290
|
if (!my) {
|
1254
1291
|
my = new BaseSysAbstraction({
|
1255
|
-
TxtEnDecoder: (
|
1292
|
+
TxtEnDecoder: (param3 == null ? void 0 : param3.TxtEnDecoder) || Utf8EnDecoderSingleton(),
|
1256
1293
|
FileSystem: new WebFileService(),
|
1257
1294
|
SystemService: new WebSystemService()
|
1258
1295
|
});
|
1259
1296
|
}
|
1260
|
-
return new WrapperSysAbstraction(my,
|
1261
|
-
}
|
1262
|
-
|
1263
|
-
// src/result.ts
|
1264
|
-
var Result = class _Result {
|
1265
|
-
static Ok(t) {
|
1266
|
-
return new ResultOK(t);
|
1267
|
-
}
|
1268
|
-
static Err(t) {
|
1269
|
-
if (typeof t === "string") {
|
1270
|
-
return new ResultError(new Error(t));
|
1271
|
-
}
|
1272
|
-
if (_Result.Is(t)) {
|
1273
|
-
if (t.is_ok()) {
|
1274
|
-
return new ResultError(new Error("Result Error is Ok"));
|
1275
|
-
}
|
1276
|
-
return t;
|
1277
|
-
}
|
1278
|
-
return new ResultError(t);
|
1279
|
-
}
|
1280
|
-
static Is(t) {
|
1281
|
-
if (!t) {
|
1282
|
-
return false;
|
1283
|
-
}
|
1284
|
-
if (t instanceof _Result) {
|
1285
|
-
return true;
|
1286
|
-
}
|
1287
|
-
const rt = t;
|
1288
|
-
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
1289
|
-
return true;
|
1290
|
-
}
|
1291
|
-
return false;
|
1292
|
-
}
|
1293
|
-
isOk() {
|
1294
|
-
return this.is_ok();
|
1295
|
-
}
|
1296
|
-
isErr() {
|
1297
|
-
return this.is_err();
|
1298
|
-
}
|
1299
|
-
Ok() {
|
1300
|
-
return this.unwrap();
|
1301
|
-
}
|
1302
|
-
Err() {
|
1303
|
-
return this.unwrap_err();
|
1304
|
-
}
|
1305
|
-
};
|
1306
|
-
var ResultOK = class extends Result {
|
1307
|
-
constructor(t) {
|
1308
|
-
super();
|
1309
|
-
this._t = t;
|
1310
|
-
}
|
1311
|
-
is_ok() {
|
1312
|
-
return true;
|
1313
|
-
}
|
1314
|
-
is_err() {
|
1315
|
-
return false;
|
1316
|
-
}
|
1317
|
-
unwrap_err() {
|
1318
|
-
throw new Error("Result is Ok");
|
1319
|
-
}
|
1320
|
-
unwrap() {
|
1321
|
-
return this._t;
|
1322
|
-
}
|
1323
|
-
};
|
1324
|
-
var ResultError = class extends Result {
|
1325
|
-
constructor(t) {
|
1326
|
-
super();
|
1327
|
-
this._error = t;
|
1328
|
-
}
|
1329
|
-
is_ok() {
|
1330
|
-
return false;
|
1331
|
-
}
|
1332
|
-
is_err() {
|
1333
|
-
return true;
|
1334
|
-
}
|
1335
|
-
unwrap() {
|
1336
|
-
throw new Error(`Result is Err: ${this._error}`);
|
1337
|
-
}
|
1338
|
-
unwrap_err() {
|
1339
|
-
return this._error;
|
1340
|
-
}
|
1341
|
-
};
|
1342
|
-
function exception2Result(fn) {
|
1343
|
-
try {
|
1344
|
-
const res = fn();
|
1345
|
-
if (res instanceof Promise) {
|
1346
|
-
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
1347
|
-
}
|
1348
|
-
return Result.Ok(res);
|
1349
|
-
} catch (e) {
|
1350
|
-
return Result.Err(e);
|
1351
|
-
}
|
1297
|
+
return new WrapperSysAbstraction(my, param3);
|
1352
1298
|
}
|
1353
1299
|
|
1354
1300
|
// src/utils/relative-path.ts
|
@@ -1397,23 +1343,23 @@ var Path = class {
|
|
1397
1343
|
this.parts.push(part);
|
1398
1344
|
}
|
1399
1345
|
};
|
1400
|
-
function splitPath(
|
1346
|
+
function splitPath(path) {
|
1401
1347
|
const p = new Path();
|
1402
|
-
if (
|
1348
|
+
if (path === "") {
|
1403
1349
|
return p;
|
1404
1350
|
}
|
1405
|
-
for (let count = 0;
|
1406
|
-
if (
|
1351
|
+
for (let count = 0; path.length; count++) {
|
1352
|
+
if (path.match(/^\/+/)) {
|
1407
1353
|
if (count === 0) {
|
1408
1354
|
p.add(3 /* Root */);
|
1409
1355
|
} else {
|
1410
1356
|
p.add(1 /* Slash */);
|
1411
1357
|
}
|
1412
|
-
|
1358
|
+
path = path.replace(/^\/+/, "");
|
1413
1359
|
} else {
|
1414
|
-
const part =
|
1360
|
+
const part = path.replace(/\/.*$/, "");
|
1415
1361
|
p.add(part);
|
1416
|
-
|
1362
|
+
path = path.replace(/^[^/]+/, "");
|
1417
1363
|
}
|
1418
1364
|
}
|
1419
1365
|
return p;
|
@@ -1422,29 +1368,29 @@ function pathJoin(...paths) {
|
|
1422
1368
|
let prev = "";
|
1423
1369
|
const res = [];
|
1424
1370
|
for (let i = 0; i < paths.length; i++) {
|
1425
|
-
const
|
1426
|
-
if (
|
1371
|
+
const path = paths[i];
|
1372
|
+
if (path === "") {
|
1427
1373
|
continue;
|
1428
1374
|
}
|
1429
|
-
if (!(prev.endsWith("/") ||
|
1375
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1430
1376
|
if (prev !== "") {
|
1431
1377
|
res.push("/");
|
1432
1378
|
}
|
1433
|
-
res.push(
|
1379
|
+
res.push(path);
|
1434
1380
|
} else {
|
1435
|
-
res.push(
|
1381
|
+
res.push(path);
|
1436
1382
|
}
|
1437
|
-
prev =
|
1383
|
+
prev = path;
|
1438
1384
|
}
|
1439
1385
|
return res.join("");
|
1440
1386
|
}
|
1441
|
-
function relativePath(
|
1442
|
-
const relativeParts = splitPath(
|
1387
|
+
function relativePath(path, relative) {
|
1388
|
+
const relativeParts = splitPath(relative);
|
1443
1389
|
let result;
|
1444
1390
|
if (relativeParts.parts[0] === 3 /* Root */) {
|
1445
|
-
result =
|
1391
|
+
result = relative;
|
1446
1392
|
} else {
|
1447
|
-
result = pathJoin(
|
1393
|
+
result = pathJoin(path, relative);
|
1448
1394
|
}
|
1449
1395
|
const unoptPath = splitPath(result);
|
1450
1396
|
const out = [];
|
@@ -1496,12 +1442,12 @@ function stripper(strip, obj) {
|
|
1496
1442
|
});
|
1497
1443
|
return localStripper(void 0, restrips, obj);
|
1498
1444
|
}
|
1499
|
-
function localStripper(
|
1445
|
+
function localStripper(path, restrips, obj) {
|
1500
1446
|
if (typeof obj !== "object" || obj === null) {
|
1501
1447
|
return obj;
|
1502
1448
|
}
|
1503
1449
|
if (Array.isArray(obj)) {
|
1504
|
-
return obj.map((i) => localStripper(
|
1450
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
1505
1451
|
}
|
1506
1452
|
const ret = { ...obj };
|
1507
1453
|
const matcher = (key2, nextPath) => {
|
@@ -1515,8 +1461,8 @@ function localStripper(path3, restrips, obj) {
|
|
1515
1461
|
for (const key2 in ret) {
|
1516
1462
|
if (Object.prototype.hasOwnProperty.call(ret, key2)) {
|
1517
1463
|
let nextPath;
|
1518
|
-
if (
|
1519
|
-
nextPath = [
|
1464
|
+
if (path) {
|
1465
|
+
nextPath = [path, key2].join(".");
|
1520
1466
|
} else {
|
1521
1467
|
nextPath = key2;
|
1522
1468
|
}
|
@@ -1543,20 +1489,7 @@ function localStripper(path3, restrips, obj) {
|
|
1543
1489
|
}
|
1544
1490
|
|
1545
1491
|
// src/uri.ts
|
1546
|
-
var
|
1547
|
-
constructor() {
|
1548
|
-
this.val = "REQUIRED";
|
1549
|
-
}
|
1550
|
-
};
|
1551
|
-
var _OPTIONAL = class {
|
1552
|
-
constructor() {
|
1553
|
-
this.val = "OPTIONAL";
|
1554
|
-
}
|
1555
|
-
};
|
1556
|
-
var key = {
|
1557
|
-
REQUIRED: new _REQUIRED(),
|
1558
|
-
OPTIONAL: new _OPTIONAL()
|
1559
|
-
};
|
1492
|
+
var key = param;
|
1560
1493
|
function coerceKey(key2, def) {
|
1561
1494
|
if (typeof key2 === "object") {
|
1562
1495
|
const keys = Object.keys(key2);
|
@@ -1712,49 +1645,6 @@ function getParamResult(key2, val, msgFn = (key3) => {
|
|
1712
1645
|
}
|
1713
1646
|
return Result.Ok(val);
|
1714
1647
|
}
|
1715
|
-
function getParamsResult(keys, getParam) {
|
1716
|
-
const keyDef = keys.flat().reduce(
|
1717
|
-
(acc, i) => {
|
1718
|
-
if (typeof i === "string") {
|
1719
|
-
acc.push({ key: i, def: void 0, isOptional: false });
|
1720
|
-
} else if (typeof i === "object") {
|
1721
|
-
acc.push(
|
1722
|
-
...Object.keys(i).map((k) => ({
|
1723
|
-
key: k,
|
1724
|
-
def: typeof i[k] === "string" ? i[k] : void 0,
|
1725
|
-
isOptional: i[k] instanceof _OPTIONAL
|
1726
|
-
}))
|
1727
|
-
);
|
1728
|
-
}
|
1729
|
-
return acc;
|
1730
|
-
},
|
1731
|
-
[]
|
1732
|
-
);
|
1733
|
-
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1734
|
-
const msg = keys2.join(",");
|
1735
|
-
return `missing parameters: ${msg}`;
|
1736
|
-
});
|
1737
|
-
const errors = [];
|
1738
|
-
const result = {};
|
1739
|
-
for (const kd of keyDef) {
|
1740
|
-
const val = getParam.getParam(kd.key);
|
1741
|
-
if (val === void 0) {
|
1742
|
-
if (typeof kd.def === "string") {
|
1743
|
-
result[kd.key] = kd.def;
|
1744
|
-
} else {
|
1745
|
-
if (!kd.isOptional) {
|
1746
|
-
errors.push(kd.key);
|
1747
|
-
}
|
1748
|
-
}
|
1749
|
-
} else {
|
1750
|
-
result[kd.key] = val;
|
1751
|
-
}
|
1752
|
-
}
|
1753
|
-
if (errors.length) {
|
1754
|
-
return Result.Err(msgFn(...errors));
|
1755
|
-
}
|
1756
|
-
return Result.Ok(result);
|
1757
|
-
}
|
1758
1648
|
var BuildURI = class _BuildURI {
|
1759
1649
|
// pathname needs this
|
1760
1650
|
constructor(url) {
|
@@ -2014,7 +1904,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
2014
1904
|
this.ready = Promise.resolve(void 0);
|
2015
1905
|
this.closed = Promise.resolve(void 0);
|
2016
1906
|
}
|
2017
|
-
|
1907
|
+
write(chunk) {
|
2018
1908
|
let strObj = this.decoder.decode(chunk).trimEnd();
|
2019
1909
|
let output = "log";
|
2020
1910
|
try {
|
@@ -2032,6 +1922,7 @@ var ConsoleWriterStreamDefaultWriter = class {
|
|
2032
1922
|
default:
|
2033
1923
|
console.log(strObj);
|
2034
1924
|
}
|
1925
|
+
return Promise.resolve();
|
2035
1926
|
}
|
2036
1927
|
};
|
2037
1928
|
var ConsoleWriterStream = class {
|
@@ -2042,8 +1933,8 @@ var ConsoleWriterStream = class {
|
|
2042
1933
|
abort(reason) {
|
2043
1934
|
throw new Error("Method not implemented.");
|
2044
1935
|
}
|
2045
|
-
|
2046
|
-
return;
|
1936
|
+
close() {
|
1937
|
+
return Promise.resolve();
|
2047
1938
|
}
|
2048
1939
|
getWriter() {
|
2049
1940
|
if (this.locked) {
|
@@ -2071,7 +1962,7 @@ var LogWriterStream = class {
|
|
2071
1962
|
const writer = this._out.getWriter();
|
2072
1963
|
await writer.ready;
|
2073
1964
|
await writer.write(encoded);
|
2074
|
-
|
1965
|
+
writer.releaseLock();
|
2075
1966
|
} catch (err) {
|
2076
1967
|
console.error("Chunk error:", err);
|
2077
1968
|
}
|
@@ -2095,7 +1986,9 @@ var LogWriterStream = class {
|
|
2095
1986
|
return;
|
2096
1987
|
}
|
2097
1988
|
const my2 = this._toFlush.shift();
|
2098
|
-
my2 == null ? void 0 : my2().
|
1989
|
+
my2 == null ? void 0 : my2().catch((e) => {
|
1990
|
+
console.error("Flush error:", e);
|
1991
|
+
}).finally(() => {
|
2099
1992
|
this._flush(this._toFlush);
|
2100
1993
|
});
|
2101
1994
|
}
|
@@ -2256,9 +2149,6 @@ function getLen(value, lvs) {
|
|
2256
2149
|
}
|
2257
2150
|
return logValue(() => -1, lvs);
|
2258
2151
|
}
|
2259
|
-
function hash(value) {
|
2260
|
-
return "not implemented";
|
2261
|
-
}
|
2262
2152
|
function toLogValue(lop) {
|
2263
2153
|
if (lop && typeof lop.then === "function") {
|
2264
2154
|
throw new Error("async logValue Not implemented");
|
@@ -2508,11 +2398,9 @@ var LoggerImpl = class _LoggerImpl {
|
|
2508
2398
|
this._attributes[key2] = getLen(value, toLogValueCtx(this.levelHandler));
|
2509
2399
|
return this;
|
2510
2400
|
}
|
2401
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2511
2402
|
Hash(value, key2 = "hash") {
|
2512
|
-
|
2513
|
-
async () => `${getLen(value, toLogValueCtx(this.levelHandler)).value()}:${await hash(value)}`
|
2514
|
-
);
|
2515
|
-
return this;
|
2403
|
+
throw new Error("Not implemented");
|
2516
2404
|
}
|
2517
2405
|
Url(url, key2 = "url") {
|
2518
2406
|
this.Ref(key2, () => URI.from(url).toString());
|
@@ -2545,8 +2433,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2545
2433
|
return this.Uint64(key2, value);
|
2546
2434
|
}
|
2547
2435
|
async Flush() {
|
2548
|
-
return new Promise((
|
2549
|
-
this._logWriter._flush(void 0,
|
2436
|
+
return new Promise((resolve) => {
|
2437
|
+
this._logWriter._flush(void 0, resolve);
|
2550
2438
|
});
|
2551
2439
|
}
|
2552
2440
|
With() {
|
@@ -2857,8 +2745,8 @@ function MockLogger(params) {
|
|
2857
2745
|
|
2858
2746
|
// src/tracer.ts
|
2859
2747
|
var Metric = class {
|
2860
|
-
constructor(
|
2861
|
-
this.path =
|
2748
|
+
constructor(path) {
|
2749
|
+
this.path = path;
|
2862
2750
|
}
|
2863
2751
|
set(value) {
|
2864
2752
|
this.value = value;
|
@@ -2893,23 +2781,23 @@ var Metrics = class {
|
|
2893
2781
|
return obj;
|
2894
2782
|
}
|
2895
2783
|
get(ipath) {
|
2896
|
-
const
|
2897
|
-
if (
|
2898
|
-
if (
|
2899
|
-
throw new Error(`Metrics path must contain value /:${
|
2784
|
+
const path = ipath.replace(/[/]+/g, "/").trim();
|
2785
|
+
if (path.startsWith("/")) {
|
2786
|
+
if (path.slice(1).length === 0) {
|
2787
|
+
throw new Error(`Metrics path must contain value /:${path}`);
|
2900
2788
|
}
|
2901
|
-
let metric = this.map.get(
|
2789
|
+
let metric = this.map.get(path);
|
2902
2790
|
if (!metric) {
|
2903
|
-
metric = new Metric(
|
2904
|
-
this.map.set(
|
2791
|
+
metric = new Metric(path);
|
2792
|
+
this.map.set(path, metric);
|
2905
2793
|
}
|
2906
|
-
this.spanRefs.set(
|
2794
|
+
this.spanRefs.set(path, metric);
|
2907
2795
|
return metric;
|
2908
|
-
} else if (
|
2909
|
-
throw new Error(`Metrics path must start with /:${
|
2796
|
+
} else if (path.includes("/")) {
|
2797
|
+
throw new Error(`Metrics path must start with /:${path}`);
|
2910
2798
|
}
|
2911
2799
|
const rootPath = this.tracenode.getRootPath();
|
2912
|
-
return this.get(`${rootPath}/${
|
2800
|
+
return this.get(`${rootPath}/${path}`);
|
2913
2801
|
}
|
2914
2802
|
};
|
2915
2803
|
var TraceNode = class _TraceNode {
|
@@ -3209,6 +3097,8 @@ __export(utils_exports, {
|
|
3209
3097
|
FanoutWriteStream: () => FanoutWriteStream,
|
3210
3098
|
array2stream: () => array2stream,
|
3211
3099
|
devnull: () => devnull,
|
3100
|
+
getParamsResult: () => getParamsResult,
|
3101
|
+
param: () => param,
|
3212
3102
|
rebuffer: () => rebuffer,
|
3213
3103
|
rebufferArray: () => rebufferArray,
|
3214
3104
|
stream2array: () => stream2array,
|
@@ -3322,6 +3212,9 @@ function pump(ps, controller, next) {
|
|
3322
3212
|
ps.tmpLen += value.length;
|
3323
3213
|
}
|
3324
3214
|
pump(ps, controller, next);
|
3215
|
+
}).catch((err) => {
|
3216
|
+
controller.error(err);
|
3217
|
+
next();
|
3325
3218
|
});
|
3326
3219
|
}
|
3327
3220
|
function rebuffer(a, chunkSize) {
|
@@ -3333,8 +3226,8 @@ function rebuffer(a, chunkSize) {
|
|
3333
3226
|
};
|
3334
3227
|
return new ReadableStream({
|
3335
3228
|
async pull(controller) {
|
3336
|
-
return new Promise((
|
3337
|
-
pump(state, controller,
|
3229
|
+
return new Promise((resolve) => {
|
3230
|
+
pump(state, controller, resolve);
|
3338
3231
|
});
|
3339
3232
|
}
|
3340
3233
|
});
|
@@ -3399,6 +3292,9 @@ function uint8array2stream(str) {
|
|
3399
3292
|
}
|
3400
3293
|
});
|
3401
3294
|
}
|
3295
|
+
|
3296
|
+
// src/index.ts
|
3297
|
+
var param2 = param;
|
3402
3298
|
// Annotate the CommonJS export names for ESM import in node:
|
3403
3299
|
0 && (module.exports = {
|
3404
3300
|
BaseSysAbstraction,
|
@@ -3459,6 +3355,7 @@ function uint8array2stream(str) {
|
|
3459
3355
|
isURL,
|
3460
3356
|
key,
|
3461
3357
|
logValue,
|
3358
|
+
param,
|
3462
3359
|
registerEnvAction,
|
3463
3360
|
runtimeFn,
|
3464
3361
|
toCryptoRuntime,
|