@adviser/cement 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- package/base_sys_abstraction-BCdXJHNa.d.ts +21 -0
- package/base_sys_abstraction-BYZvxqsW.d.cts +21 -0
- package/chunk-J2IM7FHM.js +65 -0
- package/chunk-J2IM7FHM.js.map +1 -0
- package/chunk-MWAFFTM4.js +82 -0
- package/chunk-MWAFFTM4.js.map +1 -0
- package/chunk-PZTL4UNG.js +233 -0
- package/chunk-PZTL4UNG.js.map +1 -0
- package/index.cjs +987 -0
- package/index.cjs.map +1 -0
- package/index.d.cts +196 -0
- package/index.d.ts +196 -11
- package/index.js +611 -26
- package/index.js.map +1 -1
- package/node/index.cjs +436 -0
- package/node/index.cjs.map +1 -0
- package/node/index.d.cts +47 -0
- package/node/index.d.ts +47 -4
- package/node/index.js +215 -17
- package/node/index.js.map +1 -1
- package/package.json +34 -8
- package/sys_abstraction-CjljYIkv.d.cts +65 -0
- package/sys_abstraction-CjljYIkv.d.ts +65 -0
- package/utils/index.cjs +270 -0
- package/utils/index.cjs.map +1 -0
- package/utils/index.d.cts +33 -0
- package/utils/index.d.ts +33 -6
- package/utils/index.js +232 -20
- package/utils/index.js.map +1 -1
- package/web/index.cjs +286 -0
- package/web/index.cjs.map +1 -0
- package/web/index.d.cts +6 -0
- package/web/index.d.ts +6 -2
- package/web/index.js +7 -16
- package/web/index.js.map +1 -1
- package/base_sys_abstraction.d.ts +0 -79
- package/base_sys_abstraction.d.ts.map +0 -1
- package/base_sys_abstraction.js +0 -186
- package/base_sys_abstraction.js.map +0 -1
- package/base_sys_abstraction.test.d.ts +0 -2
- package/base_sys_abstraction.test.d.ts.map +0 -1
- package/base_sys_abstraction.test.js +0 -77
- package/base_sys_abstraction.test.js.map +0 -1
- package/file_service.d.ts +0 -18
- package/file_service.d.ts.map +0 -1
- package/file_service.js +0 -3
- package/file_service.js.map +0 -1
- package/future.d.ts +0 -8
- package/future.d.ts.map +0 -1
- package/future.js +0 -42
- package/future.js.map +0 -1
- package/future.test.d.ts +0 -2
- package/future.test.d.ts.map +0 -1
- package/future.test.js +0 -30
- package/future.test.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/logger.d.ts +0 -36
- package/logger.d.ts.map +0 -1
- package/logger.js +0 -11
- package/logger.js.map +0 -1
- package/logger.test.d.ts +0 -2
- package/logger.test.d.ts.map +0 -1
- package/logger.test.js +0 -372
- package/logger.test.js.map +0 -1
- package/logger_impl.d.ts +0 -64
- package/logger_impl.d.ts.map +0 -1
- package/logger_impl.js +0 -331
- package/logger_impl.js.map +0 -1
- package/node/index.d.ts.map +0 -1
- package/node/mock_file_service.d.ts +0 -11
- package/node/mock_file_service.d.ts.map +0 -1
- package/node/mock_file_service.js +0 -38
- package/node/mock_file_service.js.map +0 -1
- package/node/mock_file_service.test.d.ts +0 -2
- package/node/mock_file_service.test.d.ts.map +0 -1
- package/node/mock_file_service.test.js +0 -19
- package/node/mock_file_service.test.js.map +0 -1
- package/node/node_file_service.d.ts +0 -16
- package/node/node_file_service.d.ts.map +0 -1
- package/node/node_file_service.js +0 -84
- package/node/node_file_service.js.map +0 -1
- package/node/node_sys_abstraction.d.ts +0 -21
- package/node/node_sys_abstraction.d.ts.map +0 -1
- package/node/node_sys_abstraction.js +0 -101
- package/node/node_sys_abstraction.js.map +0 -1
- package/node/node_sys_abstraction.test.d.ts +0 -2
- package/node/node_sys_abstraction.test.d.ts.map +0 -1
- package/node/node_sys_abstraction.test.js +0 -57
- package/node/node_sys_abstraction.test.js.map +0 -1
- package/option.d.ts +0 -25
- package/option.d.ts.map +0 -1
- package/option.js +0 -53
- package/option.js.map +0 -1
- package/result.d.ts +0 -31
- package/result.d.ts.map +0 -1
- package/result.js +0 -69
- package/result.js.map +0 -1
- package/result.test.d.ts +0 -2
- package/result.test.d.ts.map +0 -1
- package/result.test.js +0 -39
- package/result.test.js.map +0 -1
- package/sys_abstraction.d.ts +0 -35
- package/sys_abstraction.d.ts.map +0 -1
- package/sys_abstraction.js +0 -35
- package/sys_abstraction.js.map +0 -1
- package/test/log_collector.d.ts +0 -22
- package/test/log_collector.d.ts.map +0 -1
- package/test/log_collector.js +0 -66
- package/test/log_collector.js.map +0 -1
- package/test/mock_logger.d.ts +0 -13
- package/test/mock_logger.d.ts.map +0 -1
- package/test/mock_logger.js +0 -30
- package/test/mock_logger.js.map +0 -1
- package/test/mock_logger.test.d.ts +0 -2
- package/test/mock_logger.test.d.ts.map +0 -1
- package/test/mock_logger.test.js +0 -49
- package/test/mock_logger.test.js.map +0 -1
- package/test/test-exit-handler.d.ts +0 -1
- package/test/test-exit-handler.d.ts.map +0 -1
- package/test/test-exit-handler.js +0 -76
- package/test/test-exit-handler.js.map +0 -1
- package/time.d.ts +0 -13
- package/time.d.ts.map +0 -1
- package/time.js +0 -18
- package/time.js.map +0 -1
- package/utils/index.d.ts.map +0 -1
- package/utils/rebuffer.d.ts +0 -3
- package/utils/rebuffer.d.ts.map +0 -1
- package/utils/rebuffer.js +0 -65
- package/utils/rebuffer.js.map +0 -1
- package/utils/rebuffer.test.d.ts +0 -2
- package/utils/rebuffer.test.d.ts.map +0 -1
- package/utils/rebuffer.test.js +0 -79
- package/utils/rebuffer.test.js.map +0 -1
- package/utils/stream2string.d.ts +0 -3
- package/utils/stream2string.d.ts.map +0 -1
- package/utils/stream2string.js +0 -53
- package/utils/stream2string.js.map +0 -1
- package/utils/stream2string.test.d.ts +0 -2
- package/utils/stream2string.test.d.ts.map +0 -1
- package/utils/stream2string.test.js +0 -31
- package/utils/stream2string.test.js.map +0 -1
- package/utils/stream_map.d.ts +0 -9
- package/utils/stream_map.d.ts.map +0 -1
- package/utils/stream_map.js +0 -67
- package/utils/stream_map.js.map +0 -1
- package/utils/stream_map.test.d.ts +0 -2
- package/utils/stream_map.test.d.ts.map +0 -1
- package/utils/stream_map.test.js +0 -89
- package/utils/stream_map.test.js.map +0 -1
- package/utils/stream_test_helper.d.ts +0 -15
- package/utils/stream_test_helper.d.ts.map +0 -1
- package/utils/stream_test_helper.js +0 -42
- package/utils/stream_test_helper.js.map +0 -1
- package/utils/string2stream.d.ts +0 -3
- package/utils/string2stream.d.ts.map +0 -1
- package/utils/string2stream.js +0 -18
- package/utils/string2stream.js.map +0 -1
- package/utils/string2stream.test.d.ts +0 -2
- package/utils/string2stream.test.d.ts.map +0 -1
- package/utils/string2stream.test.js +0 -9
- package/utils/string2stream.test.js.map +0 -1
- package/web/index.d.ts.map +0 -1
- package/web/web_sys_abstraction.d.ts +0 -4
- package/web/web_sys_abstraction.d.ts.map +0 -1
- package/web/web_sys_abstraction.js +0 -65
- package/web/web_sys_abstraction.js.map +0 -1
package/utils/stream_map.test.js
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const stream_test_helper_1 = require("./stream_test_helper");
|
4
|
-
const stream_map_1 = require("./stream_map");
|
5
|
-
it("array2stream", async () => {
|
6
|
-
const as = (0, stream_map_1.array2stream)([1, 2, 3]);
|
7
|
-
let i = 0;
|
8
|
-
const reader = as.getReader();
|
9
|
-
while (true) {
|
10
|
-
const { done, value } = await reader.read();
|
11
|
-
if (done) {
|
12
|
-
break;
|
13
|
-
}
|
14
|
-
expect(1 + i++).toBe(value);
|
15
|
-
}
|
16
|
-
});
|
17
|
-
it("stream2array", async () => {
|
18
|
-
const as = await (0, stream_map_1.stream2array)(new ReadableStream({
|
19
|
-
start(controller) {
|
20
|
-
controller.enqueue(1);
|
21
|
-
controller.enqueue(2);
|
22
|
-
controller.enqueue(3);
|
23
|
-
controller.close();
|
24
|
-
},
|
25
|
-
}));
|
26
|
-
expect(as).toEqual([1, 2, 3]);
|
27
|
-
});
|
28
|
-
it("devnull", async () => {
|
29
|
-
const cnt = await (0, stream_map_1.devnull)((0, stream_map_1.streamMap)((0, stream_map_1.array2stream)([1, 2, 3]), {
|
30
|
-
Map: (i, idx) => (idx + 1) * 10 + i + 1,
|
31
|
-
}));
|
32
|
-
expect(cnt).toBe(3);
|
33
|
-
});
|
34
|
-
it("stream_map", async () => {
|
35
|
-
const closeFn = jest.fn();
|
36
|
-
const s = await (0, stream_map_1.stream2array)((0, stream_map_1.streamMap)((0, stream_map_1.array2stream)([1, 2, 3]), {
|
37
|
-
Map: (i, idx) => (idx + 1) * 10 + i + 1,
|
38
|
-
Close: closeFn,
|
39
|
-
}));
|
40
|
-
expect(closeFn).toBeCalledTimes(1);
|
41
|
-
expect(s).toEqual([12, 23, 34]);
|
42
|
-
});
|
43
|
-
it("stream_map async", async () => {
|
44
|
-
const closeFn = jest.fn();
|
45
|
-
const s = await (0, stream_map_1.stream2array)((0, stream_map_1.streamMap)((0, stream_map_1.array2stream)([1, 2, 3]), {
|
46
|
-
Map: (i, idx) => Promise.resolve((idx + 1) * 10 + i + 1),
|
47
|
-
Close: closeFn,
|
48
|
-
}));
|
49
|
-
expect(closeFn).toBeCalledTimes(1);
|
50
|
-
expect(s).toEqual([12, 23, 34]);
|
51
|
-
});
|
52
|
-
it("map types", async () => {
|
53
|
-
const oo = await (0, stream_map_1.stream2array)((0, stream_map_1.streamMap)((0, stream_map_1.array2stream)([1, 2, 3]), {
|
54
|
-
Map: (chunk, idx) => {
|
55
|
-
return "[" + chunk + "/" + idx + "]";
|
56
|
-
},
|
57
|
-
}));
|
58
|
-
expect(oo).toEqual(["[1/0]", "[2/1]", "[3/2]"]);
|
59
|
-
});
|
60
|
-
describe("test streaming through streamMap", () => {
|
61
|
-
const state = {
|
62
|
-
sendChunks: 10000,
|
63
|
-
sendChunkSize: 3,
|
64
|
-
fillCalls: 0,
|
65
|
-
CollectorFn: jest.fn(),
|
66
|
-
};
|
67
|
-
it("does streamMap respect backpressure", async () => {
|
68
|
-
const ts = new TransformStream(undefined, undefined, { highWaterMark: 2 });
|
69
|
-
const reb = (0, stream_map_1.streamMap)(ts.readable, {
|
70
|
-
Map: (chunk) => {
|
71
|
-
for (let i = 0; i < chunk.length; i++) {
|
72
|
-
chunk[i] = (chunk[i] + 1) % 256;
|
73
|
-
}
|
74
|
-
return chunk;
|
75
|
-
},
|
76
|
-
});
|
77
|
-
await Promise.all([(0, stream_test_helper_1.receiveFromStream)(reb, state), (0, stream_test_helper_1.sendToStream)(ts.writable, state)]);
|
78
|
-
expect(state.CollectorFn).toBeCalledTimes(state.sendChunks + 1);
|
79
|
-
expect(state.CollectorFn.mock.calls.slice(-1)[0][0].done).toBeTruthy();
|
80
|
-
let lastfillCalls = 0;
|
81
|
-
for (let i = 0; i < state.CollectorFn.mock.calls.length - 1; i++) {
|
82
|
-
const { fillCalls, reBufferCalls, value } = state.CollectorFn.mock.calls[i][0];
|
83
|
-
expect(value === null || value === void 0 ? void 0 : value[0]).toBe((i + 1) % 256);
|
84
|
-
expect(fillCalls * state.sendChunkSize).toBeGreaterThanOrEqual((fillCalls - lastfillCalls) * state.sendChunkSize + reBufferCalls * state.sendChunkSize);
|
85
|
-
lastfillCalls = fillCalls;
|
86
|
-
}
|
87
|
-
});
|
88
|
-
});
|
89
|
-
//# sourceMappingURL=stream_map.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"stream_map.test.js","sourceRoot":"","sources":["../../src/utils/stream_map.test.ts"],"names":[],"mappings":";;AAAA,6DAA2F;AAC3F,6CAA8E;AAE9E,EAAE,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;IAC5B,MAAM,EAAE,GAAG,IAAA,yBAAY,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,MAAM,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;IAC9B,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC5C,IAAI,IAAI,EAAE,CAAC;YACT,MAAM;QACR,CAAC;QACD,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAA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AAU,CAAC;QACzE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;QACvE,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAW,CAAC,EAAE,EAAE,CAAC;YAC1E,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/E,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;YACvC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,sBAAsB,CAC5D,CAAC,SAAS,GAAG,aAAa,CAAC,GAAG,KAAK,CAAC,aAAa,GAAG,aAAa,GAAG,KAAK,CAAC,aAAa,CACxF,CAAC;YACF,aAAa,GAAG,SAAS,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/// <reference types="jest" />
|
2
|
-
export interface streamingTestState {
|
3
|
-
readonly sendChunks: number;
|
4
|
-
readonly sendChunkSize: number;
|
5
|
-
fillCalls: number;
|
6
|
-
CollectorFn: jest.Mock<void, [{
|
7
|
-
done: boolean;
|
8
|
-
value: Uint8Array | undefined;
|
9
|
-
fillCalls: number;
|
10
|
-
reBufferCalls: number;
|
11
|
-
}]>;
|
12
|
-
}
|
13
|
-
export declare function receiveFromStream(reb: ReadableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
14
|
-
export declare function sendToStream(reb: WritableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
15
|
-
//# sourceMappingURL=stream_test_helper.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"stream_test_helper.d.ts","sourceRoot":"","sources":["../../src/utils/stream_test_helper.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC5H;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,kBAAkB,iBAiBjG;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,cAAc,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,kBAAkB,iBAiB5F"}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.sendToStream = exports.receiveFromStream = void 0;
|
4
|
-
async function receiveFromStream(reb, state) {
|
5
|
-
return new Promise((resolve) => {
|
6
|
-
let reBufferCalls = 0;
|
7
|
-
const reader = reb.getReader();
|
8
|
-
function pump() {
|
9
|
-
reader.read().then(({ done, value }) => {
|
10
|
-
state.CollectorFn({ done, value, fillCalls: state.fillCalls, reBufferCalls });
|
11
|
-
reBufferCalls++;
|
12
|
-
if (done) {
|
13
|
-
resolve();
|
14
|
-
return;
|
15
|
-
}
|
16
|
-
pump();
|
17
|
-
});
|
18
|
-
}
|
19
|
-
pump();
|
20
|
-
});
|
21
|
-
}
|
22
|
-
exports.receiveFromStream = receiveFromStream;
|
23
|
-
async function sendToStream(reb, state) {
|
24
|
-
return new Promise((resolve) => {
|
25
|
-
const writer = reb.getWriter();
|
26
|
-
function pump(i) {
|
27
|
-
if (i >= state.sendChunks) {
|
28
|
-
writer.close();
|
29
|
-
resolve();
|
30
|
-
return;
|
31
|
-
}
|
32
|
-
writer.ready.then(() => {
|
33
|
-
state.fillCalls++;
|
34
|
-
writer.write(new Uint8Array(Array(state.sendChunkSize).fill(i)));
|
35
|
-
pump(i + 1);
|
36
|
-
});
|
37
|
-
}
|
38
|
-
pump(0);
|
39
|
-
});
|
40
|
-
}
|
41
|
-
exports.sendToStream = sendToStream;
|
42
|
-
//# sourceMappingURL=stream_test_helper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"stream_test_helper.js","sourceRoot":"","sources":["../../src/utils/stream_test_helper.ts"],"names":[],"mappings":";;;AAOO,KAAK,UAAU,iBAAiB,CAAC,GAA+B,EAAE,KAAyB;IAChG,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC/B,SAAS,IAAI;YACX,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACrC,KAAK,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;gBAC9E,aAAa,EAAE,CAAC;gBAChB,IAAI,IAAI,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,OAAO;gBACT,CAAC;gBACD,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,8CAiBC;AAEM,KAAK,UAAU,YAAY,CAAC,GAA+B,EAAE,KAAyB;IAC3F,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC/B,SAAS,IAAI,CAAC,CAAS;YACrB,IAAI,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBAC1B,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrB,KAAK,CAAC,SAAS,EAAE,CAAC;gBAClB,MAAM,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,oCAiBC"}
|
package/utils/string2stream.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string2stream.d.ts","sourceRoot":"","sources":["../../src/utils/string2stream.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAGrE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAO7E"}
|
package/utils/string2stream.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.uint8array2stream = exports.string2stream = void 0;
|
4
|
-
function string2stream(str) {
|
5
|
-
const encoder = new TextEncoder();
|
6
|
-
return uint8array2stream(encoder.encode(str));
|
7
|
-
}
|
8
|
-
exports.string2stream = string2stream;
|
9
|
-
function uint8array2stream(str) {
|
10
|
-
return new ReadableStream({
|
11
|
-
start(controller) {
|
12
|
-
controller.enqueue(str);
|
13
|
-
controller.close();
|
14
|
-
},
|
15
|
-
});
|
16
|
-
}
|
17
|
-
exports.uint8array2stream = uint8array2stream;
|
18
|
-
//# sourceMappingURL=string2stream.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string2stream.js","sourceRoot":"","sources":["../../src/utils/string2stream.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAC,GAAW;IACvC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,OAAO,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC;AAHD,sCAGC;AAED,SAAgB,iBAAiB,CAAC,GAAe;IAC/C,OAAO,IAAI,cAAc,CAAa;QACpC,KAAK,CAAC,UAAU;YACd,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACxB,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAPD,8CAOC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string2stream.test.d.ts","sourceRoot":"","sources":["../../src/utils/string2stream.test.ts"],"names":[],"mappings":""}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const stream2string_1 = require("./stream2string");
|
4
|
-
const string2stream_1 = require("./string2stream");
|
5
|
-
it("string2stream", async () => {
|
6
|
-
const inStr = (0, string2stream_1.string2stream)("Hello World!");
|
7
|
-
expect(await (0, stream2string_1.stream2string)(inStr)).toBe("Hello World!");
|
8
|
-
});
|
9
|
-
//# sourceMappingURL=string2stream.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string2stream.test.js","sourceRoot":"","sources":["../../src/utils/string2stream.test.ts"],"names":[],"mappings":";;AAAA,mDAAgD;AAChD,mDAAgD;AAEhD,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;IAC7B,MAAM,KAAK,GAAG,IAAA,6BAAa,EAAC,cAAc,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,IAAA,6BAAa,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC"}
|
package/web/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { WrapperSysAbstractionParams } from "../base_sys_abstraction";
|
2
|
-
import { SysAbstraction } from "../sys_abstraction";
|
3
|
-
export declare function WebSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction;
|
4
|
-
//# sourceMappingURL=web_sys_abstraction.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"web_sys_abstraction.d.ts","sourceRoot":"","sources":["../../src/web/web_sys_abstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEjH,OAAO,EAAE,cAAc,EAA2B,MAAM,oBAAoB,CAAC;AAkE7E,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,2BAA2B,GAAG,cAAc,CAQrF"}
|
@@ -1,65 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.WebSysAbstraction = void 0;
|
4
|
-
const base_sys_abstraction_1 = require("../base_sys_abstraction");
|
5
|
-
class WebFileService {
|
6
|
-
get baseDir() {
|
7
|
-
throw new Error("basedir-Method not implemented.");
|
8
|
-
}
|
9
|
-
create(fname) {
|
10
|
-
throw new Error("create-Method not implemented.");
|
11
|
-
}
|
12
|
-
readFileString(fname) {
|
13
|
-
throw new Error("readFileString-Method not implemented.");
|
14
|
-
}
|
15
|
-
writeFileString(fname, content) {
|
16
|
-
throw new Error("writeFileString-Method not implemented.");
|
17
|
-
}
|
18
|
-
abs(fname) {
|
19
|
-
throw new Error("abs-Method not implemented.");
|
20
|
-
}
|
21
|
-
join(...paths) {
|
22
|
-
throw new Error("join-Method not implemented.");
|
23
|
-
}
|
24
|
-
relative(from, to) {
|
25
|
-
throw new Error("relative-Method not implemented.");
|
26
|
-
}
|
27
|
-
dirname(fname) {
|
28
|
-
throw new Error("dirname-Method not implemented.");
|
29
|
-
}
|
30
|
-
basename(fname) {
|
31
|
-
throw new Error("basename-Method not implemented.");
|
32
|
-
}
|
33
|
-
nodeImport(fname) {
|
34
|
-
throw new Error("nodeImport-Method not implemented.");
|
35
|
-
}
|
36
|
-
isAbsolute(fname) {
|
37
|
-
throw new Error("isAbsolute-Method not implemented.");
|
38
|
-
}
|
39
|
-
}
|
40
|
-
class WebSystemService {
|
41
|
-
Env() {
|
42
|
-
throw new Error("Env-Method not implemented.");
|
43
|
-
}
|
44
|
-
Args() {
|
45
|
-
throw new Error("Args-Method not implemented.");
|
46
|
-
}
|
47
|
-
OnExit(hdl) {
|
48
|
-
throw new Error("OnExit-Method not implemented.");
|
49
|
-
}
|
50
|
-
Exit(code) {
|
51
|
-
throw new Error("Exit-Method not implemented.");
|
52
|
-
}
|
53
|
-
}
|
54
|
-
let my = undefined;
|
55
|
-
function WebSysAbstraction(param) {
|
56
|
-
if (!my) {
|
57
|
-
my = new base_sys_abstraction_1.BaseSysAbstraction({
|
58
|
-
FileSystem: new WebFileService(),
|
59
|
-
SystemService: new WebSystemService(),
|
60
|
-
});
|
61
|
-
}
|
62
|
-
return new base_sys_abstraction_1.WrapperSysAbstraction(my, param);
|
63
|
-
}
|
64
|
-
exports.WebSysAbstraction = WebSysAbstraction;
|
65
|
-
//# sourceMappingURL=web_sys_abstraction.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"web_sys_abstraction.js","sourceRoot":"","sources":["../../src/web/web_sys_abstraction.ts"],"names":[],"mappings":";;;AAAA,kEAAiH;AAIjH,MAAM,cAAc;IAClB,IAAI,OAAO;QACT,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,cAAc,CAAC,KAAa;QAC1B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,eAAe,CAAC,KAAa,EAAE,OAAe;QAC5C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,GAAG,CAAC,KAAa;QACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,GAAG,KAAe;QACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,EAAuB;QAC5C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC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