@adviser/cement 0.3.6 → 0.3.8
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-DLnSeH4s.d.cts → base-sys-abstraction-4Vw4QGaI.d.cts} +2 -2
- package/{base-sys-abstraction-CKI4xiRR.d.ts → base-sys-abstraction-8v83VyEU.d.ts} +2 -2
- package/cf/index.cjs +63 -12
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +19 -4
- package/cf/index.d.ts +19 -4
- package/cf/index.js +7 -5
- package/cf/index.js.map +1 -1
- package/{chunk-QDDO6NOK.js → chunk-A57BAYWU.js} +70 -11
- package/chunk-A57BAYWU.js.map +1 -0
- package/{chunk-4QRZPFED.js → chunk-GVZIH356.js} +58 -57
- package/{chunk-4QRZPFED.js.map → chunk-GVZIH356.js.map} +1 -1
- package/{chunk-Z7F6652G.js → chunk-TPIXB3KY.js} +7 -7
- package/chunk-TPIXB3KY.js.map +1 -0
- package/{chunk-OIIUVSUX.js → chunk-TRSU5M6V.js} +5 -5
- package/chunk-TRSU5M6V.js.map +1 -0
- package/{chunk-N5ISHPJ6.js → chunk-W53WEZWY.js} +43 -4
- package/chunk-W53WEZWY.js.map +1 -0
- package/deno/index.cjs +63 -14
- 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 +6 -6
- package/deno/index.js.map +1 -1
- package/{get-params-result-Bhy5997x.d.ts → get-params-result-C2cbgB78.d.cts} +14 -8
- package/{get-params-result-Bhy5997x.d.cts → get-params-result-C2cbgB78.d.ts} +14 -8
- package/{index-6ofzOS0J.d.ts → index-CbOCsgzP.d.ts} +2 -2
- package/{index-TZQHtEZo.d.cts → index-Dpc3oVOD.d.cts} +19 -3
- package/{index-CcNS7k5i.d.cts → index-EnKo_jNv.d.cts} +2 -2
- package/{index-DjN6Y4N2.d.ts → index-MWn9Xel9.d.ts} +19 -3
- package/index.cjs +189 -23
- package/index.cjs.map +1 -1
- package/index.d.cts +27 -10
- package/index.d.ts +27 -10
- package/index.js +85 -9
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -0
- package/metafile-esm.json +1 -0
- package/node/index.cjs +144 -95
- 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 +5 -5
- package/node/index.js.map +1 -1
- package/package.json +2 -2
- package/src/cf/cf-sys-abstraction.ts +2 -2
- package/src/cf/index.ts +1 -0
- package/src/deno/deno-file-service.ts +3 -3
- package/src/deno/deno-sys-abstraction.ts +2 -2
- package/src/http_header.ts +1 -1
- package/src/index.ts +5 -1
- package/src/json-en-decoder.ts +83 -0
- package/src/jsr.json +1 -1
- package/src/logger-impl.ts +2 -2
- package/src/node/node-file-service.ts +2 -2
- package/src/node/node-sys-abstraction.ts +2 -2
- package/src/path-ops.ts +30 -0
- package/src/test/log-write-stream.ts +2 -2
- package/src/txt-en-decoder.ts +40 -11
- package/src/utils/coerce-uint8.ts +53 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/sorted-object.ts +18 -0
- package/src/utils/string2stream.ts +2 -2
- package/src/utils/uint8array-equal.ts +11 -0
- package/src/web/web-sys-abstraction.ts +2 -2
- package/{sys-abstraction-BRDT_TIU.d.cts → sys-abstraction-3OXhCVsu.d.cts} +2 -2
- package/{sys-abstraction-Bd0EzwO6.d.ts → sys-abstraction-DXeSUn9x.d.ts} +2 -2
- package/test/index.cjs +156 -107
- 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 +4 -4
- package/ts/src/cf/cf-sys-abstraction.js +2 -2
- package/ts/src/cf/cf-sys-abstraction.js.map +1 -1
- package/ts/src/cf/index.d.ts +1 -0
- package/ts/src/cf/index.d.ts.map +1 -1
- package/ts/src/cf/index.js +1 -0
- package/ts/src/cf/index.js.map +1 -1
- package/ts/src/deno/deno-file-service.d.ts.map +1 -1
- package/ts/src/deno/deno-file-service.js +3 -3
- package/ts/src/deno/deno-file-service.js.map +1 -1
- package/ts/src/deno/deno-sys-abstraction.js +2 -2
- package/ts/src/deno/deno-sys-abstraction.js.map +1 -1
- package/ts/src/http_header.d.ts +1 -1
- package/ts/src/http_header.d.ts.map +1 -1
- package/ts/src/http_header.js.map +1 -1
- package/ts/src/index.d.ts +2 -0
- package/ts/src/index.d.ts.map +1 -1
- package/ts/src/index.js +2 -0
- package/ts/src/index.js.map +1 -1
- package/ts/src/json-en-decoder.d.ts +12 -0
- package/ts/src/json-en-decoder.d.ts.map +1 -0
- package/ts/src/json-en-decoder.js +41 -0
- package/ts/src/json-en-decoder.js.map +1 -0
- package/ts/src/json-en-decoder.test.d.ts +2 -0
- package/ts/src/json-en-decoder.test.d.ts.map +1 -0
- package/ts/src/json-en-decoder.test.js +18 -0
- package/ts/src/json-en-decoder.test.js.map +1 -0
- package/ts/src/logger-impl.d.ts.map +1 -1
- package/ts/src/logger-impl.js +2 -2
- package/ts/src/logger-impl.js.map +1 -1
- package/ts/src/node/node-file-service.d.ts.map +1 -1
- package/ts/src/node/node-file-service.js +2 -2
- package/ts/src/node/node-file-service.js.map +1 -1
- package/ts/src/node/node-sys-abstraction.js +2 -2
- package/ts/src/node/node-sys-abstraction.js.map +1 -1
- package/ts/src/path-ops.d.ts +7 -0
- package/ts/src/path-ops.d.ts.map +1 -0
- package/ts/src/path-ops.js +33 -0
- package/ts/src/path-ops.js.map +1 -0
- package/ts/src/path-ops.test.d.ts +2 -0
- package/ts/src/path-ops.test.d.ts.map +1 -0
- package/ts/src/path-ops.test.js +23 -0
- package/ts/src/path-ops.test.js.map +1 -0
- package/ts/src/test/log-write-stream.d.ts.map +1 -1
- package/ts/src/test/log-write-stream.js +2 -2
- package/ts/src/test/log-write-stream.js.map +1 -1
- package/ts/src/txt-en-decoder.d.ts +8 -7
- package/ts/src/txt-en-decoder.d.ts.map +1 -1
- package/ts/src/txt-en-decoder.js +32 -8
- package/ts/src/txt-en-decoder.js.map +1 -1
- package/ts/src/txt-en-decoder.test.d.ts +2 -0
- package/ts/src/txt-en-decoder.test.d.ts.map +1 -0
- package/ts/src/txt-en-decoder.test.js +48 -0
- package/ts/src/txt-en-decoder.test.js.map +1 -0
- package/ts/src/utils/coerce-uint8.d.ts +8 -0
- package/ts/src/utils/coerce-uint8.d.ts.map +1 -0
- package/ts/src/utils/coerce-uint8.js +34 -0
- package/ts/src/utils/coerce-uint8.js.map +1 -0
- package/ts/src/utils/index.d.ts +3 -0
- package/ts/src/utils/index.d.ts.map +1 -1
- package/ts/src/utils/index.js +3 -0
- package/ts/src/utils/index.js.map +1 -1
- package/ts/src/utils/sorted-objec.test.d.ts +2 -0
- package/ts/src/utils/sorted-objec.test.d.ts.map +1 -0
- package/ts/src/utils/sorted-objec.test.js +20 -0
- package/ts/src/utils/sorted-objec.test.js.map +1 -0
- package/ts/src/utils/sorted-object.d.ts +4 -0
- package/ts/src/utils/sorted-object.d.ts.map +1 -0
- package/ts/src/utils/sorted-object.js +16 -0
- package/ts/src/utils/sorted-object.js.map +1 -0
- package/ts/src/utils/string2stream.d.ts.map +1 -1
- package/ts/src/utils/string2stream.js +2 -2
- package/ts/src/utils/string2stream.js.map +1 -1
- package/ts/src/utils/uint8array-equal.d.ts +2 -0
- package/ts/src/utils/uint8array-equal.d.ts.map +1 -0
- package/ts/src/utils/uint8array-equal.js +12 -0
- package/ts/src/utils/uint8array-equal.js.map +1 -0
- package/ts/src/web/web-sys-abstraction.js +2 -2
- package/ts/src/web/web-sys-abstraction.js.map +1 -1
- package/utils/index.cjs +186 -91
- 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 +14 -2
- package/web/index.cjs +61 -12
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +3 -3
- package/web/index.d.ts +3 -3
- package/web/index.js +3 -3
- package/chunk-N5ISHPJ6.js.map +0 -1
- package/chunk-OIIUVSUX.js.map +0 -1
- package/chunk-QDDO6NOK.js.map +0 -1
- package/chunk-Z7F6652G.js.map +0 -1
package/node/index.js
CHANGED
@@ -2,10 +2,10 @@ import {
|
|
2
2
|
BaseSysAbstraction,
|
3
3
|
WrapperSysAbstraction,
|
4
4
|
envFactory
|
5
|
-
} from "../chunk-
|
5
|
+
} from "../chunk-GVZIH356.js";
|
6
6
|
import {
|
7
|
-
|
8
|
-
} from "../chunk-
|
7
|
+
TxtEnDecoderSingleton
|
8
|
+
} from "../chunk-A57BAYWU.js";
|
9
9
|
|
10
10
|
// src/node/node-file-service.ts
|
11
11
|
import path from "node:path";
|
@@ -54,7 +54,7 @@ var NodeFileService = class {
|
|
54
54
|
isAbsolute(fname) {
|
55
55
|
return path.isAbsolute(fname);
|
56
56
|
}
|
57
|
-
async writeFileString(fname, content, ende =
|
57
|
+
async writeFileString(fname, content, ende = TxtEnDecoderSingleton()) {
|
58
58
|
const o = await this.create(fname);
|
59
59
|
const wr = o.stream.getWriter();
|
60
60
|
await wr.write(ende.encode(content));
|
@@ -171,7 +171,7 @@ var my = void 0;
|
|
171
171
|
function NodeSysAbstraction(param) {
|
172
172
|
if (!my) {
|
173
173
|
my = new BaseSysAbstraction({
|
174
|
-
TxtEnDecoder: (param == null ? void 0 : param.TxtEnDecoder) ||
|
174
|
+
TxtEnDecoder: (param == null ? void 0 : param.TxtEnDecoder) || TxtEnDecoderSingleton(),
|
175
175
|
FileSystem: new NodeFileService(),
|
176
176
|
SystemService: new NodeSystemService()
|
177
177
|
});
|
package/node/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/node/node-file-service.ts","../../../src/node/node-sys-abstraction.ts","../../../src/node/mock-file-service.ts"],"sourcesContent":["import path from \"node:path\";\nimport fs from \"node:fs\";\nimport process from \"node:process\";\nimport { FileService, NamedWritableStream } from \"../file-service.js\";\nimport { TxtEnDecoder, Utf8EnDecoderSingleton } from \"../txt-en-decoder.js\";\n\nexport class NodeFileService implements FileService {\n readonly baseDir: string;\n constructor(baseDir: string = process.cwd()) {\n this.baseDir = this.abs(baseDir);\n }\n\n // nodeImport(fname: string): string {\n // // console.log('nodeImport:'+ fname);\n // if (path.isAbsolute(fname)) {\n // return fname;\n // } else {\n // return \"./\" + path.normalize(fname);\n // }\n // }\n\n readFileString(fname: string): Promise<string> {\n return fs.promises.readFile(fname, { encoding: \"utf-8\" });\n }\n\n dirname(fname: string): string {\n return path.dirname(fname);\n }\n basename(fname: string): string {\n return path.basename(fname);\n }\n\n join(...paths: string[]): string {\n return path.join(...paths);\n }\n\n relative(from: string, to?: string): string {\n if (to === undefined) {\n to = from;\n from = process.cwd();\n }\n const ret = path.relative(from, to);\n // console.log('relative:'+ from + \" -> \" + to + \"= \" + ret);\n return ret;\n }\n\n abs(fname: string): string {\n if (path.isAbsolute(fname)) {\n return fname;\n } else {\n const cwd = process.cwd();\n return path.resolve(cwd, fname);\n }\n }\n\n isAbsolute(fname: string): boolean {\n return path.isAbsolute(fname);\n }\n\n async writeFileString(fname: string, content: string, ende: TxtEnDecoder = Utf8EnDecoderSingleton()): Promise<void> {\n const o = await this.create(fname);\n const wr = o.stream.getWriter();\n await wr.write(ende.encode(content));\n await wr.close();\n }\n\n async create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!path.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const base = path.dirname(oName);\n await fs.promises.mkdir(base, { recursive: true });\n const out = fs.createWriteStream(oName);\n return {\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n out.write(chunk);\n },\n close(): void {\n out.close();\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n };\n }\n}\n","import { SysAbstraction, SystemService, VoidFunc } from \"../sys-abstraction.js\";\nimport {\n BaseSysAbstraction,\n ExitHandler,\n ExitService,\n WrapperSysAbstraction,\n WrapperSysAbstractionParams,\n} from \"../base-sys-abstraction.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\nimport { Env, envFactory } from \"../sys-env.js\";\nimport { Utf8EnDecoderSingleton } from \"../txt-en-decoder.js\";\nimport process from \"node:process\";\n\nexport class NodeExitServiceImpl implements ExitService {\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"unhandledRejection\", (reason: string, p: Promise<unknown>) => {\n this.exit(19);\n });\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"uncaughtException\", (error: Error) => {\n this.exit(18);\n });\n process.on(\"close\", () => {\n this.exit(0);\n });\n process.on(\"exit\", () => {\n this.exit(0);\n });\n process.on(\"SIGQUIT\", () => {\n this.exit(3);\n });\n process.on(\"SIGINT\", () => {\n this.exit(2);\n });\n process.on(\"SIGTERM\", () => {\n this.exit(9);\n });\n }\n _exitHandlers: ExitHandler[] = [];\n injectExitHandlers(hdls: ExitHandler[]): void {\n // console.log(\"ExitService: injecting exit handlers\", hdls)\n this._exitHandlers = hdls;\n }\n invoked = false;\n readonly _handleExit = async (): Promise<void> => {\n if (this.invoked) {\n // console.error(\"ExitService: already invoked\");\n return;\n }\n this.invoked = true;\n for (const h of this._exitHandlers) {\n try {\n // console.log(`ExitService: calling handler ${h.id}`)\n const ret = h.hdl();\n // console.log(`ExitService: called handler ${h.id}`, ret)\n if (typeof (ret as Promise<void>).then === \"function\") {\n await ret;\n }\n } finally {\n // ignore\n }\n }\n };\n\n exit(code: number): void {\n // console.log(\"ExitService: exit called\", code)\n this._handleExit()\n .then(() => {\n process.exit(code);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(\"ExitService: failed to handle exit\", err);\n process.exit(code);\n });\n }\n}\n\nexport class NodeSystemService implements SystemService {\n static readonly _exitHandlers: ExitHandler[] = [];\n readonly _exitService: ExitService = new NodeExitServiceImpl();\n constructor() {\n this._exitService.injectExitHandlers(NodeSystemService._exitHandlers);\n }\n\n Env(): Env {\n return envFactory();\n }\n\n Args(): string[] {\n return process.argv;\n }\n\n OnExit(hdl: VoidFunc): VoidFunc {\n const id = crypto.randomUUID();\n NodeSystemService._exitHandlers.push({ hdl, id });\n return () => {\n const idx = NodeSystemService._exitHandlers.findIndex((h) => h.id === id);\n if (idx >= 0) {\n NodeSystemService._exitHandlers.splice(idx, 1);\n }\n };\n }\n\n Exit(code: number): void {\n this._exitService.exit(code);\n }\n}\n\nlet my: BaseSysAbstraction | undefined = undefined;\nexport function NodeSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {\n if (!my) {\n my = new BaseSysAbstraction({\n TxtEnDecoder: param?.TxtEnDecoder || Utf8EnDecoderSingleton(),\n FileSystem: new NodeFileService(),\n SystemService: new NodeSystemService(),\n });\n }\n return new WrapperSysAbstraction(my, param);\n}\n","import { NamedWritableStream } from \"../file-service.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\n\nexport interface FileCollector {\n readonly name: string;\n content: string;\n}\n\nexport class MockFileService extends NodeFileService {\n readonly files = {} as Record<string, FileCollector>;\n\n // override abs(fname: string): string {\n // return this.join(\"/mock/\", fname);\n // }\n\n override create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!this.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const fc = {\n name: oName,\n content: \"\",\n };\n this.files[oName] = fc;\n this.files[fname] = fc;\n const decoder = new TextDecoder();\n\n return Promise.resolve({\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n fc.content = fc.content + decoder.decode(chunk);\n },\n close(): void {\n // do nothing\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,aAAa;AAIb,IAAM,kBAAN,MAA6C;AAAA,EAElD,YAAY,UAAkB,QAAQ,IAAI,GAAG;AAC3C,SAAK,UAAU,KAAK,IAAI,OAAO;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,eAAe,OAAgC;AAC7C,WAAO,GAAG,SAAS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,EAA9C;AAAA;AACL,SAAS,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,OAAO,OAA6C;AAC3D,QAAI,QAAQ;AACZ,QAAI,CAAC,KAAK,WAAW,KAAK,GAAG;AAC3B,cAAQ,KAAK,IAAI,KAAK;AAAA,IACxB;AAEA,UAAM,KAAK;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AACA,SAAK,MAAM,KAAK,IAAI;AACpB,SAAK,MAAM,KAAK,IAAI;AACpB,UAAM,UAAU,IAAI,YAAY;AAEhC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM;AAAA,MACN,QAAQ,IAAI,eAA2B;AAAA,QACrC,MAAM,OAAa;AACjB,aAAG,UAAU,GAAG,UAAU,QAAQ,OAAO,KAAK;AAAA,QAChD;AAAA,QACA,QAAc;AAAA,QAEd;AAAA,QACA,QAAc;AACZ,gBAAM,IAAI,MAAM,iBAAiB;AAAA,QACnC;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":["process"]}
|
1
|
+
{"version":3,"sources":["../../../src/node/node-file-service.ts","../../../src/node/node-sys-abstraction.ts","../../../src/node/mock-file-service.ts"],"sourcesContent":["import path from \"node:path\";\nimport fs from \"node:fs\";\nimport process from \"node:process\";\nimport { FileService, NamedWritableStream } from \"../file-service.js\";\nimport { TxtEnDecoder, TxtEnDecoderSingleton } from \"../txt-en-decoder.js\";\n\nexport class NodeFileService implements FileService {\n readonly baseDir: string;\n constructor(baseDir: string = process.cwd()) {\n this.baseDir = this.abs(baseDir);\n }\n\n // nodeImport(fname: string): string {\n // // console.log('nodeImport:'+ fname);\n // if (path.isAbsolute(fname)) {\n // return fname;\n // } else {\n // return \"./\" + path.normalize(fname);\n // }\n // }\n\n readFileString(fname: string): Promise<string> {\n return fs.promises.readFile(fname, { encoding: \"utf-8\" });\n }\n\n dirname(fname: string): string {\n return path.dirname(fname);\n }\n basename(fname: string): string {\n return path.basename(fname);\n }\n\n join(...paths: string[]): string {\n return path.join(...paths);\n }\n\n relative(from: string, to?: string): string {\n if (to === undefined) {\n to = from;\n from = process.cwd();\n }\n const ret = path.relative(from, to);\n // console.log('relative:'+ from + \" -> \" + to + \"= \" + ret);\n return ret;\n }\n\n abs(fname: string): string {\n if (path.isAbsolute(fname)) {\n return fname;\n } else {\n const cwd = process.cwd();\n return path.resolve(cwd, fname);\n }\n }\n\n isAbsolute(fname: string): boolean {\n return path.isAbsolute(fname);\n }\n\n async writeFileString(fname: string, content: string, ende: TxtEnDecoder = TxtEnDecoderSingleton()): Promise<void> {\n const o = await this.create(fname);\n const wr = o.stream.getWriter();\n await wr.write(ende.encode(content));\n await wr.close();\n }\n\n async create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!path.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const base = path.dirname(oName);\n await fs.promises.mkdir(base, { recursive: true });\n const out = fs.createWriteStream(oName);\n return {\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n out.write(chunk);\n },\n close(): void {\n out.close();\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n };\n }\n}\n","import { SysAbstraction, SystemService, VoidFunc } from \"../sys-abstraction.js\";\nimport {\n BaseSysAbstraction,\n ExitHandler,\n ExitService,\n WrapperSysAbstraction,\n WrapperSysAbstractionParams,\n} from \"../base-sys-abstraction.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\nimport { Env, envFactory } from \"../sys-env.js\";\nimport { TxtEnDecoderSingleton } from \"../txt-en-decoder.js\";\nimport process from \"node:process\";\n\nexport class NodeExitServiceImpl implements ExitService {\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"unhandledRejection\", (reason: string, p: Promise<unknown>) => {\n this.exit(19);\n });\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"uncaughtException\", (error: Error) => {\n this.exit(18);\n });\n process.on(\"close\", () => {\n this.exit(0);\n });\n process.on(\"exit\", () => {\n this.exit(0);\n });\n process.on(\"SIGQUIT\", () => {\n this.exit(3);\n });\n process.on(\"SIGINT\", () => {\n this.exit(2);\n });\n process.on(\"SIGTERM\", () => {\n this.exit(9);\n });\n }\n _exitHandlers: ExitHandler[] = [];\n injectExitHandlers(hdls: ExitHandler[]): void {\n // console.log(\"ExitService: injecting exit handlers\", hdls)\n this._exitHandlers = hdls;\n }\n invoked = false;\n readonly _handleExit = async (): Promise<void> => {\n if (this.invoked) {\n // console.error(\"ExitService: already invoked\");\n return;\n }\n this.invoked = true;\n for (const h of this._exitHandlers) {\n try {\n // console.log(`ExitService: calling handler ${h.id}`)\n const ret = h.hdl();\n // console.log(`ExitService: called handler ${h.id}`, ret)\n if (typeof (ret as Promise<void>).then === \"function\") {\n await ret;\n }\n } finally {\n // ignore\n }\n }\n };\n\n exit(code: number): void {\n // console.log(\"ExitService: exit called\", code)\n this._handleExit()\n .then(() => {\n process.exit(code);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(\"ExitService: failed to handle exit\", err);\n process.exit(code);\n });\n }\n}\n\nexport class NodeSystemService implements SystemService {\n static readonly _exitHandlers: ExitHandler[] = [];\n readonly _exitService: ExitService = new NodeExitServiceImpl();\n constructor() {\n this._exitService.injectExitHandlers(NodeSystemService._exitHandlers);\n }\n\n Env(): Env {\n return envFactory();\n }\n\n Args(): string[] {\n return process.argv;\n }\n\n OnExit(hdl: VoidFunc): VoidFunc {\n const id = crypto.randomUUID();\n NodeSystemService._exitHandlers.push({ hdl, id });\n return () => {\n const idx = NodeSystemService._exitHandlers.findIndex((h) => h.id === id);\n if (idx >= 0) {\n NodeSystemService._exitHandlers.splice(idx, 1);\n }\n };\n }\n\n Exit(code: number): void {\n this._exitService.exit(code);\n }\n}\n\nlet my: BaseSysAbstraction | undefined = undefined;\nexport function NodeSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {\n if (!my) {\n my = new BaseSysAbstraction({\n TxtEnDecoder: param?.TxtEnDecoder || TxtEnDecoderSingleton(),\n FileSystem: new NodeFileService(),\n SystemService: new NodeSystemService(),\n });\n }\n return new WrapperSysAbstraction(my, param);\n}\n","import { NamedWritableStream } from \"../file-service.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\n\nexport interface FileCollector {\n readonly name: string;\n content: string;\n}\n\nexport class MockFileService extends NodeFileService {\n readonly files = {} as Record<string, FileCollector>;\n\n // override abs(fname: string): string {\n // return this.join(\"/mock/\", fname);\n // }\n\n override create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!this.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const fc = {\n name: oName,\n content: \"\",\n };\n this.files[oName] = fc;\n this.files[fname] = fc;\n const decoder = new TextDecoder();\n\n return Promise.resolve({\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n fc.content = fc.content + decoder.decode(chunk);\n },\n close(): void {\n // do nothing\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,aAAa;AAIb,IAAM,kBAAN,MAA6C;AAAA,EAElD,YAAY,UAAkB,QAAQ,IAAI,GAAG;AAC3C,SAAK,UAAU,KAAK,IAAI,OAAO;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,eAAe,OAAgC;AAC7C,WAAO,GAAG,SAAS,SAAS,OAAO,EAAE,UAAU,QAAQ,CAAC;AAAA,EAC1D;AAAA,EAEA,QAAQ,OAAuB;AAC7B,WAAO,KAAK,QAAQ,KAAK;AAAA,EAC3B;AAAA,EACA,SAAS,OAAuB;AAC9B,WAAO,KAAK,SAAS,KAAK;AAAA,EAC5B;AAAA,EAEA,QAAQ,OAAyB;AAC/B,WAAO,KAAK,KAAK,GAAG,KAAK;AAAA,EAC3B;AAAA,EAEA,SAAS,MAAc,IAAqB;AAC1C,QAAI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AI;AACpB,UAAM,UAAU,IAAI,YAAY;AAEhC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM;AAAA,MACN,QAAQ,IAAI,eAA2B;AAAA,QACrC,MAAM,OAAa;AACjB,aAAG,UAAU,GAAG,UAAU,QAAQ,OAAO,KAAK;AAAA,QAChD;AAAA,QACA,QAAc;AAAA,QAEd;AAAA,QACA,QAAc;AACZ,gBAAM,IAAI,MAAM,iBAAiB;AAAA,QACnC;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":["process"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adviser/cement",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.8",
|
4
4
|
"description": "better try/catch/finally handling",
|
5
5
|
"main": "index.js",
|
6
6
|
"type": "module",
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"build": "pnpm run build:tsc; pnpm run build:js; pnpm run build:deno",
|
74
74
|
"build:tsc": "tsc",
|
75
75
|
"xbuild:js": "tsup",
|
76
|
-
"build:js": "tsup --out-dir dist/pkg src/index.ts src/*/index.ts --sourcemap --format cjs,esm --dts --clean --external node:fs --external node:path",
|
76
|
+
"build:js": "tsup --metafile --out-dir dist/pkg src/index.ts src/*/index.ts --sourcemap --format cjs,esm --dts --clean --external node:fs --external node:path",
|
77
77
|
"build:deno": "deno publish --dry-run --unstable-sloppy-imports --allow-dirty",
|
78
78
|
"test": "pnpm run test:js; pnpm run test:deno",
|
79
79
|
"test:deno": "deno run --quiet --allow-net --allow-write --allow-run --allow-sys --allow-ffi --allow-read --allow-env ./node_modules/vitest/vitest.mjs --run --project node",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { BaseSysAbstraction, WrapperSysAbstraction, WrapperSysAbstractionParams } from "../base-sys-abstraction.js";
|
2
2
|
import { SysAbstraction, SystemService, VoidFunc } from "../sys-abstraction.js";
|
3
3
|
import { Env, envFactory } from "../sys-env.js";
|
4
|
-
import {
|
4
|
+
import { TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
5
5
|
import { WebFileService } from "../web/web-sys-abstraction.js";
|
6
6
|
|
7
7
|
export class CFSystemService implements SystemService {
|
@@ -25,7 +25,7 @@ let my: BaseSysAbstraction | undefined = undefined;
|
|
25
25
|
export function CFSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {
|
26
26
|
if (!my) {
|
27
27
|
my = new BaseSysAbstraction({
|
28
|
-
TxtEnDecoder: param?.TxtEnDecoder ||
|
28
|
+
TxtEnDecoder: param?.TxtEnDecoder || TxtEnDecoderSingleton(),
|
29
29
|
FileSystem: new WebFileService(),
|
30
30
|
SystemService: new CFSystemService(),
|
31
31
|
});
|
package/src/cf/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as path from "node:path";
|
2
2
|
import { FileService, NamedWritableStream } from "../file-service.js";
|
3
|
-
import { TxtEnDecoder,
|
3
|
+
import { TxtEnDecoder, TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
4
4
|
|
5
5
|
const Deno = (globalThis as unknown as { Deno: unknown }).Deno as {
|
6
6
|
cwd(): string;
|
@@ -12,7 +12,7 @@ const Deno = (globalThis as unknown as { Deno: unknown }).Deno as {
|
|
12
12
|
export class DenoFileService implements FileService {
|
13
13
|
readonly baseDir: string;
|
14
14
|
readonly txtEnde: TxtEnDecoder;
|
15
|
-
constructor(baseDir: string = Deno.cwd(), txtEnde: TxtEnDecoder =
|
15
|
+
constructor(baseDir: string = Deno.cwd(), txtEnde: TxtEnDecoder = TxtEnDecoderSingleton()) {
|
16
16
|
this.baseDir = this.abs(baseDir);
|
17
17
|
this.txtEnde = txtEnde;
|
18
18
|
}
|
@@ -64,7 +64,7 @@ export class DenoFileService implements FileService {
|
|
64
64
|
return path.isAbsolute(fname);
|
65
65
|
}
|
66
66
|
|
67
|
-
async writeFileString(fname: string, content: string, ende: TxtEnDecoder =
|
67
|
+
async writeFileString(fname: string, content: string, ende: TxtEnDecoder = TxtEnDecoderSingleton()): Promise<void> {
|
68
68
|
const o = await this.create(fname);
|
69
69
|
const wr = o.stream.getWriter();
|
70
70
|
await wr.write(ende.encode(content));
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
} from "../base-sys-abstraction.js";
|
8
8
|
import { SysAbstraction, SystemService, VoidFunc } from "../sys-abstraction.js";
|
9
9
|
import { Env, envFactory } from "../sys-env.js";
|
10
|
-
import {
|
10
|
+
import { TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
11
11
|
// import * as process from "node:process";
|
12
12
|
import { DenoFileService } from "./deno-file-service.js";
|
13
13
|
|
@@ -125,7 +125,7 @@ let my: BaseSysAbstraction | undefined = undefined;
|
|
125
125
|
export function DenoSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {
|
126
126
|
if (!my) {
|
127
127
|
my = new BaseSysAbstraction({
|
128
|
-
TxtEnDecoder: param?.TxtEnDecoder ||
|
128
|
+
TxtEnDecoder: param?.TxtEnDecoder || TxtEnDecoderSingleton(),
|
129
129
|
FileSystem: new DenoFileService(),
|
130
130
|
SystemService: new DenoSystemService(),
|
131
131
|
});
|
package/src/http_header.ts
CHANGED
@@ -37,7 +37,7 @@ export class HeadersImpl extends Headers {
|
|
37
37
|
export class HttpHeader {
|
38
38
|
readonly _headers: Map<string, string[]> = new Map<string, string[]>();
|
39
39
|
|
40
|
-
static from(headers?: HeadersInit |
|
40
|
+
static from(headers?: HeadersInit | Headers | HttpHeader): HttpHeader {
|
41
41
|
if (headers instanceof HttpHeader) {
|
42
42
|
return headers.Clone();
|
43
43
|
}
|
package/src/index.ts
CHANGED
@@ -19,7 +19,11 @@ export * from "./base-sys-abstraction.js";
|
|
19
19
|
export * from "./bin2text.js";
|
20
20
|
export * from "./version.js";
|
21
21
|
export * from "./http_header.js";
|
22
|
-
export *
|
22
|
+
export * from "./path-ops.js";
|
23
|
+
export * from "./json-en-decoder.js";
|
24
|
+
|
23
25
|
// ugly
|
26
|
+
export * as utils from "./utils/index.js";
|
24
27
|
import * as utils from "./utils/index.js";
|
28
|
+
|
25
29
|
export const param = utils.param;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { exception2Result, Result } from "./result.js";
|
2
|
+
import { AsyncToEnDecoder, ToEnDecoder, TxtEnDecoder, TxtEnDecoderSingleton as TxtEnDecoderSingleton } from "./txt-en-decoder.js";
|
3
|
+
|
4
|
+
export interface JSONEnDecoder {
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
6
|
+
stringify<T>(input: Result<T> | T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
7
|
+
asyncStringify<T>(
|
8
|
+
input: Promise<Result<T> | T>,
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10
|
+
replacer?: (this: any, key: string, value: any) => any,
|
11
|
+
space?: string | number,
|
12
|
+
): Promise<string>;
|
13
|
+
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
15
|
+
uint8ify<T>(input: Result<T> | T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): Uint8Array;
|
16
|
+
asyncUint8ify<T>(
|
17
|
+
input: Promise<Result<T> | T>,
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
19
|
+
replacer?: (this: any, key: string, value: any) => any,
|
20
|
+
space?: string | number,
|
21
|
+
): Promise<Uint8Array>;
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
23
|
+
parse<T>(input: ToEnDecoder, reviver?: (this: any, key: string, value: any) => any): Result<T>;
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25
|
+
asyncParse<T>(input: AsyncToEnDecoder, reviver?: (this: any, key: string, value: any) => any): Promise<Result<T>>;
|
26
|
+
}
|
27
|
+
|
28
|
+
class JSONOps implements JSONEnDecoder {
|
29
|
+
readonly txtOps: TxtEnDecoder;
|
30
|
+
constructor(txtOps: TxtEnDecoder) {
|
31
|
+
this.txtOps = txtOps;
|
32
|
+
}
|
33
|
+
async asyncStringify<T>(
|
34
|
+
input: Promise<Result<T> | T>,
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
36
|
+
replacer?: (this: any, key: string, value: any) => any,
|
37
|
+
space?: string | number,
|
38
|
+
): Promise<string> {
|
39
|
+
const resolved = await input;
|
40
|
+
return this.stringify(resolved, replacer, space);
|
41
|
+
}
|
42
|
+
async asyncUint8ify<T>(
|
43
|
+
input: Promise<Result<T> | T>,
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
45
|
+
replacer?: (this: any, key: string, value: any) => any,
|
46
|
+
space?: string | number,
|
47
|
+
): Promise<Uint8Array> {
|
48
|
+
const resolved = await input;
|
49
|
+
return this.uint8ify(resolved, replacer, space);
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
async asyncParse<T>(input: AsyncToEnDecoder, reviver?: (this: any, key: string, value: any) => any): Promise<Result<T>> {
|
54
|
+
return this.parse(await this.txtOps.asyncDecode(input), reviver);
|
55
|
+
}
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
57
|
+
stringify<T>(input: Result<T> | T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string {
|
58
|
+
return JSON.stringify(Result.Is(input) ? input.unwrap() : input, replacer, space);
|
59
|
+
}
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
61
|
+
uint8ify<T>(input: Result<T> | T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): Uint8Array {
|
62
|
+
return this.txtOps.encode(this.stringify(input, replacer, space));
|
63
|
+
}
|
64
|
+
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
66
|
+
parse<T>(input: ToEnDecoder, reviver?: (this: any, key: string, value: any) => any): Result<T> {
|
67
|
+
return exception2Result(() => JSON.parse(this.txtOps.decode(input), reviver) as T) as Result<T>;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
let jsonEnDecoder: JSONEnDecoder;
|
72
|
+
export function JSONEnDecoderSingleton(txtEnde?: TxtEnDecoder): JSONEnDecoder {
|
73
|
+
let needNew = false;
|
74
|
+
if (txtEnde && txtEnde !== TxtEnDecoderSingleton()) {
|
75
|
+
needNew = !!txtEnde;
|
76
|
+
txtEnde = txtEnde ?? TxtEnDecoderSingleton();
|
77
|
+
}
|
78
|
+
if (needNew && txtEnde) {
|
79
|
+
return new JSONOps(txtEnde);
|
80
|
+
}
|
81
|
+
jsonEnDecoder = jsonEnDecoder ?? new JSONOps(TxtEnDecoderSingleton());
|
82
|
+
return jsonEnDecoder;
|
83
|
+
}
|
package/src/jsr.json
CHANGED
package/src/logger-impl.ts
CHANGED
@@ -26,7 +26,7 @@ import { CoerceURI, URI } from "./uri.js";
|
|
26
26
|
import { runtimeFn } from "./runtime.js";
|
27
27
|
import { ConsoleWriterStream } from "./utils/console-write-stream.js";
|
28
28
|
import { LogWriterStream } from "./log-writer-impl.js";
|
29
|
-
import { TxtEnDecoder,
|
29
|
+
import { TxtEnDecoder, TxtEnDecoderSingleton } from "./txt-en-decoder.js";
|
30
30
|
import { LevelHandlerSingleton } from "./log-level-impl.js";
|
31
31
|
|
32
32
|
function getLen(value: unknown, lvs: LogValueState): LogValue {
|
@@ -126,7 +126,7 @@ export class LoggerImpl implements Logger {
|
|
126
126
|
this._sys = params.sys;
|
127
127
|
}
|
128
128
|
if (!params.txtEnDe) {
|
129
|
-
this._txtEnDe =
|
129
|
+
this._txtEnDe = TxtEnDecoderSingleton();
|
130
130
|
} else {
|
131
131
|
this._txtEnDe = params.txtEnDe;
|
132
132
|
}
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
3
3
|
import process from "node:process";
|
4
4
|
import { FileService, NamedWritableStream } from "../file-service.js";
|
5
|
-
import { TxtEnDecoder,
|
5
|
+
import { TxtEnDecoder, TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
6
6
|
|
7
7
|
export class NodeFileService implements FileService {
|
8
8
|
readonly baseDir: string;
|
@@ -57,7 +57,7 @@ export class NodeFileService implements FileService {
|
|
57
57
|
return path.isAbsolute(fname);
|
58
58
|
}
|
59
59
|
|
60
|
-
async writeFileString(fname: string, content: string, ende: TxtEnDecoder =
|
60
|
+
async writeFileString(fname: string, content: string, ende: TxtEnDecoder = TxtEnDecoderSingleton()): Promise<void> {
|
61
61
|
const o = await this.create(fname);
|
62
62
|
const wr = o.stream.getWriter();
|
63
63
|
await wr.write(ende.encode(content));
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
} from "../base-sys-abstraction.js";
|
9
9
|
import { NodeFileService } from "./node-file-service.js";
|
10
10
|
import { Env, envFactory } from "../sys-env.js";
|
11
|
-
import {
|
11
|
+
import { TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
12
12
|
import process from "node:process";
|
13
13
|
|
14
14
|
export class NodeExitServiceImpl implements ExitService {
|
@@ -112,7 +112,7 @@ let my: BaseSysAbstraction | undefined = undefined;
|
|
112
112
|
export function NodeSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {
|
113
113
|
if (!my) {
|
114
114
|
my = new BaseSysAbstraction({
|
115
|
-
TxtEnDecoder: param?.TxtEnDecoder ||
|
115
|
+
TxtEnDecoder: param?.TxtEnDecoder || TxtEnDecoderSingleton(),
|
116
116
|
FileSystem: new NodeFileService(),
|
117
117
|
SystemService: new NodeSystemService(),
|
118
118
|
});
|
package/src/path-ops.ts
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
export interface PathOps {
|
2
|
+
join(...args: string[]): string;
|
3
|
+
dirname(path: string): string;
|
4
|
+
basename(path: string): string;
|
5
|
+
}
|
6
|
+
|
7
|
+
class pathOpsImpl implements PathOps {
|
8
|
+
join(...paths: string[]): string {
|
9
|
+
return paths.map((i) => i.replace(/\/+$/, "")).join("/");
|
10
|
+
}
|
11
|
+
#parts(path: string): { dirname: string; basename: string } {
|
12
|
+
const splitted = path.split("/");
|
13
|
+
const last = splitted.pop();
|
14
|
+
if (splitted.length && last === "") {
|
15
|
+
return this.#parts(this.join(...splitted));
|
16
|
+
}
|
17
|
+
return {
|
18
|
+
dirname: this.join(...splitted),
|
19
|
+
basename: last ?? "",
|
20
|
+
};
|
21
|
+
}
|
22
|
+
dirname(path: string): string {
|
23
|
+
return this.#parts(path).dirname;
|
24
|
+
}
|
25
|
+
basename(path: string): string {
|
26
|
+
return this.#parts(path).basename;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
export const pathOps: PathOps = new pathOpsImpl();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FanoutWriteStream } from "../utils/fanout-write-stream.js";
|
2
2
|
import { Future } from "../future.js";
|
3
|
-
import { TxtEnDecoder,
|
3
|
+
import { TxtEnDecoder, TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
4
4
|
|
5
5
|
export class LogWriteStream implements WritableStreamDefaultWriter<Uint8Array> {
|
6
6
|
private readonly _bufferArr: Uint8Array[];
|
@@ -42,7 +42,7 @@ export class LogCollector implements WritableStream<Uint8Array> {
|
|
42
42
|
|
43
43
|
constructor(pass?: WritableStreamDefaultWriter<Uint8Array>, txtEnDe?: TxtEnDecoder) {
|
44
44
|
this._pass = pass;
|
45
|
-
this._txtEnDe = txtEnDe ||
|
45
|
+
this._txtEnDe = txtEnDe || TxtEnDecoderSingleton();
|
46
46
|
}
|
47
47
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
package/src/txt-en-decoder.ts
CHANGED
@@ -1,21 +1,50 @@
|
|
1
|
+
import { Result } from "./result.js";
|
2
|
+
import { coerceIntoUint8, ToUInt8 } from "./utils/coerce-uint8.js";
|
3
|
+
|
4
|
+
export type ToEnDecoder = ToUInt8 | string | Result<string>;
|
5
|
+
export type AsyncToEnDecoder = ToEnDecoder | Blob | Promise<ToEnDecoder | Blob>;
|
6
|
+
|
1
7
|
export interface TxtEnDecoder {
|
2
|
-
encode(
|
3
|
-
decode(
|
8
|
+
encode(input: string): Uint8Array;
|
9
|
+
decode(input: ToEnDecoder): string;
|
10
|
+
asyncDecode(input: AsyncToEnDecoder): Promise<string>;
|
4
11
|
}
|
5
12
|
|
6
|
-
|
7
|
-
|
13
|
+
class TxtOps implements TxtEnDecoder {
|
14
|
+
readonly encoder = new TextEncoder();
|
15
|
+
readonly decoder = new TextDecoder();
|
8
16
|
|
9
|
-
export class Utf8EnDecoder implements TxtEnDecoder {
|
10
17
|
encode(str: string): Uint8Array {
|
11
|
-
return encoder.encode(str);
|
18
|
+
return this.encoder.encode(str);
|
12
19
|
}
|
13
|
-
decode(data:
|
14
|
-
|
20
|
+
decode(data: ToEnDecoder): string {
|
21
|
+
if (Result.Is(data)) {
|
22
|
+
if (data.isErr()) {
|
23
|
+
throw data.Err();
|
24
|
+
}
|
25
|
+
// only for string let do coerceInto the work
|
26
|
+
const unwrapped = data.unwrap();
|
27
|
+
if (typeof unwrapped === "string") {
|
28
|
+
return this.decode(unwrapped);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
if (typeof data === "string") {
|
32
|
+
return data;
|
33
|
+
}
|
34
|
+
return this.decoder.decode(coerceIntoUint8(data as ToUInt8).Ok());
|
35
|
+
}
|
36
|
+
|
37
|
+
async asyncDecode(data: AsyncToEnDecoder): Promise<string> {
|
38
|
+
let resolved = await data;
|
39
|
+
if (resolved instanceof Blob) {
|
40
|
+
resolved = await resolved.arrayBuffer();
|
41
|
+
}
|
42
|
+
return this.decode(resolved);
|
15
43
|
}
|
16
44
|
}
|
17
45
|
|
18
|
-
|
19
|
-
export function
|
20
|
-
|
46
|
+
let txtEnDecoder: TxtEnDecoder;
|
47
|
+
export function TxtEnDecoderSingleton(): TxtEnDecoder {
|
48
|
+
txtEnDecoder = txtEnDecoder ?? new TxtOps();
|
49
|
+
return txtEnDecoder;
|
21
50
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { Result } from "../result.js";
|
2
|
+
|
3
|
+
// Tested in txt-en-decoder.test.ts
|
4
|
+
|
5
|
+
interface GlobalBuffer {
|
6
|
+
Buffer?: {
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
8
|
+
isBuffer: (obj: any) => obj is {
|
9
|
+
buffer: ArrayBufferLike;
|
10
|
+
byteOffset: number;
|
11
|
+
byteLength: number;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
}
|
15
|
+
const globalBuffer = globalThis as GlobalBuffer;
|
16
|
+
|
17
|
+
export type ToUInt8Plain = Uint8Array | ArrayBuffer | ArrayBufferView;
|
18
|
+
export type ToUInt8Async = ToUInt8Plain | Blob;
|
19
|
+
export type ToUInt8 = ToUInt8Plain | Result<ToUInt8Plain>;
|
20
|
+
export type AsyncToUInt8 = ToUInt8Async | Result<ToUInt8Async> | Promise<ToUInt8Async> | Promise<Result<ToUInt8Async>>;
|
21
|
+
|
22
|
+
export function coerceIntoUint8(raw: ToUInt8): Result<Uint8Array> {
|
23
|
+
if (raw instanceof ArrayBuffer) {
|
24
|
+
return Result.Ok(new Uint8Array(raw));
|
25
|
+
}
|
26
|
+
if (ArrayBuffer.isView(raw)) {
|
27
|
+
return Result.Ok(new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength));
|
28
|
+
}
|
29
|
+
if (raw instanceof Blob) {
|
30
|
+
return Result.Err("Blob not supported");
|
31
|
+
}
|
32
|
+
if (globalBuffer.Buffer && globalBuffer.Buffer.isBuffer(raw)) {
|
33
|
+
return Result.Ok(new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength));
|
34
|
+
}
|
35
|
+
if (raw instanceof Uint8Array) {
|
36
|
+
return Result.Ok(raw);
|
37
|
+
}
|
38
|
+
if (Result.Is(raw)) {
|
39
|
+
if (raw.isErr()) {
|
40
|
+
return Result.Err(raw);
|
41
|
+
}
|
42
|
+
return coerceIntoUint8(raw.unwrap());
|
43
|
+
}
|
44
|
+
return Result.Err("Not a Uint8Array");
|
45
|
+
}
|
46
|
+
|
47
|
+
export async function asyncCoerceIntoUint8(raw: AsyncToUInt8): Promise<Result<Uint8Array>> {
|
48
|
+
let resolved = await raw;
|
49
|
+
if (resolved instanceof Blob) {
|
50
|
+
resolved = await resolved.arrayBuffer();
|
51
|
+
}
|
52
|
+
return coerceIntoUint8(resolved as ToUInt8);
|
53
|
+
}
|
package/src/utils/index.ts
CHANGED
@@ -6,3 +6,6 @@ export * from "./console-write-stream.js";
|
|
6
6
|
export * from "./fanout-write-stream.js";
|
7
7
|
export * from "./get-params-result.js";
|
8
8
|
export * from "./stripper.js";
|
9
|
+
export * from "./sorted-object.js";
|
10
|
+
export * from "./uint8array-equal.js";
|
11
|
+
export * from "./coerce-uint8.js";
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export function toSortedObjectArray<T>(set?: T): Record<string, unknown>[] {
|
2
|
+
if (!set) return [];
|
3
|
+
return toSortedArray(set).map(([k, v]) => ({ [k]: v }));
|
4
|
+
}
|
5
|
+
|
6
|
+
export function toSortedArray<T>(set?: T): [string, unknown][] {
|
7
|
+
if (!set) return [];
|
8
|
+
return Object.entries(set).sort(([a], [b]) => a.localeCompare(b));
|
9
|
+
}
|
10
|
+
|
11
|
+
export function toSortedObject<S, T extends NonNullable<S>>(set?: T): T {
|
12
|
+
if (!set) return set as T;
|
13
|
+
return Object.fromEntries(toSortedArray(set)) as T;
|
14
|
+
// return toSortedArray(set).reduce((acc, cur) => {
|
15
|
+
// acc[cur[0]] = cur[1];
|
16
|
+
// return acc
|
17
|
+
// }, {} as Record<string, unknown>) as T;
|
18
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { TxtEnDecoder,
|
1
|
+
import { TxtEnDecoder, TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
2
2
|
|
3
|
-
export function string2stream(str: string, ende: TxtEnDecoder =
|
3
|
+
export function string2stream(str: string, ende: TxtEnDecoder = TxtEnDecoderSingleton()): ReadableStream<Uint8Array> {
|
4
4
|
return uint8array2stream(ende.encode(str));
|
5
5
|
}
|
6
6
|
|
@@ -2,7 +2,7 @@ import { BaseSysAbstraction, WrapperSysAbstraction, WrapperSysAbstractionParams
|
|
2
2
|
import { FileService, NamedWritableStream } from "../file-service.js";
|
3
3
|
import { SysAbstraction, SystemService, VoidFunc } from "../sys-abstraction.js";
|
4
4
|
import { Env, envFactory } from "../sys-env.js";
|
5
|
-
import {
|
5
|
+
import { TxtEnDecoderSingleton } from "../txt-en-decoder.js";
|
6
6
|
|
7
7
|
export class WebFileService implements FileService {
|
8
8
|
get baseDir(): string {
|
@@ -71,7 +71,7 @@ let my: BaseSysAbstraction | undefined = undefined;
|
|
71
71
|
export function WebSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {
|
72
72
|
if (!my) {
|
73
73
|
my = new BaseSysAbstraction({
|
74
|
-
TxtEnDecoder: param?.TxtEnDecoder ||
|
74
|
+
TxtEnDecoder: param?.TxtEnDecoder || TxtEnDecoderSingleton(),
|
75
75
|
FileSystem: new WebFileService(),
|
76
76
|
SystemService: new WebSystemService(),
|
77
77
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { K as KeysParam, R as Result } from './get-params-result-
|
1
|
+
import { K as KeysParam, R as Result } from './get-params-result-C2cbgB78.cjs';
|
2
2
|
|
3
3
|
interface NamedWritableStream {
|
4
4
|
readonly name: string;
|
@@ -106,4 +106,4 @@ interface SysAbstraction {
|
|
106
106
|
FileSystem(): FileService;
|
107
107
|
}
|
108
108
|
|
109
|
-
export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type
|
109
|
+
export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type SysAbstraction as S, Time as T, type VoidFunc as V, TimeMode as a, type SystemService as b, type EnvActions as c, EnvImpl as d, type EnvFactoryOpts as e, String2TimeMode as f, type EnvTuple as g, type EnvMap as h, type EnvFactoryFn as i, envFactory as j, TimeUnits as k, registerEnvAction as r };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { K as KeysParam, R as Result } from './get-params-result-
|
1
|
+
import { K as KeysParam, R as Result } from './get-params-result-C2cbgB78.js';
|
2
2
|
|
3
3
|
interface NamedWritableStream {
|
4
4
|
readonly name: string;
|
@@ -106,4 +106,4 @@ interface SysAbstraction {
|
|
106
106
|
FileSystem(): FileService;
|
107
107
|
}
|
108
108
|
|
109
|
-
export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type
|
109
|
+
export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type SysAbstraction as S, Time as T, type VoidFunc as V, TimeMode as a, type SystemService as b, type EnvActions as c, EnvImpl as d, type EnvFactoryOpts as e, String2TimeMode as f, type EnvTuple as g, type EnvMap as h, type EnvFactoryFn as i, envFactory as j, TimeUnits as k, registerEnvAction as r };
|