spliterator 6.2.0 → 6.3.1
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/out/lib/core/AsyncSpliterator.d.ts +1 -1
- package/out/lib/core/AsyncSpliterator.d.ts.map +1 -1
- package/out/lib/core/AsyncSpliterator.js +2 -2
- package/out/lib/core/AsyncSpliterator.js.map +1 -1
- package/out/lib/core/SlidingWindow.d.ts +1 -1
- package/out/lib/core/SlidingWindow.d.ts.map +1 -1
- package/out/lib/core/SlidingWindow.js.map +1 -1
- package/out/lib/core/Spliterator.d.ts +1 -1
- package/out/lib/core/Spliterator.d.ts.map +1 -1
- package/out/lib/core/Spliterator.js +1 -1
- package/out/lib/core/Spliterator.js.map +1 -1
- package/out/lib/formats/CSVSpliterator.d.ts +2 -2
- package/out/lib/formats/CSVSpliterator.d.ts.map +1 -1
- package/out/lib/formats/CSVSpliterator.js +92 -1
- package/out/lib/formats/CSVSpliterator.js.map +1 -1
- package/out/lib/formats/XLSXSpliterator.d.ts +1 -1
- package/out/lib/formats/XLSXSpliterator.d.ts.map +1 -1
- package/package.json +2 -3
- package/out/lib/AsyncSequence.d.ts +0 -180
- package/out/lib/AsyncSequence.d.ts.map +0 -1
- package/out/lib/AsyncSequence.js +0 -432
- package/out/lib/AsyncSequence.js.map +0 -1
- package/out/lib/AsyncSpliterator.d.ts +0 -227
- package/out/lib/AsyncSpliterator.d.ts.map +0 -1
- package/out/lib/AsyncSpliterator.js +0 -510
- package/out/lib/AsyncSpliterator.js.map +0 -1
- package/out/lib/BufferController.d.ts +0 -77
- package/out/lib/BufferController.d.ts.map +0 -1
- package/out/lib/BufferController.js +0 -118
- package/out/lib/BufferController.js.map +0 -1
- package/out/lib/CSVSpliterator.d.ts +0 -131
- package/out/lib/CSVSpliterator.d.ts.map +0 -1
- package/out/lib/CSVSpliterator.js +0 -172
- package/out/lib/CSVSpliterator.js.map +0 -1
- package/out/lib/CharacterSequence.d.ts +0 -72
- package/out/lib/CharacterSequence.d.ts.map +0 -1
- package/out/lib/CharacterSequence.js +0 -347
- package/out/lib/CharacterSequence.js.map +0 -1
- package/out/lib/CompositeDataView.d.ts +0 -111
- package/out/lib/CompositeDataView.d.ts.map +0 -1
- package/out/lib/CompositeDataView.js +0 -241
- package/out/lib/CompositeDataView.js.map +0 -1
- package/out/lib/IndexQueue.d.ts +0 -48
- package/out/lib/IndexQueue.d.ts.map +0 -1
- package/out/lib/IndexQueue.js +0 -111
- package/out/lib/IndexQueue.js.map +0 -1
- package/out/lib/JSONSpliterator.d.ts +0 -44
- package/out/lib/JSONSpliterator.d.ts.map +0 -1
- package/out/lib/JSONSpliterator.js +0 -77
- package/out/lib/JSONSpliterator.js.map +0 -1
- package/out/lib/PSVSpliterator.d.ts +0 -21
- package/out/lib/PSVSpliterator.d.ts.map +0 -1
- package/out/lib/PSVSpliterator.js +0 -22
- package/out/lib/PSVSpliterator.js.map +0 -1
- package/out/lib/SlidingWindow.d.ts +0 -47
- package/out/lib/SlidingWindow.d.ts.map +0 -1
- package/out/lib/SlidingWindow.js +0 -63
- package/out/lib/SlidingWindow.js.map +0 -1
- package/out/lib/Spliterator.d.ts +0 -96
- package/out/lib/Spliterator.d.ts.map +0 -1
- package/out/lib/Spliterator.js +0 -330
- package/out/lib/Spliterator.js.map +0 -1
- package/out/lib/TSVSpliterator.d.ts +0 -21
- package/out/lib/TSVSpliterator.d.ts.map +0 -1
- package/out/lib/TSVSpliterator.js +0 -22
- package/out/lib/TSVSpliterator.js.map +0 -1
- package/out/lib/TextSpliterator.d.ts +0 -53
- package/out/lib/TextSpliterator.d.ts.map +0 -1
- package/out/lib/TextSpliterator.js +0 -67
- package/out/lib/TextSpliterator.js.map +0 -1
- package/out/lib/XLSXSpliterator.d.ts +0 -143
- package/out/lib/XLSXSpliterator.d.ts.map +0 -1
- package/out/lib/XLSXSpliterator.js +0 -161
- package/out/lib/XLSXSpliterator.js.map +0 -1
- package/out/lib/adaptive-source.d.ts +0 -39
- package/out/lib/adaptive-source.d.ts.map +0 -1
- package/out/lib/adaptive-source.js +0 -95
- package/out/lib/adaptive-source.js.map +0 -1
- package/out/lib/casing.d.ts +0 -27
- package/out/lib/casing.d.ts.map +0 -1
- package/out/lib/casing.js +0 -68
- package/out/lib/casing.js.map +0 -1
- package/out/lib/chunks.d.ts +0 -20
- package/out/lib/chunks.d.ts.map +0 -1
- package/out/lib/chunks.js +0 -36
- package/out/lib/chunks.js.map +0 -1
- package/out/lib/merge-async-iterators.d.ts +0 -12
- package/out/lib/merge-async-iterators.d.ts.map +0 -1
- package/out/lib/merge-async-iterators.js +0 -39
- package/out/lib/merge-async-iterators.js.map +0 -1
- package/out/lib/parallel-map-runtime.d.ts +0 -22
- package/out/lib/parallel-map-runtime.d.ts.map +0 -1
- package/out/lib/parallel-map-runtime.js +0 -60
- package/out/lib/parallel-map-runtime.js.map +0 -1
- package/out/lib/parallel-map-worker-entry.d.ts +0 -11
- package/out/lib/parallel-map-worker-entry.d.ts.map +0 -1
- package/out/lib/parallel-map-worker-entry.js +0 -41
- package/out/lib/parallel-map-worker-entry.js.map +0 -1
- package/out/lib/parallel-map-workers.d.ts +0 -57
- package/out/lib/parallel-map-workers.d.ts.map +0 -1
- package/out/lib/parallel-map-workers.js +0 -82
- package/out/lib/parallel-map-workers.js.map +0 -1
- package/out/lib/parallel-map.d.ts +0 -28
- package/out/lib/parallel-map.d.ts.map +0 -1
- package/out/lib/parallel-map.js +0 -30
- package/out/lib/parallel-map.js.map +0 -1
- package/out/lib/pivot.d.ts +0 -30
- package/out/lib/pivot.d.ts.map +0 -1
- package/out/lib/pivot.js +0 -47
- package/out/lib/pivot.js.map +0 -1
- package/out/lib/row-emitters.d.ts +0 -35
- package/out/lib/row-emitters.d.ts.map +0 -1
- package/out/lib/row-emitters.js +0 -50
- package/out/lib/row-emitters.js.map +0 -1
- package/out/lib/segment-runtime.d.ts +0 -27
- package/out/lib/segment-runtime.d.ts.map +0 -1
- package/out/lib/segment-runtime.js +0 -41
- package/out/lib/segment-runtime.js.map +0 -1
- package/out/lib/segment-worker-entry.d.ts +0 -10
- package/out/lib/segment-worker-entry.d.ts.map +0 -1
- package/out/lib/segment-worker-entry.js +0 -59
- package/out/lib/segment-worker-entry.js.map +0 -1
- package/out/lib/segment-workers.d.ts +0 -56
- package/out/lib/segment-workers.d.ts.map +0 -1
- package/out/lib/segment-workers.js +0 -110
- package/out/lib/segment-workers.js.map +0 -1
- package/out/lib/segments.d.ts +0 -31
- package/out/lib/segments.d.ts.map +0 -1
- package/out/lib/segments.js +0 -52
- package/out/lib/segments.js.map +0 -1
- package/out/lib/shared.d.ts +0 -155
- package/out/lib/shared.d.ts.map +0 -1
- package/out/lib/shared.js +0 -41
- package/out/lib/shared.js.map +0 -1
- package/out/lib/take.d.ts +0 -42
- package/out/lib/take.d.ts.map +0 -1
- package/out/lib/take.js +0 -101
- package/out/lib/take.js.map +0 -1
- package/out/lib/utils.d.ts +0 -37
- package/out/lib/utils.d.ts.map +0 -1
- package/out/lib/utils.js +0 -39
- package/out/lib/utils.js.map +0 -1
- package/out/lib/wasm_base64.d.ts +0 -19
- package/out/lib/wasm_base64.d.ts.map +0 -1
- package/out/lib/wasm_base64.js +0 -19
- package/out/lib/wasm_base64.js.map +0 -1
- package/out/lib/wasm_module.d.ts +0 -57
- package/out/lib/wasm_module.d.ts.map +0 -1
- package/out/lib/wasm_module.js +0 -34
- package/out/lib/wasm_module.js.map +0 -1
- package/out/lib/writer.d.ts +0 -45
- package/out/lib/writer.d.ts.map +0 -1
- package/out/lib/writer.js +0 -57
- package/out/lib/writer.js.map +0 -1
- package/out/lib/zip.d.ts +0 -33
- package/out/lib/zip.d.ts.map +0 -1
- package/out/lib/zip.js +0 -59
- package/out/lib/zip.js.map +0 -1
- package/out/node/cli/parse-args.d.ts +0 -120
- package/out/node/cli/parse-args.d.ts.map +0 -1
- package/out/node/cli/parse-args.js +0 -118
- package/out/node/cli/parse-args.js.map +0 -1
package/out/lib/row-emitters.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { zipSync } from "./zip.js";
|
|
7
|
-
export const identity = (value) => value;
|
|
8
|
-
/**
|
|
9
|
-
* Create the `mode`-keyed emitter table for a cell type.
|
|
10
|
-
*
|
|
11
|
-
* `missingValue` fills columns absent from a short row (CSV binds `""`, XLSX binds `null`).
|
|
12
|
-
*/
|
|
13
|
-
export function createRowEmitters(missingValue) {
|
|
14
|
-
return {
|
|
15
|
-
array: null,
|
|
16
|
-
entries(columns, headerColumns = []) {
|
|
17
|
-
return Array.from(zipSync(headerColumns, columns), ([transformer, value], idx) => {
|
|
18
|
-
const key = transformer?.[0];
|
|
19
|
-
const transform = transformer?.[1] ?? identity;
|
|
20
|
-
return [key ?? `column_${idx}`, transform(value ?? missingValue), idx];
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
object(columns, headerColumns = []) {
|
|
24
|
-
const record = {};
|
|
25
|
-
for (const [transformer, value, idx] of zipSync(headerColumns, columns)) {
|
|
26
|
-
const key = transformer?.[0] ?? `column_${idx}`;
|
|
27
|
-
const transform = transformer?.[1] ?? identity;
|
|
28
|
-
record[key] = transform(value ?? missingValue);
|
|
29
|
-
}
|
|
30
|
-
return record;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Bind a header row to the caller's transformers, producing the `headerColumns` entries the emitters consume. Columns
|
|
36
|
-
* without a transformer pass through {@linkcode identity}.
|
|
37
|
-
*/
|
|
38
|
-
export function bindTransformers(headers, transformersInput) {
|
|
39
|
-
if (Array.isArray(transformersInput)) {
|
|
40
|
-
return Array.from(zipSync(headers, transformersInput), ([columnName, transformer]) => [
|
|
41
|
-
columnName,
|
|
42
|
-
transformer ?? identity,
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
return headers.map((columnName) => {
|
|
46
|
-
const transform = transformersInput[columnName] || identity;
|
|
47
|
-
return [columnName, transform];
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=row-emitters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"row-emitters.js","sourceRoot":"","sources":["../../lib/row-emitters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AA0BlC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAI,KAAQ,EAAK,EAAE,CAAC,KAAK,CAAA;AAEjD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAI,YAAe;IACnD,OAAO;QACN,KAAK,EAAE,IAAI;QAEX,OAAO,CAAC,OAAoB,EAAE,aAAa,GAAqC,EAAE;YACjF,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE;gBAChF,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,CAAA;gBAC5B,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAA;gBAE9C,OAAO,CAAC,GAAG,IAAI,UAAU,GAAG,EAAE,EAAE,SAAS,CAAC,KAAK,IAAI,YAAY,CAAC,EAAE,GAAG,CAAC,CAAA;YACvE,CAAC,CAAC,CAAA;QACH,CAAC;QACD,MAAM,CAAC,OAAoB,EAAE,aAAa,GAAqC,EAAE;YAChF,MAAM,MAAM,GAA2B,EAAE,CAAA;YAEzC,KAAK,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,CAAC;gBACzE,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,GAAG,EAAE,CAAA;gBAC/C,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAA;gBAE9C,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,IAAI,YAAY,CAAC,CAAA;YAC/C,CAAC;YAED,OAAO,MAAM,CAAA;QACd,CAAC;KACD,CAAA;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC/B,OAAiB,EACjB,iBAA6E;IAE7E,IAAI,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC;YACrF,UAAW;YACV,WAA6C,IAAI,QAAQ;SAC1D,CAAC,CAAA;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QACjC,MAAM,SAAS,GAAI,iBAA6C,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAA;QAExF,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
export type SegmentHandler = (record: Uint8Array, ctx: {
|
|
7
|
-
index: number;
|
|
8
|
-
segmentIndex: number;
|
|
9
|
-
}) => unknown | Promise<unknown>;
|
|
10
|
-
export interface RunSegmentIO {
|
|
11
|
-
records: AsyncIterable<Uint8Array>;
|
|
12
|
-
handleRecord: SegmentHandler;
|
|
13
|
-
segmentIndex: number;
|
|
14
|
-
batchSize: number;
|
|
15
|
-
maxInFlight: number;
|
|
16
|
-
post: (batch: unknown[], transfer: ArrayBuffer[]) => void;
|
|
17
|
-
waitForAck: () => Promise<void>;
|
|
18
|
-
inFlight: () => number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Drive one segment: read records, run the handler, accumulate results into `batchSize` batches, transfer `Uint8Array`
|
|
22
|
-
* result buffers zero-copy, and respect a bounded in-flight window by awaiting an ack before exceeding `maxInFlight`
|
|
23
|
-
* outstanding batches. Results of `undefined` are skipped (the filter case). Transport-agnostic so it unit-tests
|
|
24
|
-
* without `worker_threads`.
|
|
25
|
-
*/
|
|
26
|
-
export declare function runSegment(io: RunSegmentIO): Promise<void>;
|
|
27
|
-
//# sourceMappingURL=segment-runtime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-runtime.d.ts","sourceRoot":"","sources":["../../lib/segment-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG,CAC5B,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,KACxC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/B,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAClC,YAAY,EAAE,cAAc,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAA;IACzD,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,QAAQ,EAAE,MAAM,MAAM,CAAA;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoChE"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Drive one segment: read records, run the handler, accumulate results into `batchSize` batches, transfer `Uint8Array`
|
|
8
|
-
* result buffers zero-copy, and respect a bounded in-flight window by awaiting an ack before exceeding `maxInFlight`
|
|
9
|
-
* outstanding batches. Results of `undefined` are skipped (the filter case). Transport-agnostic so it unit-tests
|
|
10
|
-
* without `worker_threads`.
|
|
11
|
-
*/
|
|
12
|
-
export async function runSegment(io) {
|
|
13
|
-
let batch = [];
|
|
14
|
-
let transfer = [];
|
|
15
|
-
let index = 0;
|
|
16
|
-
const flush = async () => {
|
|
17
|
-
if (!batch.length)
|
|
18
|
-
return;
|
|
19
|
-
while (io.inFlight() >= io.maxInFlight) {
|
|
20
|
-
await io.waitForAck();
|
|
21
|
-
}
|
|
22
|
-
io.post(batch, transfer);
|
|
23
|
-
batch = [];
|
|
24
|
-
transfer = [];
|
|
25
|
-
};
|
|
26
|
-
for await (const record of io.records) {
|
|
27
|
-
const result = await io.handleRecord(record, { index, segmentIndex: io.segmentIndex });
|
|
28
|
-
index++;
|
|
29
|
-
if (result === undefined)
|
|
30
|
-
continue;
|
|
31
|
-
batch.push(result);
|
|
32
|
-
if (result instanceof Uint8Array) {
|
|
33
|
-
transfer.push(result.buffer);
|
|
34
|
-
}
|
|
35
|
-
if (batch.length >= io.batchSize) {
|
|
36
|
-
await flush();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
await flush();
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=segment-runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-runtime.js","sourceRoot":"","sources":["../../lib/segment-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;;;;GAKG;AACH,MAA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
-
*
|
|
6
|
-
* Runs inside a worker thread (spawned by runSegmentWorkers). Reads its segment via its own handle,
|
|
7
|
-
* runs the user handler per record, and posts batched results to the parent with ack backpressure.
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=segment-worker-entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-worker-entry.d.ts","sourceRoot":"","sources":["../../lib/segment-worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Runs inside a worker thread (spawned by runSegmentWorkers). Reads its segment via its own handle,
|
|
7
|
-
* runs the user handler per record, and posts batched results to the parent with ack backpressure.
|
|
8
|
-
*/
|
|
9
|
-
import { parentPort, workerData } from "node:worker_threads";
|
|
10
|
-
import { AsyncSpliterator } from "./AsyncSpliterator.js";
|
|
11
|
-
import { runSegment } from "./segment-runtime.js";
|
|
12
|
-
async function main() {
|
|
13
|
-
const data = workerData;
|
|
14
|
-
const port = parentPort;
|
|
15
|
-
// Ack backpressure: the parent posts `"ack"` per consumed batch; we track outstanding batches.
|
|
16
|
-
let acked = 0;
|
|
17
|
-
let posted = 0;
|
|
18
|
-
let wakeAck;
|
|
19
|
-
port.on("message", (msg) => {
|
|
20
|
-
if (msg === "ack") {
|
|
21
|
-
acked++;
|
|
22
|
-
wakeAck?.();
|
|
23
|
-
wakeAck = undefined;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const mod = (await import(data.handlerUrl));
|
|
27
|
-
const handleRecord = mod.handleRecord ?? mod.default;
|
|
28
|
-
if (typeof handleRecord !== "function") {
|
|
29
|
-
port.postMessage({ type: "error", message: `Worker module ${data.handlerUrl} has no handleRecord export.` });
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const { createChunkIterator } = await import("spliterator/node/fs");
|
|
33
|
-
const chunkIterator = await createChunkIterator(data.source, { start: data.start, end: data.end - 1 });
|
|
34
|
-
const records = new AsyncSpliterator(chunkIterator, { delimiter: data.delimiter, autoDispose: true });
|
|
35
|
-
return runSegment({
|
|
36
|
-
records,
|
|
37
|
-
handleRecord,
|
|
38
|
-
segmentIndex: data.segmentIndex,
|
|
39
|
-
batchSize: data.batchSize,
|
|
40
|
-
maxInFlight: data.maxInFlight,
|
|
41
|
-
post: (batch, transfer) => {
|
|
42
|
-
posted++;
|
|
43
|
-
port.postMessage({ type: "batch", records: batch }, transfer);
|
|
44
|
-
},
|
|
45
|
-
waitForAck: () => new Promise((resolve) => {
|
|
46
|
-
wakeAck = resolve;
|
|
47
|
-
}),
|
|
48
|
-
inFlight: () => posted - acked,
|
|
49
|
-
})
|
|
50
|
-
.then(() => {
|
|
51
|
-
port.postMessage({ type: "done" });
|
|
52
|
-
return void 0;
|
|
53
|
-
})
|
|
54
|
-
.catch((error) => {
|
|
55
|
-
port.postMessage({ type: "error", message: error instanceof Error ? error.message : String(error) });
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
void main();
|
|
59
|
-
//# sourceMappingURL=segment-worker-entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-worker-entry.js","sourceRoot":"","sources":["../../lib/segment-worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAuB,MAAM,sBAAsB,CAAA;AActE,KAAK,UAAU,IAAI;IAClB,MAAM,IAAI,GAAG,UAAwB,CAAA;IACrC,MAAM,IAAI,GAAG,UAAW,CAAA;IAExB,+FAA+F;IAC/F,IAAI,KAAK,GAAG,CAAC,CAA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E,EAAE;YACzB,MAAM,EAAE,CAAA;YACR,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC9D,CAAC;QACD,UAAU,EAAE,GAAG,EAAE,CAChB,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC7B,OAAO,GAAG,OAAO,CAAA;QAClB,CAAC,CAAC;QACH,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,GAAG,KAAK;KAC9B,CAAC;SACA,IAAI,CAAC,GAAG,EAAE;QACV,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QAElC,OAAO,KAAK,CAAC,CAAA;IACd,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACrG,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,IAAI,EAAE,CAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import type { CharacterSequenceInput } from "./CharacterSequence.js";
|
|
7
|
-
import type { AsyncDataResource } from "./shared.js";
|
|
8
|
-
export { mergeAsyncIterators } from "./merge-async-iterators.js";
|
|
9
|
-
export interface MinimalWorker {
|
|
10
|
-
on(event: "message", cb: (msg: unknown) => void): void;
|
|
11
|
-
on(event: "error", cb: (err: Error) => void): void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Drain a worker's batched messages into an async iterator. Listeners attach **eagerly** (messages posted before
|
|
15
|
-
* iteration starts are buffered, not lost) and draining uses a `batches[] + head` pointer (no `Array.shift()`).
|
|
16
|
-
* `onBatchConsumed` fires once per batch after its records are yielded — the ack hook for backpressure. An `error`
|
|
17
|
-
* message or worker `error` rejects the iterator.
|
|
18
|
-
*/
|
|
19
|
-
export declare function workerToIterable<R>(worker: MinimalWorker, onBatchConsumed: () => void): AsyncIterableIterator<R>;
|
|
20
|
-
export interface AsManyWorkersOptions {
|
|
21
|
-
/**
|
|
22
|
-
* Module path or URL exporting `handleRecord(bytes, ctx)`. Runs once per worker at import.
|
|
23
|
-
*/
|
|
24
|
-
worker: string | URL;
|
|
25
|
-
/**
|
|
26
|
-
* The record delimiter. @default LineFeed
|
|
27
|
-
*/
|
|
28
|
-
delimiter?: CharacterSequenceInput;
|
|
29
|
-
/**
|
|
30
|
-
* Desired number of segments/workers. Clamped to ≥ 1; fewer may run.
|
|
31
|
-
*/
|
|
32
|
-
concurrency: number;
|
|
33
|
-
/**
|
|
34
|
-
* Bytes read at each ideal boundary to find the next delimiter. @default 65536
|
|
35
|
-
*/
|
|
36
|
-
probeSize?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Results per message. @default 256
|
|
39
|
-
*/
|
|
40
|
-
batchSize?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Unacked batches per worker before it pauses (bounds memory). @default 8
|
|
43
|
-
*/
|
|
44
|
-
maxInFlight?: number;
|
|
45
|
-
/**
|
|
46
|
-
* Forwarded to every worker via `workerData.userData`.
|
|
47
|
-
*/
|
|
48
|
-
workerData?: unknown;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Spawn one worker per delimiter-aligned segment, each running the `worker` handler module over its own handle, and
|
|
52
|
-
* merge their results into a single async iterator. Results interleave across segments. Sends an `ack` per consumed
|
|
53
|
-
* batch (backpressure); terminates all workers on completion, error, or early return.
|
|
54
|
-
*/
|
|
55
|
-
export declare function runSegmentWorkers<R>(source: AsyncDataResource, options: AsManyWorkersOptions): AsyncIterableIterator<R>;
|
|
56
|
-
//# sourceMappingURL=segment-workers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-workers.d.ts","sourceRoot":"","sources":["../../lib/segment-workers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAGpE,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,aAAa,CAAA;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEhE,MAAM,WAAW,aAAa;IAC7B,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAA;IACtD,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAA;CAClD;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,IAAI,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAyDhH;AAED,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAA;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAuB,iBAAiB,CAAC,CAAC,EACzC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,oBAAoB,GAC3B,qBAAqB,CAAC,CAAC,CAAC,CA+C1B"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { Worker } from "node:worker_threads";
|
|
7
|
-
import { mergeAsyncIterators } from "./merge-async-iterators.js";
|
|
8
|
-
import { computeSegments } from "./segments.js";
|
|
9
|
-
export { mergeAsyncIterators } from "./merge-async-iterators.js";
|
|
10
|
-
/**
|
|
11
|
-
* Drain a worker's batched messages into an async iterator. Listeners attach **eagerly** (messages posted before
|
|
12
|
-
* iteration starts are buffered, not lost) and draining uses a `batches[] + head` pointer (no `Array.shift()`).
|
|
13
|
-
* `onBatchConsumed` fires once per batch after its records are yielded — the ack hook for backpressure. An `error`
|
|
14
|
-
* message or worker `error` rejects the iterator.
|
|
15
|
-
*/
|
|
16
|
-
export function workerToIterable(worker, onBatchConsumed) {
|
|
17
|
-
const batches = [];
|
|
18
|
-
let head = 0;
|
|
19
|
-
let done = false;
|
|
20
|
-
let error;
|
|
21
|
-
let wake;
|
|
22
|
-
const signal = () => {
|
|
23
|
-
wake?.();
|
|
24
|
-
wake = undefined;
|
|
25
|
-
};
|
|
26
|
-
worker.on("message", (msg) => {
|
|
27
|
-
const m = msg;
|
|
28
|
-
if (m.type === "batch") {
|
|
29
|
-
batches.push(m.records);
|
|
30
|
-
}
|
|
31
|
-
else if (m.type === "done") {
|
|
32
|
-
done = true;
|
|
33
|
-
}
|
|
34
|
-
else if (m.type === "error") {
|
|
35
|
-
error = new Error(m.message);
|
|
36
|
-
done = true;
|
|
37
|
-
}
|
|
38
|
-
signal();
|
|
39
|
-
});
|
|
40
|
-
worker.on("error", (err) => {
|
|
41
|
-
error = err;
|
|
42
|
-
done = true;
|
|
43
|
-
signal();
|
|
44
|
-
});
|
|
45
|
-
async function* drain() {
|
|
46
|
-
for (;;) {
|
|
47
|
-
if (head < batches.length) {
|
|
48
|
-
const batch = batches[head++];
|
|
49
|
-
for (const record of batch) {
|
|
50
|
-
yield record;
|
|
51
|
-
}
|
|
52
|
-
onBatchConsumed();
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (error)
|
|
56
|
-
throw error;
|
|
57
|
-
if (done)
|
|
58
|
-
return;
|
|
59
|
-
// oxlint-disable-next-line no-loop-func no-promise-executor-return
|
|
60
|
-
await new Promise((resolve) => (wake = resolve));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return drain();
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Spawn one worker per delimiter-aligned segment, each running the `worker` handler module over its own handle, and
|
|
67
|
-
* merge their results into a single async iterator. Results interleave across segments. Sends an `ack` per consumed
|
|
68
|
-
* batch (backpressure); terminates all workers on completion, error, or early return.
|
|
69
|
-
*/
|
|
70
|
-
export async function* runSegmentWorkers(source, options) {
|
|
71
|
-
if (typeof source !== "string" && !(source instanceof URL)) {
|
|
72
|
-
throw new TypeError("asManyWorkers requires a file path or URL — file handles cannot cross threads.");
|
|
73
|
-
}
|
|
74
|
-
const handlerUrl = options.worker instanceof URL ? options.worker.href : new URL(options.worker, `file://${process.cwd()}/`).href;
|
|
75
|
-
const sourcePath = source instanceof URL ? source.href : source;
|
|
76
|
-
const segments = await computeSegments(source, {
|
|
77
|
-
delimiter: options.delimiter,
|
|
78
|
-
concurrency: options.concurrency,
|
|
79
|
-
probeSize: options.probeSize,
|
|
80
|
-
});
|
|
81
|
-
const workers = [];
|
|
82
|
-
const entryUrl = new URL("./segment-worker-entry.js", import.meta.url);
|
|
83
|
-
try {
|
|
84
|
-
const iterables = segments.map(([start, end], segmentIndex) => {
|
|
85
|
-
const worker = new Worker(entryUrl, {
|
|
86
|
-
workerData: {
|
|
87
|
-
source: sourcePath,
|
|
88
|
-
handlerUrl,
|
|
89
|
-
start,
|
|
90
|
-
end,
|
|
91
|
-
delimiter: options.delimiter ?? null,
|
|
92
|
-
segmentIndex,
|
|
93
|
-
batchSize: options.batchSize ?? 256,
|
|
94
|
-
maxInFlight: options.maxInFlight ?? 8,
|
|
95
|
-
userData: options.workerData,
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
workers.push(worker);
|
|
99
|
-
return workerToIterable(worker, () => worker.postMessage("ack"));
|
|
100
|
-
});
|
|
101
|
-
// Drain all workers concurrently so they run in parallel — a sequential drain would consume one
|
|
102
|
-
// to completion while the rest stall at their in-flight window. Order across segments is not
|
|
103
|
-
// guaranteed (results arrive in completion order).
|
|
104
|
-
yield* mergeAsyncIterators(iterables);
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
await Promise.all(workers.map((w) => w.terminate()));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=segment-workers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-workers.js","sourceRoot":"","sources":["../../lib/segment-workers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAShE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAI,MAAqB,EAAE,eAA2B;IACrF,MAAM,OAAO,GAAU,EAAE,CAAA;IACzB,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,IAAI,GAAG,KAAK,CAAA;IAChB,IAAI,KAAwB,CAAA;IAC5B,IAAI,IAA8B,CAAA;IAElC,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,IAAI,EAAE,EAAE,CAAA;QACR,IAAI,GAAG,SAAS,CAAA;IACjB,CAAC,CAAA;IAED,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,C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,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,GAAG;oBACnC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,CAAC;oBACrC,QAAQ,EAAE,OAAO,CAAC,UAAU;iBAC5B;aACD,CAAC,CAAA;YAEF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAEpB,OAAO,gBAAgB,CAAI,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;QAEF,gGAAgG;QAChG,6FAA6F;QAC7F,mDAAmD;QACnD,KAAK,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAA;IACtC,CAAC;YAAS,CAAC;QACV,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;IACrD,CAAC;AACF,CAAC"}
|
package/out/lib/segments.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { type CharacterSequenceInput } from "./CharacterSequence.js";
|
|
7
|
-
import type { AsyncDataResource, ByteRange } from "./shared.js";
|
|
8
|
-
export interface SegmentOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The record delimiter. @default LineFeed
|
|
11
|
-
*/
|
|
12
|
-
delimiter?: CharacterSequenceInput;
|
|
13
|
-
/**
|
|
14
|
-
* Desired number of segments. Clamped to ≥ 1; the result may be fewer.
|
|
15
|
-
*/
|
|
16
|
-
concurrency: number;
|
|
17
|
-
/**
|
|
18
|
-
* Bytes read at each ideal boundary to find the next delimiter. @default 65536
|
|
19
|
-
*/
|
|
20
|
-
probeSize?: number;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Divide `source` into up to `concurrency` delimiter-aligned byte ranges. Each internal boundary is placed immediately
|
|
24
|
-
* after the first delimiter at or past the ideal cut, so concatenating each segment's records reproduces the file
|
|
25
|
-
* exactly — no record is split or duplicated.
|
|
26
|
-
*
|
|
27
|
-
* A probe window with no delimiter (a record longer than `probeSize`) collapses that boundary, so the result may have
|
|
28
|
-
* fewer than `concurrency` segments. An empty file yields no segments.
|
|
29
|
-
*/
|
|
30
|
-
export declare function computeSegments(source: AsyncDataResource, options: SegmentOptions): Promise<ByteRange[]>;
|
|
31
|
-
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../lib/segments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE/D,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAA;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAgD9G"}
|
package/out/lib/segments.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { CharacterSequence } from "./CharacterSequence.js";
|
|
7
|
-
/**
|
|
8
|
-
* Divide `source` into up to `concurrency` delimiter-aligned byte ranges. Each internal boundary is placed immediately
|
|
9
|
-
* after the first delimiter at or past the ideal cut, so concatenating each segment's records reproduces the file
|
|
10
|
-
* exactly — no record is split or duplicated.
|
|
11
|
-
*
|
|
12
|
-
* A probe window with no delimiter (a record longer than `probeSize`) collapses that boundary, so the result may have
|
|
13
|
-
* fewer than `concurrency` segments. An empty file yields no segments.
|
|
14
|
-
*/
|
|
15
|
-
export async function computeSegments(source, options) {
|
|
16
|
-
const { readFileSize, readBytes } = await import("spliterator/node/fs");
|
|
17
|
-
const needle = new CharacterSequence(options.delimiter);
|
|
18
|
-
const probeSize = options.probeSize ?? 65_536;
|
|
19
|
-
const concurrency = Math.max(1, Math.floor(options.concurrency));
|
|
20
|
-
const fileSize = await readFileSize(source);
|
|
21
|
-
if (fileSize === 0)
|
|
22
|
-
return [];
|
|
23
|
-
if (concurrency === 1)
|
|
24
|
-
return [[0, fileSize]];
|
|
25
|
-
const idealCuts = Array.from({ length: concurrency - 1 }, (_, i) => Math.round(((i + 1) * fileSize) / concurrency));
|
|
26
|
-
const alignedCuts = await Promise.all(idealCuts.map(async (cut) => {
|
|
27
|
-
if (cut <= 0 || cut >= fileSize)
|
|
28
|
-
return null;
|
|
29
|
-
const window = await readBytes(source, cut, probeSize);
|
|
30
|
-
const index = needle.search(window, 0, window.length);
|
|
31
|
-
if (index === -1)
|
|
32
|
-
return null;
|
|
33
|
-
return cut + index + needle.length;
|
|
34
|
-
}));
|
|
35
|
-
const boundaries = new Set([0, fileSize]);
|
|
36
|
-
for (const cut of alignedCuts) {
|
|
37
|
-
if (cut !== null && cut > 0 && cut < fileSize) {
|
|
38
|
-
boundaries.add(cut);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const sorted = Array.from(boundaries).toSorted((a, b) => a - b);
|
|
42
|
-
const segments = [];
|
|
43
|
-
for (let i = 1; i < sorted.length; i++) {
|
|
44
|
-
const start = sorted[i - 1];
|
|
45
|
-
const end = sorted[i];
|
|
46
|
-
if (end > start) {
|
|
47
|
-
segments.push([start, end]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return segments;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=segments.js.map
|
package/out/lib/segments.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../lib/segments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAA+B,MAAM,wBAAwB,CAAA;AAkBvF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAyB,EAAE,OAAuB;IACvF,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAA;IACvE,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAA;IAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAA;IAEhE,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;IAE3C,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAE7B,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE7C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC,CAAC,CAAA;IAEnH,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CACpC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE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KAAK,EAAE,GAAG,CAAC,CAAC,CAAA;QAC5B,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC"}
|
package/out/lib/shared.d.ts
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import type { Stats } from "node:fs";
|
|
7
|
-
import type { FileHandle } from "node:fs/promises";
|
|
8
|
-
import type { PathBuilderLike } from "path-ts";
|
|
9
|
-
/**
|
|
10
|
-
* A trimmed-down version of the Node.js `Stats` interface.
|
|
11
|
-
*/
|
|
12
|
-
export type StatsLike = Pick<Stats, "size" | "blksize" | "mtimeMs">;
|
|
13
|
-
/**
|
|
14
|
-
* A trimmed-down version of the Node.js `FileHandle` interface.
|
|
15
|
-
*/
|
|
16
|
-
export type FileHandleLike = Pick<FileHandle, "fd" | "stat" | "close" | "read" | "readableWebStream" | "createReadStream">;
|
|
17
|
-
/**
|
|
18
|
-
* A tuple representing a window of bytes in a buffer.
|
|
19
|
-
*/
|
|
20
|
-
export type ByteRange = [
|
|
21
|
-
/**
|
|
22
|
-
* The starting byte index of the window.
|
|
23
|
-
*/
|
|
24
|
-
start: number,
|
|
25
|
-
/**
|
|
26
|
-
* The ending byte index of the window.
|
|
27
|
-
*/
|
|
28
|
-
end: number
|
|
29
|
-
];
|
|
30
|
-
/**
|
|
31
|
-
* Typed arrays that may be used as sources for byte streams.
|
|
32
|
-
*/
|
|
33
|
-
export type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | BigUint64Array | BigInt64Array | Float32Array | Float64Array;
|
|
34
|
-
/**
|
|
35
|
-
* A source of bytes that can be read from.
|
|
36
|
-
*/
|
|
37
|
-
export type ReadableSource = FileHandleLike | TypedArray;
|
|
38
|
-
/**
|
|
39
|
-
* Type-predicate to determine if a value is a file handle.
|
|
40
|
-
*/
|
|
41
|
-
export declare function isFileHandleLike(input: unknown): input is FileHandleLike;
|
|
42
|
-
/**
|
|
43
|
-
* Type-helper to determine the destination type for a typed array.
|
|
44
|
-
*
|
|
45
|
-
* This is useful to infer the ultimate return type of a function which optionally accepts a typed array destination.
|
|
46
|
-
*/
|
|
47
|
-
export type TypedArrayFallback<T> = T extends TypedArray ? T : Uint8Array;
|
|
48
|
-
/**
|
|
49
|
-
* Options for reading a range of bytes from a source.
|
|
50
|
-
*/
|
|
51
|
-
export interface ReadBytesOptions {
|
|
52
|
-
/**
|
|
53
|
-
* The offset from where to begin writing to the buffer.
|
|
54
|
-
*
|
|
55
|
-
* This is useful when reading multiple buffers into a single buffer.
|
|
56
|
-
*
|
|
57
|
-
* @default 0
|
|
58
|
-
*/
|
|
59
|
-
offset?: number;
|
|
60
|
-
/**
|
|
61
|
-
* How many bytes to read.
|
|
62
|
-
*
|
|
63
|
-
* @default `length of buffer`
|
|
64
|
-
*/
|
|
65
|
-
length?: number;
|
|
66
|
-
/**
|
|
67
|
-
* From where to start reading.
|
|
68
|
-
*/
|
|
69
|
-
position?: number;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A trait for reading a range of bytes from a source.
|
|
73
|
-
*
|
|
74
|
-
* While possible with a variety of platform-specific APIs, this trait provides a common interface for reading byte
|
|
75
|
-
* ranges.
|
|
76
|
-
*/
|
|
77
|
-
export interface ByteRangeReader extends AsyncIterator<Uint8Array> {
|
|
78
|
-
/**
|
|
79
|
-
* Reads a range of bytes from a source.
|
|
80
|
-
*/
|
|
81
|
-
read(options?: ReadBytesOptions): Promise<Uint8Array>;
|
|
82
|
-
read<B extends TypedArray>(options: ReadBytesOptions & {
|
|
83
|
-
buffer: B;
|
|
84
|
-
}): Promise<B>;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* An isomorphic file resource which can be read from and disposed.
|
|
88
|
-
*
|
|
89
|
-
* Generally, this interface aligns with the `File` interface in the browser.
|
|
90
|
-
*/
|
|
91
|
-
export interface FileResourceLike extends File {
|
|
92
|
-
/**
|
|
93
|
-
* Slice the file into a new file resource.
|
|
94
|
-
*
|
|
95
|
-
* @param start - The byte offset to start the slice.
|
|
96
|
-
* @param end - The byte offset to end the slice.
|
|
97
|
-
*/
|
|
98
|
-
slice(start: number, end: number): FileResourceLike;
|
|
99
|
-
/**
|
|
100
|
-
* The block size of the file, if known.
|
|
101
|
-
*/
|
|
102
|
-
blockSize?: number;
|
|
103
|
-
[Symbol.asyncDispose]?(): PromiseLike<void>;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Type-predicate to determine if a value is a file resource.
|
|
107
|
-
*/
|
|
108
|
-
export declare function isFileResourceLike(input: unknown): input is FileResourceLike;
|
|
109
|
-
/**
|
|
110
|
-
* Given a file resource, adds a `read` method to read a range of bytes.
|
|
111
|
-
*
|
|
112
|
-
* This allows the web `File` interface to be used as a byte range reader.
|
|
113
|
-
*/
|
|
114
|
-
export declare function applyReaderPolyfill<T extends FileResourceLike>(file: T): asserts file is T & ByteRangeReader;
|
|
115
|
-
/**
|
|
116
|
-
* An asynchronous iterable byte stream.
|
|
117
|
-
*
|
|
118
|
-
* String chunks are tolerated and UTF-8 encoded on arrival — a `fs.createReadStream(path, "utf8")` or Node `Readable`
|
|
119
|
-
* in string mode would otherwise coerce to garbage bytes via `TypedArray.set`.
|
|
120
|
-
*
|
|
121
|
-
* Note that as an iterable this will drained of all bytes when iterated over.
|
|
122
|
-
*/
|
|
123
|
-
export interface AsyncChunkIterator extends AsyncIterable<Uint8Array | string> {
|
|
124
|
-
/**
|
|
125
|
-
* Disposes of the byte stream, releasing any resources.
|
|
126
|
-
*
|
|
127
|
-
* This method is optional and may not be implemented by all byte streams.
|
|
128
|
-
*/
|
|
129
|
-
[Symbol.asyncDispose]?(): PromiseLike<void>;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* An asynchronous resource to a delimited byte stream, which can be a...
|
|
133
|
-
*
|
|
134
|
-
* - `string` representing a file path.
|
|
135
|
-
* - {@linkcode URL} object representing a file path.
|
|
136
|
-
* - {@linkcode FileHandleLike} object representing an open file handle.
|
|
137
|
-
* - {@linkcode AsyncChunkIterator} object representing an asynchronous byte stream — anything async-iterable over bytes
|
|
138
|
-
* qualifies: a Node `Readable` (child-process stdout, a gunzip pipe), a web `ReadableStream` wrapped via
|
|
139
|
-
* `Symbol.asyncIterator`, or a hand-rolled generator.
|
|
140
|
-
*/
|
|
141
|
-
export type AsyncDataResource = string | URL | FileHandleLike | AsyncChunkIterator | PathBuilderLike;
|
|
142
|
-
/**
|
|
143
|
-
* A resource to a delimited byte stream, i.e., a file buffer, handle, or path.
|
|
144
|
-
*
|
|
145
|
-
* @see {@link AsyncDataResource} : File paths, URLs, and handles.
|
|
146
|
-
* @see {@link TypedArray} : Buffers and typed arrays.
|
|
147
|
-
*/
|
|
148
|
-
export type DataResource = AsyncDataResource | TypedArray;
|
|
149
|
-
/**
|
|
150
|
-
* A trimmed-down version of the text decoder interface.
|
|
151
|
-
*/
|
|
152
|
-
export interface TextDecoderLike {
|
|
153
|
-
decode(input: Uint8Array): string;
|
|
154
|
-
}
|
|
155
|
-
//# sourceMappingURL=shared.d.ts.map
|
package/out/lib/shared.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../lib/shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC,CAAA;AAEnE;;GAEG;AACH,MAAM,MAAM,cAAc,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