spliterator 6.2.0 → 6.3.0
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.map +1 -1
- package/out/lib/formats/CSVSpliterator.js +92 -1
- package/out/lib/formats/CSVSpliterator.js.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/AsyncSequence.js
DELETED
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { ReadableStream } from "stream/web";
|
|
7
|
-
const OP_MAP = 0;
|
|
8
|
-
const OP_FILTER = 1;
|
|
9
|
-
const OP_TAKE = 2;
|
|
10
|
-
const OP_DROP = 3;
|
|
11
|
-
function isThenable(value) {
|
|
12
|
-
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
13
|
-
}
|
|
14
|
-
function toAsyncIterator(source) {
|
|
15
|
-
if (Symbol.asyncIterator in source)
|
|
16
|
-
return source[Symbol.asyncIterator]();
|
|
17
|
-
const iterator = source[Symbol.iterator]();
|
|
18
|
-
return {
|
|
19
|
-
next: async () => iterator.next(),
|
|
20
|
-
return: async (value) => iterator.return?.(value) ?? { value: undefined, done: true },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
async function* flattenValues(source, fn) {
|
|
24
|
-
let counter = 0;
|
|
25
|
-
for await (const value of source) {
|
|
26
|
-
const mapped = fn(value, counter++);
|
|
27
|
-
const inner = isThenable(mapped) ? await mapped : mapped;
|
|
28
|
-
if (inner === null || typeof inner !== "object") {
|
|
29
|
-
throw new TypeError(`flatMap callback must return an iterable, received ${typeof inner}`);
|
|
30
|
-
}
|
|
31
|
-
yield* inner;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function* batchValues(source, size) {
|
|
35
|
-
let batch = [];
|
|
36
|
-
for await (const value of source) {
|
|
37
|
-
batch.push(value);
|
|
38
|
-
if (batch.length === size) {
|
|
39
|
-
yield batch;
|
|
40
|
-
batch = [];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (batch.length) {
|
|
44
|
-
yield batch;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async function* mapValuesConcurrently(source, fn, limit, signal) {
|
|
48
|
-
const upstream = source[Symbol.asyncIterator]();
|
|
49
|
-
// Slots key this map, not items: a source may repeat a value (a list of file paths routinely does), and two `===`
|
|
50
|
-
// equal keys would collapse into one entry, losing a result and deleting the wrong dispatch.
|
|
51
|
-
const inflight = new Map();
|
|
52
|
-
let slot = 0;
|
|
53
|
-
let exhausted = false;
|
|
54
|
-
try {
|
|
55
|
-
for (;;) {
|
|
56
|
-
if (signal?.aborted)
|
|
57
|
-
break;
|
|
58
|
-
while (!exhausted && inflight.size < limit) {
|
|
59
|
-
const result = await upstream.next();
|
|
60
|
-
if (result.done) {
|
|
61
|
-
exhausted = true;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
const current = slot++;
|
|
65
|
-
const produced = fn(result.value, current);
|
|
66
|
-
inflight.set(current, Promise.resolve(produced).then((value) => ({ slot: current, value })));
|
|
67
|
-
}
|
|
68
|
-
if (!inflight.size)
|
|
69
|
-
break;
|
|
70
|
-
const { slot: settled, value } = await Promise.race(inflight.values());
|
|
71
|
-
inflight.delete(settled);
|
|
72
|
-
yield value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
await upstream.return?.();
|
|
77
|
-
// Settle whatever is still running so an abandoned rejection is never unobserved.
|
|
78
|
-
await Promise.allSettled(inflight.values());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A lazy, chainable async iterator.
|
|
83
|
-
*
|
|
84
|
-
* The core methods (`map`, `filter`, `take`, `drop`, `flatMap`, `reduce`, `toArray`, `forEach`, `some`, `every`,
|
|
85
|
-
* `find`) match the [async iterator helpers proposal][proposal] in name, arity, and semantics — including the `counter`
|
|
86
|
-
* second argument handed to every callback. Callbacks may return promises. Code written against this keeps working
|
|
87
|
-
* verbatim if the proposal ever ships natively.
|
|
88
|
-
*
|
|
89
|
-
* [proposal]: https://github.com/tc39/proposal-async-iterator-helpers
|
|
90
|
-
*
|
|
91
|
-
* **Chain depth is nearly free.** A chain is an op list plus a source, not nested generators, so one async boundary is
|
|
92
|
-
* paid per item no matter how many operators you stack; only the op loop grows. Measured on Node 26 over 2M items:
|
|
93
|
-
* ~5.4M items/s at three operators and ~4.9M/s at six, against ~2.3M/s for the equivalent nested-generator
|
|
94
|
-
* implementation, where each operator adds a microtask hop. Doubling the operator count costs ~10% here and would cost
|
|
95
|
-
* ~2× there. Only {@linkcode flatMap}, {@linkcode chunks}, and {@linkcode parallelMap} break fusion, because they need
|
|
96
|
-
* inner-iterator state.
|
|
97
|
-
*
|
|
98
|
-
* Callback results are awaited **only when thenable**, so synchronous callbacks — the common case — cost no microtask
|
|
99
|
-
* hop at all.
|
|
100
|
-
*
|
|
101
|
-
* **When not to reach for this.** Wrapping costs ~1.9× a bare async generator (~10.3M/s), one extra async frame per
|
|
102
|
-
* item. On parsed rows (`JSON.parse` at ~1–3µs) that is 3–8%, invisible. On raw {@linkcode Uint8Array} ranges with no
|
|
103
|
-
* per-row parse it is most of the cost — iterate the {@linkcode AsyncSpliterator} directly there.
|
|
104
|
-
*
|
|
105
|
-
* Single-shot, like the iterators the proposal specifies: iterating consumes the source.
|
|
106
|
-
*/
|
|
107
|
-
export class AsyncSequence {
|
|
108
|
-
#source;
|
|
109
|
-
#ops;
|
|
110
|
-
/**
|
|
111
|
-
* Indices of `take` ops, precomputed so the exhaustion pre-check costs nothing when there are none.
|
|
112
|
-
*/
|
|
113
|
-
#takeIndices;
|
|
114
|
-
#upstream = null;
|
|
115
|
-
#syncUpstream = null;
|
|
116
|
-
#counters = null;
|
|
117
|
-
#budgets = null;
|
|
118
|
-
#done = false;
|
|
119
|
-
constructor(source, ops = []) {
|
|
120
|
-
this.#source = source;
|
|
121
|
-
this.#ops = ops;
|
|
122
|
-
const takeIndices = [];
|
|
123
|
-
for (let i = 0; i < ops.length; i++) {
|
|
124
|
-
if (ops[i].kind === OP_TAKE) {
|
|
125
|
-
takeIndices.push(i);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
this.#takeIndices = takeIndices;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Wrap any iterable or async iterable as a chainable sequence.
|
|
132
|
-
*/
|
|
133
|
-
static from(source) {
|
|
134
|
-
return source instanceof AsyncSequence ? source : new AsyncSequence(source);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Resolve the source once, keeping a synchronous iterator as such.
|
|
138
|
-
*
|
|
139
|
-
* Adapting a sync iterator to the async protocol would allocate a promise per pulled value for an iterator that never
|
|
140
|
-
* needs one, which is most of the cost of parsing an in-memory source: 0.733ms against a 0.540ms floor over a 68KB
|
|
141
|
-
* file.
|
|
142
|
-
*/
|
|
143
|
-
async #openUpstream() {
|
|
144
|
-
if (this.#upstream)
|
|
145
|
-
return this.#upstream;
|
|
146
|
-
if (this.#syncUpstream)
|
|
147
|
-
return this.#syncUpstream;
|
|
148
|
-
const source = this.#source;
|
|
149
|
-
const resolved = typeof source === "function" ? await source() : source;
|
|
150
|
-
if (!(Symbol.asyncIterator in resolved)) {
|
|
151
|
-
this.#syncUpstream = resolved[Symbol.iterator]();
|
|
152
|
-
return this.#syncUpstream;
|
|
153
|
-
}
|
|
154
|
-
this.#upstream = toAsyncIterator(resolved);
|
|
155
|
-
return this.#upstream;
|
|
156
|
-
}
|
|
157
|
-
#derive(op) {
|
|
158
|
-
return new AsyncSequence(this.#source, [...this.#ops, op]);
|
|
159
|
-
}
|
|
160
|
-
//#region Spec-compatible core — lazy
|
|
161
|
-
/**
|
|
162
|
-
* Transform each value. The callback receives `(value, counter)` and may return a promise.
|
|
163
|
-
*/
|
|
164
|
-
map(fn) {
|
|
165
|
-
return this.#derive({ kind: OP_MAP, fn });
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Keep values for which the callback is truthy. The callback receives `(value, counter)` and may return a promise.
|
|
169
|
-
*/
|
|
170
|
-
filter(fn) {
|
|
171
|
-
return this.#derive({ kind: OP_FILTER, fn });
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Yield at most `limit` values, then close the underlying iterator.
|
|
175
|
-
*
|
|
176
|
-
* The close is what makes this safe on a file-backed source — `take(5)` over a 40GB file releases the handle rather
|
|
177
|
-
* than leaving it open until GC.
|
|
178
|
-
*/
|
|
179
|
-
take(limit) {
|
|
180
|
-
const normalized = Math.trunc(limit);
|
|
181
|
-
if (!Number.isFinite(normalized) || normalized < 0) {
|
|
182
|
-
throw new RangeError(`take(${limit}): limit must be a non-negative finite number`);
|
|
183
|
-
}
|
|
184
|
-
return this.#derive({ kind: OP_TAKE, limit: normalized });
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Skip the first `limit` values.
|
|
188
|
-
*/
|
|
189
|
-
drop(limit) {
|
|
190
|
-
const normalized = Math.trunc(limit);
|
|
191
|
-
if (!Number.isFinite(normalized) || normalized < 0) {
|
|
192
|
-
throw new RangeError(`drop(${limit}): limit must be a non-negative finite number`);
|
|
193
|
-
}
|
|
194
|
-
return this.#derive({ kind: OP_DROP, limit: normalized });
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Map each value to an iterable and flatten one level.
|
|
198
|
-
*
|
|
199
|
-
* **Fusion barrier.** Unlike the other operators this needs inner-iterator state, so it starts a fresh fused segment
|
|
200
|
-
* rather than joining the current op list. Stacking `flatMap` costs one async boundary each; stacking
|
|
201
|
-
* `map`/`filter`/`take`/`drop` costs nothing.
|
|
202
|
-
*/
|
|
203
|
-
flatMap(fn) {
|
|
204
|
-
return new AsyncSequence(flattenValues(this, fn));
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region Spec-compatible core — terminal
|
|
208
|
-
/**
|
|
209
|
-
* Collect every remaining value into an array.
|
|
210
|
-
*
|
|
211
|
-
* **Reads the whole source into memory.** On a sequence backed by a file this defeats the point of streaming — filter
|
|
212
|
-
* and map first so only what you keep is materialized.
|
|
213
|
-
*/
|
|
214
|
-
async toArray() {
|
|
215
|
-
const values = [];
|
|
216
|
-
for await (const value of this) {
|
|
217
|
-
values.push(value);
|
|
218
|
-
}
|
|
219
|
-
return values;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Invoke the callback for each value, for side effects.
|
|
223
|
-
*/
|
|
224
|
-
async forEach(fn) {
|
|
225
|
-
let counter = 0;
|
|
226
|
-
for await (const value of this) {
|
|
227
|
-
const result = fn(value, counter++);
|
|
228
|
-
if (isThenable(result)) {
|
|
229
|
-
await result;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
async reduce(fn, ...rest) {
|
|
234
|
-
let accumulator = rest[0];
|
|
235
|
-
let seeded = rest.length > 0;
|
|
236
|
-
let counter = 0;
|
|
237
|
-
for await (const value of this) {
|
|
238
|
-
if (!seeded) {
|
|
239
|
-
accumulator = value;
|
|
240
|
-
seeded = true;
|
|
241
|
-
counter++;
|
|
242
|
-
continue;
|
|
243
|
-
}
|
|
244
|
-
const next = fn(accumulator, value, counter++);
|
|
245
|
-
accumulator = isThenable(next) ? await next : next;
|
|
246
|
-
}
|
|
247
|
-
if (!seeded)
|
|
248
|
-
throw new TypeError("reduce of empty sequence with no initial value");
|
|
249
|
-
return accumulator;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Whether any value satisfies the callback. Short-circuits and closes the underlying iterator.
|
|
253
|
-
*/
|
|
254
|
-
async some(fn) {
|
|
255
|
-
let counter = 0;
|
|
256
|
-
for await (const value of this) {
|
|
257
|
-
const result = fn(value, counter++);
|
|
258
|
-
if (isThenable(result) ? await result : result)
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
return false;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Whether every value satisfies the callback. Short-circuits and closes the underlying iterator.
|
|
265
|
-
*/
|
|
266
|
-
async every(fn) {
|
|
267
|
-
let counter = 0;
|
|
268
|
-
for await (const value of this) {
|
|
269
|
-
const result = fn(value, counter++);
|
|
270
|
-
if (!(isThenable(result) ? await result : result))
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* The first value satisfying the callback, or `undefined`. Short-circuits and closes the underlying iterator.
|
|
277
|
-
*/
|
|
278
|
-
async find(fn) {
|
|
279
|
-
let counter = 0;
|
|
280
|
-
for await (const value of this) {
|
|
281
|
-
const result = fn(value, counter++);
|
|
282
|
-
if (isThenable(result) ? await result : result)
|
|
283
|
-
return value;
|
|
284
|
-
}
|
|
285
|
-
return undefined;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region Extras — deliberately not spec surface
|
|
289
|
-
/**
|
|
290
|
-
* Group values into arrays of `size`, with a shorter final batch if the sequence does not divide evenly.
|
|
291
|
-
*
|
|
292
|
-
* Distinct from {@linkcode take}, which yields the first `size` _values_. Named for the [iterator chunking
|
|
293
|
-
* proposal](https://github.com/tc39/proposal-iterator-chunking).
|
|
294
|
-
*
|
|
295
|
-
* **Fusion barrier**, like {@linkcode flatMap}.
|
|
296
|
-
*/
|
|
297
|
-
chunks(size) {
|
|
298
|
-
const normalized = Math.trunc(size);
|
|
299
|
-
if (!Number.isFinite(normalized) || normalized < 1) {
|
|
300
|
-
throw new RangeError(`chunks(${size}): size must be a positive finite number`);
|
|
301
|
-
}
|
|
302
|
-
return new AsyncSequence(batchValues(this, normalized));
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Map values through a callback with up to `concurrency` calls in flight, yielding in **completion order** — not
|
|
306
|
-
* input order.
|
|
307
|
-
*
|
|
308
|
-
* The callback is a closure, so it runs on the caller's thread. This overlaps _latency_ (file reads, network) and
|
|
309
|
-
* does nothing for CPU-bound work; for that, cross a thread boundary with `parallelMapWorkers` or
|
|
310
|
-
* `AsyncSpliterator.asManyWorkers`, which take a module path precisely because a closure cannot.
|
|
311
|
-
*
|
|
312
|
-
* **Fusion barrier**, like {@linkcode flatMap}.
|
|
313
|
-
*/
|
|
314
|
-
parallelMap(fn, { concurrency, signal }) {
|
|
315
|
-
return new AsyncSequence(mapValuesConcurrently(this, fn, Math.max(1, Math.trunc(concurrency)), signal));
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Expose the sequence as a web stream, for interop with `pipeThrough`/`pipeTo` consumers.
|
|
319
|
-
*/
|
|
320
|
-
toReadableStream() {
|
|
321
|
-
const iterator = this[Symbol.asyncIterator]();
|
|
322
|
-
return new ReadableStream({
|
|
323
|
-
pull: async (controller) => {
|
|
324
|
-
const { done, value } = await iterator.next();
|
|
325
|
-
if (done) {
|
|
326
|
-
controller.close();
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
controller.enqueue(value);
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
cancel: async () => void (await iterator.return?.()),
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Pipe the sequence through a transform stream.
|
|
337
|
-
*/
|
|
338
|
-
pipeThrough(transform, options) {
|
|
339
|
-
return this.toReadableStream().pipeThrough(transform, options);
|
|
340
|
-
}
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region Iteration
|
|
343
|
-
async next() {
|
|
344
|
-
if (this.#done)
|
|
345
|
-
return { value: undefined, done: true };
|
|
346
|
-
const ops = this.#ops;
|
|
347
|
-
const length = ops.length;
|
|
348
|
-
this.#counters ??= Array.from({ length }).fill(0);
|
|
349
|
-
this.#budgets ??= ops.map((op) => (op.kind === OP_TAKE || op.kind === OP_DROP ? op.limit : 0));
|
|
350
|
-
const counters = this.#counters;
|
|
351
|
-
const budgets = this.#budgets;
|
|
352
|
-
// A satisfied `take` must close the source WITHOUT pulling again — the whole point of `take(5)` on a huge file is
|
|
353
|
-
// that the sixth row is never read.
|
|
354
|
-
for (const index of this.#takeIndices) {
|
|
355
|
-
if (budgets[index] <= 0)
|
|
356
|
-
return this.#finish();
|
|
357
|
-
}
|
|
358
|
-
const upstream = await this.#openUpstream();
|
|
359
|
-
const isSync = upstream === this.#syncUpstream;
|
|
360
|
-
try {
|
|
361
|
-
outer: for (;;) {
|
|
362
|
-
const pulled = upstream.next();
|
|
363
|
-
const result = isSync ? pulled : await pulled;
|
|
364
|
-
if (result.done) {
|
|
365
|
-
this.#done = true;
|
|
366
|
-
return { value: undefined, done: true };
|
|
367
|
-
}
|
|
368
|
-
let value = result.value;
|
|
369
|
-
for (let i = 0; i < length; i++) {
|
|
370
|
-
const op = ops[i];
|
|
371
|
-
switch (op.kind) {
|
|
372
|
-
case OP_MAP: {
|
|
373
|
-
const mapped = op.fn(value, counters[i]++);
|
|
374
|
-
value = isThenable(mapped) ? await mapped : mapped;
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
case OP_FILTER: {
|
|
378
|
-
const keep = op.fn(value, counters[i]++);
|
|
379
|
-
if (!(isThenable(keep) ? await keep : keep))
|
|
380
|
-
continue outer;
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
case OP_DROP: {
|
|
384
|
-
if (budgets[i] > 0) {
|
|
385
|
-
budgets[i]--;
|
|
386
|
-
continue outer;
|
|
387
|
-
}
|
|
388
|
-
break;
|
|
389
|
-
}
|
|
390
|
-
case OP_TAKE: {
|
|
391
|
-
if (budgets[i] <= 0)
|
|
392
|
-
return this.#finish();
|
|
393
|
-
budgets[i]--;
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
return { value: value, done: false };
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
catch (error) {
|
|
402
|
-
// A rejected `next()` does not make `for await` call `return()` — the iterator is presumed broken — so a
|
|
403
|
-
// throwing callback would otherwise strand the source's resources.
|
|
404
|
-
await this.#finish();
|
|
405
|
-
throw error;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Close the sequence and release the underlying source.
|
|
410
|
-
*/
|
|
411
|
-
async return() {
|
|
412
|
-
return this.#finish();
|
|
413
|
-
}
|
|
414
|
-
async #finish() {
|
|
415
|
-
if (this.#done)
|
|
416
|
-
return { value: undefined, done: true };
|
|
417
|
-
this.#done = true;
|
|
418
|
-
// An eager source may already hold a resource that no pull ever touched, so closing has to reach it even along
|
|
419
|
-
// paths like `take(0)`. A thunk source that was never invoked has nothing open to release, and invoking it here
|
|
420
|
-
// would open a file purely to close it.
|
|
421
|
-
const source = this.#source;
|
|
422
|
-
const upstream = this.#upstream ?? this.#syncUpstream ?? (typeof source === "function" ? null : toAsyncIterator(source));
|
|
423
|
-
this.#upstream = null;
|
|
424
|
-
this.#syncUpstream = null;
|
|
425
|
-
await upstream?.return?.();
|
|
426
|
-
return { value: undefined, done: true };
|
|
427
|
-
}
|
|
428
|
-
[Symbol.asyncIterator]() {
|
|
429
|
-
return this;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
//# sourceMappingURL=AsyncSequence.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncSequence.js","sourceRoot":"","sources":["../../lib/AsyncSequence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAqD,MAAM,YAAY,CAAA;AAc9F,MAAM,MAAM,GAAG,CAAC,CAAA;AAChB,MAAM,SAAS,GAAG,CAAC,CAAA;AACnB,MAAM,OAAO,GAAG,CAAC,CAAA;AACjB,MAAM,OAAO,GAAG,CAAC,CAAA;AAEjB,SAAS,UAAU,CAAC,KAAc;IACjC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAA8B,CAAC,IAAI,KAAK,UAAU,CAAA;AACjH,CAAC;AAcD,SAAS,eAAe,CAAI,MAAsC;IACjE,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAEzE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAE1C,OAAO;QACN,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE;QACjC,MAAM,EAAE,KAAK,EAA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AK;YAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;QAEvD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QAEjB,+GAA+G;QAC/G,gHAAgH;QAChH,wCAAwC;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QAE3B,MAAM,QAAQ,GACb,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;QAExG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA;QAEzB,MAAM,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAA;QAE1B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACxC,CAAC;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QACrB,OAAO,IAAI,CAAA;IACZ,CAAC;CAGD"}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license MIT
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { ReadableStream, type ReadableWritablePair, type StreamPipeOptions } from "stream/web";
|
|
7
|
-
import { type CharacterSequenceInput } from "./CharacterSequence.js";
|
|
8
|
-
import { type AsManyWorkersOptions } from "./segment-workers.js";
|
|
9
|
-
import { type SegmentOptions } from "./segments.js";
|
|
10
|
-
import type { AsyncChunkIterator, AsyncDataResource, ByteRange } from "./shared.js";
|
|
11
|
-
/**
|
|
12
|
-
* Initialization options for creating a spliterator.
|
|
13
|
-
*/
|
|
14
|
-
export interface SpliteratorInit {
|
|
15
|
-
/**
|
|
16
|
-
* The character to delimit by. Typically a newline or comma.
|
|
17
|
-
*
|
|
18
|
-
* @default Delimiters.LineFeed
|
|
19
|
-
*/
|
|
20
|
-
delimiter?: CharacterSequenceInput;
|
|
21
|
-
/**
|
|
22
|
-
* The byte offset to start reading from.
|
|
23
|
-
*
|
|
24
|
-
* This is an advanced option that is not typically used.
|
|
25
|
-
*
|
|
26
|
-
* @default 0
|
|
27
|
-
*/
|
|
28
|
-
position?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Whether to drop empty slices, so a run of repeated delimiters yields nothing between them.
|
|
31
|
-
*
|
|
32
|
-
* Setting this to `false` emits those empties and matches the behavior of `String.prototype.split`.
|
|
33
|
-
*
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
skipEmpty?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Count of skipped matches before emitting a data.
|
|
39
|
-
*
|
|
40
|
-
* @default 0
|
|
41
|
-
*/
|
|
42
|
-
drop?: number;
|
|
43
|
-
/**
|
|
44
|
-
* The maximum number of data slices to yield.
|
|
45
|
-
*
|
|
46
|
-
* Useful for limiting the number of emitted slices, i.e. lines in a file.
|
|
47
|
-
*
|
|
48
|
-
* Note that skipped slices are not counted towards the limit.
|
|
49
|
-
*
|
|
50
|
-
* @default Infinity
|
|
51
|
-
*/
|
|
52
|
-
take?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Whether to treat double-quoted regions as opaque: a delimiter inside `"…"` does not split, and the emitted slices
|
|
55
|
-
* keep their quotes verbatim. Quote _stripping_ and `""` unescaping are the consumer's concern —
|
|
56
|
-
* {@linkcode CSVSpliterator} does both when this flag is set.
|
|
57
|
-
*
|
|
58
|
-
* The asynchronous engine requires a single-byte delimiter for this mode (every {@linkcode Delimiters} entry
|
|
59
|
-
* qualifies) — a multi-byte delimiter straddling a chunk boundary cannot be rescanned without re-toggling quote
|
|
60
|
-
* state.
|
|
61
|
-
*
|
|
62
|
-
* @default false
|
|
63
|
-
*/
|
|
64
|
-
enableQuoteHandling?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Whether to treat a carriage return immediately preceding a delimiter as part of the delimiter — i.e. CRLF
|
|
67
|
-
* normalization when splitting on `\n`, matching `node:readline`'s `crlfDelay: Infinity`. Only a `\r` directly before
|
|
68
|
-
* an actual delimiter match is trimmed; a trailing `\r` at end-of-input is preserved.
|
|
69
|
-
*
|
|
70
|
-
* {@linkcode CSVSpliterator} defaults this to `true` for row splitting (RFC 4180 mandates CRLF row terminators);
|
|
71
|
-
* everywhere else the default is `false`.
|
|
72
|
-
*
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
crlf?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Whether to emit debug information.
|
|
78
|
-
*/
|
|
79
|
-
debug?: boolean;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Initialization options for creating an asynchronous spliterator.
|
|
83
|
-
*/
|
|
84
|
-
export interface AsyncSpliteratorInit extends SpliteratorInit {
|
|
85
|
-
/**
|
|
86
|
-
* The buffer chunk size to read from the file, i.e. the high-water mark for the file read operation.
|
|
87
|
-
*
|
|
88
|
-
* @default BlockSize * 16
|
|
89
|
-
* @minimum The delimiter byte length * 4 or block size of the file system. Whichever is greater.
|
|
90
|
-
* @maximum The byte length of the file.
|
|
91
|
-
*/
|
|
92
|
-
highWaterMark?: number;
|
|
93
|
-
/**
|
|
94
|
-
* Whether to automatically dispose of the source once the iterator is done.
|
|
95
|
-
*
|
|
96
|
-
* @default true
|
|
97
|
-
*/
|
|
98
|
-
autoDispose?: boolean;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* An asynchronous spliterator for reading delimited byte streams.
|
|
102
|
-
*
|
|
103
|
-
* ```ts
|
|
104
|
-
* import { AsyncSpliterator } from "spliterator"
|
|
105
|
-
*
|
|
106
|
-
* const file = await AsyncSpliterator.from("data.csv")
|
|
107
|
-
*
|
|
108
|
-
* for await (const line of file) {
|
|
109
|
-
* console.log(line)
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* @see {@linkcode Spliterator} for the synchronous version.
|
|
114
|
-
*/
|
|
115
|
-
export declare class AsyncSpliterator<R extends Uint8Array | DataView | ArrayBuffer = Uint8Array> implements AsyncIterableIterator<R>, AsyncDisposable {
|
|
116
|
-
#private;
|
|
117
|
-
/**
|
|
118
|
-
* Create a new delimited generator from an asynchronous byte stream.
|
|
119
|
-
*
|
|
120
|
-
* @param source - The data resource to read from.
|
|
121
|
-
* @param init - The initialization options for the generator.
|
|
122
|
-
*
|
|
123
|
-
* @returns A new generator instance, yielding byte ranges.
|
|
124
|
-
*/
|
|
125
|
-
static from(source: AsyncChunkIterator, init?: AsyncSpliteratorInit): AsyncSpliterator;
|
|
126
|
-
/**
|
|
127
|
-
* Create a new delimited generator from a resource such as a file handle or URL.
|
|
128
|
-
*
|
|
129
|
-
* @param source - The data resource to read from.
|
|
130
|
-
* @param init - The initialization options for the generator.
|
|
131
|
-
*
|
|
132
|
-
* @returns A new generator instance, yielding byte ranges.
|
|
133
|
-
*/
|
|
134
|
-
static from(source: AsyncDataResource, init?: AsyncSpliteratorInit): Promise<AsyncSpliterator>;
|
|
135
|
-
/**
|
|
136
|
-
* Create a new delimited generator from a resource such as a file handle, URL, or byte stream.
|
|
137
|
-
*
|
|
138
|
-
* @param source - The data resource to read from.
|
|
139
|
-
* @param init - The initialization options for the generator.
|
|
140
|
-
*
|
|
141
|
-
* @returns A new generator instance, yielding byte ranges.
|
|
142
|
-
*/
|
|
143
|
-
static from(source: AsyncDataResource | AsyncChunkIterator, init?: AsyncSpliteratorInit): AsyncSpliterator | Promise<AsyncSpliterator>;
|
|
144
|
-
/**
|
|
145
|
-
* Dispose of the spliterator, closing the file handle if necessary.
|
|
146
|
-
*/
|
|
147
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* Create a new delimited generator from a data resource.
|
|
150
|
-
*/
|
|
151
|
-
static toTransformStream(init: SpliteratorInit): TransformStream<AsyncChunkIterator, Uint8Array>;
|
|
152
|
-
/**
|
|
153
|
-
* Create a new delimited generator from an asynchronous byte stream.
|
|
154
|
-
*
|
|
155
|
-
* @param source - The file to read from.
|
|
156
|
-
* @param init - The initialization options for the generator.
|
|
157
|
-
* @see {@linkcode AsyncSpliterator.from} to create a new generator from a data resource.
|
|
158
|
-
*/
|
|
159
|
-
constructor(source: AsyncChunkIterator, init?: AsyncSpliteratorInit);
|
|
160
|
-
next(): Promise<IteratorResult<R>>;
|
|
161
|
-
/**
|
|
162
|
-
* Collect all the byte ranges from the file.
|
|
163
|
-
*
|
|
164
|
-
* **This method will read the entire file into memory.**
|
|
165
|
-
*/
|
|
166
|
-
toArray(): Promise<R[]>;
|
|
167
|
-
/**
|
|
168
|
-
* Collect all the byte ranges from the file as a string.
|
|
169
|
-
*
|
|
170
|
-
* **This method will read the entire file into memory.**
|
|
171
|
-
*/
|
|
172
|
-
toDecodedArray(decoder?: import("node:util").TextDecoder): Promise<string[]>;
|
|
173
|
-
/**
|
|
174
|
-
* Wraps the spliterator in a readable stream.
|
|
175
|
-
*
|
|
176
|
-
* This is useful for piping the spliterator to other streams.
|
|
177
|
-
*
|
|
178
|
-
* @returns A readable stream of byte ranges.
|
|
179
|
-
*/
|
|
180
|
-
toReadableStream(): ReadableStream<R>;
|
|
181
|
-
/**
|
|
182
|
-
* Pipes the spliterator to a writable stream.
|
|
183
|
-
*
|
|
184
|
-
* ```ts
|
|
185
|
-
* const spliterator = await AsyncSpliterator.from("data.csv")
|
|
186
|
-
*
|
|
187
|
-
* const textStream = spliterator.pipeTo(new TextDecoderStream())
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* @see {@linkcode toReadableStream} to first convert the spliterator to a readable stream.
|
|
191
|
-
*/
|
|
192
|
-
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
|
193
|
-
/**
|
|
194
|
-
* Iterate over the byte ranges in the file, yielding each range. between delimiters.
|
|
195
|
-
*/
|
|
196
|
-
[Symbol.asyncIterator](): this;
|
|
197
|
-
return(): Promise<IteratorReturnResult<undefined>>;
|
|
198
|
-
/**
|
|
199
|
-
* Compute delimiter-aligned `[start, end)` byte ranges dividing `source` into up to `concurrency` segments. The
|
|
200
|
-
* boundary primitive for parallel parsing — hand each range to a worker (with its own handle). See
|
|
201
|
-
* {@linkcode asManyWorkers} for the turnkey worker version.
|
|
202
|
-
*/
|
|
203
|
-
static segments(source: AsyncDataResource, options: SegmentOptions): Promise<ByteRange[]>;
|
|
204
|
-
/**
|
|
205
|
-
* Split `source` into delimiter-aligned segments and return one {@linkcode AsyncSpliterator} per segment. All share
|
|
206
|
-
* the event loop (no worker threads) — for moderate jobs or to overlap I/O. Returns at most `concurrency` instances.
|
|
207
|
-
*
|
|
208
|
-
* @param source - The data resource to read from.
|
|
209
|
-
* @param options - Delimiter, desired concurrency, and optional probe size.
|
|
210
|
-
*
|
|
211
|
-
* @returns One `AsyncSpliterator` per non-empty segment, possibly fewer than `concurrency`.
|
|
212
|
-
*/
|
|
213
|
-
static asMany(source: AsyncDataResource, options: SegmentOptions): Promise<AsyncSpliterator[]>;
|
|
214
|
-
/**
|
|
215
|
-
* Parse `source` across worker threads. Each worker owns a handle to a delimiter-aligned segment, runs the `worker`
|
|
216
|
-
* handler module per record, and streams results back to the main thread as one merged async iterator — for a
|
|
217
|
-
* single-thread writer. Results interleave across segments.
|
|
218
|
-
*
|
|
219
|
-
* The handler returns a value (structured-cloned back), a `Uint8Array` (transferred zero-copy), or `undefined` (the
|
|
220
|
-
* record is skipped). The handler module's top-level code runs once per worker — load models/handles there.
|
|
221
|
-
*
|
|
222
|
-
* @param source A file path or URL (file handles cannot cross threads → `TypeError` otherwise).
|
|
223
|
-
* @param options Handler module, delimiter, concurrency, and batching/backpressure tuning.
|
|
224
|
-
*/
|
|
225
|
-
static asManyWorkers<R = unknown>(source: AsyncDataResource, options: AsManyWorkersOptions): AsyncIterableIterator<R>;
|
|
226
|
-
}
|
|
227
|
-
//# sourceMappingURL=AsyncSpliterator.d.ts.map
|