@ssttevee/streamsearch 0.3.0 → 0.4.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/README.md +57 -2
- package/lib/index.cjs +29 -265
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +13 -9
- package/lib/index.mjs +21 -256
- package/lib/index.mjs.map +1 -1
- package/lib/iterate-chunks-concatted.cjs +15 -0
- package/lib/iterate-chunks-concatted.cjs.map +1 -0
- package/lib/iterate-chunks-concatted.d.ts +2 -0
- package/lib/iterate-chunks-concatted.mjs +13 -0
- package/lib/iterate-chunks-concatted.mjs.map +1 -0
- package/lib/iterate-chunks.cjs +22 -0
- package/lib/iterate-chunks.cjs.map +1 -0
- package/lib/iterate-chunks.d.ts +2 -0
- package/lib/iterate-chunks.mjs +20 -0
- package/lib/iterate-chunks.mjs.map +1 -0
- package/lib/iterate-strings.cjs +16 -0
- package/lib/iterate-strings.cjs.map +1 -0
- package/lib/iterate-strings.d.ts +2 -0
- package/lib/iterate-strings.mjs +14 -0
- package/lib/iterate-strings.mjs.map +1 -0
- package/lib/iterator.cjs +42 -0
- package/lib/iterator.cjs.map +1 -0
- package/lib/iterator.d.ts +7 -0
- package/lib/iterator.mjs +40 -0
- package/lib/iterator.mjs.map +1 -0
- package/lib/queueable.cjs +55 -0
- package/lib/queueable.cjs.map +1 -0
- package/lib/queueable.d.ts +11 -11
- package/lib/queueable.mjs +53 -0
- package/lib/queueable.mjs.map +1 -0
- package/lib/readable.cjs +36 -0
- package/lib/readable.cjs.map +1 -0
- package/lib/readable.d.ts +7 -7
- package/lib/readable.mjs +34 -0
- package/lib/readable.mjs.map +1 -0
- package/lib/search-BXQkEs3p.js +97 -0
- package/lib/search-BXQkEs3p.js.map +1 -0
- package/lib/search-D_ihawrM.js +108 -0
- package/lib/search-D_ihawrM.js.map +1 -0
- package/lib/{index.js → search.cjs} +179 -263
- package/lib/search.cjs.map +1 -0
- package/lib/search.d.ts +13 -14
- package/lib/search.mjs +185 -0
- package/lib/search.mjs.map +1 -0
- package/lib/split.cjs +26 -0
- package/lib/split.cjs.map +1 -0
- package/lib/split.d.ts +1 -0
- package/lib/split.mjs +24 -0
- package/lib/split.mjs.map +1 -0
- package/package.json +85 -37
- package/lib/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
This module is a port of [streamsearch](https://github.com/mscdex/streamsearch) for es modules using Web APIs, namely `ReadableStream` and `Uint8Array`.
|
|
6
6
|
|
|
7
|
+
Node's `stream.Readable` can be used with `IterableStreamSearch` class starting from [v11.14.0](https://nodejs.org/api/stream.html#readablesymbolasynciterator).
|
|
8
|
+
|
|
7
9
|
# Installation
|
|
8
10
|
|
|
9
11
|
```bash
|
|
@@ -13,12 +15,65 @@ npm install @ssttevee/streamsearch
|
|
|
13
15
|
# Example
|
|
14
16
|
|
|
15
17
|
```js
|
|
16
|
-
import { ReadableStreamSearch } from '@ssttevee/streamsearch';
|
|
18
|
+
import { ReadableStreamSearch, iterateStrings } from '@ssttevee/streamsearch';
|
|
17
19
|
|
|
18
20
|
const res = await fetch('https://httpbin.org/stream/10');
|
|
19
21
|
const search = new ReadableStreamSearch('\n', res.body);
|
|
20
22
|
|
|
21
|
-
for await (const str of search
|
|
23
|
+
for await (const str of iterateStrings(search)) {
|
|
22
24
|
console.log(str);
|
|
23
25
|
}
|
|
24
26
|
```
|
|
27
|
+
|
|
28
|
+
Each function can also be imported individually for bundling efficiency.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { iterateStrings } from '@ssttevee/streamsearch/iterate-strings';
|
|
32
|
+
import { IteratorStreamSearch } from '@ssttevee/streamsearch/iterator';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
# API
|
|
36
|
+
|
|
37
|
+
## Classes
|
|
38
|
+
|
|
39
|
+
### `StreamSearch`
|
|
40
|
+
|
|
41
|
+
**Constructor:** `new StreamSearch(needle: Uint8Array | string)`
|
|
42
|
+
|
|
43
|
+
Base class that implements the Boyer-Moore-Horspool algorithm. Use `feed(chunk: Uint8Array)` to push data and `end()` to get remaining data. Returns an array of `Token` (either `Uint8Array` chunks or `MATCH` symbols).
|
|
44
|
+
|
|
45
|
+
### `IteratorStreamSearch`
|
|
46
|
+
|
|
47
|
+
**Constructor:** `new IteratorStreamSearch(needle: Uint8Array | string, iter: AsyncIterable<Uint8Array>)`
|
|
48
|
+
|
|
49
|
+
Wraps an async iterable (e.g., Node.js streams with `Symbol.asyncIterator`). Implements `AsyncIterable<Token>`.
|
|
50
|
+
|
|
51
|
+
### `QueueableStreamSearch`
|
|
52
|
+
|
|
53
|
+
**Constructor:** `new QueueableStreamSearch(needle: Uint8Array | string)`
|
|
54
|
+
|
|
55
|
+
Manual push-based interface. Use `push(...chunks: Uint8Array[])` to add data and `close()` when done. Implements `AsyncIterable<Token>`.
|
|
56
|
+
|
|
57
|
+
### `ReadableStreamSearch`
|
|
58
|
+
|
|
59
|
+
**Constructor:** `new ReadableStreamSearch(needle: Uint8Array | string, stream: ReadableStream<Uint8Array>)`
|
|
60
|
+
|
|
61
|
+
Wraps a Web `ReadableStream`. Implements `AsyncIterable<Token>`.
|
|
62
|
+
|
|
63
|
+
## Helper functions
|
|
64
|
+
|
|
65
|
+
### `iterateChunks(iter: AsyncIterable<Token>): AsyncIterableIterator<Uint8Array[]>`
|
|
66
|
+
|
|
67
|
+
Yields arrays of `Uint8Array` chunks between matches. Each match produces a separate array.
|
|
68
|
+
|
|
69
|
+
### `iterateChunksConcatted(iter: AsyncIterable<Token>): AsyncIterableIterator<Uint8Array>`
|
|
70
|
+
|
|
71
|
+
Like `iterateChunks` but concatenates each chunk array into a single `Uint8Array`.
|
|
72
|
+
|
|
73
|
+
### `iterateStrings(iter: AsyncIterable<Token>): AsyncIterableIterator<string>`
|
|
74
|
+
|
|
75
|
+
Yields UTF-8 decoded strings between matches.
|
|
76
|
+
|
|
77
|
+
### `split(chunks: Uint8Array | Uint8Array[], needle: Uint8Array | string): Uint8Array[]`
|
|
78
|
+
|
|
79
|
+
Synchronous split function. Returns an array of `Uint8Array` chunks split by the needle.
|
package/lib/index.cjs
CHANGED
|
@@ -1,272 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var iterateStrings = require('./iterate-strings.cjs');
|
|
4
|
+
var iterateChunks = require('./iterate-chunks.cjs');
|
|
5
|
+
var iterateChunksConcatted = require('./iterate-chunks-concatted.cjs');
|
|
6
|
+
var iterator = require('./iterator.cjs');
|
|
7
|
+
var queueable = require('./queueable.cjs');
|
|
8
|
+
var readable = require('./readable.cjs');
|
|
9
|
+
var search = require('./search.cjs');
|
|
10
|
+
var split = require('./split.cjs');
|
|
11
|
+
require('uint8arrays/concat');
|
|
12
|
+
require('uint8arrays/to-string');
|
|
13
|
+
require('uint8arrays/from-string');
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
}
|
|
17
|
-
function jsmemcmp(buf1, pos1, buf2, pos2, len) {
|
|
18
|
-
const fn1 = coerce(buf1);
|
|
19
|
-
const fn2 = coerce(buf2);
|
|
20
|
-
for (var i = 0; i < len; ++i) {
|
|
21
|
-
if (fn1(pos1 + i) !== fn2(pos2 + i)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
function createOccurenceTable(s) {
|
|
28
|
-
// Populate occurrence table with analysis of the needle,
|
|
29
|
-
// ignoring last letter.
|
|
30
|
-
const table = new Array(256).fill(s.length);
|
|
31
|
-
if (s.length > 1) {
|
|
32
|
-
for (let i = 0; i < s.length - 1; i++) {
|
|
33
|
-
table[s[i]] = s.length - 1 - i;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return table;
|
|
37
|
-
}
|
|
38
|
-
const MATCH = Symbol('Match');
|
|
39
|
-
class StreamSearch {
|
|
40
|
-
constructor(needle) {
|
|
41
|
-
this._lookbehind = new Uint8Array();
|
|
42
|
-
if (typeof needle === 'string') {
|
|
43
|
-
this._needle = needle = u8Utils.stringToArray(needle);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this._needle = needle;
|
|
47
|
-
}
|
|
48
|
-
this._lastChar = needle[needle.length - 1];
|
|
49
|
-
this._occ = createOccurenceTable(needle);
|
|
50
|
-
}
|
|
51
|
-
feed(chunk) {
|
|
52
|
-
let pos = 0;
|
|
53
|
-
let tokens;
|
|
54
|
-
const allTokens = [];
|
|
55
|
-
while (pos !== chunk.length) {
|
|
56
|
-
[pos, ...tokens] = this._feed(chunk, pos);
|
|
57
|
-
allTokens.push(...tokens);
|
|
58
|
-
}
|
|
59
|
-
return allTokens;
|
|
60
|
-
}
|
|
61
|
-
end() {
|
|
62
|
-
const tail = this._lookbehind;
|
|
63
|
-
this._lookbehind = new Uint8Array();
|
|
64
|
-
return tail;
|
|
65
|
-
}
|
|
66
|
-
_feed(data, buf_pos) {
|
|
67
|
-
const tokens = [];
|
|
68
|
-
// Positive: points to a position in `data`
|
|
69
|
-
// pos == 3 points to data[3]
|
|
70
|
-
// Negative: points to a position in the lookbehind buffer
|
|
71
|
-
// pos == -2 points to lookbehind[lookbehind_size - 2]
|
|
72
|
-
let pos = -this._lookbehind.length;
|
|
73
|
-
if (pos < 0) {
|
|
74
|
-
// Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
|
|
75
|
-
// search with character lookup code that considers both the
|
|
76
|
-
// lookbehind buffer and the current round's haystack data.
|
|
77
|
-
//
|
|
78
|
-
// Loop until (condition 1)
|
|
79
|
-
// there is a match.
|
|
80
|
-
// or until
|
|
81
|
-
// we've moved past the position that requires the
|
|
82
|
-
// lookbehind buffer. In this case we switch to the
|
|
83
|
-
// optimized loop.
|
|
84
|
-
// or until (condition 3)
|
|
85
|
-
// the character to look at lies outside the haystack.
|
|
86
|
-
while (pos < 0 && pos <= data.length - this._needle.length) {
|
|
87
|
-
const ch = this._charAt(data, pos + this._needle.length - 1);
|
|
88
|
-
if (ch === this._lastChar && this._memcmp(data, pos, this._needle.length - 1)) {
|
|
89
|
-
if (pos > -this._lookbehind.length) {
|
|
90
|
-
tokens.push(this._lookbehind.slice(0, this._lookbehind.length + pos));
|
|
91
|
-
}
|
|
92
|
-
tokens.push(MATCH);
|
|
93
|
-
this._lookbehind = new Uint8Array();
|
|
94
|
-
return [pos + this._needle.length, ...tokens];
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
pos += this._occ[ch];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// No match.
|
|
101
|
-
if (pos < 0) {
|
|
102
|
-
// There's too little data for Boyer-Moore-Horspool to run,
|
|
103
|
-
// so we'll use a different algorithm to skip as much as
|
|
104
|
-
// we can.
|
|
105
|
-
// Forward pos until
|
|
106
|
-
// the trailing part of lookbehind + data
|
|
107
|
-
// looks like the beginning of the needle
|
|
108
|
-
// or until
|
|
109
|
-
// pos == 0
|
|
110
|
-
while (pos < 0 && !this._memcmp(data, pos, data.length - pos)) {
|
|
111
|
-
pos++;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (pos >= 0) {
|
|
115
|
-
// Discard lookbehind buffer.
|
|
116
|
-
tokens.push(this._lookbehind);
|
|
117
|
-
this._lookbehind = new Uint8Array();
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
// Cut off part of the lookbehind buffer that has
|
|
121
|
-
// been processed and append the entire haystack
|
|
122
|
-
// into it.
|
|
123
|
-
const bytesToCutOff = this._lookbehind.length + pos;
|
|
124
|
-
if (bytesToCutOff > 0) {
|
|
125
|
-
// The cut off data is guaranteed not to contain the needle.
|
|
126
|
-
tokens.push(this._lookbehind.slice(0, bytesToCutOff));
|
|
127
|
-
this._lookbehind = this._lookbehind.slice(bytesToCutOff);
|
|
128
|
-
}
|
|
129
|
-
this._lookbehind = Uint8Array.from(new Array(this._lookbehind.length + data.length), (_, i) => this._charAt(data, i - this._lookbehind.length));
|
|
130
|
-
return [data.length, ...tokens];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
pos += buf_pos;
|
|
134
|
-
// Lookbehind buffer is now empty. Perform Boyer-Moore-Horspool
|
|
135
|
-
// search with optimized character lookup code that only considers
|
|
136
|
-
// the current round's haystack data.
|
|
137
|
-
while (pos <= data.length - this._needle.length) {
|
|
138
|
-
const ch = data[pos + this._needle.length - 1];
|
|
139
|
-
if (ch === this._lastChar
|
|
140
|
-
&& data[pos] === this._needle[0]
|
|
141
|
-
&& jsmemcmp(this._needle, 0, data, pos, this._needle.length - 1)) {
|
|
142
|
-
if (pos > buf_pos) {
|
|
143
|
-
tokens.push(data.slice(buf_pos, pos));
|
|
144
|
-
}
|
|
145
|
-
tokens.push(MATCH);
|
|
146
|
-
return [pos + this._needle.length, ...tokens];
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
pos += this._occ[ch];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// There was no match. If there's trailing haystack data that we cannot
|
|
153
|
-
// match yet using the Boyer-Moore-Horspool algorithm (because the trailing
|
|
154
|
-
// data is less than the needle size) then match using a modified
|
|
155
|
-
// algorithm that starts matching from the beginning instead of the end.
|
|
156
|
-
// Whatever trailing data is left after running this algorithm is added to
|
|
157
|
-
// the lookbehind buffer.
|
|
158
|
-
if (pos < data.length) {
|
|
159
|
-
while (pos < data.length && (data[pos] !== this._needle[0]
|
|
160
|
-
|| !jsmemcmp(data, pos, this._needle, 0, data.length - pos))) {
|
|
161
|
-
++pos;
|
|
162
|
-
}
|
|
163
|
-
if (pos < data.length) {
|
|
164
|
-
this._lookbehind = data.slice(pos);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// Everything until pos is guaranteed not to contain needle data.
|
|
168
|
-
if (pos > 0) {
|
|
169
|
-
tokens.push(data.slice(buf_pos, pos < data.length ? pos : data.length));
|
|
170
|
-
}
|
|
171
|
-
return [data.length, ...tokens];
|
|
172
|
-
}
|
|
173
|
-
_charAt(data, pos) {
|
|
174
|
-
if (pos < 0) {
|
|
175
|
-
return this._lookbehind[this._lookbehind.length + pos];
|
|
176
|
-
}
|
|
177
|
-
return data[pos];
|
|
178
|
-
}
|
|
179
|
-
;
|
|
180
|
-
_memcmp(data, pos, len) {
|
|
181
|
-
return jsmemcmp(this._charAt.bind(this, data), pos, this._needle, 0, len);
|
|
182
|
-
}
|
|
183
|
-
;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
class ReadableStreamSearch {
|
|
187
|
-
constructor(needle, _readableStream) {
|
|
188
|
-
this._readableStream = _readableStream;
|
|
189
|
-
this._search = new StreamSearch(needle);
|
|
190
|
-
}
|
|
191
|
-
async *[Symbol.asyncIterator]() {
|
|
192
|
-
const reader = this._readableStream.getReader();
|
|
193
|
-
try {
|
|
194
|
-
while (true) {
|
|
195
|
-
const result = await reader.read();
|
|
196
|
-
if (result.done) {
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
yield* this._search.feed(result.value);
|
|
200
|
-
}
|
|
201
|
-
const tail = this._search.end();
|
|
202
|
-
if (tail.length) {
|
|
203
|
-
yield tail;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
reader.releaseLock();
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function splitChunks(chunks, needle) {
|
|
213
|
-
const search = new StreamSearch(needle);
|
|
214
|
-
const outchunks = [[]];
|
|
215
|
-
for (const chunk of chunks) {
|
|
216
|
-
for (const token of search.feed(chunk)) {
|
|
217
|
-
if (token === MATCH) {
|
|
218
|
-
outchunks.push([]);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
outchunks[outchunks.length - 1].push(token);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
const end = search.end();
|
|
226
|
-
outchunks[outchunks.length - 1].push(end);
|
|
227
|
-
return outchunks.map((chunks) => u8Utils.mergeArrays(...chunks));
|
|
228
|
-
}
|
|
229
|
-
function split(buf, needle) {
|
|
230
|
-
return splitChunks([buf], needle);
|
|
231
|
-
}
|
|
232
|
-
async function* chunksIterator(iter) {
|
|
233
|
-
let chunks = [];
|
|
234
|
-
for await (const value of iter) {
|
|
235
|
-
if (value === MATCH) {
|
|
236
|
-
yield chunks;
|
|
237
|
-
chunks = [];
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
chunks.push(value);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
yield chunks;
|
|
244
|
-
}
|
|
245
|
-
async function* stringIterator(iter) {
|
|
246
|
-
for await (const chunk of chunksIterator(iter)) {
|
|
247
|
-
yield chunk.map(u8Utils.arrayToString).join('');
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
async function allStrings(iter) {
|
|
251
|
-
const segments = [];
|
|
252
|
-
for await (const value of stringIterator(iter)) {
|
|
253
|
-
segments.push(value);
|
|
254
|
-
}
|
|
255
|
-
return segments;
|
|
256
|
-
}
|
|
257
|
-
async function* arrayIterator(iter) {
|
|
258
|
-
for await (const chunk of chunksIterator(iter)) {
|
|
259
|
-
yield u8Utils.mergeArrays(...chunk);
|
|
260
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use the [Async Iterator Helpers](https://github.com/tc39/proposal-async-iterator-helpers). (e.g. `AsyncIterator.from(iterateStrings(...))`)
|
|
17
|
+
*/
|
|
18
|
+
async function allStrings(iter) {
|
|
19
|
+
const segments = [];
|
|
20
|
+
for await (const value of iterateStrings.iterateStrings(iter)) {
|
|
21
|
+
segments.push(value);
|
|
22
|
+
}
|
|
23
|
+
return segments;
|
|
261
24
|
}
|
|
262
25
|
|
|
263
|
-
exports.
|
|
264
|
-
exports.
|
|
265
|
-
exports.
|
|
26
|
+
exports.iterateStrings = iterateStrings.iterateStrings;
|
|
27
|
+
exports.iterateChunks = iterateChunks.iterateChunks;
|
|
28
|
+
exports.iterateChunksConcatted = iterateChunksConcatted.iterateChunksConcatted;
|
|
29
|
+
exports.IteratorStreamSearch = iterator.IteratorStreamSearch;
|
|
30
|
+
exports.QueueableStreamSearch = queueable.QueueableStreamSearch;
|
|
31
|
+
exports.ReadableStreamSearch = readable.ReadableStreamSearch;
|
|
32
|
+
exports.MATCH = search.MATCH;
|
|
33
|
+
exports.StreamSearch = search.StreamSearch;
|
|
34
|
+
exports.split = split.split;
|
|
266
35
|
exports.allStrings = allStrings;
|
|
267
|
-
exports.arrayIterator = arrayIterator;
|
|
268
|
-
exports.chunksIterator = chunksIterator;
|
|
269
|
-
exports.split = split;
|
|
270
|
-
exports.splitChunks = splitChunks;
|
|
271
|
-
exports.stringIterator = stringIterator;
|
|
272
36
|
//# sourceMappingURL=index.cjs.map
|
package/lib/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["iterateStrings"],"mappings":";;;;;;;;;;;;;;AAGA;;AAEG;AACI,eAAe,UAAU,CAC/B,IAA0B,EAAA;IAE1B,MAAM,QAAQ,GAAa,EAAE;IAC7B,WAAW,MAAM,KAAK,IAAIA,6BAAc,CAAC,IAAI,CAAC,EAAE;AAC/C,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IACrB;AAEA,IAAA,OAAO,QAAQ;AAChB;;;;;;;;;;;;;"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Token } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
import type { Token } from "./search.js";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use the [Async Iterator Helpers](https://github.com/tc39/proposal-async-iterator-helpers). (e.g. `AsyncIterator.from(iterateStrings(...))`)
|
|
4
|
+
*/
|
|
5
|
+
export declare function allStrings(iter: AsyncIterable<Token>): Promise<string[]>;
|
|
6
|
+
export * from "./iterate-chunks.js";
|
|
7
|
+
export * from "./iterate-chunks-concatted.js";
|
|
8
|
+
export * from "./iterate-strings.js";
|
|
9
|
+
export * from "./iterator.js";
|
|
10
|
+
export * from "./queueable.js";
|
|
11
|
+
export * from "./readable.js";
|
|
12
|
+
export * from "./search.js";
|
|
13
|
+
export * from "./split.js";
|